1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 13:03:11 +01:00
Commit Graph

57 Commits

Author SHA1 Message Date
Johan Mattsson
c00cc90b1f Fix bounds checks and a nullptr check 2022-02-03 21:42:12 +01:00
Michael Steenbeek
4192fc5cc8 Fix leftover references to SC6 2022-01-24 20:03:20 +01:00
Hielke Morsink
5020f993b9 Do not skip .park files in save list 2022-01-09 21:58:38 +01:00
Gymnasiast
919c73d030 C++-ify most path handling 2022-01-08 16:58:57 +01:00
Hielke Morsink
4b4b3333d6 Remove unnecessary else blocks 2021-09-16 18:31:12 +02:00
Hielke Morsink
6011478590 Directly use std::unique_ptr prvalues
This removes the unnecessary constructor calls and improves flexibility in case of typename changes.
All cases, except for the one in Context.cpp, are temporaries.
2021-08-20 23:38:15 +02:00
Silent
94da3cf422 Fix #13445: Make FileScanner::ScanDirectory return a unique_ptr
Also fixes a resource leak in TitleSequence::GetSaves.
2021-05-20 19:22:36 +02:00
Ted John
477677775f Fix crash if save does not exist 2021-02-08 22:27:28 +00:00
skdltmxn
b0a8ebc808 Refactor to use push_back more efficient (#13726) 2021-01-08 20:59:55 +00:00
Kevin Singh
3feefb09b1 Close #12443: Refactor TITLE_SCRIPT to use strong enum (#13540)
Close #12443: Refactor TITLE_SCRIPT to use strong enum
2020-12-10 08:01:54 -03:00
Hielke Morsink
f0c1ea1d37 Split declarations and definitions to improve compile times when editing (#13332)
* Split FileStream declarations and definitions

* Split JobPool declarations and definitions

* Split StringBuilder declarations and definitions

* Split StringReader declarations and definitions

* Split ZoomLevel declarations and definitions

* Fix missing include in FileClassifier.cpp

* Remove pragma once from source files

* Fix missing include in StringBuilder.h

* Update Xcode project

* Fix compilation of tests

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-07 12:42:04 +00:00
Matt
005e1e0e1f Final cleanup
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:23:51 +03:00
Matt
850b10f1fd Fix memory leak
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:23:41 +03:00
Matt
f765ed2f94 Use unique_ptr for TitleSequenceParkHandle Stream
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:23:28 +03:00
Matt
e3a4d6a245 Use std::string for TitleSequenceParkHandle HintPath
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:23:01 +03:00
Matt
17bff41e82 Use std::unique_ptr for TitleSequenceParkHandle
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:22:44 +03:00
Matt
464545b907 Cleanup remnants
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:22:35 +03:00
Matt
668bd8dc9b Use std::string for TitleSequence paths
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:22:25 +03:00
Matt
f586981cd3 Use std::string for TitleSequence names
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:22:12 +03:00
Matt
612249bd74 Use vector for TitleSequence commands
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:21:58 +03:00
Matt
7245f23422 Use vector for TitleSequence saves
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:21:42 +03:00
Matt
ccb6eb06f8 Use unique_ptr for TitleSequence instances
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:21:27 +03:00
Michael Steenbeek
55722a7ad4 Remove commented-out code (#12834) 2020-09-01 15:33:52 -03:00
Matt
83355e35cc Move IStream, MemoryStream, FileStream into OpenRCT2 namespace 2020-08-05 16:29:36 +02:00
Aaron van Geffen
7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Tulio Leao
116bcb5ccb Use named casts on openrct2/(util|windows|scenario|title) (#11146) 2020-04-17 19:45:19 +02:00
Michael Steenbeek
d7f23bc5bf Close #6898: Remove LOADMM and LOADRCT1 commands (#10546) 2020-01-12 14:26:33 +01:00
Aaron van Geffen
2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Linus Unnebäck
fd07be587a Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
clang-format
abb097124c clang-format title 2018-07-23 16:00:12 +02:00
Michael Steenbeek
1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michael Steenbeek
ec3a1e575e Replace Math::Min and Max with std variants 2018-06-20 17:11:35 +02:00
Hielke Morsink
0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Hielke Morsink
5d0022a5cb Remove argument list from zero-initializers with zero/false/nullptr value 2018-06-04 19:50:46 +02:00
Ted John
2ea857a10e Improve IZipArchive so that it is more C++ 2018-05-06 17:46:45 +01:00
Gymnasiast
778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Ted John
7851446a6f Replace Memory::Set with std::fill or similar 2018-02-04 12:35:02 +00:00
Ted John
02c58a6c5a Remove custom base Exception class 2018-01-05 18:11:47 +00:00
Robert Jordan
298420fd1e Finalize follow sprite command
Added new smart follow variable to window to more intuitively follow
sprites that may not be directly followable at all times.
Follow sprite is now canceled when dragging the screen but not
scrolling. This is only relevant when testing title sequences in game.
Select sprite button is now disabled in the title menu.
Sprites are now identified based on their name. Excess identification
information is not given as it'd clutter up the screen and is not
necissary with the viewbox in the command editor.
2017-12-31 20:03:09 +01:00
Hielke Morsink
943747056e Add window settings and save support for follow sprite command 2017-12-31 20:03:09 +01:00
Hielke Morsink
500b0d09aa Add follow sprite command to title sequence 2017-12-31 20:03:09 +01:00
Robert Jordan
92fc010b9a Feature: "Load Scenario" title sequence command
New command goes by LOADSC in script files and in the enumeration.
Scenarios are stored using the internal also used for localisation.
Scenarios selected can only be scenarios to originally come with one of
the games or expansions.
Modified Scenario Select window to have a mode just for title editor
scenario selection.
2017-12-31 12:42:40 +01:00
Ethan Smith
64f2778c10 Refactor MAX_PATH to be in common.h 2017-12-07 22:04:33 +00:00
Robert Jordan
d79d2a7503 Fix numerous title sequence editor bugs
* Change how current title sequence is handled. It can either be
previewing a title sequence, or playing the preset.
* LoadMM and LoadRCT1 now save when script is saved.
* No more infinite failing to load loops.
* No more crashing when attempting to display "no save selected" in
title editor.
* Title editor now gracefully fails to preview a title sequence and lets
the user know with a context error.
* When preset title sequence fails to load, the preset will forcibly be
changed to the first sequence to successfully load.

Added changelog entries for last two items.
2017-11-02 18:36:37 +01: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
Tomas Dittmann
c1b8230eef Wrap the FileStream creation in try-catch. (#5840) 2017-07-13 18:56:33 +01:00
spacek531
c815a427c0 Change Seconds (internal) to Milliseconds, en-GB too 2017-07-07 17:35:31 +01:00
Marijn van der Werf
8766ec37a1 Add Android project 2017-06-15 14:22:15 +02: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
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