Commit Graph

53 Commits

Author SHA1 Message Date
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
rdbaris 8aa8d77ca1
Fix for smart pointer bug (#12293)
Don't allocate a ton of memory on load.
2020-07-17 05:23:05 +01:00
rdbaris a2493af9ce
Part of #11159 (purge malloc() & free()) (#11893)
* Used smart pointers

* Changed functions to take vector as input
2020-07-16 22:35:30 +01:00
frutiemax 67a8d833ea
Part of #11159: ImageImporter::ImportResult uses std::vector (#12076) 2020-07-02 14:04:49 -03:00
Ted John 21a9d8f934 Refactor RLE drawing, one arg struct 2020-06-01 20:46:21 +01:00
Ted John d0b1bfbe87 Refactor bitmap drawing, one arg struct 2020-06-01 20:46:21 +01:00
Ted John d3f7ec4844 Create new PaletteMap type to replace byte pointers 2020-05-28 20:00:23 +01:00
Ted John 46bb30f8a1 Refactor rct_palette to GamePalette 2020-05-27 20:52:51 +01:00
Michael Steenbeek 10209690c2
Fix documentation of `sprite exportalldat` command (#11799) 2020-05-23 18:32:41 +02:00
Gymnasiast d5e60e0e71
Create command to export images from .DAT file 2020-05-23 15:30:50 +02:00
Gymnasiast 08b0268b0f
Clean up CmdlineSprite.cpp 2020-05-23 13:02:08 +02:00
Gymnasiast 4b25345d8d
Create GamePalette struct 2020-05-19 21:09:51 +02:00
Gymnasiast 70c4bd89f1
Remove unused struct 2020-05-19 19:42:44 +02:00
Gymnasiast eb25b0db33
Merge cmdline and JSON object palette 2020-05-19 15:42:58 +02:00
Tulio Leao c17127f65b
Use named casts on openrct2 root folder (#11139) 2020-04-17 21:36:25 +02:00
Michał Janiszewski 38907fd0c7
Fix memory leaks around PNG/sprite handling (#10711) 2020-02-16 07:25:30 +01:00
Tulio Leao f790fb9079 Improve variable initialisation, if statements and assertions 2019-12-27 15:05:28 -03:00
Tulio Leao 28812760e7 Fix some compilation warnings 2019-12-27 15:05:27 -03:00
Ted John 3925a6162d Start using ImageId 2019-08-24 18:35:40 +01:00
Ted John a1d9e52046 Rename ToUtf16 to ToWideChar
This is more correct as wchar_t size can differ, for example Linux typically uses 32 bits for wchar_t where as Windows uses 16 bits.
2019-07-22 23:44:03 +01:00
Ted John 6f61c94dbd Remove old widechar <-> utf-8 conversion function 2019-07-22 23:44:03 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Ted John 8ce6cde2b7 Fix building sprite file for unicode paths on Windows 2018-09-18 12:37:42 +01:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format 95ce592579 Enforce not breaking before assignments and function names
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:19 +02:00
clang-format c57bbca827 clang-format root 2018-07-23 16:00:14 +02:00
Michael Steenbeek 136b1e7456 Add sprite file option to force BMP encoding 2018-07-20 17:29:34 +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
Ted John 428dd05dcf Refactor ImageImporter 2018-05-13 01:11:56 +01:00
Ted John bffbf5857d Refactor image importer out into new class 2018-05-13 01:11:56 +01:00
Ted John ac3233b819 Change consumers to use new imaging API 2018-05-13 01:11:56 +01:00
Ted John 4552f6a405 Move Imaging to core 2018-05-13 01:11:56 +01:00
Ted John 4fa45abec9 Remove old C signatures in Imaging.h 2018-05-13 01:11:56 +01:00
Hielke Morsink 30063984e6
Delete unused function arguments or mark them so (#7426)
This aims to make future refactoring easier. The arguments are removed where possible, but kept and marked with C++17's [[maybe_unused]] where they could not be removed (e.g. when they are used as a callback, rather than called directly).

I've skipped the rides/<category>/* and peep/* source files, because the rides source files are mostly generated and have a ton of unused variables, and the peep source files are being refactored.
I've also skipped most of window/* source files, because most of the functions are used as callbacks and will be bulk-renamed at some point.
2018-04-20 13:56:37 +02:00
Michał Janiszewski 67f74119cf Fix missing headers 2018-03-20 00:27:58 +01:00
Michał Janiszewski 3303246b09 Reduce header inclusions 2018-03-20 00:27:58 +01:00
Michał Janiszewski f1ab13f56e Fix sorting and missed floor() usage 2018-03-18 23:29:13 +01:00
Michał Janiszewski 4dd0995efb Move cmath out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 28391eaf5d Move cstring out of common.h 2018-03-18 23:29:13 +01:00
Thomas den Hollander af8adfeb40 Fix dithering error in sprite importer 2018-03-18 12:58:50 +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 6a65f791b6 Add const to arguments 2018-01-10 23:58:57 +01:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Ted John 3dcbebcf68 Refactor drawing.c to C++ 2018-01-05 22:57:57 +01:00
Michał Janiszewski b2bc974fe7
Use nullptr where possible 2018-01-04 06:58:44 +01:00
Michael Steenbeek 1a9975d683 Compile util and cheats as C++ 2017-12-14 10:03:21 +01:00