Ted John
c5899139d7
Move scenario sources to sub directory
2016-12-16 01:25:05 +00:00
Michał Janiszewski
f486a1d302
Return valid value from strlogicalcmp even if assert is hit
2016-12-01 10:58:19 +01:00
Michał Janiszewski
29a4277709
Refactor sawyercoding
2016-11-28 09:59:01 +00:00
Michał Janiszewski
2ec1fd0378
Prevent variable underflow in path_end_with_separator
2016-11-22 17:15:03 +01:00
Michał Janiszewski
3f7fd56328
Remove trailing whitespace in sources
2016-11-13 20:32:55 +01:00
Michał Janiszewski
b164c2be61
Extract openrct2_assert to guard.h ( #4753 )
...
* Extract openrct2_assert to Guard.hpp
`openrct2_assert` is not defined in util.c and including all of
openrct2.h is unnecessary.
2016-11-06 21:02:25 +01:00
Daniel Kamil Kozar
55f1d3aac6
Fixes to the new bitcount implementation
...
Use Intel-standardized _mm_popcnt_u32 instead of Microsoft-specific
__popcnt, replace assert with openrct2_assert, replace bitcount's argument
with uint32.
2016-11-01 11:45:17 +01:00
Daniel Kamil Kozar
b68b6f731b
Use bool instead of int for bitcount_popcnt_available's return value
2016-10-31 01:06:18 +01:00
Daniel Kamil Kozar
d7606c8fa3
Remove void from argument lists in new bitcount_ functions
...
Keep it in line with the rest of the C code.
2016-10-31 00:58:22 +01:00
Daniel Kamil Kozar
46b6ff35a0
Initialise the pointer to bitcount_fn in a new early initialisation function
...
In order to avoid the overhead of checking whether the function pointer
to bitcount's actual implementation has been initialised every time
bitcount is called, initialise it at application startup.
2016-10-31 00:45:30 +01:00
Daniel Kamil Kozar
bc101f4151
Use POPCNT, if available, to count the number of set bits
...
Replace the current implementation of bitcount() with a one that uses the
POPCNT instruction available in most newer CPUs. Also, replace the basic
implementation with a one based on a lookup table, which has much better
performance than the old one.
2016-10-31 00:13:19 +01:00
Michał Janiszewski
7f9fa28995
Fix uninitialised variables
2016-10-09 22:43:07 +02:00
LRFLEW
e5ff7412e4
Refactor/Improve String and Path Handling
2016-10-09 15:29:58 -05:00
Michał Janiszewski
3c4a683701
Fix #4558 : Crash on loading invalid scenario
2016-10-08 21:23:03 +01:00
Ted John
a48976cc6b
Fix x86 warning
2016-09-06 22:06:56 +01:00
Ted John
220afe04d5
x64: Fix readentirefile calls
2016-09-06 21:33:15 +01:00
Michał Janiszewski
f8145b6edc
Refactor inclusion of addresses.h
...
addresses.h is now only included when necessary, limiting scope as much
as possible.
2016-09-03 21:25:19 +01:00
Michał Janiszewski
f3fe28e722
Verify sv4/sc4 sizes when loading them
2016-09-01 22:56:30 +02:00
Ted John
8cf7e87b5c
Fix many warnings for x64
2016-08-27 23:32:15 +01:00
Michał Janiszewski
b66853383e
Add more checks to object loading
2016-07-15 18:50:15 +01:00
Ted John
dca816cfd3
Merge pull request #4024 from IntelOrca/refactor/object-list
...
Refactor and improve the object system:
- Objects are now exported to user directory under 'object'.
- Object directories are scanned recursively.
- Improves reliability of object loading and handling of bad objects.
- Improve performance of object scanning.
- Only load new objects when loading a new game.
- Improve changing language experience.
2016-07-11 23:45:45 +01:00
Michał Janiszewski
ef09dcd64a
Add another assert to decode_chunk_rle_with_size
2016-07-11 22:52:43 +01:00
Michał Janiszewski
639f19adbf
Fix define checks in project
2016-07-09 10:05:12 +02:00
Ted John
09782e980c
implement saving of objects and fix other bugs
2016-07-08 22:58:38 +01:00
Sijmen Schoon
e882bfe736
Change strdup to _strdup
2016-07-06 18:50:30 +02:00
Sijmen Schoon
fcf4008395
Remember previous save/load location
...
Works for games, landscapes, scenarios and tracks (but this is commented out due to tracks not being separated or something?)
2016-07-06 18:22:08 +02:00
Michał Janiszewski
da08b963c9
Check RLE chunk size
2016-06-23 21:50:23 +01:00
Michał Janiszewski
bee6bcd1c7
Verify size in sawyercoding_read_chunk
2016-06-23 19:00:54 +01:00
Michał Janiszewski
644a36a310
Fixes to -Wall compilation
...
By default, not all warnings are enabled. This change makes sure that
the project compiles correctly with following options turned on:
-Wall -Wno-unused-but-set-variable -Wno-missing-braces \
-Wno-unknown-pragmas -Wno-unused-function
2016-06-20 13:46:27 +01:00
Ted John
1761907f57
handle bad map data and close connection
2016-06-09 18:37:12 +01:00
Michał Janiszewski
1508e49a28
Change macro to assert_struct_size
2016-06-03 11:29:50 +02:00
Michał Janiszewski
60630b9ad7
Drop PACKED attribute
2016-06-03 10:55:21 +02:00
Michał Janiszewski
df3030e4a9
Provide static_assert for hard-coded struct sizes.
2016-06-03 10:55:21 +02:00
Michał Janiszewski
3907fcd9d2
Explicitly pack structs
2016-06-03 10:55:21 +02:00
CraigCraig
3f9afb9744
Various Spellchecks ( #3741 )
2016-05-26 09:49:19 +02:00
Hielke Morsink
1089f02e15
Moved logically string compare function to utils
2016-05-22 21:48:14 +02:00
Ted John
8d4e4ed0e9
remove unread RCT2_GLOBALs
2016-05-17 23:39:37 +01:00
Hielke Morsink
d7aacfcde6
Fixed warning in sawyerencoding.c
2016-05-15 01:10:37 +02:00
Michał Janiszewski
90bcca11d2
More sawyercoding optimisations
2016-05-14 11:54:19 +02:00
Michał Janiszewski
9cd762b1a6
Use memset/memcpy functions for RLE chunk decoding
...
Reduces time spent in `decode_chunk_rle` by 4-5x.
2016-05-14 11:12:14 +02:00
janisozaur
658e877955
Name all the typdef-ed structs ( #3581 )
2016-05-12 22:57:40 +01:00
Ted John
4298f416d2
fix #3558 : safely read chunks from S6 files
...
It appears many saved games have been saved with excess uncompressed data that overflows the S6 structure. This may have been caused by a save bug in an earlier version of OpenRCT2. This will now cap the uncompressed data to the amount expected.
2016-05-10 21:39:12 +01:00
janisozaur
68bad6505c
Add and correct licence headers to all sources ( #3108 )
2016-05-04 18:24:41 +01:00
Ted John
cf7b81fd3a
start moving RCT1 importer to C++
2016-04-22 18:24:54 +01:00
Gymnasiast
2d3dfd8834
Move RCT1 file version detection to its own function
2016-04-22 18:23:46 +01:00
Michał Janiszewski
843014eac2
Silence compiler warning
...
Though this really should be taken care of properly, see
https://stackoverflow.com/questions/14562845/why-does-passing-char-as-const-char-generate-a-warning
2016-03-19 12:56:35 +01:00
IntelOrca
1daa657657
fix #3091 : Korean words corrupted if over byte limit
2016-03-10 18:48:00 +00:00
Michał Janiszewski
016d26976e
Add a note about low-hanging optimisation fruit
2016-02-15 00:17:15 +01:00
Michał Janiszewski
f447b9665a
Use GCC's __builtin_ffs for bitscanforward impl
2016-02-15 00:05:33 +01:00
Michał Janiszewski
b89282cc2f
Fix zlib inflate on broken builders
2016-01-24 21:36:14 +01:00