1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 22:34:33 +01:00
Commit Graph

39 Commits

Author SHA1 Message Date
germanaizek
958bfbc08a Using std::move(), correct clear strings, better use '= default;', modernize make_* and replace heavy strlen 2022-05-07 16:05:39 +02:00
germanaizek
0045aed7f9 Add const ref, remove excess .c_str(), push_* -> emplace_* and rewrite constructors 2022-05-07 16:05:38 +02:00
Hielke Morsink
4b4b3333d6 Remove unnecessary else blocks 2021-09-16 18:31:12 +02: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
16fc41e6bf Always return unique_ptr for the IniReader/IniWriter interface 2020-09-16 20:23:39 +03:00
Matt
83355e35cc Move IStream, MemoryStream, FileStream into OpenRCT2 namespace 2020-08-05 16:29:36 +02:00
Michał Janiszewski
3b60740128 Add int64_t support to INI parser (#12374) 2020-07-25 09:37:35 +02:00
Aaron van Geffen
7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Michał Janiszewski
2323cc1596 Use named casts instead of old-style casts
Change prepared with clang-tidy and google-readability-casting check
2020-04-22 17:09:29 +02:00
Aaron van Geffen
2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
clang-format
6f2e84e593 clang-format config 2018-07-23 15:58:02 +02:00
Øystein Dale
5744509b87 Fix memory leak in config
Assigning a pointer to std::string appears to only perform a copy and
does not transfer ownership of the pointer, thus the allocated memory is
will never be freed. Use StringBuilder::GetStdString() to avoid the
memory leak.
2018-07-18 00:57:37 +02:00
Michael Steenbeek
fae7c61f05 Fix config read/write 2018-06-20 17:56:57 +02:00
Michael Steenbeek
1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +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
204dd4439b Mark unused arguments in the libopenrct2 project
For dummy classes and functions with empty bodies I've only commented out the arguments, for all others I used C++17's [[maybe_unused]].
2018-06-06 21:03:11 +02:00
Michał Janiszewski
3303246b09 Reduce header inclusions 2018-03-20 00:27:58 +01:00
Michał Janiszewski
764520076f Reduce header inclusion
* Update includes in PlatformEnvironment.cpp

* Update includes in ParkImporter.h

* Update includes of OpenRCT2.h

* Update includes in Intro.h

* Remove unused include from Input.cpp

* Update includes of Imaging.h

* Update includes in Game.h

* Update includes in Editor.h

* Update includes of Context.cpp

* Update includes in Cheats.cpp, CmdlineSprite.cpp

* Update includes of some source files

* Update includes in some cpp files

* Update includes in some cpp files

* Update includes in TextureCache.h

* Fix tests

* Update includes in Font.cpp

* Update includes in LightFX files

* Update some includes

* Fix GCC builds

* Update some includes

* Update some includes

* Update includes in FontsFamilies.*

* Update includes of Console.h

* Improve includes in Window.h

* Improve headers in Viewport.h/Window.h

* Fix MSVC build

* Fix network-less builds

* Reduce inclusion of Map.h
2018-03-13 13:14:02 +01:00
Hielke Morsink
55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
Michał Janiszewski
48c3225cb7 Fix types of caught exception in IniReader.cpp 2018-01-18 19:06:05 +01:00
Michał Janiszewski
4d0c88fb94 Mark constructors explicit (#6928) 2018-01-04 01:12:34 +00: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
duncanspumpkin
76c154a567 Fix #5285. Config file not read correctly.
When the hashing function finds a collision such as on play_intro and auto_staff_placement it has to do a string compare to find out if two map entries are different. Due to a mistype this comparison would always return true. This meant that the auto_staff_placement value would overwrite the play_intro value. Mistake caused when fixing previous bug
2017-03-08 20:32:21 +00:00
LRFLEW
8e55b6ef22 Make the INI keys case insensitive 2017-03-06 09:22:44 -06:00
Michał Janiszewski
3b3f0b2e6b Return actual instead of default value in IniReader::GetString 2017-02-24 23:39:01 +01:00
Michał Janiszewski
58da1cde84 Make IniReader not throw while parsing invalid values 2017-02-24 20:26:49 +01:00
Michał Janiszewski
9c32cb3a62 Don't break on too short INI streams 2017-02-23 23:26:39 +01:00
Ted John
9ba51f221b Add summary comments 2017-02-22 18:00:19 +00:00
Ted John
40eb2c55fd Reduce duplicated code in IniReader 2017-02-22 17:58:50 +00:00
Ted John
4dc792bc1d Use IStream for IniReader and IniWriter 2017-02-22 17:52:33 +00:00
Ted John
6e9d22e99d Use hpp for header files
...as they contain C++ implementation code.
2017-02-22 17:46:10 +00:00
Ted John
6bda8eba0f Move remaining config functions to C++ 2017-02-18 15:16:19 +00:00
Ted John
2fc5012670 Fix build errors 2017-02-18 10:17:26 +00:00
Ted John
d8fae61e0c Add remaining config reading 2017-02-18 10:17:26 +00:00
Ted John
6f15fc2cee Refactor config reading to different files 2017-02-18 10:17:26 +00:00
Ted John
a582cc0cca Add support for config enums 2017-02-18 10:17:26 +00:00
Ted John
3255a1b88c Support reading quoted strings 2017-02-18 10:17:26 +00:00
Ted John
f8f60a69a7 Implement reading of config values 2017-02-18 10:17:26 +00:00
Ted John
d5ee210797 Begin writing IniReader 2017-02-18 10:17:26 +00:00