Commit Graph

66 Commits

Author SHA1 Message Date
Hielke Morsink 53d9bfa8b4
Update implicit zoom conversions 2021-12-01 00:08:35 +01:00
Hielke Morsink 4b4b3333d6
Remove unnecessary else blocks 2021-09-16 18:31:12 +02:00
ζeh Matt 59a6c34db4
Make use of std::optional strict 2021-09-13 20:02:32 +03:00
ZehMatt 8fa4823055
Pass rct_drawpixelinfo as explicit argument, make DrawSpriteArgs const 2021-08-25 15:37:44 +03:00
Hielke Morsink cef26400cf Use std::make_unique instead of new for arrays 2021-08-21 00:28:21 +02:00
Gymnasiast b3bbdcbfd5
Remove hardcoded terrain style constants from RCT1 and MapGen 2021-03-27 17:34:10 +01:00
csunday95 51faec5c50
Close #13637: Refactor sprite compiler for filesystem efficiency
- sprite building would save a file with just the sprite file header
   and then immediately open it again at the beginning of compilation
 - sprite file generation is now entirely in memory until the final
   output file is saved on success
 - added validation of no file activity in the failed build test case;
   failed builds will not generate a file or edit an existing one
2020-12-29 13:12:55 +01:00
Duncan 3f53961e5d
Fix incorrect formatting of input and output of g2.dat (#13599)
* Fix incorrect formatting of input and output of g2.dat

* Fix entry offsets and empty data
2020-12-16 14:34:29 +00:00
Duncan 5b24a9accc
Cmdsprite 2 (#13590)
* Merge all cmdsprite global state into single struct

* Move MakeEntries into a member function

* Use std::optional for sprite file open

* Move sprite_file_save to a member function

* Make sprite_file_close a member function and rename open

* Remove global variable

* Make Entries a vector

* Make Data a vector

* Use FileStream for Open

* Use FileStream for Save

* Renmae Image Import/Export functions and cleanup

* Extract out common item AddImage

* Simplify SpriteFile::AddImage

* Header and struct cleanup

* Make suggested changes
2020-12-16 06:07:44 +00:00
Duncan 04b26631c0
Fix #13576: Remove unrequired code and casts from sprite export
As not all objects load images in the same order the previous code could end up with sprite index's that were incorrect. There also was no reason to make the code object specific as we can just access the image table directly.
2020-12-12 23:18:08 +01:00
Łukasz Pękalski 832fd69822 refactor: changed ObjectType enum to strong enum
code does not compile yet
2020-11-11 16:07:01 +01:00
Łukasz Pękalski 6e5105ab3b refactor: ObjectType to use strong enum
enum renaming complete
2020-11-11 16:07:01 +01:00
Simon Jarrett 12dfa74eef Refactor CmdlineSprite to use new JSON library 2020-09-16 20:18:54 +01:00
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