Skip to content

Commit

Permalink
Windows: build bat
Browse files Browse the repository at this point in the history
  • Loading branch information
glKarin committed Nov 8, 2024
1 parent 00a2eec commit ed0cfc8
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ cmake_install.cmake
CMakeCache.txt
*.sln
x64
x86
x86
build
Release
Debug
4 changes: 3 additions & 1 deletion Q3E/src/main/jni/doom3/neo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ cmake-*
*.dir
*.vcxproj*
cmake_install.cmake
Release
build
Release
Debug
47 changes: 47 additions & 0 deletions build_win_x64_doom3_quak4_prey.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@echo off

rem MSBuild with MSVC on Windows
rem Using vcpkg as package manager
rem vcpkg install SDL2 curl OpenAL-soft zlib

rem Replace your `vcpkg` path
set VCPKG_PATH=D:\project\c\vcpkg

rem Setup build arch: x64 | x86
set BUILD_ARCH=x64

set VCPKG_CMAKE_TOOLCHAIN=%VCPKG_PATH%\scripts\buildsystems\vcpkg.cmake
set DIRECTXSDK_INCLUDE_PATH="%VCPKG_PATH%/packages/directxsdk_%BUILD_ARCH%-windows/include/directxsdk"

rem Setup build type: Release | Debug
set BUILD_TYPE=Release

set PROJECT_PATH=Q3E\src\main\jni\doom3\neo

set WORK_DIR=build\win_%BUILD_ARCH%

echo Configure and generate MSVC project ......
if %BUILD_ARCH% == x86 (
echo Platform: x86
cmake -B %WORK_DIR% "-A Win32" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_CMAKE_TOOLCHAIN% -DDIRECTXSDK_INCLUDE_PATH=%DIRECTXSDK_INCLUDE_PATH% CMakeLists.txt
rem -G "Visual Studio 17 2022"
) else (
echo Platform: x86-64
cmake -B %WORK_DIR% "-A x64" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_CMAKE_TOOLCHAIN% CMakeLists.txt
rem -DBUILD_D3_MOD=OFF -DBUILD_Q4=OFF -DBUILD_PREY=OFF -DBUILD_Q4_MOD=OFF
)

echo Build %BUILD_TYPE% ......
cmake --build %WORK_DIR% --config "%BUILD_TYPE%"

rem clean: cmake --build . --config "%BUILD_TYPE%" --target clean

set TARGET_PATH=%cd%\%WORK_DIR%\%PROJECT_PATH%\%BUILD_TYPE%

echo Copy OpenAL32.dll......
xcopy /Y/Q %VCPKG_PATH%\packages\openal-soft_%BUILD_ARCH%-windows\bin\OpenAL32.dll %TARGET_PATH%\

echo Open target directory: %TARGET_PATH% ......
start "" %TARGET_PATH%

pause
47 changes: 47 additions & 0 deletions build_win_x86_doom3_quak4_prey.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@echo off

rem MSBuild with MSVC on Windows
rem Using vcpkg as package manager
rem vcpkg install SDL2 curl OpenAL-soft zlib

rem Replace your `vcpkg` path
set VCPKG_PATH=D:\project\c\vcpkg

rem Setup build arch: x64 | x86
set BUILD_ARCH=x86

set VCPKG_CMAKE_TOOLCHAIN=%VCPKG_PATH%\scripts\buildsystems\vcpkg.cmake
set DIRECTXSDK_INCLUDE_PATH="%VCPKG_PATH%/packages/directxsdk_%BUILD_ARCH%-windows/include/directxsdk"

rem Setup build type: Release | Debug
set BUILD_TYPE=Release

set PROJECT_PATH=Q3E\src\main\jni\doom3\neo

set WORK_DIR=build\win_%BUILD_ARCH%

echo Configure and generate MSVC project ......
if %BUILD_ARCH% == x86 (
echo Platform: x86
cmake -B %WORK_DIR% "-A Win32" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_CMAKE_TOOLCHAIN% -DDIRECTXSDK_INCLUDE_PATH=%DIRECTXSDK_INCLUDE_PATH% CMakeLists.txt
rem -G "Visual Studio 17 2022"
) else (
echo Platform: x86-64
cmake -B %WORK_DIR% "-A x64" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_CMAKE_TOOLCHAIN% CMakeLists.txt
rem -DBUILD_D3_MOD=OFF -DBUILD_Q4=OFF -DBUILD_PREY=OFF -DBUILD_Q4_MOD=OFF
)

echo Build %BUILD_TYPE% ......
cmake --build %WORK_DIR% --config "%BUILD_TYPE%"

rem clean: cmake --build . --config "%BUILD_TYPE%" --target clean

set TARGET_PATH=%cd%\%WORK_DIR%\%PROJECT_PATH%\%BUILD_TYPE%

echo Copy OpenAL32.dll......
xcopy /Y/Q %VCPKG_PATH%\packages\openal-soft_%BUILD_ARCH%-windows\bin\OpenAL32.dll %TARGET_PATH%\

echo Open target directory: %TARGET_PATH% ......
start "" %TARGET_PATH%

pause
12 changes: 8 additions & 4 deletions cmake_linux_build_doom3_quak4_prey.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
#!/bin/sh

# need install tools: cmake, gcc/g++ | clang/clang++, make
# need install libraries: SDL2, curl, OpenAL-soft, zlib, ALSA
# need install libraries: SDL2, OpenAL-soft, zlib, ALSA # curl


# Setup build type: Release | Debug
BUILD_TYPE=Release

PROJECT_PATH=Q3E/src/main/jni/doom3/neo

WORK_DIR=build

echo "Configure and generate GNU makefile ......";
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} CMakeLists.txt;
cmake -B ${WORK_DIR} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} CMakeLists.txt; # -DBUILD_D3_MOD=OFF -DBUILD_Q4=OFF -DBUILD_PREY=OFF -DBUILD_Q4_MOD=OFF

echo "Build ${BUILD_TYPE} ......";
make;
cmake --build ${WORK_DIR} --config ${BUILD_TYPE}

# clean: make clean;

TARGET_PATH="`pwd`/Q3E/src/main/jni/doom3/neo";
TARGET_PATH="`pwd`/${WORK_DIR}/${PROJECT_PATH}";
echo "Target directory: ${TARGET_PATH} ......"

echo "Done";
Expand Down
6 changes: 4 additions & 2 deletions cmake_linux_build_doom3bfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
BUILD_TYPE=Release
TARGET_PATH="`pwd`/Q3E/src/main/jni/doom3bfg/neo";

WORK_DIR=build

cd ${TARGET_PATH};

echo "Configure and generate GNU makefile ......";
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS="-Werror=nonnull" CMakeLists.txt;
cmake -B build -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS="-Werror=nonnull" CMakeLists.txt;

echo "Build ${BUILD_TYPE} ......";
make;
cmake --build ${WORK_DIR} --config ${BUILD_TYPE}

# clean: make clean;

Expand Down
14 changes: 10 additions & 4 deletions cmake_msvc_build_doom3_quak4_prey.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,27 @@ set DIRECTXSDK_INCLUDE_PATH="%VCPKG_PATH%/packages/directxsdk_%BUILD_ARCH%-windo
rem Setup build type: Release | Debug
set BUILD_TYPE=Release

set PROJECT_PATH=Q3E\src\main\jni\doom3\neo

set WORK_DIR=build\win_%BUILD_ARCH%

echo Configure and generate MSVC project ......
if %BUILD_ARCH% == x86 (
echo Platform: x86
cmake -G "Visual Studio 17 2022" "-A Win32" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_CMAKE_TOOLCHAIN% -DDIRECTXSDK_INCLUDE_PATH=%DIRECTXSDK_INCLUDE_PATH% CMakeLists.txt
cmake -B %WORK_DIR% "-A Win32" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_CMAKE_TOOLCHAIN% -DDIRECTXSDK_INCLUDE_PATH=%DIRECTXSDK_INCLUDE_PATH% CMakeLists.txt
rem -G "Visual Studio 17 2022"
) else (
echo Platform: x86-64
cmake -DCMAKE_TOOLCHAIN_FILE=%VCPKG_CMAKE_TOOLCHAIN% CMakeLists.txt
cmake -B %WORK_DIR% "-A x64" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_CMAKE_TOOLCHAIN% CMakeLists.txt
rem -DBUILD_D3_MOD=OFF -DBUILD_Q4=OFF -DBUILD_PREY=OFF -DBUILD_Q4_MOD=OFF
)

echo Build %BUILD_TYPE% ......
cmake --build . --config "%BUILD_TYPE%"
cmake --build %WORK_DIR% --config "%BUILD_TYPE%"

rem clean: cmake --build . --config "%BUILD_TYPE%" --target clean

set TARGET_PATH=%cd%\Q3E\src\main\jni\doom3\neo\%BUILD_TYPE%
set TARGET_PATH=%cd%\%WORK_DIR%\%PROJECT_PATH%\%BUILD_TYPE%

echo Copy OpenAL32.dll......
xcopy /Y/Q %VCPKG_PATH%\packages\openal-soft_%BUILD_ARCH%-windows\bin\OpenAL32.dll %TARGET_PATH%\
Expand Down
44 changes: 41 additions & 3 deletions idTech4Amm/src/main/java/com/karin/idTech4Amm/lib/KCVarSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,45 @@ public static Map<String, KCVar.Group> CVars()

KCVar.Group REALRTCW_CVARS = new KCVar.Group("RealRTCW", true)
.AddCVar(
KCVar.CreateCVar("harm_sv_cheats", "bool", "0", "Disable change `sv_cheats` when load map and disconnect for allow cheats", KCVar.FLAG_INIT
KCVar.CreateCVar("harm_sv_cheats", "bool", "0", "Disable change `sv_cheats` when load map and disconnect for allow cheats", KCVar.FLAG_INIT | KCVar.FLAG_LAUNCHER
),
KCVar.CreateCVar("harm_r_stencilShadowPersonal", "bool", "1", "Render personal stencil shadow when `cg_shadows` = 2", 0
KCVar.CreateCVar("harm_r_stencilShadowPersonal", "bool", "1", "Render personal stencil shadow when `cg_shadows` = 2", KCVar.FLAG_LAUNCHER
),
KCVar.CreateCVar("harm_r_stencilShadowOp", "integer", "0", "Stencil testing operation", 0,
"0", "Automatic(Personal shadow using Z-Fail, other shadow using Z-Pass)",
"1", "Z-Pass",
"2", "Z-Fail"
),
KCVar.CreateCVar("harm_r_stencilShadowMaxAngle", "integer", "-1", "Limit stencil shadow of light direction and negative-Z-axis max angle(-1=not limit)", 0
),
KCVar.CreateCVar("harm_r_stencilShadowModel", "integer", "3", "Render stencil shadow model type mask(mask bit are 1 2 4 8 16, 0=all models; 3=all animation model)", KCVar.FLAG_POSITIVE
),
KCVar.CreateCVar("harm_r_stencilShadowCap", "bool", "1", "Render stencil shadow volume caps(0=don't render caps, personal shadow is always render)", 0
),
KCVar.CreateCVar("harm_r_stencilShadowInfinite", "float", "0", "Stencil shadow volume far is infinite(absolute value as volume's length; 0=512. negative value is infinite, personal shadow is always infinite)", 0
),
KCVar.CreateCVar("harm_r_stencilShadowMask", "bool", "0", "Render stencil shadow mask(0=render mask after all shadows; 1=render mask every shadow volume)", 0
)
);

KCVar.Group ETW_CVARS = new KCVar.Group("ETW", true)
.AddCVar(
KCVar.CreateCVar("harm_r_stencilShadowPersonal", "bool", "1", "Render personal stencil shadow when `cg_shadows` = 2", KCVar.FLAG_LAUNCHER
),
KCVar.CreateCVar("harm_r_stencilShadowOp", "integer", "0", "Stencil testing operation", 0,
"0", "Automatic(Personal shadow using Z-Fail, other shadow using Z-Pass)",
"1", "Z-Pass",
"2", "Z-Fail"
),
KCVar.CreateCVar("harm_r_stencilShadowMaxAngle", "integer", "-1", "Limit stencil shadow of light direction and negative-Z-axis max angle(-1=not limit)", 0
),
KCVar.CreateCVar("harm_r_stencilShadowModel", "integer", "3", "Render stencil shadow model type mask(mask bit are 1 2 4 8, 0=all models; 3=all animation model)", KCVar.FLAG_POSITIVE
),
KCVar.CreateCVar("harm_r_stencilShadowCap", "bool", "1", "Render stencil shadow volume caps(0=don't render caps, personal shadow is always render)", 0
),
KCVar.CreateCVar("harm_r_stencilShadowInfinite", "float", "0", "Stencil shadow volume far is infinite(absolute value as volume's length; 0=512. negative value is infinite, personal shadow is always infinite)", 0
),
KCVar.CreateCVar("harm_r_stencilShadowMask", "bool", "0", "Render stencil shadow mask(0=render mask after all shadows; 1=render mask every shadow volume)", 0
)
);

Expand All @@ -172,6 +208,7 @@ public static Map<String, KCVar.Group> CVars()
_cvars.put("preybase", PREY_CVARS);
_cvars.put("DOOM3BFG", DOOM3BFG_CVARS);
_cvars.put("RealRTCW", REALRTCW_CVARS);
_cvars.put("ETW", REALRTCW_CVARS);

return _cvars;
}
Expand All @@ -198,7 +235,8 @@ else if(Q3EUtils.q3ei.isQ4)
else if(Q3EUtils.q3ei.isD3BFG)
res.add(_cvars.get("DOOM3BFG"));
else if(Q3EUtils.q3ei.isDOOM) ;
else if(Q3EUtils.q3ei.isETW) ;
else if(Q3EUtils.q3ei.isETW)
res.add(_cvars.get("ETW"));
else if(Q3EUtils.q3ei.isRealRTCW)
res.add(_cvars.get("RealRTCW"));
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<Preference
android:key="standalone_game_data_directories"
android:title="@string/show_game_datas_standalone_directories"
android:dependency="harm_game_standalone_directory"
android:persistent="false"/>
<CheckBoxPreference
android:title="@string/redirect_output_to_file"
Expand Down

0 comments on commit ed0cfc8

Please sign in to comment.