Skip to content

Commit

Permalink
Merge pull request OpenApoc#523 from FranciscoDA/msvcFixes
Browse files Browse the repository at this point in the history
Msvc fixes
Fixes OpenApoc#522
  • Loading branch information
FilmBoy84 authored Mar 2, 2019
2 parents 7a30e19 + 5003017 commit eba6adb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
31 changes: 28 additions & 3 deletions OpenApoc.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.28307.421
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenApoc", "game\OpenApoc.vcxproj", "{284825AB-1430-40A4-8F08-5810C5559687}"
EndProject
Expand Down Expand Up @@ -35,7 +35,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniz", "dependencies\miniz
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gamestate_serialize_gen", "tools\code_generators\gamestate_serialize_gen\gamestate_serialize_gen.vcxproj", "{31FBCCBD-BFD2-45FC-B9DF-3375684A3157}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gamestate_serialize_gen", "tools\code_generators\luagamestate_support_gen\luagamestate_support_gen.vcxproj", "{31FBCCBD-BFD2-45FC-B9DF-3375684A3158}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "luagamestate_support_gen", "tools\code_generators\luagamestate_support_gen\luagamestate_support_gen.vcxproj", "{31FBCCBD-BFD2-45FC-B9DF-3375684A3158}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_images", "tests\test_images.vcxproj", "{1CA306CD-C11A-4E14-AAAF-2DD282E10652}"
EndProject
Expand All @@ -47,6 +47,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{3F55B450
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_serialize", "tests\test_serialize.vcxproj", "{D7563548-254B-46EF-A911-999CEE6BCDD8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{27DFC6A6-AC91-4102-B049-5AA61DD92168}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua", "dependencies\lua.vcxproj", "{44A12AC1-7E09-4AF7-BAC4-A264C2F814A8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand Down Expand Up @@ -175,6 +179,14 @@ Global
{31FBCCBD-BFD2-45FC-B9DF-3375684A3157}.Release|Win32.Build.0 = Release|Win32
{31FBCCBD-BFD2-45FC-B9DF-3375684A3157}.Release|x64.ActiveCfg = Release|x64
{31FBCCBD-BFD2-45FC-B9DF-3375684A3157}.Release|x64.Build.0 = Release|x64
{31FBCCBD-BFD2-45FC-B9DF-3375684A3158}.Debug|Win32.ActiveCfg = Debug|Win32
{31FBCCBD-BFD2-45FC-B9DF-3375684A3158}.Debug|Win32.Build.0 = Debug|Win32
{31FBCCBD-BFD2-45FC-B9DF-3375684A3158}.Debug|x64.ActiveCfg = Debug|x64
{31FBCCBD-BFD2-45FC-B9DF-3375684A3158}.Debug|x64.Build.0 = Debug|x64
{31FBCCBD-BFD2-45FC-B9DF-3375684A3158}.Release|Win32.ActiveCfg = Release|Win32
{31FBCCBD-BFD2-45FC-B9DF-3375684A3158}.Release|Win32.Build.0 = Release|Win32
{31FBCCBD-BFD2-45FC-B9DF-3375684A3158}.Release|x64.ActiveCfg = Release|x64
{31FBCCBD-BFD2-45FC-B9DF-3375684A3158}.Release|x64.Build.0 = Release|x64
{1CA306CD-C11A-4E14-AAAF-2DD282E10652}.Debug|Win32.ActiveCfg = Debug|Win32
{1CA306CD-C11A-4E14-AAAF-2DD282E10652}.Debug|Win32.Build.0 = Debug|Win32
{1CA306CD-C11A-4E14-AAAF-2DD282E10652}.Debug|x64.ActiveCfg = Debug|x64
Expand All @@ -198,6 +210,14 @@ Global
{D7563548-254B-46EF-A911-999CEE6BCDD8}.Release|Win32.ActiveCfg = Release|Win32
{D7563548-254B-46EF-A911-999CEE6BCDD8}.Release|Win32.Build.0 = Release|Win32
{D7563548-254B-46EF-A911-999CEE6BCDD8}.Release|x64.ActiveCfg = Release|x64
{44A12AC1-7E09-4AF7-BAC4-A264C2F814A8}.Debug|Win32.ActiveCfg = Debug|Win32
{44A12AC1-7E09-4AF7-BAC4-A264C2F814A8}.Debug|Win32.Build.0 = Debug|Win32
{44A12AC1-7E09-4AF7-BAC4-A264C2F814A8}.Debug|x64.ActiveCfg = Debug|x64
{44A12AC1-7E09-4AF7-BAC4-A264C2F814A8}.Debug|x64.Build.0 = Debug|x64
{44A12AC1-7E09-4AF7-BAC4-A264C2F814A8}.Release|Win32.ActiveCfg = Release|Win32
{44A12AC1-7E09-4AF7-BAC4-A264C2F814A8}.Release|Win32.Build.0 = Release|Win32
{44A12AC1-7E09-4AF7-BAC4-A264C2F814A8}.Release|x64.ActiveCfg = Release|x64
{44A12AC1-7E09-4AF7-BAC4-A264C2F814A8}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -217,7 +237,12 @@ Global
{657FEC45-218E-416F-B048-0BE062CF9368} = {8EAE9E1C-DF71-4144-88F4-5F4C8FD8968F}
{44A12AC1-7E09-4AF7-BAC4-A264C2F814A7} = {90A13965-1997-49A0-98A7-FD7484C0707D}
{31FBCCBD-BFD2-45FC-B9DF-3375684A3157} = {3F55B450-53E6-4467-BC58-860D0E2059EA}
{31FBCCBD-BFD2-45FC-B9DF-3375684A3158} = {3F55B450-53E6-4467-BC58-860D0E2059EA}
{1CA306CD-C11A-4E14-AAAF-2DD282E10652} = {8EAE9E1C-DF71-4144-88F4-5F4C8FD8968F}
{D7563548-254B-46EF-A911-999CEE6BCDD8} = {8EAE9E1C-DF71-4144-88F4-5F4C8FD8968F}
{44A12AC1-7E09-4AF7-BAC4-A264C2F814A8} = {90A13965-1997-49A0-98A7-FD7484C0707D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1DEB271E-C799-4CDD-9173-2105453DAEE2}
EndGlobalSection
EndGlobal
10 changes: 5 additions & 5 deletions data/data.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<CustomBuildStep>
<Message>Generating data</Message>
<Outputs>difficulty1_patched</Outputs>
<Inputs>"$(SolutionDir)\bin\$(Platform)\$(Configuration)\extractor.exe"</Inputs>
<Inputs>$(SolutionDir)\bin\$(Platform)\$(Configuration)\extractor.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand All @@ -113,7 +113,7 @@
<CustomBuildStep>
<Message>Generating data</Message>
<Outputs>difficulty1_patched</Outputs>
<Inputs>"$(SolutionDir)\bin\$(Platform)\$(Configuration)\extractor.exe"</Inputs>
<Inputs>$(SolutionDir)\bin\$(Platform)\$(Configuration)\extractor.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -133,7 +133,7 @@
"$(SolutionDir)\bin\$(Platform)\$(Configuration)\extractor.exe" --Framework.CD="$(SolutionDir)\data\cd.iso" --Framework.Data="$(SolutionDir)\data"</Command>
<Message>Generating data</Message>
<Outputs>difficulty1_patched</Outputs>
<Inputs>"$(SolutionDir)\bin\$(Platform)\$(Configuration)\extractor.exe"</Inputs>
<Inputs>$(SolutionDir)\bin\$(Platform)\$(Configuration)\extractor.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -153,7 +153,7 @@
"$(SolutionDir)\bin\$(Platform)\$(Configuration)\extractor.exe" --Framework.CD="$(SolutionDir)\data\cd.iso" --Framework.Data="$(SolutionDir)\data"</Command>
<Message>Generating data</Message>
<Outputs>difficulty1_patched</Outputs>
<Inputs>"$(SolutionDir)\bin\$(Platform)\$(Configuration)\extractor.exe"</Inputs>
<Inputs>$(SolutionDir)\bin\$(Platform)\$(Configuration)\extractor.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -177,4 +177,4 @@
<RemoveDir Directories="$(SolutionDir)\data\maps" ContinueOnError="true" />
<RemoveDir Directories="$(SolutionDir)\data\tilesets" ContinueOnError="true" />
</Target>
</Project>
</Project>
6 changes: 2 additions & 4 deletions framework/luaframework.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ template <typename C> int generateIpairsIterator(lua_State *L)
lua_pushcfunction(L, advanceIpairsIterator<C>);
LuaIteratorState<C> *it =
(LuaIteratorState<C> *)lua_newuserdata(L, sizeof(LuaIteratorState<C>));
it->first = (*v)->begin();
it->second = (*v)->end();
new (it) LuaIteratorState<C>((*v)->begin(), (*v)->end());
lua_pushinteger(L, 0);
return 2;
}
Expand All @@ -371,8 +370,7 @@ template <typename C> int generatePairsIterator(lua_State *L)
lua_pushcfunction(L, advancePairsIterator<C>);
LuaIteratorState<C> *it =
(LuaIteratorState<C> *)lua_newuserdata(L, sizeof(LuaIteratorState<C>));
it->first = (*v)->begin();
it->second = (*v)->end();
new (it) LuaIteratorState<C>((*v)->begin(), (*v)->end());
return 2;
}

Expand Down
2 changes: 1 addition & 1 deletion tools/code_generators/luagamestate_support_gen/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void iterateDepthFirstByNames(First first, Last last, std::ostream &out, std::st
previousName = std::move(currentName);
}
// set and pop whats left
for (auto itP = --previousName.end(); itP != --previousName.begin(); --itP)
for (auto itP = previousName.rbegin(); itP != previousName.rend(); ++itP)
out << "\tlua_setfield(L, -2, \"" << *itP << "\");\n";
}

Expand Down

0 comments on commit eba6adb

Please sign in to comment.