1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Build image repository from object images (#23640)

This commit is contained in:
spacek531
2025-01-27 00:25:22 -08:00
committed by GitHub
parent 5b5d91abb0
commit f1148e310e
2 changed files with 9 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
- Improved: [#20683] Allow Giga Coaster cable lift to start after block brake section.
- Improved: [#23328] The costume list in the staff window is now ordered alphabetically.
- Improved: [#23540] The file browser now optionally shows a file size column.
- Improved: [#23640] Building sprite repository with command line can use images array of JSON parkobj.
- Change: [#23328] All RCT2 entertainer costumes are now available in legacy parks.
- Fix: [#1479] Incorrect values provided by the in game console “get location” command.
- Fix: [#21794] Lay-down coaster cars reverse on first frames of downwards corkscrew.

View File

@@ -537,6 +537,9 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc)
return -1;
}
if (jsonSprites.is_object() && !jsonSprites["images"].is_null())
jsonSprites = jsonSprites["images"];
if (!jsonSprites.is_array())
{
fprintf(stderr, "Error: expected array\n");
@@ -555,6 +558,8 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc)
json_t sprite_description;
uint32_t numSuccessful = 0;
// Note: jsonSprite is deliberately left non-const: json_t behaviour changes when const
for (auto& [jsonKey, jsonSprite] : jsonSprites.items())
{
@@ -588,6 +593,8 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc)
if (!silent)
fprintf(stdout, "Added: %s\n", imagePath.c_str());
numSuccessful++;
}
if (!spriteFile.Save(spriteFilePath))
@@ -596,7 +603,7 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc)
return -1;
}
fprintf(stdout, "Finished\n");
fprintf(stdout, "Finished building graphics repository with %u images\n", numSuccessful);
return 1;
}