Skip to content

Commit

Permalink
XP Support. Add auto settings
Browse files Browse the repository at this point in the history
  • Loading branch information
UnrealKaraulov committed Dec 25, 2024
1 parent 708fc9b commit 553a507
Show file tree
Hide file tree
Showing 17 changed files with 176 additions and 83 deletions.
41 changes: 18 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,6 @@ jobs:
Write-Host "components were not installed"
exit 1
}
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
- name: Build release
run: |
msbuild ${{ env.solution }} -m /p:Configuration=Release /p:Platform=x64
- name: Create Windows release archive
run: >
mkdir -p build\win64_release
cp vs-project\Release\bspguy.exe build\win64_release\
xcopy /I /E /Y "resources\*" "build\win64_release\"
Compress-Archive -Path "build\win64_release\*" -DestinationPath "build\newbspguy_win7_x64_release.zip"
- name: Publish nightly release binaries for windows 7+
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.get_time_build.outputs.release_tag }}
files: |
build/newbspguy_win7_x64_release.zip
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
Expand All @@ -134,10 +114,25 @@ jobs:
build/newbspguy_winxp_x86_release.zip
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
- name: Clean build directory
- name: Build release
run: |
msbuild ${{ env.solution }} /t:Clean /p:Configuration=Debug /p:Platform=x64\
msbuild ${{ env.solution }} /t:Clean /p:Configuration=DebugGithub /p:Platform=x64
msbuild ${{ env.solution }} -m /p:Configuration=Release /p:Platform=x64
- name: Create Windows release archive
run: >
mkdir -p build\win64_release
cp vs-project\Release\bspguy.exe build\win64_release\
xcopy /I /E /Y "resources\*" "build\win64_release\"
Compress-Archive -Path "build\win64_release\*" -DestinationPath "build\newbspguy_win7_x64_release.zip"
- name: Publish nightly release binaries for windows 7+
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.get_time_build.outputs.release_tag }}
files: |
build/newbspguy_win7_x64_release.zip
- name: Build Debug
run: |
msbuild ${{ env.solution }} -m /p:Configuration=DebugGithub /p:Platform=x64
Expand Down
14 changes: 10 additions & 4 deletions ascript/angelscript/projects/msvc2022/angelscript.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,9 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseXPx86|Win32'">
<TargetExt>XP.lib</TargetExt>
<IncludePath>$(VC_IncludePath);$(WindowsSdk_71A_IncludePath);$(VC_ExecutablePath_x86);$(WindowsSdk_71A_ExecutablePath);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(MSBuild_ExecutablePath);$(VC_LibraryPath_x86);</IncludePath>
<ExcludePath>$(VC_IncludePath);$(WindowsSdk_71A_IncludePath);$(VC_ExecutablePath_x86);$(WindowsSdk_71A_ExecutablePath);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(MSBuild_ExecutablePath);$(VC_LibraryPath_x86);</ExcludePath>
<IncludePath>$(VC_IncludePath);$(WindowsSdk_71A_IncludePath);</IncludePath>
<LibraryPath>$(WindowsSdk_71A_LibraryPath_x86);$(VC_LibraryPath_x86);$(LibraryPath)</LibraryPath>
<ExcludePath>$(WindowsSDK_ExecutablePath);$(WindowsSDK_IncludePath);$(WindowsSDK_LibraryPath_x86);$(WindowsSDK_LibraryPath);$(WindowsSDK_LibraryPath_x64);C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\;C:\Program Files (x86)\Windows Kits\10\;$(ExcludePath)</ExcludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down Expand Up @@ -448,19 +449,24 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseXPx86|Win32'">
<ClCompile>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PreprocessorDefinitions>ANGELSCRIPT_EXPORT;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0501;WINVER=0x0501;NTDDI_VERSION=0x05010000;VC_EXTRALEAN;_ATL_XP_TARGETING;WIN32_LEAN_AND_MEAN;PSAPI_VERSION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ANGELSCRIPT_EXPORT;WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0501;WINVER=0x0501;NTDDI_VERSION=0x05010100;_WIN32_IE_ 0x0501;VC_EXTRALEAN;_ATL_XP_TARGETING;WIN32_LEAN_AND_MEAN;PSAPI_VERSION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<BufferSecurityCheck>
</BufferSecurityCheck>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Fast</FloatingPointModel>
<SDLCheck>false</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
Expand Down
Binary file removed imgui/examples/libs/glfw/lib-vc2010-32/glfw3.lib
Binary file not shown.
Binary file removed imgui/examples/libs/glfw/lib-vc2010-64/glfw3.lib
Binary file not shown.
2 changes: 2 additions & 0 deletions src/bsp/Bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,14 @@ Bsp::Bsp(std::string fpath)
if (!fileExists(fpath))
{
print_log(get_localized_string(LANG_0036), fpath);
FlushConsoleLog(true);
return;
}

if (!load_lumps(fpath))
{
print_log(get_localized_string(LANG_0037), fpath);
FlushConsoleLog(true);
return;
}

Expand Down
2 changes: 2 additions & 0 deletions src/bsp/BspMerger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ MergeResult BspMerger::merge(std::vector<Bsp*> maps, const vec3& gap, const std:
if (maps.size() < 2)
{
print_log(PRINT_RED | PRINT_INTENSITY, get_localized_string(LANG_0219));
FlushConsoleLog(true);
return result;
}
result.fpath = maps[1]->bsp_path;
Expand Down Expand Up @@ -1061,6 +1062,7 @@ bool BspMerger::merge(Bsp& mapA, Bsp& mapB, bool modelMerge)
if (separationPlane.nType == -1 && !modelMerge)
{
print_log(PRINT_RED | PRINT_INTENSITY, get_localized_string(LANG_0236));
FlushConsoleLog(true);
return false;
}
thisWorldLeafCount = mapA.models[0].nVisLeafs; // excludes solid leaf 0
Expand Down
2 changes: 2 additions & 0 deletions src/cli/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ bool CommandLine::hasOptionVector(const std::string& optionName)
if (parts.size() != 3)
{
print_log(get_localized_string(LANG_0265),optionName);
FlushConsoleLog(true);
return false;
}

Expand All @@ -113,6 +114,7 @@ vec3 CommandLine::getOptionVector(const std::string& optionName)
if (parts.size() != 3)
{
print_log(get_localized_string(LANG_1045),optionName);
FlushConsoleLog(true);
return ret;
}

Expand Down
30 changes: 30 additions & 0 deletions src/editor/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9036,6 +9036,7 @@ void Gui::loadFonts()

if (!fs::exists(fontPath) || !fs::is_directory(fontPath)) {
print_log(PRINT_RED, "Font directory does not exist or is not accessible.\n");
FlushConsoleLog(true);
return;
}

Expand Down Expand Up @@ -9323,6 +9324,35 @@ void Gui::drawSettings()
if (settingsTab == 0)
{
ImGui::Text(get_localized_string(LANG_0713).c_str());
if (ImGui::Button("Auto detect fgd/wad"))
{
if (!dirExists(g_settings.gamedir))
{
print_log("No gamedir found!\n");
}
else
{
std::vector<std::string> wadDirList;
std::vector<std::string> fgdFileList;
findDirsWithHasFileExtension(g_settings.gamedir, ".wad", wadDirList, true);
findFilesWithExtension(g_settings.gamedir, ".fgd", fgdFileList, true);

g_settings.fgdPaths.clear();
PathToggleStruct tmpPath("", true);
for (auto& f : fgdFileList)
{
tmpPath.path = f;
g_settings.fgdPaths.push_back(tmpPath);
}

g_settings.resPaths.clear();
for (auto& w : wadDirList)
{
tmpPath.path = w;
g_settings.resPaths.push_back(tmpPath);
}
}
}
ImGui::SetNextItemWidth(pathWidth);
ImGui::InputText(get_localized_string(LANG_0714).c_str(), &g_settings.gamedir);
if (ImGui::IsItemHovered() && g.HoveredIdTimer > g_tooltip_delay && g_settings.gamedir.size())
Expand Down
20 changes: 15 additions & 5 deletions src/editor/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Renderer::Renderer()
if (!glfwInit())
{
print_log(get_localized_string(LANG_0902));
FlushConsoleLog(true);
return;
}

Expand All @@ -209,6 +210,7 @@ Renderer::Renderer()
if (!window)
{
print_log(get_localized_string(LANG_0903));
FlushConsoleLog(true);
return;
}

Expand All @@ -223,14 +225,19 @@ Renderer::Renderer()
glfwSetWindowMaximizeCallback(window, window_maximize_callback);
glfwSetWindowFocusCallback(window, window_focus_callback);

glewInit();
GLenum err = glewInit();
if (GLEW_OK != err)
{
print_log("Glew: {}", (const char*)glewGetErrorString(err));
FlushConsoleLog(true);
return;
}

glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT, GL_FASTEST);
glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST);
glHint(GL_POLYGON_SMOOTH_HINT, GL_FASTEST);
glHint(GL_TEXTURE_COMPRESSION_HINT, GL_FASTEST);


unsigned char* img_dat = NULL;
unsigned int w, h;

Expand Down Expand Up @@ -282,7 +289,6 @@ Renderer::Renderer()
blueTex = new Texture(w, h, img_dat, "blue");
img_dat = NULL;


missingTex_rgba->upload();
aaatriggerTex_rgba->upload();
aaatriggerTex->upload();
Expand Down Expand Up @@ -352,8 +358,6 @@ Renderer::Renderer()

oldLeftMouse = curLeftMouse = oldRightMouse = curRightMouse = 0;

//blockMoving = false;

gui->init();

g_progress.simpleMode = true;
Expand Down Expand Up @@ -1539,6 +1543,7 @@ void Renderer::postLoadFgdsAndTextures()
if (reloading)
{
print_log(get_localized_string(LANG_0906));
FlushConsoleLog(true);
return;
}
reloading = reloadingGameDir = true;
Expand Down Expand Up @@ -3219,6 +3224,7 @@ void Renderer::addMap(Bsp* map)
if (!map->bsp_valid)
{
print_log(get_localized_string(LANG_0912));
FlushConsoleLog(true);
return;
}

Expand Down Expand Up @@ -4011,7 +4017,9 @@ bool Renderer::getModelSolid(std::vector<TransformVert>& hullVerts, Bsp* map, So
if (verts.size() < 2)
{
if (g_settings.verboseLogs)
{
print_log(get_localized_string(LANG_0914)); // hl_c00 pipe in green water place
}
return false;
}

Expand Down Expand Up @@ -4082,7 +4090,9 @@ bool Renderer::getModelSolid(std::vector<TransformVert>& hullVerts, Bsp* map, So
if (planeCount != 2)
{
if (g_settings.verboseLogs)
{
print_log(get_localized_string(LANG_0915), planeCount);
}
return false;
}

Expand Down
7 changes: 6 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// Notes: (newbspguy):
// ...

std::string g_version_string = "NewBSPGuy v4.49";
std::string g_version_string = "NewBSPGuy v4.50";


#ifdef WIN32
Expand All @@ -44,6 +44,7 @@ bool start_viewer(const char* map)
return false;
}
Renderer renderer{};

if (map && map[0] != '\0')
{
g_settings.AddRecentFile(map);
Expand Down Expand Up @@ -119,6 +120,7 @@ int merge_maps()
if (input_maps.size() < 2)
{
print_log(PRINT_RED | PRINT_INTENSITY, get_localized_string(LANG_0003));
FlushConsoleLog(true);
return 1;
}

Expand Down Expand Up @@ -411,6 +413,7 @@ int simplify()
if (modelIdx < 0 || modelIdx >= map->modelCount)
{
print_log(PRINT_RED | PRINT_INTENSITY, get_localized_string(LANG_1018), map->modelCount);
FlushConsoleLog(true);
return 1;
}

Expand Down Expand Up @@ -1005,6 +1008,7 @@ int main(int argc, char* argv[])
sizeof(COLOR4) != 4)
{
print_log(PRINT_RED | PRINT_INTENSITY, "sizeof() fatal error!\n");
FlushConsoleLog(true);
return 1;
}

Expand Down Expand Up @@ -1234,6 +1238,7 @@ int main(int argc, char* argv[])
print_log(get_localized_string(LANG_0033), g_settings_path);

FlushConsoleLog(true);

if (!start_viewer(g_cmdLine.bspfile.c_str()))
{
print_log(get_localized_string(LANG_0034), g_cmdLine.bspfile);
Expand Down
Loading

0 comments on commit 553a507

Please sign in to comment.