From ac17b52139d4369dfa2cbeea900569a66557b5bd Mon Sep 17 00:00:00 2001 From: Robert Jordan Date: Wed, 20 May 2015 14:20:24 -0400 Subject: [PATCH] g2.dat is now updated every build. data/g2.dat is now ignored. --- .gitignore | 1 + projects/openrct2.vcxproj | 14 +++++++++++++- projects/openrct2.vcxproj.filters | 1 - src/cmdline_sprite.c | 8 ++++---- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 6486216ed8..c34bf9e3e5 100644 --- a/.gitignore +++ b/.gitignore @@ -231,3 +231,4 @@ pip-log.txt openrct2.id* openrct2.nam openrct2.til +data/g2.dat diff --git a/projects/openrct2.vcxproj b/projects/openrct2.vcxproj index 0e3320b342..02c1ab98ec 100644 --- a/projects/openrct2.vcxproj +++ b/projects/openrct2.vcxproj @@ -264,6 +264,8 @@ $(SolutionDir)..\lib\sdl\lib\x86;$(LibraryPath) $(SolutionDir)..\build\$(Configuration)\ $(SolutionDir)..\obj\$(ProjectName)\$(Configuration)\ + + @@ -304,8 +306,18 @@ winmm.lib;sdl2.lib;Dsound.lib;%(AdditionalDependencies) - xcopy /Y "$(SolutionDir)\..\Data\*.*" "$(TargetDir)\Data\" + "$(TargetDir)\openrct2.exe" sprite build "$(SolutionDir)\..\Data\g2.dat" "$(SolutionDir)\..\Resources\g2\" +xcopy /Y "$(SolutionDir)\..\Data\*.*" "$(TargetDir)\Data\" + Build g2.dat and copy the Data directory. + + + + + + + + diff --git a/projects/openrct2.vcxproj.filters b/projects/openrct2.vcxproj.filters index c39a466b58..eb0498021c 100644 --- a/projects/openrct2.vcxproj.filters +++ b/projects/openrct2.vcxproj.filters @@ -378,7 +378,6 @@ Source\Windows - Source\Localisation diff --git a/src/cmdline_sprite.c b/src/cmdline_sprite.c index 5b4197a484..83c2d1b536 100644 --- a/src/cmdline_sprite.c +++ b/src/cmdline_sprite.c @@ -415,7 +415,7 @@ int cmdline_for_sprite(const char **argv, int argc) } else if (_strcmpi(argv[0], "build") == 0) { if (argc < 3) { - fprintf(stderr, "usage: sprite build [-s]\n"); + fprintf(stderr, "usage: sprite build [silent]\n"); return -1; } @@ -424,7 +424,7 @@ int cmdline_for_sprite(const char **argv, int argc) char imagePath[256], number[8]; int resourceLength = strlen(resourcePath); - bool silent = (argc >= 4 && strcmp(argv[3], "-s") == 0); + bool silent = (argc >= 4 && strcmp(argv[3], "silent") == 0); bool fileExists = true; FILE *file; @@ -436,7 +436,7 @@ int cmdline_for_sprite(const char **argv, int argc) for (int i = 0; fileExists; i++) { itoa(i, number, 10); strcpy(imagePath, resourcePath); - if (resourceLength == 0 || resourcePath[resourceLength - 1] != '/') + if (resourceLength == 0 || (resourcePath[resourceLength - 1] != '/' && resourcePath[resourceLength - 1] != '\\')) strcat(imagePath, "/"); strcat(imagePath, number); strcat(imagePath, ".png"); @@ -484,7 +484,7 @@ int cmdline_for_sprite(const char **argv, int argc) return 1; } else { fprintf(stderr, "Unknown sprite command."); - return -1; + return 1; } }