Commit Graph

169 Commits

Author SHA1 Message Date
Michael Steenbeek ce8d9cc71b Rename map_element to tile_element 2017-10-31 19:59:06 +01:00
Robert Jordan a3c64bb146 Feature: Preview title sequences in-game
Title sequences can now be played back in-game, allowing for much easier
editing.

Improved title sequence playback in general. Clicking play while on a
different title sequence will play the new one. Clicking stop will make
the title screen go back to the config title sequence. And the closing
the title sequence window will also make the game go back to the config
title sequence, and reload the sequence if it was modified.

Changes made to title sequences in-game are now correctly loaded in the
title screen.

Starting a title sequence within the editor will now always reset it
even if it's the current playing sequence. (Not for playing in the
editor though).

Get Location in title sequence command editor now has 100% accuracy
compared to before
where it would usually get some offset value.

Added `get_map_coordinates_from_pos_window` which will allow getting the
viewport coordinates of a specific window even if the input coordinates
are under another window. This has use with getting 2D positions from
the main window without the other windows getting in the way.

Options window will now always specify the config title sequence in the
dropdown and not the current title sequence.

Made a global variable `gLoadKeepWindowsOpen`, in game.h to keep windows
open when loading a park. When loading a title sequence park in-game.
The sequence player will force-close all park-specific windows ahead of
time.

Skipping while testing title sequences no longer needs to reload the
park if the current playback position is already before the target
position and ahead of the load position.

Added changelog entry.
2017-10-30 12:07:01 +01:00
Michał Janiszewski 8fd2266bda Refactor includes (#6512)
* Refactor Intent.h inclusion

* Use forward declaration of ITcpSocket

* Remove unused include

* Forward declare rct_ride_entry

* Remove unused headers

* Forward-declare rct_drawpixelinfo

* Remove unused headers

* Lower header include from header to source file

* Reduce included headers

* Reduce includes
2017-10-19 10:01:05 +02:00
Robert Jordan ec22d04089 Fix #6470: Title sequence naming issues
Predefined title sequence filenames are now treated as "reserved".
Custom title sequences cannot use reserved names and an error will
appear if the user tries.

Duplicating predefined title sequence now uses default text of
predefined sequence's proper name instead of filename.

Renamed `WIDX_TITLE_EDITOR_RENAME_SAVE_BUTTON` to
`WIDX_TITLE_EDITOR_RENAME_BUTTON` to follow formatting of other preset
button ids.

Added string id 6154, `STR_ERROR_RESERVED_NAME`, "Name is reserved".
2017-10-18 11:18:14 +02:00
Robert Jordan 74f1eb39a8 Fix: TitleSequence spelling errors
```c++
bool TileSequenceSave(TitleSequence * seq);
bool TileSequenceAddPark(TitleSequence * seq, const utf8 * path, const
utf8 * name);
bool TileSequenceRenamePark(TitleSequence * seq, size_t index, const
utf8 * name);
```

Renamed to:

```c++
bool TitleSequenceSave(TitleSequence * seq);
bool TitleSequenceAddPark(TitleSequence * seq, const utf8 * path, const
utf8 * name);
bool TitleSequenceRenamePark(TitleSequence * seq, size_t index, const
utf8 * name);
```
2017-10-15 10:33:10 +02:00
Michael Steenbeek 7f9c25a7a9 Use constant for LOCATION_NULL, split off location stuff to Location.h 2017-10-13 22:23:07 +02:00
Michael Steenbeek 42d6a10952 Compile management as C++ 2017-10-11 21:38:26 +02:00
Michał Janiszewski c4538496c5 Make sure variables are either static or declared externally 2017-10-09 22:59:40 +02:00
Marijn van der Werf d02976695d Move new ride and research windows 2017-10-07 22:24:14 +02:00
Tyler Ruckinger d33803b5d0 Ensure title sequence user data path exists 2017-10-03 09:32:11 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
wolfreak99 e1f40352b6 Fix various currently loaded map marker issues
* create gCurrentLoadedPath for Load/Save dialog

* Clear gCurrentLoadedPath upon quitting game/loading titlescreen

* Mark loaded landscapes in load dialog
2017-09-12 08:09:54 +02:00
Marijn van der Werf 294cef3c9b Move additional windows to UI project 2017-08-14 23:53:28 +02:00
Marijn van der Werf 4d90940d21 Move windows to UI project 2017-08-10 13:42:27 +02:00
Marijn van der Werf dc7f4bcf89 Convert most dialogs to C++ 2017-08-10 13:42:27 +02:00
Ted John 6699d0885b Merge pull request #6065 from IntelOrca/refactor/remove-rct2.c
Move remaining functions out rct2.c
2017-07-30 18:09:26 +01:00
Michał Janiszewski a90dce018d Properly dispose of TitleSequencePlayer to plug memleak 2017-07-30 16:46:56 +02:00
Michał Janiszewski 1ea5a902df Initialise various fields and variables 2017-07-30 15:28:16 +02:00
Ted John 8b2eb8a13e Move screen variables to OpenRCT2.h 2017-07-29 20:29:29 +01:00
Christian F. Coors 32da66aa79 Fix build errors 2017-07-25 22:50:19 +02:00
Ted John bc88cb9c2b Make TitleScreen a class (#5971) 2017-07-22 23:42:14 +01:00
ZehM4tt ad4eaff323 Fix game not allowing to catch up if rendering is slow.
Refactored game_update to use the given parameters from context.
2017-07-18 15:14:21 +02:00
Ted John cb884dad11 Refactor rct2_draw to a new Painter class
Right now this is created for each drawing engine, but should eventually be a dependency into them.
2017-07-16 23:25:11 +01:00
Tomas Dittmann c1b8230eef Wrap the FileStream creation in try-catch. (#5840) 2017-07-13 18:56:33 +01:00
Tomas Dittmann bec1538f48 Improve the error console output. (#5839) 2017-07-09 00:09:46 +01:00
spacek531 bd4e8cbd08 change Min to Max 2017-07-07 17:35:32 +01:00
spacek531 c815a427c0 Change Seconds (internal) to Milliseconds, en-GB too 2017-07-07 17:35:31 +01:00
spacek531 f5bc1b598c removed extra newline, changed tabs to spaces 2017-07-07 17:35:31 +01:00
spacek531 b460401ab6 Removed redundant Ceil 2017-07-07 17:35:31 +01:00
spacek531 ec0f35fe7b added comment 2017-07-07 17:35:31 +01:00
spacek531 cbe154f63b I hope this isn't a joke of a commit
I have no idea.
2017-07-07 17:35:31 +01:00
Ted John fd2eda921f Merge pull request #5705 from Broxzier/hardcoded-values
Replace -1 with SPR_NONE for viewport sprite, sort some includes
2017-07-02 00:08:33 +01:00
Ted John 14443b30f1 Fix #5751: Title sequence seconds are about 0.8 seconds 2017-07-02 00:04:32 +01:00
Ted John 2fffeb9470 Set the map to blank if no title sequences can load 2017-06-29 19:24:28 +01:00
Broxzier 9e204c11a9 Replace newly added SPR_NONE's with SPRITE_INDEX_NULL, remove new includes
needed to change its type to match .
2017-06-25 22:44:58 +02:00
Broxzier 36fb2c42d9 Replace -1 with SPR_NONE for viewport sprite, sort some includes 2017-06-25 21:13:04 +02:00
Ted John f275e5ba9b Remove all platform.h includes from header files
System headers, particularly windows.h polute the namespace too much with macros and unwanted definitions. Do not use them in header files.
2017-06-25 18:59:56 +01:00
ZehM4tt 10740106f2 Fix causing asserts with DEBUG_DESYNC and loading new maps. (#5650)
Moved input handling out of game_logic_update back to game_update,
should be executed per frame not tick.
Placed gInUpdateCode at the proper locations.
2017-06-19 17:41:28 +02:00
Marijn van der Werf 8766ec37a1 Add Android project 2017-06-15 14:22:15 +02:00
Ted John 97d68957f0 Fix segfault in screenshot command 2017-06-10 15:48:05 +01:00
Michał Janiszewski 14bbe2c2c2 Verify scenario is not null before accessing it 2017-06-09 22:18:15 +02:00
Ted John c1ccf2b7a6 Refactor load_palette to call gfx_invalidate_screen
Nearly all calls to load_palette were succeeded with a call to gfx_invalidate_screen. So remove these and stick just one call inside load_palette.
2017-06-07 23:24:18 +01:00
Michał Janiszewski 79d76759bb Fix #5516: Update copyrights for 2017
Not all files were necessarily _changed_, but all were touched, see
https://github.com/OpenRCT2/OpenRCT2/pull/4932
2017-06-01 21:55:10 +02:00
Ted John bd9839ff50 Get the game working
Mostly just needed to resolve screen size which is now retrieved via ui context.
2017-05-29 22:38:43 +02:00
ceeac eeac581857 Fix memory leak when closing Title Sequence handle.
The handle is now invalid after calling TitleSequenceCloseParkHandle().
2017-05-26 18:21:50 +02:00
ceeac daeeb5f827 Fix memory leak when adding title sequence.
The constructor of std::string already duplicates the string.
2017-05-26 18:21:50 +02:00
ceeac bed408ef3f Fix memory leak when loading title sequence.
The buffer for loading the title sequence script was allocated but not free'd
2017-05-26 18:21:50 +02:00
Michał Janiszewski de6e493049 Catch exceptions using const-reference rather than value 2017-03-23 22:21:17 +01:00
Ted John bcc0bfa485 Rename climate.h to Climate.h 2017-03-11 22:59:33 +00:00
Michał Janiszewski 7f48df20ec Refactor input 2017-02-27 20:20:41 +01:00
Ted John fb2c835d52 Include new config header 2017-02-18 15:45:10 +00:00
Michał Janiszewski d40bbd7f5c Fix #5219: segfault when opening "misc" tab in options 2017-02-15 22:11:28 +01:00
Ted John e2aebb2236 Use streams for reading title sequence scripts 2017-02-08 22:11:46 +00:00
Ted John 44120b2e7e Fix build issues 2017-02-02 22:00:01 +00:00
Ted John fed4c248e3 Remove use of SDL RWOps from title sequence player 2017-02-02 22:00:01 +00:00
Ted John 5d7a712672 Use new S6 importer for title screen and fix issues 2017-02-02 22:00:01 +00:00
Ted John 5c1f2f4c43 Replace IS4Importer with IParkImporter 2017-02-02 22:00:01 +00:00
Ted John f30a3b315c Add common load method for S4 importer 2017-02-02 22:00:01 +00:00
Ted John 612e268e5f Allow SC4s to be loaded by title seq player 2017-01-31 17:54:39 +00:00
Michał Janiszewski 723e13cb16 Prevent some crashes when title sequence is not present 2017-01-28 21:13:36 +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 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 71f83cd7a7 Dissociate rct_news_item from RCT2 2017-01-17 12:51:02 +00:00
Broxzier 60603ae10a Use types from common.h 2017-01-14 12:37:31 +01:00
Michał Janiszewski 0a36af19e4 Mark classes as final to help devirtualisation 2017-01-13 12:12:50 +01:00
LRFLEW 47c532d020 Don't zoom to cursor for keyboard or toolbar inputs (#5028) 2017-01-11 17:43:11 -06:00
Ted John 25bc798ff8 Move contents of src into project sub directory 2017-01-04 17:44:12 +00:00