diff --git a/Examples/HelloWorld/HelloWorld/S4ModApi.lib b/Examples/HelloWorld/HelloWorld/S4ModApi.lib index 32a7de3..92fc658 100644 Binary files a/Examples/HelloWorld/HelloWorld/S4ModApi.lib and b/Examples/HelloWorld/HelloWorld/S4ModApi.lib differ diff --git a/Examples/LuaExample/LuaExample/S4ModApi.lib b/Examples/LuaExample/LuaExample/S4ModApi.lib index 32a7de3..92fc658 100644 Binary files a/Examples/LuaExample/LuaExample/S4ModApi.lib and b/Examples/LuaExample/LuaExample/S4ModApi.lib differ diff --git a/Examples/SelectionLimitExample/SelectionLimitExample/S4ModApi.lib b/Examples/SelectionLimitExample/SelectionLimitExample/S4ModApi.lib index 32a7de3..92fc658 100644 Binary files a/Examples/SelectionLimitExample/SelectionLimitExample/S4ModApi.lib and b/Examples/SelectionLimitExample/SelectionLimitExample/S4ModApi.lib differ diff --git a/S4ModApi.sln b/S4ModApi.sln index 90da351..6850144 100644 --- a/S4ModApi.sln +++ b/S4ModApi.sln @@ -1,21 +1,18 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29503.13 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34714.143 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S4ModApi", "S4ModApi\S4ModApi.vcxproj", "{80F4B5D7-9AB1-4DA7-B3A9-C13241352964}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 - Debug142|x86 = Debug142|x86 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {80F4B5D7-9AB1-4DA7-B3A9-C13241352964}.Debug|x86.ActiveCfg = Debug|Win32 {80F4B5D7-9AB1-4DA7-B3A9-C13241352964}.Debug|x86.Build.0 = Debug|Win32 - {80F4B5D7-9AB1-4DA7-B3A9-C13241352964}.Debug142|x86.ActiveCfg = Debug142|Win32 - {80F4B5D7-9AB1-4DA7-B3A9-C13241352964}.Debug142|x86.Build.0 = Debug142|Win32 {80F4B5D7-9AB1-4DA7-B3A9-C13241352964}.Release|x86.ActiveCfg = Release|Win32 {80F4B5D7-9AB1-4DA7-B3A9-C13241352964}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/S4ModApi/CS4Selection.cpp b/S4ModApi/CS4Selection.cpp index 66b8298..d220977 100644 --- a/S4ModApi/CS4Selection.cpp +++ b/S4ModApi/CS4Selection.cpp @@ -45,7 +45,7 @@ BOOL CSettlers4Api::GetSelection(PWORD out, SIZE_T outlen, PSIZE_T selectionCoun auto ct = s->count(); auto elementsToCopy = min(ct, outlen); if (selectionCount) *selectionCount = ct; - LOG("s->BasePtr == " << HEXNUM(s->BasePtr)) + LOG("s->BasePtr == " << HEXNUM(s->BasePtr)); if (out && elementsToCopy) memget_s(out, s->BasePtr, elementsToCopy * sizeof(*s->BasePtr)); return TRUE; } @@ -59,9 +59,8 @@ BOOL CSettlers4Api::RemoveSelection(PWORD settlers, SIZE_T settlerslen, PSIZE_T } auto& s = S4::GetInstance().Selection; if (!s) return FALSE; - auto ppool = S4::GetInstance().EntityPool; - if (!ppool) return FALSE; - auto pool = *ppool; + auto pool = S4::GetInstance().EntityPool; + if (!pool) return FALSE; // build a set for settlers to remove std::unordered_set removeSet; @@ -74,7 +73,7 @@ BOOL CSettlers4Api::RemoveSelection(PWORD settlers, SIZE_T settlerslen, PSIZE_T auto cur = s->BasePtr; for (auto sp = cur; sp < end; ++sp) { if (removeSet.find(*sp) != removeSet.end()) { - pool[*sp].clrSelectionVisibility(); + pool[*sp]->clrSelectionVisibility(); continue; } *cur = *sp; diff --git a/S4ModApi/S4ModApi.rc b/S4ModApi/S4ModApi.rc index 6b0351f..72f5305 100644 Binary files a/S4ModApi/S4ModApi.rc and b/S4ModApi/S4ModApi.rc differ diff --git a/S4ModApi/S4ModApi.vcxproj b/S4ModApi/S4ModApi.vcxproj index 01009bf..460c32d 100644 --- a/S4ModApi/S4ModApi.vcxproj +++ b/S4ModApi/S4ModApi.vcxproj @@ -1,10 +1,6 @@  - - Debug142 - Win32 - Debug Win32 @@ -20,22 +16,18 @@ Win32Proj S4Hooks S4ModApi + 10.0 DynamicLibrary true - v141_xp - - - DynamicLibrary - true - v142 + v143 DynamicLibrary false - v141_xp + v143 false @@ -46,9 +38,6 @@ - - - @@ -60,13 +49,6 @@ $(ProjectDir)lib;$(SourcePath) AllRules.ruleset - - true - $(ProjectDir)lib\lua321\Release\;$(ProjectDir)lib\$(Configuration)\;$(LibraryPath) - $(ProjectDir)lib\lua321\include\;$(ProjectDir)lib\;$(VC_IncludePath);$(WindowsSDK_IncludePath); - $(ProjectDir)lib;$(SourcePath) - AllRules.ruleset - false $(ProjectDir)lib\lua321\Release\;$(ProjectDir)lib\$(Configuration)\;$(LibraryPath) @@ -100,32 +82,6 @@ true - - - Level4 - Disabled - true - WIN32;S4MODAPI;_DEBUG;S4MODAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - MultiThreadedDebug - true - false - ProgramDatabase - /D_WIN32_WINNT=0x0501 %(AdditionalOptions) - - - Windows - true - false - Enabled - Precompiled.lib;Lua321.lib;%(AdditionalDependencies) - - - if exist "$(OutDir)deploy.bat" (call "$(OutDir)deploy.bat" ) - - - true - - Level4