1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-01 19:25:12 +01:00

Rework palette information into palettes.dat (#25681)

* Rework all palette information into new palette.dat

* Harmonise order between sprites.json, SpriteIds.h, kPaletteToG1Offset

* Rename G1 counterparts for completeness/documentation

* Bump libsawyer to v1.4.0
This commit is contained in:
Aaron van Geffen
2026-01-25 10:39:18 +01:00
committed by GitHub
parent fa72aaf6b2
commit e6fa0e48d0
206 changed files with 1831 additions and 554 deletions

View File

@@ -164,13 +164,14 @@ jobs:
path: OpenRCT2
- name: Download gxc
run: |
curl -Lo tools.tar.gz https://github.com/IntelOrca/libsawyer/releases/download/v1.3.0/libsawyer-tools-linux-x64.tar.gz
curl -Lo tools.tar.gz https://github.com/OpenRCT2/libsawyer/releases/download/v1.4.0/libsawyer-tools-linux-x64.tar.gz
mkdir -p "$GITHUB_WORKSPACE/bin"
tar -C "$GITHUB_WORKSPACE/bin" -xf tools.tar.gz
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Build graphics .dat files
run: |
gxc build g2.dat OpenRCT2/resources/g2/sprites.json
gxc build palettes.dat OpenRCT2/resources/palettes/sprites.json
gxc build fonts.dat OpenRCT2/resources/fonts/sprites.json
gxc build tracks.dat OpenRCT2/resources/tracks/sprites.json
- name: Upload graphics .dat files
@@ -179,6 +180,7 @@ jobs:
name: graphics-${{ needs.build_variables.outputs.name }}
path: |
g2.dat
palettes.dat
fonts.dat
tracks.dat
windows:

1
.gitignore vendored
View File

@@ -25,6 +25,7 @@ libversion
# Downloaded or built data files
data/g2.dat
data/fonts.dat
data/palettes.dat
data/tracks.dat
data/sequence
data/object

View File

@@ -396,9 +396,9 @@ if(NOT DISABLE_GUI)
include("${ROOT_DIR}/src/openrct2-ui/CMakeLists.txt" NO_POLICY_SCOPE)
endif()
# graphics files (g2.dat and font.dat)
# graphics files (g2.dat, fonts.dat, palettes.dat, tracks.dat)
if (NOT CMAKE_CROSSCOMPILING)
set(graphics_files "g2" "fonts" "tracks")
set(graphics_files "g2" "fonts" "palettes" "tracks")
foreach(graphics_file ${graphics_files})
set(output_file "${graphics_file}.dat")
@@ -505,6 +505,7 @@ if (NOT MACOS_BUNDLE OR (MACOS_BUNDLE AND WITH_TESTS))
endif ()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/g2.dat" DESTINATION "${CMAKE_INSTALL_DATADIR}/openrct2")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fonts.dat" DESTINATION "${CMAKE_INSTALL_DATADIR}/openrct2")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/palettes.dat" DESTINATION "${CMAKE_INSTALL_DATADIR}/openrct2")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tracks.dat" DESTINATION "${CMAKE_INSTALL_DATADIR}/openrct2")
install(DIRECTORY "data/" DESTINATION "${CMAKE_INSTALL_DATADIR}/openrct2")

View File

@@ -20,6 +20,7 @@
<G2InputFile Condition="'$(G2InputFile)' == ''">$(ResourcesPath)g2\sprites.json</G2InputFile>
<FontsInputFile Condition="'$(FontsInputFile)' == ''">$(ResourcesPath)fonts\sprites.json</FontsInputFile>
<TracksInputFile Condition="'$(TracksInputFile)' == ''">$(ResourcesPath)tracks\sprites.json</TracksInputFile>
<PalettesInputFile Condition="'$(PalettesInputFile)' == ''">$(ResourcesPath)palettes\sprites.json</PalettesInputFile>
<DataOutputPath Condition="'$(DataOutputPath)' == ''">$(OutDir)data\</DataOutputPath>
</PropertyGroup>
@@ -28,6 +29,7 @@
<G2Input Include="$(G2InputFile)" />
<FontsInput Include="$(FontsInputFile)" />
<TracksInput Include="$(TracksInputFile)" />
<PalettesInput Include="$(PalettesInputFile)" />
<LanguageFiles Include="$(DataLanguagePath)**\*"
Exclude="$(DataLanguagePath)*.bak;
@@ -162,4 +164,24 @@
AlwaysCreate="true" />
</Target>
<Target Name="tracks" DependsOnTargets="BuildTracks" />
<Target Name="BuildPalettes"
AfterTargets="Build"
Inputs="@(PalettesInput)"
Outputs="$(DataOutputPath)palettes.dat"
Condition="'$(TestConfig)' != 'true' and ('$(Platform)' != 'ARM64' or '$(PROCESSOR_ARCHITECTURE)' == 'ARM64')">
<MakeDir Directories="$(DataOutputPath)" />
<Exec Command="&quot;$(GraphicsCLIPath)&quot; sprite build &quot;$(DataOutputPath)palettes.dat&quot; &quot;%(PalettesInput.FullPath)&quot;"
ConsoleToMSBuild="true"
IgnoreExitCode="false">
<Output TaskParameter="ConsoleOutput" PropertyName="PalettesBuildOutput" />
</Exec>
<Touch Files="$(DataOutputPath)palettes.dat"
ForceTouch="true"
AlwaysCreate="true" />
</Target>
<Target Name="palettes" DependsOnTargets="BuildPalettes" />
</Project>

View File

@@ -542,246 +542,6 @@
{
"path": "loader/loader_gokarts_vehicles.png"
},
{
"path": "palette_map/palette_map_dark_olive_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_dark_olive_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_saturated_brown_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_bordeaux_red_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_bordeaux_red_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_grass_green_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_grass_green_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_olive_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_olive_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_saturated_green_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_tan_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_tan_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_dull_purple_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_dull_green_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_dull_green_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_saturated_purple_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_saturated_purple_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_orange_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_aqua_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_magenta_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_dull_brown_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_dull_brown_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_invisible.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_void.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_dark_olive_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_dark_olive_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_saturated_brown_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_bordeaux_red_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_bordeaux_red_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_grass_green_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_grass_green_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_olive_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_olive_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_saturated_green_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_tan_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_tan_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_dull_purple_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_dull_green_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_dull_green_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_saturated_purple_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_saturated_purple_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_orange_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_aqua_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_magenta_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_dull_brown_dark.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_dull_brown_light.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_invisible.png",
"palette": "keep",
"format": "raw"
},
{
"path": "palette_map/palette_map_glass_void.png",
"palette": "keep",
"format": "raw"
},
{
"path": "surface/glassy_recolourable.png",
"x": -32,

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Some files were not shown because too many files have changed in this diff Show More