Commit Graph

365 Commits

Author SHA1 Message Date
Michał Janiszewski 6ac6b272c4 Bump network version 2017-02-02 22:46:37 +01:00
Ted John 676903e65c Reduce false positive desync
The staff list window modifies the sprites purely for local state causing a false positive desync warning to pop up in multiplayer. This now causes it to only happen if the map window is also open. This is also a performance improvement.

#5164
2017-02-02 21:31:36 +00:00
Michael Steenbeek 695f7c33bf Fix all known incorrect land ownership in RCT1 2017-02-02 22:21:05 +01:00
Michael Steenbeek cad39c788a Remove more magic values from metal_a_supports_paint_setup 2017-02-02 21:54:19 +01:00
Broxzier 81a8a1a939 Minor tile inspector improvements
- Fix tile unselectable after closing the window
- Remove unused code (scenery has no dropdown)
- Drawing dashes in X/Y spinners when no tile is selected
2017-02-02 21:28:18 +01:00
duncanspumpkin e384b9a508 Label known offsets and flags of wall/fence 2017-02-02 18:52:35 +00:00
duncanspumpkin e1ea820111 Remove unnecessery read. Add offsets 2017-02-02 18:20:16 +00:00
duncanspumpkin 6a9cddf2d8 Label water object offsets 2017-02-02 18:13:51 +00:00
duncanspumpkin e749285e48 Label PARK_FLAGS_18 and adjust SCENARIO_NO_MONEY comment 2017-02-02 17:59:23 +00:00
Gymnasiast 2381bd5cfb Fix RCT1 Splash Boats import 2017-02-02 15:47:08 +01:00
Michael Steenbeek eb45ec95ce Merge pull request #5145 from IntelOrca/feature/rct1-scenario-select
Enable RCT1 SC4s for scenario select
2017-02-01 18:32:45 +01:00
muemart a64dae573a Fix data path command line on windows 2017-01-31 19:41:26 +00:00
Ted John 72800acd5c Fix std::string used as char * 2017-01-31 17:59:42 +00:00
Ted John 4670d2f770 Fix some SC enum items missing prefix 2017-01-31 17:57:10 +00:00
Ted John 612e268e5f Allow SC4s to be loaded by title seq player 2017-01-31 17:54:39 +00:00
Ted John daaf6c69a3 Use missing SC IDs in scenario sources 2017-01-31 17:54:39 +00:00
Ted John a8e329ef99 Implement getting sc entries from SC4s 2017-01-31 17:54:39 +00:00
Ted John c9d7cd8216 Refactor loading of SC6 information when scanning scenarios 2017-01-31 17:54:39 +00:00
Michael Steenbeek 94d38b9f7a Don't remove vehicles when removing all guests, name some interaction fields 2017-01-30 23:51:01 +01:00
Michał Janiszewski bde17f2b30 Start v0.0.7 2017-01-29 23:35:17 +00:00
wolfreak99 99c68439b1 define MAX_PEEP_SPAWNS and MAX_PARK_ENTRANCES (#5119) 2017-01-29 22:27:14 +01:00
wolfreak99 70a855c395 Fix #5029: Invalid window limit can cause crash
#5121
2017-01-29 18:03:23 +00:00
duncanspumpkin 35b91037e8 Refactor of footpath labeling enums 2017-01-29 10:15:29 +00:00
duncanspumpkin e2efb66d3d Minor refactor of banner and footpath enums 2017-01-29 09:40:43 +00:00
Michał Janiszewski 723e13cb16 Prevent some crashes when title sequence is not present 2017-01-28 21:13:36 +00:00
Michał Janiszewski f6cc743da6 Fix #5096: Crash on park with out of bounds sprite coordinates 2017-01-28 21:12:07 +00:00
Michał Janiszewski cb1911280a Don't crash if path to RCT2 is NULL
This can happen when `game_path` entry gets removed from `config.ini`
2017-01-28 21:31:33 +01:00
Michał Janiszewski 404fceaed9 Guard against invalid fence better 2017-01-28 21:04:08 +01:00
duncanspumpkin 3633b86405 Minor refactor of track design to label enums 2017-01-28 09:28:11 +00:00
Michał Janiszewski 0e7c94d98a Guard fence from null entry
Allows loading
http://www.nedesigns.com/park/3626/mediterranean-mysteries/
2017-01-28 00:12:49 +01:00
Michał Janiszewski 834cee311b Fix typos in RCT1-related code 2017-01-27 22:13:49 +01:00
Michał Janiszewski 51523df50a Fix left-shifts in research.c 2017-01-27 21:46:10 +01:00
Ted John 233a3040e1 Merge pull request #5007 from IntelOrca/feature/rct1/import-vehicles
RCT1: import vehicles
2017-01-27 07:49:20 +00:00
Michał Janiszewski 6bd9e3eca8 Make sure various fields are initialised properly 2017-01-27 07:35:48 +01:00
Gymnasiast 24b546b789 Fix import of peep sprites 2017-01-27 00:50:49 +01:00
Ted John e115227c08 Sort includes 2017-01-26 23:36:33 +00:00
Ted John b5505c9fc9 Improve function names 2017-01-26 23:36:21 +00:00
Ted John f019aa5db5 Remove commented out code 2017-01-26 23:35:01 +00:00
Ted John f3fc09cb9a Fix switch brace syntax 2017-01-26 23:32:46 +00:00
Ted John 438926c08c Protect ride_mechanic_status_update from null mechanic 2017-01-26 23:30:16 +00:00
Gymnasiast 2da90b9808 Fix erroneous messages about stalling 2017-01-26 23:30:16 +00:00
Ted John c24127bafe Fix loading scenario details from SV4 2017-01-26 23:30:16 +00:00
Gymnasiast c92792a973 Also import news items in S4 files correctly 2017-01-26 23:30:16 +00:00
Gymnasiast 6d8a617712 Count block sections when importing an SC4/SV4 file 2017-01-26 23:30:16 +00:00
Gymnasiast a7e91ad556 Use the actual scenario number in the S4 file rather than the file name 2017-01-26 23:30:16 +00:00
Gymnasiast bd68624c92 Fix unbuyable land tiles in Katie's Dreamland 2017-01-26 23:30:16 +00:00
Gymnasiast 84754ec30f Correctly import Heide-Parks Compact Inverted Coaster 2017-01-26 23:30:16 +00:00
Gymnasiast 585e28b67f Temporarily fix non-ascii import 2017-01-26 23:30:16 +00:00
Gymnasiast e621cd37cc Fix mechanics facing the wrong direction 2017-01-26 23:30:16 +00:00
Ted John 1cb6dbbe1f Convert RCT1 strings to UTF-8 2017-01-26 23:30:16 +00:00
Ted John 67b668c54e Use spite_move when importing misc sprites 2017-01-26 23:30:16 +00:00
Ted John 1a5bec7846 Fix and refactor sprite index mapping 2017-01-26 23:30:16 +00:00
Gymnasiast 79f9cf611d Guard better against incorrect subtypes 2017-01-26 23:30:16 +00:00
Gymnasiast 91c3b5c592 Fix lifecycle flags import 2017-01-26 23:30:16 +00:00
Gymnasiast d476176d73 Import more fields, name mechanic flags, fix booster behaviour 2017-01-26 23:30:16 +00:00
Gymnasiast 39d413b781 Fix Megaworld Park crashing on opening, fix some colour schemes 2017-01-26 23:30:16 +00:00
Gymnasiast 476f1fad2b Use constants for null sprite location and maximum vehicles 2017-01-26 23:30:16 +00:00
Gymnasiast 02da9caf5d Fix formatting and remove warning silencer 2017-01-26 23:30:16 +00:00
Gymnasiast 803c4ddfe5 Fix minigolf import 2017-01-26 23:30:16 +00:00
Gymnasiast 653be68b98 Don't assert on incorrect colour or sprite type 2017-01-26 23:30:16 +00:00
Gymnasiast 69a79fd00a Import water colour 2017-01-26 23:30:16 +00:00
Gymnasiast 3d0c357fbf Fix vehicle direction 2017-01-26 23:30:16 +00:00
Michael Steenbeek b47694a9f7 Fix typo 2017-01-26 23:30:16 +00:00
Gymnasiast 54c4f0f1f3 Fix import of more vehicles, fix some colours 2017-01-26 23:30:16 +00:00
Gymnasiast cc4576b72a Fix colour lookup for vehicle sprites 2017-01-26 23:30:16 +00:00
Gymnasiast 51c812458e Extract colour lookup functions 2017-01-26 23:30:16 +00:00
Gymnasiast d077cd1341 Create table for converting colour schemes, fix some vehicles, fix river rapids 2017-01-26 23:30:16 +00:00
Gymnasiast 63d639db5d Fix negative queue lengths, fix monorail, fix chairlift crashes 2017-01-26 23:30:16 +00:00
Ted John c1d532be01 Fix colour conversion out of range 2017-01-26 23:30:16 +00:00
duncanspumpkin e3e435c9f7 Fix trains splitting up into multiple vehicles 2017-01-26 23:30:16 +00:00
Gymnasiast dacfba9eda Import more fields, correct more vehicles 2017-01-26 23:30:16 +00:00
Gymnasiast fc7b03747e Import ride measurements (with bugs) 2017-01-26 23:30:16 +00:00
Gymnasiast e3d197e856 Import Corkscrew train correctly, import colours 2017-01-26 23:30:16 +00:00
Gymnasiast f7f744f59b Use a map to convert vehicle subentry and restore seat rotation 2017-01-26 23:30:16 +00:00
Gymnasiast 8646f5d4ee Use speed, friction from source vehicle 2017-01-26 23:30:16 +00:00
Ted John 6c339787ee Fix peep links in vehicles 2017-01-26 23:30:16 +00:00
Gymnasiast 748d82f517 Import peeps in vehicles as well 2017-01-26 23:30:16 +00:00
Ted John 390a03a540 Remove seat rotation from RCT1 vehicle struct 2017-01-26 23:30:16 +00:00
Ted John f52286a442 Import and fix vehicle links 2017-01-26 23:30:16 +00:00
Ted John 604e17007f Copy over some properties 2017-01-26 23:30:16 +00:00
Ted John 7a4ca989ba Add beginnings of vehicle importing 2017-01-26 23:30:16 +00:00
Ted John 53c788d9d9 Fix #5003: Able to remove entrance/exit of unedittable rides 2017-01-26 23:24:59 +00:00
Michał Janiszewski 8d1fbcf188 Raise network version to 33 2017-01-26 23:00:56 +01:00
zaxcav f5ae931406 Replace reuse of test_edge with new variable next_test_edge
Value of test_edge is needed for checking all path tiles placed with
zero clearance at that location.
2017-01-26 22:59:54 +01:00
duncanspumpkin 61bb44cd22 Bump network version just in case 2017-01-26 19:52:01 +00:00
Michał Janiszewski aeef3a7d5d Remove trailing whitespace 2017-01-26 19:51:31 +00:00
duncanspumpkin 98f483e4bb Fix trailing white space. Fixed space indent 2017-01-26 19:51:31 +00:00
duncanspumpkin d951c500c5 Refactor of peep data and label known addresses
Fixes #4545. Incorrect sprite image for chicken and juice
2017-01-26 19:51:30 +00:00
duncanspumpkin 7cddd36feb Fix RCT2 builds
Due to increased warnings unreachable code warning was causing a failure to compile.
2017-01-25 18:35:28 +00:00
Ted John 7eac99c9f0 Merge pull request #5113 from IntelOrca/feature/random-entertainer-skin
Set hired entertainers to a random costume.
2017-01-25 12:35:08 +00:00
Gymnasiast 8f81485c46 Correct spelling of 'block brakes', use constant 2017-01-25 02:33:17 +01:00
zaxcav 5424e7774c Display cut height in Units when Height Label: Units is selected in the options. (#5115) 2017-01-25 00:53:25 +01:00
Ted John 93762bf15f Fix issues 2017-01-24 17:32:17 +00:00
Ted John c40df001ca Use sint32 2017-01-24 17:04:03 +00:00
Ted John c699c91348 Pick random entertainer costume 2017-01-24 13:06:23 +00:00
Ted John 2900f38cc3 Allow entertainer costume to be given to game command 2017-01-24 13:06:23 +00:00
Michał Janiszewski ceb77b489d Fix map_get_path_element_at to not consider ghosts 2017-01-24 11:30:39 +01:00
Michał Janiszewski 88113ca952 Fix some ghost consideration in peep AI
This is a continuation of
https://github.com/OpenRCT2/OpenRCT2/pull/5094.

While the previous PR cured some desyncs, the real issue remained –
logic of the game considers ghost elements. This change fixes it, to
some extent.

The problem here is we already remove ghosts when interacting over
network (e.g. `footpath_provisional_remove` in `footpath_place_real`),
but this happens only when such a game command is executed in OpenRCT2.
Whenever SV6 gets imported, path map elements already have had edges
calculated for them, neighbours being ghost or not, and we don't update
it. OpenRCT2/OpenRCT2#5094 is one, naïve, way to solve, the other option
would be to recalculate all the paths whenever we load SV6.
2017-01-24 11:29:58 +01:00
Michael Steenbeek a4d5f764f4 Implement diagonal flat-to-steep slopes on the Junior RC, fixes #4584 2017-01-24 09:26:30 +01:00
Aaron van Geffen 990b9b8708 Fix #5005: The Right Arrow in Horizontal scroll bars does not work anymore. (#5107)
Both horizontal and vertical scrollbars had a malfunctioning widget: both the
right and bottom widgets weren't fired properly.

The bug was less noticeable for vertical scrollbars, as clicking the widget would
be treated as clicking empty space, which did not happen for the horizontal
scrollbar.

This patch fixes the underlying inconsistencies, making sure the widgets for
both types of scrollbars work -- when using either scrollbar, or when combined.
2017-01-23 19:06:53 +01:00
Ted John 3379143011 Improve S4 / S6 import initialisation 2017-01-23 13:00:46 +00:00
Ted John a0fc01d54e Clean up game init a bit more 2017-01-23 12:55:59 +00:00
Ted John 288f4782b6 Make dedicated method for window set location 2017-01-23 12:48:10 +00:00
Ted John abac2ca614 Consolidate game initialisation into single method 2017-01-23 12:44:27 +00:00
Ted John ef6fa35323 Merge pull request #5106 from IntelOrca/refactor/use-scenario-repo
Refactor / use scenario repository as dependency
2017-01-23 12:08:23 +00:00
Aaron van Geffen 3437b26db8 Clean up switch statement for map window 2017-01-22 23:06:56 +01:00
Ted John e36dc622ad Pass scenario repository dependency to TitleSequencePlayer 2017-01-22 22:04:07 +00:00
Ted John d5f2ea814a Use scenario repository to load SFMM in title sequence 2017-01-22 21:57:14 +00:00
Ted John efb64603eb Only create OpenGL window when necessary
Currently the game window is always created with an OpenGL context which then means that opengl32.dll and other modules are loaded. The OpenGL window flag will now only be used if the config drawing engine is set to OpenGL. This now means that a restart of the game is required when switching to the OpenGL drawing engine for Windows.

#5104
2017-01-22 21:38:08 +00:00
zaxcav a4b476ac92 Minor changes as requested by reviewer. 2017-01-22 21:21:00 +01:00
zaxcav 80b0df3b74 Add formatting to tooltip texts; Fix printing of raw clip height value. 2017-01-22 21:21:00 +01:00
zaxcav 6a4ced856e Minor code changes per reviewer comments. 2017-01-22 21:17:08 +01:00
zaxcav 0d81835224 Correct mistakes during rebase. 2017-01-22 21:17:08 +01:00
zaxcav 93e5e80e26 Correct code alignment in widget placement code (tab based). 2017-01-22 21:11:42 +01:00
zaxcav e8f97da2c6 Implement further changes as requested by reviewer.
Add toggling displayed clip height value between the raw value and value in units.
2017-01-22 21:11:42 +01:00
zaxcav 25e57ca50d Updated code as requested by reviewer.
Removed display of raw cut height value.

Changed display of cut height in METRIC/SI from 1DP to 2DP to display odd raw heights with accurate value.

Changed display of cut height in IMPERIAL to 1DP to display odd raw heights with accurate value.
2017-01-22 21:02:19 +01:00
zaxcav 87a80ac956 Minor code cleanups.
Adjusted sprite trimming.
2017-01-22 20:57:17 +01:00
zaxcav e287b4ec3e Fix typo. 2017-01-22 20:57:17 +01:00
Broxzier ef5f4a5f5a Add spinners for better control of clip-height
This commit also changes the step size to 1 (I did not notice anything
strange).
2017-01-22 20:57:17 +01:00
Broxzier e87da61436 Fix screen invalidation on drag
The window size did not match the sizes given to window_create, causing
the window to think it was actually smaller, and as a result not clearing
the screen properly. This commit adds the WW and WH macros and uses them.

This commit also has a few formatting changes.
2017-01-22 20:57:17 +01:00
zaxcav f76628bff0 Recorrect errors identified by AppVeyor. 2017-01-22 20:57:17 +01:00
zaxcav d06d37e862 Revise previous error corrections 2017-01-22 20:57:17 +01:00
zaxcav c91871822b Correct more errors detected by AppVeyor 2017-01-22 20:57:17 +01:00
zaxcav c615368115 Correct errors identified by AppVeyor 2017-01-22 20:57:17 +01:00
zaxcav 77e3827935 Add view_clipping.c to openrct2.vcxproj 2017-01-22 20:57:17 +01:00
zaxcav a30c9b3717 Minor code cleanups 2017-01-22 20:57:17 +01:00
zaxcav a008dcb186 Display clip height in METRIC/SI units with 1DP. 2017-01-22 20:57:17 +01:00
zaxcav c97f624965 Move view_clipping.c to under src/openrct2/windows 2017-01-22 20:50:39 +01:00
zaxcav c3aabede64 Initial prototype of paint clipping.
Paint clipping is a possible future feature to assist players building in cluttered areas of a park by controlling which map elements and sprites are rendered, providing a clearer view for construction, inspection, etc.

Only clip height is supported in this prototype.

Map elements are clipped according to the map element base height (meaning *all* scenery on that map element is currently clipped with it).

Sprites are clipped according to their z value being within the "sprite volume" of any non-clipped map element (which means below clip height + 2).

Control is only provided through the console in this prototype - use the command: set paint_clip_height _value_

To turn clipping off use the command: set paint_clip_height 255

Clip heights are limited to multiples of two to coincide with the native heights of map elements.

Command "get paint_clip_height" prints the clip height as a raw value as well as the equivalent height in ft and m as used when displaying heights in-game.

At this time only painting of the main viewport is affected. There is no change to any input control handling.
2017-01-22 20:50:39 +01:00
zaxcav 0620321fb2 Re-added initialisation of scrollbar.
Added window theme, so window displays correctly everytime.

Changed strings.

Other minor tweaks to window.
2017-01-22 20:50:39 +01:00
zaxcav c6da3fa862 Scrollbar for clipping height now works.
Initialisatation of scrollbar with clip height is temporarily disabled.

Revised view menu entry bahaviour.

Other minor window tweaks.
2017-01-22 20:45:21 +01:00
zaxcav 5f03047c40 View clipping window fixes.
Cleaned up widget positions - looks like a proper interface now.

Remaining Issues:

- Window only displays correctly every second time it is opened;

- Clip height in Units (ft/m) is displayed without the decimal point;

- Scroll bar is not working;

- Decide how the View menu entry should work.
2017-01-22 20:45:21 +01:00
zaxcav fc8da2086f Fix view menu so view clipping entry shows 2017-01-22 20:45:21 +01:00
zaxcav e8d6cba5be Initial attempt at paintClip UI
Compiles but untested.

NOT INTENDED FOR MERGING
2017-01-22 20:45:21 +01:00
zaxcav 1e5b83c631 Initial prototype of paint clipping.
Paint clipping is a possible future feature to assist players building in cluttered areas of a park by controlling which map elements and sprites are rendered, providing a clearer view for construction, inspection, etc.

Only clip height is supported in this prototype.

Map elements are clipped according to the map element base height (meaning *all* scenery on that map element is currently clipped with it).

Sprites are clipped according to their z value being within the "sprite volume" of any non-clipped map element (which means below clip height + 2).

Control is only provided through the console in this prototype - use the command: set paint_clip_height _value_

To turn clipping off use the command: set paint_clip_height 255

Clip heights are limited to multiples of two to coincide with the native heights of map elements.

Command "get paint_clip_height" prints the clip height as a raw value as well as the equivalent height in ft and m as used when displaying heights in-game.

At this time only painting of the main viewport is affected. There is no change to any input control handling.
2017-01-22 20:41:34 +01:00
Ted John 8d959fa519 Merge pull request #5085 from IntelOrca/refactor/structs/various
Create new OpenRCT2 news item struct
2017-01-22 16:15:42 +00:00
Gymnasiast 0a83bb8b15 Fix importing custom peep/staff names, fix formatting 2017-01-22 16:54:58 +01:00
Ted John ed940ab41c Merge pull request #5098 from IntelOrca/enable-lightfx
Resolve #5048: Enable light FX
2017-01-22 01:31:56 +00:00
Ted John 66c2dcaa59 Remove unncessary extern from functions definitions. 2017-01-21 21:57:09 +00:00
Michael Steenbeek d60b0def60 Fix loading zoomed sprites from RCT1 2017-01-21 21:48:12 +00:00
Ted John a7edba27aa Enable light FX in builds 2017-01-21 12:02:41 +00:00
Ted John fc66f42c31 Add config option to enable / disable light FX 2017-01-21 12:01:01 +00:00
wolfreak99 a15a3fedf7 Create "misc_commands" enum 2017-01-21 12:43:16 +01:00
Michał Janiszewski 64fc76009a Strip ghost flag from elements on loading
Ghost elements are notoriously a reason of network desyncs, because they
don't get transferred over network. They are meant to be local only and
disregarded by any logic, but it is not yet the case in many places.

Upon saving, we *remove* all the ghost elements (by calling
`scenario_fix_ghosts`), based on assumption they can only be caused by
local interaction. Testing has shown there are `sv6`s in the wild that
have elements marked as ghosts and this could lead to a situation where
we strip away parts of the park. This also causes network desyncs for
reason stated above.

As we strip elements with ghost flag from saves anyway, it should be
safe to assume none of our saves introduce ghosts and this issue is
limited to hacked parks only. One example of such park is [Cocopa
Bay](http://www.nedesigns.com/park/3473/cocopa-bay/).

This change removes the flag on all map elements while importing. This
is much less invasive than removing all ghost elements on importing, as
they may contain some actual data. This ~~fixes~~ hides the desync that
could be seen in the Cocopa Bay park.

As this doesn't change any in-game logic, no network version update is
necessary.

#5094
2017-01-21 00:21:10 +00:00
Michael Steenbeek 936ec799fa Add constants for CSG1 large surface sprites 2017-01-20 12:40:06 +00:00
Michael Steenbeek a5b280e115 Whitespace correction 2017-01-19 20:28:29 +01:00
Michael Steenbeek 5a3f2e01ab Add note explaining the start address of CSG1 2017-01-19 20:27:35 +01:00
Ted John ebc0d03601 Rename terrain edge constant arrays 2017-01-19 15:00:21 +01:00
Ted John ebebd3836c Refactor edge image arrays and add constants 2017-01-19 15:00:21 +01:00
Ted John a102a566d2 Allocate image IDs for RCT1 images 2017-01-19 15:00:20 +01:00