g2.dat is now updated every build.

data/g2.dat is now ignored.
This commit is contained in:
Robert Jordan 2015-05-20 14:20:24 -04:00
parent 0a3d2b949c
commit ac17b52139
4 changed files with 18 additions and 6 deletions

1
.gitignore vendored
View File

@ -231,3 +231,4 @@ pip-log.txt
openrct2.id*
openrct2.nam
openrct2.til
data/g2.dat

View File

@ -264,6 +264,8 @@
<LibraryPath>$(SolutionDir)..\lib\sdl\lib\x86;$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)..\build\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\obj\$(ProjectName)\$(Configuration)\</IntDir>
<CustomBuildBeforeTargets>
</CustomBuildBeforeTargets>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@ -304,8 +306,18 @@
<AdditionalDependencies>winmm.lib;sdl2.lib;Dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /Y "$(SolutionDir)\..\Data\*.*" "$(TargetDir)\Data\"</Command>
<Command>"$(TargetDir)\openrct2.exe" sprite build "$(SolutionDir)\..\Data\g2.dat" "$(SolutionDir)\..\Resources\g2\"
xcopy /Y "$(SolutionDir)\..\Data\*.*" "$(TargetDir)\Data\"</Command>
<Message>Build g2.dat and copy the Data directory.</Message>
</PostBuildEvent>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>
</Outputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -378,7 +378,6 @@
<ClCompile Include="..\src\windows\editor_object_selection.c">
<Filter>Source\Windows</Filter>
</ClCompile>
<ClCompile Include="..\lib\lodepng\lodepng.c" />
<ClCompile Include="..\src\localisation\user.c">
<Filter>Source\Localisation</Filter>
</ClCompile>

View File

@ -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 <spritefile> <resourcedir> [-s]\n");
fprintf(stderr, "usage: sprite build <spritefile> <resourcedir> [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;
}
}