Commit Graph

7706 Commits

Author SHA1 Message Date
Ted John 8b46b32031 Protect score structs from C 2017-01-17 17:07:29 +00:00
Ted John 71f83cd7a7 Dissociate rct_news_item from RCT2 2017-01-17 12:51:02 +00:00
Ted John 8fb55a1f06 Move scores.dat structs to rct2.h 2017-01-17 12:21:57 +00:00
Ted John 6daf6c567a Convert tabs to spaces for rct2.h 2017-01-17 12:08:54 +00:00
Michael Steenbeek 6016339773 Fix two usages of raw RIDE4 flag usages, rename one, add comment
#5065
2017-01-17 12:00:47 +00:00
Ted John f6dee8c58d Unify rct1_award and rct2_award 2017-01-16 18:41:16 +00:00
Ted John 5efd23dbe5 Create new OpenRCT2 award struct 2017-01-16 18:00:04 +00:00
Marijn van der Werf 24f9a0c0ef Fix #5081: Crash on fetching server list 2017-01-16 14:29:49 +00:00
Ted John 0da434bb8a Fix tall ride consideration
The consideration of tall rides was probably not working properly as it was doing a straight comparrison of a flags variable.
This instead removes it as it already checks if the ride has ratings anyway. I've also added a status check so that guests do not attempt to walk to a ride far away that isn't open.
2017-01-16 14:30:54 +01:00
wolfreak99 3e621d75f6 Check finance_payment for int overflows 2017-01-16 14:29:03 +01:00
Broxzier 2235390ce2 Fix 5079 don't remove walls when building stalls and footpaths 2017-01-16 14:28:16 +01:00
Ted John 7edf1e8b7f Merge pull request #4936 from Broxzier/short
Because of a comment on a diff in #4878 asking for clearer and more consistent type usage. What this PR changes:

No unsigned long long found
(signed) long long -> sint64
unsigned int -> uint32
(signed) int -> sint32
(signed) long -> sint32
unsigned short -> uint16
(signed) short -> sint16
unsigned char -> uint8
No signed chars found
plain char is implementation-defined, so I left those in.
2017-01-14 23:41:47 +00:00
Ted John 0d51bdde3f Fix broken code alignment 2017-01-14 23:40:46 +00:00
Ted John fe389be7c9 Remove unused ride entry flags 2017-01-14 17:37:15 +00:00
Ted John 8f57e514fe Name more ride entry flags 2017-01-14 17:36:47 +00:00
Ted John 769d86e7cc Refactor vehicle_update_boat_location 2017-01-14 17:36:32 +00:00
Ted John f4cea0e6c8 Name a couple of ride entry flags and format enum 2017-01-14 16:48:56 +00:00
Broxzier b80b71cf81 Fixed typos and warnings after rebase 2017-01-14 14:31:06 +01:00
Broxzier 2bf1b4cd2f Fox linux builds (hopefully) 2017-01-14 12:37:34 +01:00
Broxzier a26eac91ef Use typedef for diagnostic levels, small refactor 2017-01-14 12:37:33 +01:00
Broxzier d857ebb2ad Move type definitions before the first include
This way the last remaining uses of int could be replaced with sint32 as
well. Before this change there was a circular dependancy which made the
types unknown in diagnostic.h.
2017-01-14 12:37:32 +01:00
Broxzier 60603ae10a Use types from common.h 2017-01-14 12:37:31 +01:00
Michał Janiszewski d88635307f Merge pull request #5062 from janisozaur/cmake-warnings
More warnings for CMake
2017-01-13 19:46:30 +01:00
Ted John baed215984 Add helper: ride_has_ratings
#5066
2017-01-13 18:14:38 +00:00
Ted John aed5c0aa60 Name flag: RIDE_TYPE_FLAG_26 2017-01-13 13:20:16 +00:00
Ted John ae7048b2a7 Name flag: RIDE_TYPE_FLAG_30 2017-01-13 13:16:51 +00:00
Ted John 053f8a70bf Name flag: RIDE_TYPE_FLAG_18 2017-01-13 13:13:24 +00:00
Ted John cf0c489d40 Name flag: RIDE_TYPE_FLAG_13 2017-01-13 13:08:56 +00:00
Ted John bdc5078003 Name flag: RIDE_TYPE_FLAG_6 2017-01-13 13:04:11 +00:00
Ted John ef2ddbf462 Name flag: RIDE_TYPE_FLAG_20 2017-01-13 12:55:47 +00:00
Michał Janiszewski 09ecf0b73c Fix possible null dereferences 2017-01-13 12:35:26 +01:00
Michał Janiszewski 0a36af19e4 Mark classes as final to help devirtualisation 2017-01-13 12:12:50 +01:00
Michał Janiszewski 411d1fff18 Make GCC suggest final, override keywords 2017-01-13 11:44:14 +01:00
Michał Janiszewski 33dcb1a506 Rename types to avoid shadowing 2017-01-13 10:57:00 +01:00
Michał Janiszewski ecf77e3609 Remove redundant declarations 2017-01-13 10:02:17 +01:00
Michał Janiszewski cf670deb10 Add -Wshadow to CMakeLists and fix offenders 2017-01-13 10:02:17 +01:00
Michael Steenbeek 2a435bfdae Use constants for block brakes and some other elements 2017-01-13 09:49:29 +01:00
Ted John 7875fd1f3a Ensure object list pointer is updated after realloc
Also update changelog for fix to #4944.
2017-01-12 22:20:27 +00:00
Ted John 4090522901 Fix #4944: Game crashes upon selecting objects in scenario editor
When the filter caused no results to be shown in the list, it would try to realloc for 0 bytes which returns NULL. The error shown in the console was a minor bug, the more serious issue was the the original memory was freed but the list pointer not updated. Instead just check for 0 items, dispose the list and return.
2017-01-12 22:12:21 +00:00
Ted John d70cd3775e Fix silent warnings 2017-01-12 18:40:49 +00:00
Ted John ab4bb3101c Use static inline 2017-01-12 18:29:29 +00:00
Ted John 1bf7a0ffdb Fix Win32 warnings 2017-01-12 18:28:51 +00:00
Ted John 868bb54383 Fix remaining warnings 2017-01-12 18:20:22 +00:00
Ted John b79af110c7 Fix more warnings 2017-01-12 18:02:28 +00:00
Ted John 50d0d69815 Fix name warnings for NetworkPacket 2017-01-12 17:45:48 +00:00
Ted John 18597bacb1 Fix more warnings 2017-01-12 17:36:05 +00:00
Ted John ec07d61d7b Fix name warnings for Network 2017-01-12 13:26:12 +00:00
Ted John d2cf97d0a1 Fix name warnings for NetworkPlayer 2017-01-12 13:23:16 +00:00
Ted John 3a9b6f4bb0 Fix more warnings 2017-01-12 13:16:00 +00:00
Ted John 13a8eee1b4 More warning fixes, more warnings disabled 2017-01-12 13:12:53 +00:00
Ted John ca9c3cc5ee Fix more warnings, disable others 2017-01-12 13:00:12 +00:00
Ted John bd732b99c7 Fix cast warnings 2017-01-12 12:41:47 +00:00
Ted John e67d8b4122 Use inline instead of static for header C functions 2017-01-12 12:28:19 +00:00
Michał Janiszewski 171d973e55 Initialise fields of MemoryStream in header
This makes all the constructors use these defaulted values
2017-01-12 09:58:57 +01:00
Ferdinand Thiessen afbe1dda0f Fix 'No real prototype' warnings 2017-01-12 09:52:44 +01:00
LRFLEW 47c532d020 Don't zoom to cursor for keyboard or toolbar inputs (#5028) 2017-01-11 17:43:11 -06:00
Michael Steenbeek e3cf32342b Use constant for random colour 2017-01-11 23:00:28 +01:00
Gymnasiast 7767f506be Fix balloon stall 2017-01-11 22:59:45 +01:00
Michael Steenbeek 92feea1612 Clean up metal supports 2017-01-11 20:23:47 +01:00
Ted John e6dc4f179d Fix Debug | Win32 (RCT2) builds for VS 2017-01-11 18:33:08 +00:00
Marijn van der Werf b8bb3924a7 Fix cheat window colours (#5041) 2017-01-11 00:39:52 +01:00
wolfreak99 0316decb6b Update network version for Add/set money commands (#5042) 2017-01-11 00:35:22 +01:00
wolfreak99 8932f61a67 Add cheats to set/add money by custom amounts 2017-01-10 23:43:42 +01:00
Ted John f94daa08df Merge pull request #5027 from IntelOrca/refactor/vs-static-lib
This merge does several things:
* Changes all the code to be built as a static library, `libopenrct2.lib`
* Adds two new projects to produce `openrct2.dll` and `openrct2.exe`
* Adds a build step to create `openrct2.com`

This is to remove the test configurations and make building the test projects quicker and simpler.
It also distributes two very small shims, `openrct2.exe` and `openrct2.com` which are a GUI windows app and console app respectively. This simplifies the experience of using openrct2 on the command line as .com has higher precedence. `--console` is therefore no longer necessary.

`libopenrct2.lib` will probably be the beginning of several static libraries which make up the game as we will split up the UI from the core logic and possibly more.
2017-01-10 22:23:33 +00:00
Ted John 191c4ab998 Fix mingw build 2017-01-10 17:58:04 +00:00
Ted John 21bb7b9da6 Add back main entry point for mingw 2017-01-10 17:29:55 +00:00
Ted John d535e290d3 Remove --console CLI switch 2017-01-10 17:29:52 +00:00
Ted John b7b58817bb Rename openrct2-lib to libopenrct2 2017-01-10 17:29:03 +00:00
Ted John 7d6ea1f5cd Create DLL for openrct2 with win as a wrapper 2017-01-10 17:29:03 +00:00
Ted John 73b21b5880 Convert openrct2 to static library 2017-01-10 17:29:02 +00:00
Christian F. Coors 06d1d2116f Remove unnecessary code 2017-01-10 12:44:30 +01:00
Christian F. Coors e0a6955924 Remove openssl dependency when building without network support 2017-01-10 12:44:30 +01:00
X123M3-256 7c7b67f665 Do not deselect boosters after building one, fixes #4975 2017-01-09 22:51:16 +01:00
Michael Steenbeek 1c2458b6dd Combine drawing of the Spiral and Mini RC (#5025) 2017-01-09 22:09:33 +01:00
Michael Steenbeek 4f61cae8a8 Merge pull request #4997 from zaxcav/restrictBacktrack
Restrict backtracking during peep pathfinding
2017-01-09 21:55:23 +01:00
wolfreak99 bdc34b608d Make tile inspector selector draggable 2017-01-09 19:30:42 +00:00
Ted John acba8ee63f Fix code style 2017-01-08 23:51:22 +00:00
Gymnasiast 9521911719 Import money effect 2017-01-08 23:35:30 +00:00
Gymnasiast 8c1926e41c Import jumping fountain water 2017-01-08 23:35:30 +00:00
Gymnasiast 5a51f28ba0 Fix balloons, import balloons, ducks and steam particles 2017-01-08 23:35:29 +00:00
Gymnasiast 70f6f638ca Fix negative queue lengths, fix guests thoughts, import litter, import more fields, fix monorail, fix chairlift crashes 2017-01-08 23:35:26 +00:00
Ted John 9c11b051ee Add some max constants for RCT1 2017-01-08 23:34:49 +00:00
Ted John 3037e6fb59 Merge pull request #5013 from IntelOrca/refactor/imageio
Refactor image_io
2017-01-08 22:30:58 +00:00
duncanspumpkin ac5b0b0cf5 Rename sprite list vehicle to train to reflect true use
This was found during the rct1 vehicle import branch. When importing it would load all vehicles into this list only to find that each car was treated as a seperate train.
2017-01-07 16:59:46 +00:00
Michał Janiszewski 1a2227289a Limit vehicle search to valid ones only 2017-01-07 14:54:30 +00:00
Ted John 4680aeab9b Use FileStream instead of SDL2 2017-01-07 12:23:59 +00:00
Ted John a21cbae82a Move image_io to C++ 2017-01-07 12:10:42 +00:00
Michał Janiszewski 3f8f513a47 Verify access to RCT1 fields 2017-01-07 11:19:04 +00:00
Ted John 44d9464d6b Merge pull request #4995 from IntelOrca/refactor/track-design-repository-stdstring
Refactor track design repository to use std::string
2017-01-06 21:48:37 +00:00
Ted John e7a7704efb Fix RCT1 (original) imported parks having no ride music 2017-01-06 21:48:27 +00:00
zaxcav 9772c34cee Update debugging messages to reflect changes in how pathfind_history[].direction is updated. 2017-01-06 12:26:23 +01:00
Michał Janiszewski bd140e78fb Compile fixes for MinGW (#4998)
* Fix mismatched condition in CMakeLists.txt

* Fix MinGW release builds
2017-01-06 07:04:25 +01:00
zaxcav 64a2d105e5 Reword comments with "from from". 2017-01-05 21:43:57 +01:00
Ted John 038ea82777 Fix #4996: Objects unloaded after loading landscape 2017-01-05 19:55:36 +00:00
zaxcav 78715fa1c0 Increment network version 2017-01-05 20:46:14 +01:00
Ted John 60cb84fd9d Handle nullptr for object when getting track designs 2017-01-05 18:19:20 +00:00
Ted John e1ace9528d Use std::string for File and FileScanner 2017-01-05 18:19:01 +00:00
Ted John 11477c5869 Refactor more of TrackDesignRepository to std::string 2017-01-05 17:51:31 +00:00
zaxcav f98b8e9de9 Restrict peep backtracking further via pathfind_history[i].direction
Dependent on the path layout it is possible for peeps to get stuck in backtracking cycles between two or more path tiles - each such tile is a turn around point because from that tile, the reachable tile on the search boundary that is closest to the peep destination is in the direction the peep came from.

When storing/updating the pathfind_histroy, remove the direction the peep came from (in addition to the chosen direction) from the directions left to try to prevent such backtracking.
2017-01-05 17:45:18 +01:00
Ted John be035dcdb2 Refactor various methods to use std::string 2017-01-05 13:13:22 +00:00
Ted John f201a8b43a Refactor TrackDesignRepository.cpp 2017-01-05 12:55:41 +00:00
Ted John 4fbecc2f60 Replace magic numbers with constant SPRITE_INDEX_NULL 2017-01-05 12:49:42 +00:00
Michael Steenbeek 2b35986746 Add and use constant for number of ride types 2017-01-05 09:19:22 +01:00
Michał Janiszewski 6684851115 Fix MinGW builds 2017-01-04 18:28:39 +00:00
Ted John a2e3f10ca1 Update VS project files 2017-01-04 18:28:37 +00:00
Ted John 25bc798ff8 Move contents of src into project sub directory 2017-01-04 17:44:12 +00:00