Commit Graph
52 Commits
Author SHA1 Message Date
Gymnasiast 5bc368dfdb Set G1Flag::hasZoomSprite when a zoom offset has been specified in JSON 2026-06-24 12:34:53 +02:00
Gymnasiast 0833b474c4 Always set G1Flag::hasTransparency (bit 0) when importing an image
RCT1/2 always set this flag when an entry is an image of any sort (as opposed to a palette entry). It may be misnamed, as both regular and compressed/"RLE" images support transparency.

This modifies a single bit in the example.dat file, as expected. For convenience:

2c2
< 00000010: 0000 0000 0400 0000 0001 0501 0a01 0f01  ................
---
> 00000010: 0000 0000 0500 0000 0001 0501 0a01 0f01  ................
2026-06-24 12:34:04 +02:00
Gymnasiast 96fae1b2ae Allow images over 256×256 pixels
RCT1 uses these and RCT2 may too (specifically for the reverse freefall coaster), so this limit does not seem to be inherent to g1.
Maybe it could be removed outright.
2026-06-24 12:10:38 +02:00
Gymnasiast a80fa16c20 Refactor ImportFlags into FlagHolder 2026-01-31 14:00:52 +01:00
Gymnasiast c254c2e9f8 Improve error messages, add changelog entry 2026-01-17 23:44:37 +01:00
Gymnasiast 9d7a0a167d Move importing JSON palettes to ImageImporter 2026-01-17 20:24:47 +01:00
Gymnasiast 7de4dcd675 Rename PaletteBGRA and its members 2026-01-16 19:25:24 +01:00
matheusvb3 f6cbfb91f8 Remove stray semicolons after declarations 2026-01-16 12:43:59 -03:00
Aaron van Geffen b5cd780b3e Rework drawing header includes (#25744)
* Move Csg unit into OpenRCT2 namespace

* Move G1Element into its own header file

* Clean up SpriteCommands.h

* Add trailing namespace comment to Csg.cpp

* Remove Drawing.h dependency from Graph.h

* Add <memory> include to G1Element.h

* Remove Drawing.h include from ImageTable.h (used by all objects!)

* Drop Drawing.h dependency from OpenGLFramebuffer.h

* Drop Drawing.h dependency from TextureCache.h

* Drop Drawing.h include from TitleScene.h

* Drop Drawing.h dependency from Widget.h

* Add <optional> include to SpriteFile.h

* Add Drawing.h to PlayTests, S6ImportExportTests

* Include <cstdint> in TitleScene.h for SIZE_MAX
2026-01-05 19:09:34 +00:00
Aaron van Geffen 40aaf97c07 Update copyright years to 2026 (#25741) 2026-01-05 13:42:59 +00:00
Gymnasiast 7236631db5 Create strong enum+Flagholder for G1 flags 2025-12-27 20:25:59 +01:00
Gymnasiast e6fa262b9e Rename G1Element members, add unions for palette entries 2025-12-27 16:56:54 +01:00
Michael Steenbeek be9f27e4f9 Mass rename constants (#23656) 2025-01-19 15:59:45 +00:00
Aaron van Geffen fa06a49302 Update copyright year to 2025 (#23514) 2024-12-31 20:30:04 +01:00
ζeh Matt 0e1517be4f Move GamePalette into ColourPalette.h, use namespace for it also 2024-12-14 16:21:54 +02:00
Aaron van Geffen a24dc2e60a Reduce includes in and of Util.h/cpp 2024-12-11 20:42:43 +01:00
Gymnasiast d90897fbee Refactor import flags 2024-08-07 20:15:59 +02:00
Spacek531 9f5b344a46 Allow setting “no draw on zoom flag” in image JSON 2024-08-07 18:19:30 +02:00
Gymnasiast 88eca0d518 Move everything in ImageImporter.cpp into namespace 2024-03-30 18:13:03 +01:00
Gymnasiast c232aa9b0c Create import meta object, use single method for JSON parsing 2024-03-30 18:13:03 +01:00
Harry Hopkinson 9ab18e37a2 Cleanup static_cast's
Cleanup static_cast's

Cleanup static_casts'

Cleanup static_casts'

Format Code

Address requested changes

Address requested changes

Change uint16_t to size_t

Stop undefined behaviour

Address requested changes.
2024-03-06 10:28:45 +00:00
James103 1d8dc111f1 Replace 2023 with 2024 in copyright headers (#21139)
Replace all instances of the year 2023 with 2024 in all copyright headers
2024-01-01 12:52:28 +01:00
Duncan 859b071ddc Rename classes with snakes OpenRCT2/A*-F* (#19215)
* Rename classes with snakes OpenRCT2/A*-F*

* Clang format files
2023-01-19 08:16:44 +00:00
James103 73738bbdc8 Replace 2022 with 2023 in copyright headers
Replace all instances of the year 2022 with 2023 in all copyright headers
2023-01-01 11:58:01 +01:00
73 b9e677945d Replace 20XX with 2022 (#18158)
* Replace 2020 with 2022

Replace all 2020 headers with 2022

* replace other years with 2022

add missing years
2022-10-01 08:42:14 +01:00
jazzysoggy f77611dcd2 Fix #17229: Rename G1_FLAG_BMP to G1_FLAG_HAS_TRANSPARENCY (#17441)
* Renamed All Instance of G1_FLAG_BMP

Renamed all instances of G1_FLAG_BMP to GA_FLAG_HAS_TRANSPARENCY

* Fixed comments and labels

Fixed comments and labels to be more in line with new definitions
2022-06-25 07:04:40 +01:00
Michael Steenbeek 44a607800e Bring ImageImporter enum names in line with code style 2022-02-12 18:56:17 +01:00
Michael Steenbeek 1062c3d08d Clean up palette import 2022-02-07 19:34:22 +01:00
X123M3-256 7e158a1787 Make srcX and srcY work with indexed images 2021-12-17 11:48:55 +01:00
ζeh MattandTed John 6f28f3e516 Backport ImageTable changes
Co-authored-by: Ted John <ted@brambles.org>
2021-10-20 16:50:38 +03:00
Gymnasiast e26c4bdd4e Fix US spelling 2021-09-05 20:40:01 +02:00
zrowny c381a97d66 Fix ImageImporter for colors outside of palette (#14649:)
When converting to the internal palette, if a color is not in the palette, the ImageImporter now re-maps it only to those non "special" color indices ("special," meaning those for water effects, font, chain lift and so on, as well as the primary remappable color).

Additionally, if the Importer is told to dither the image, it now does not dither colors that are already in the OpenRCT2 palette, or dither between remappable colors and non-remappable colors.
2021-09-05 20:08:00 +02:00
zrowny f6f5b41b76 Correct palette indexes of remap colors in image importer
The codes that finds the closest entry that isn't used for remapping has the indices of remappable colors slightly off, and would make some colors in the imported image remappable even though they shouldn't have been.

Comment in header file describing the standard palette corrected as well.
2021-05-13 16:30:35 +02:00
Mathias GibbensandMathias Gibbens b1e5a11bf3 Several more spelling fixes (#13752)
Signed-off-by: Mathias Gibbens <mathias@calenhad.com>

Co-authored-by: Mathias Gibbens <mathias@calenhad.com>
2021-01-10 18:23:35 +00:00
Aaron van Geffen 7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +02:00
frutiemax 67a8d833ea Part of #11159: ImageImporter::ImportResult uses std::vector (#12076) 2020-07-02 14:04:49 -03:00
Michael Steenbeek 9ef8d6da42 Convert most remaining C-style casts to C++-style ones (#11867) 2020-06-07 23:18:11 +02:00
Ted John 46bb30f8a1 Refactor rct_palette to GamePalette 2020-05-27 20:52:51 +01:00
Gymnasiast 4b25345d8d Create GamePalette struct 2020-05-19 21:09:51 +02:00
Gymnasiast eb25b0db33 Merge cmdline and JSON object palette 2020-05-19 15:42:58 +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
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
clang-formatandHielke Morsink 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
Hielke Morsink 472320d8f3 Correct formatting up to the management folder
I went over the commits ab7f22f..8726712 (bulk format commits for game actions to management inclusive) and corrected all mistakes I found. Most of them have to do with arrays missing trailing commas, making clang-format indent the entire array or not add breaks between the values.
2018-07-23 16:00:15 +02:00
clang-format 602aac47ba clang-format drawing 2018-07-23 16:00:04 +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 0f0bb021d6 Add support for raw images 2018-05-13 11:36:35 +01:00
Ted John f212894eb0 Fix clang builds 2018-05-13 01:11:56 +01:00