Commit Graph

113 Commits

Author SHA1 Message Date
Ted John d07b9535c2 integrate variables: object entry lists 2016-06-16 11:36:15 +02:00
Duncan 8e8474c400 Modify object selection to only research selected item when adding new objects during a game. (#3762) 2016-05-28 09:30:31 +01:00
Ted John 25ac99e04a add variable for gS6Info 2016-05-20 23:26:19 +01:00
Martin Černáč 6e9d1bf1ea Refactor more string & sprite hard-coded ids (#3670) 2016-05-19 18:22:24 +01:00
Martin Černáč 3bdc06dc25 Refactor hard-coded strings to use string_ids.h constants (and couple sprites too) (#3658) 2016-05-18 21:51:37 +01:00
Ted John 8d4e4ed0e9 remove unread RCT2_GLOBALs 2016-05-17 23:39:37 +01:00
Ted John cbf9a393f1 remove use of get_format_arg
Because of strict aliasing, we must use memcpy in some cases.
2016-05-15 22:40:25 +01:00
Ted John 1cc35dfe6e integrate common format args 2016-05-15 22:03:53 +01:00
janisozaur ca430e1b23 Drop unused variables (#3586) 2016-05-13 18:21:58 +01:00
janisozaur feb140b84c Revert part of last commit unsuitable for older compilers (#3584)
Also initialise all the items in gResearchedTrackTypesA and
gResearchedTrackTypesB
2016-05-13 10:36:24 +01:00
janisozaur 87d05f8a89 Fix compiler warnings (#3583)
Includes:
* type casting
* properly counting fields to initialise
2016-05-13 08:05:12 +01:00
janisozaur 658e877955 Name all the typdef-ed structs (#3581) 2016-05-12 22:57:40 +01:00
Ted John aa929e1593 add globals for researched things, cleanup 2016-05-10 00:00:59 +01:00
Ted John 1908743c71 refactor track save, move into own source 2016-05-08 14:03:49 +01:00
Ted John 77e7313540 move track design related functions to new source 2016-05-08 14:03:48 +01:00
janisozaur 68bad6505c Add and correct licence headers to all sources (#3108) 2016-05-04 18:24:41 +01:00
Ted John 489ea66cc9 add global macro for gCurrentFontSpriteBase and gCurrentFontFlags 2016-04-25 23:00:58 +01:00
Ted John 4cdb2df9dc integrate screen variables 2016-04-23 11:16:46 +01:00
Michał Janiszewski b7f9af41a8 Only initialize structs with compile-time consts
See https://stackoverflow.com/a/32584666
2016-04-21 22:20:24 +02:00
Ted John 1b3f46f960 integrate game command error string variables
- gGameCommandErrorTitle
- gGameCommandErrorText
2016-04-15 17:54:46 +01:00
Marco van Munster 8db1f27534 Fix bug 3198 different vehicles research tree 2016-03-30 22:33:26 +02:00
Michał Janiszewski 14bff0c66f Rename rct_ride_type to rct_ride_entry 2016-02-25 13:33:19 +01:00
IntelOrca caf9bd9939 get game working with new theme manager
Theme editor currently unavailable.
2016-02-03 18:23:44 +00:00
Michał Janiszewski 6d6f9f3c23 Refactor rides to be only accessible with getters
This changes how rides are accessed from macros to getter functions.
2016-01-23 01:13:36 +01:00
Michał Janiszewski 3bf1e0e06d Rename `safe_strncpy` to `safe_strcpy` 2016-01-18 20:49:52 +01:00
Marijn van der Werf 94e47be3e3 Use `ride_type_has_flag` for checking ride type flags 2016-01-15 21:02:39 +01:00
Marijn van der Werf 98b5ad1bf4 Replace known addresses with constants 2016-01-15 21:01:34 +01:00
IntelOrca 730463dbbb remove rct2_malloc, rct2_realloc and rct2_free 2016-01-14 20:18:55 +00:00
Marijn van der Werf e961cc885a Use RCT2_ADDRESS_COMMON_FORMAT_ARGS instead of raw address 2016-01-11 12:55:33 +01:00
IntelOrca 48ad1314a9 refactor object_desc 2016-01-07 19:12:59 +00:00
IntelOrca 40a4bd1fa8 remove old object_paint calls, replace with new 2016-01-07 19:01:19 +00:00
IntelOrca ab38828e03 integrate object list variables:
- gInstalledObjectsCount
- gInstalledObjects
- gNumInstalledRCT2Objects
- gNumInstalledCustomObjects
- gLastLoadedObjectChunkData
2016-01-06 20:41:21 +00:00
Hielke Morsink f04c97fbc1 Getting path scenery type and index using helper functions throughout the entire project. 2016-01-01 21:28:53 +01:00
Michał Janiszewski 8a5d066efe Fix strict aliasing violations
Compiler only guarantees proper accesses to variables when using
variable's native type or `char` (i.e. single byte type) [1].

This commit fixes violations of this rule. In most cases changing code
to a simple cast was enough, some required a bit deeper modifications.

This fixes #2596.

[1] http://blog.qt.io/blog/2011/06/10/type-punning-and-strict-aliasing/
2015-12-31 13:27:26 +01:00
Aaron van Geffen 020334fa18 Name rct_window's var_494: highlighted_item. 2015-12-26 18:46:19 +09:00
Kyle Kirby caf07c2064 Clean up the comments a litte
• Make comment heads be /**
• Make rct2 addresses be double spaced indented
• Make there be a space afte rct2: and the address
• Make single-line rct2 addresses be full block comments
• Move description of method to top of comment
2015-12-11 16:19:46 -06:00
Gymnasiast 3f6990dac9 Add close button to track designs manager, closes #1807 2015-11-30 22:53:28 +01:00
IntelOrca c6056cbb6c Merge branch 'pre-release-0.0.3' into develop
Conflicts:
	src/audio/audio.c
2015-11-27 22:05:40 +00:00
IntelOrca 67b6aa7513 fix #2330: Clear button in Object Selector doesn't refresh item list 2015-11-18 23:19:25 +00:00
Duncan e36ed5e732 Merge pull request #2325 from BodrickLight/refactor
Refactor audio.c and audio.h
2015-11-18 17:33:21 +00:00
Dom Light e9b7e41635 Refactor audio_sound_play_planned 2015-11-17 23:05:24 +00:00
Hielke Morsink 68b0068a22 Resolved warnings 2015-11-17 19:40:48 +01:00
Hielke Morsink 504f551eec Avoiding the use of strlen 2015-11-17 19:40:47 +01:00
Hielke Morsink 063a568a72 Searching through rides now also checks their type. 2015-11-17 19:40:44 +01:00
Dom Light 3a8b25a0ee Sanitize audio.h 2015-11-17 01:05:14 +00:00
IntelOrca 48e3d70e57 refactor colour maps 2015-11-08 18:55:32 +00:00
Michał Janiszewski 9a981ef68f Fix variable not being shifted
When decompiled, at 0x6AA8ED, there's `shr edi,0x4`, which is not
reflected in sources.

The `type` without that shift could easily become a value large enough
to point to memory beyond object entries and modify those values. In my
case, it was modifying `RCT2_ADDRESS_OBJECT_LIST_NO_ITEMS` from 2122 to
2123 (by setting lowest bit), which luckily, is used later in
`setup_in_use_selection_flags`. For this reason, I believe it could be a
major source of other problems, possibly also recent `MAP_ANIMATION`
ones, although I haven't checked.

I also put an assert in place to validate type against max available
count.
2015-11-01 18:53:47 +01:00
Michał Janiszewski 9284930d7e Add safe_strncpy function
safe_strncpy is similar to strncpy, but makes sure buffer is
null-terminated. Update most of project to use this updated function to
prevent illegal memory accesses.
2015-10-30 16:01:00 +01:00
Michał Janiszewski fcd22dd8ca Memory handling fixes 2015-10-25 01:15:52 +02:00
Michał Janiszewski 11fb15bba7 Add casts for types 2015-10-22 23:51:05 +02:00