From 72382c5a8b77b0239cafda1f5a5ec6040999e2d3 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 2 Feb 2026 05:52:15 +0100 Subject: [PATCH 1/3] Support building Oni as 32-bit Linux executable --- .github/workflows/cmake.yml | 4 +-- .../BFW_Source/BFW_Console/BFW_Console.c | 4 +-- .../BFW_Motoko/Manager/Motoko_Utility.c | 4 +-- .../Platform_OpenAL/BFW_SS2_Platform_OpenAL.c | 5 +-- .../BFW_Source/BFW_Totoro/BFW_Totoro.c | 36 +++++++++---------- .../BFW_Source/BFW_Utility/BFW_Timer.c | 2 +- .../BFW_Source/BFW_Utility/BFW_Utility.c | 4 +-- OniProj/OniCMakeProjs/TEVCProj/CMakeLists.txt | 4 +-- OniProj/OniGameSource/Oni_GameState.c | 2 +- OniProj/OniGameSource/Oni_Weapon.c | 2 +- 10 files changed, 34 insertions(+), 33 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 60773ea..a07e30e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -7,7 +7,7 @@ jobs: msvc: runs-on: 'windows-latest' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: 'Configure cmake' run: | cmake -DCMAKE_SYSTEM_VERSION=10.0.19041.0 -DONI_BINK_VIDEO=ON ` @@ -18,7 +18,7 @@ jobs: mingw-linux: runs-on: 'ubuntu-latest' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: 'Install MinGW' run: | sudo apt-get install gcc-mingw-w64-i686 g++-mingw-w64-i686 diff --git a/BungieFrameWork/BFW_Source/BFW_Console/BFW_Console.c b/BungieFrameWork/BFW_Source/BFW_Console/BFW_Console.c index 70e32c6..09e967a 100644 --- a/BungieFrameWork/BFW_Source/BFW_Console/BFW_Console.c +++ b/BungieFrameWork/BFW_Source/BFW_Console/BFW_Console.c @@ -164,8 +164,8 @@ static char** COgCompletionNames; static UUtUns16 COgNumCompletionNames; static UUtBool COgPerformCompletionOnTab; -extern IMtShade COgDefaultTextShade = IMcShade_White; -extern IMtShade COgDefaultTextShadowShade = IMcShade_Gray25; +IMtShade COgDefaultTextShade = IMcShade_White; +IMtShade COgDefaultTextShadowShade = IMcShade_Gray25; // ====================================================================== diff --git a/BungieFrameWork/BFW_Source/BFW_Motoko/Manager/Motoko_Utility.c b/BungieFrameWork/BFW_Source/BFW_Motoko/Manager/Motoko_Utility.c index 12422c6..b7b7d6f 100644 --- a/BungieFrameWork/BFW_Source/BFW_Motoko/Manager/Motoko_Utility.c +++ b/BungieFrameWork/BFW_Source/BFW_Motoko/Manager/Motoko_Utility.c @@ -149,7 +149,7 @@ UUtBool M3rIntersect_BBox( */ -const extern UUtUns8 M3gBBox_EdgeList[12][2] = +const UUtUns8 M3gBBox_EdgeList[12][2] = { 0,1, // 0 1,3, // 1 @@ -165,7 +165,7 @@ const extern UUtUns8 M3gBBox_EdgeList[12][2] = 5,1 // 11 }; -const extern M3tQuad M3gBBox_QuadList[6] = // Do NOT make this UUtUns8 +const M3tQuad M3gBBox_QuadList[6] = // Do NOT make this UUtUns8 { // Look-up table for which indices to use to form each box side { 0,1,3,2 }, // 0 { 4,6,7,5 }, // 1 diff --git a/BungieFrameWork/BFW_Source/BFW_SoundSystem2/Platform_OpenAL/BFW_SS2_Platform_OpenAL.c b/BungieFrameWork/BFW_Source/BFW_SoundSystem2/Platform_OpenAL/BFW_SS2_Platform_OpenAL.c index d254246..7644adb 100644 --- a/BungieFrameWork/BFW_Source/BFW_SoundSystem2/Platform_OpenAL/BFW_SS2_Platform_OpenAL.c +++ b/BungieFrameWork/BFW_Source/BFW_SoundSystem2/Platform_OpenAL/BFW_SS2_Platform_OpenAL.c @@ -198,7 +198,8 @@ SS2r_DecompressMSADPCM( UUrPrintWarning("Failed to allocate ADPCM_MS codec context"); return UUcFalse; } - c->channels = channels; + c->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + c->ch_layout.nb_channels = channels; c->sample_rate = SScSamplesPerSecond; c->sample_fmt = SScBitsPerSample == 8 ? AV_SAMPLE_FMT_U8 : AV_SAMPLE_FMT_S16; int ret = avcodec_open2(c, codec, NULL); @@ -270,7 +271,7 @@ SS2r_DecompressMSADPCM( } int data_size = av_samples_get_buffer_size( NULL, - decoded_frame->channels, + decoded_frame->ch_layout.nb_channels, decoded_frame->nb_samples, decoded_frame->format, 1 diff --git a/BungieFrameWork/BFW_Source/BFW_Totoro/BFW_Totoro.c b/BungieFrameWork/BFW_Source/BFW_Totoro/BFW_Totoro.c index 09744d2..83c224d 100644 --- a/BungieFrameWork/BFW_Source/BFW_Totoro/BFW_Totoro.c +++ b/BungieFrameWork/BFW_Source/BFW_Totoro/BFW_Totoro.c @@ -1759,24 +1759,24 @@ static void TRrQuatArray_SetAnimationInternal( frame_vector[0]=into_gap; frame_vector[1]=frame_gap; - asm __volatile__(" - lqc2 vf01, 0(%0) - lqc2 vf02, 0(%1) - lqc2 vf29, 0(%3) - vcallms quat_lerp - mtsab $0,8 - qmfc2.i $6, vf13 - qfsrv $5, $5, $6 - nop - nop - sdl $6, 0(%2) - sdr $6, 0(%2) - sdl $5, 8(%2) - sdr $5, 8(%2) - nop - nop - - " :: "r" (interp), "r" (interp+1), "r" (quaternions+i), "r" (frame_vector): "$5","$6"); + asm __volatile__( + "lqc2 vf01, 0(%0)\n\t" + "lqc2 vf02, 0(%1)\n\t" + "lqc2 vf29, 0(%3)\n\t" + "vcallms quat_lerp\n\t" + "mtsab $0,8\n\t" + "qmfc2.i $6, vf13\n\t" + "qfsrv $5, $5, $6\n\t" + "nop\n\t" + "nop\n\t" + "sdl $6, 0(%2)\n\t" + "sdr $6, 0(%2)\n\t" + "sdl $5, 8(%2)\n\t" + "sdr $5, 8(%2)\n\t" + "nop\n\t" + "nop\n\t" + + :: "r" (interp), "r" (interp+1), "r" (quaternions+i), "r" (frame_vector): "$5","$6"); #else diff --git a/BungieFrameWork/BFW_Source/BFW_Utility/BFW_Timer.c b/BungieFrameWork/BFW_Source/BFW_Utility/BFW_Timer.c index 12e71d2..defb573 100644 --- a/BungieFrameWork/BFW_Source/BFW_Utility/BFW_Timer.c +++ b/BungieFrameWork/BFW_Source/BFW_Utility/BFW_Timer.c @@ -295,7 +295,7 @@ void UUrStallTimer_End(UUtStallTimer *inTimer, const char *inName) return; } -#endif TOOL_VERSION +#endif // TOOL_VERSION #if PERFORMANCE_TIMER diff --git a/BungieFrameWork/BFW_Source/BFW_Utility/BFW_Utility.c b/BungieFrameWork/BFW_Source/BFW_Utility/BFW_Utility.c index 135cde7..99f2778 100644 --- a/BungieFrameWork/BFW_Source/BFW_Utility/BFW_Utility.c +++ b/BungieFrameWork/BFW_Source/BFW_Utility/BFW_Utility.c @@ -28,10 +28,10 @@ UUtBool UUgFalse = 0; UUtError UUgError_None = 0; - + #endif - extern double UUgMachineTime_High_Frequency = 0; + double UUgMachineTime_High_Frequency = 0; // initialize random is internal void UUiRandom_Initialize(void); diff --git a/OniProj/OniCMakeProjs/TEVCProj/CMakeLists.txt b/OniProj/OniCMakeProjs/TEVCProj/CMakeLists.txt index 9869ff2..d7ff4e3 100644 --- a/OniProj/OniCMakeProjs/TEVCProj/CMakeLists.txt +++ b/OniProj/OniCMakeProjs/TEVCProj/CMakeLists.txt @@ -33,9 +33,9 @@ if (WIN32) # shoved here for now ../../OniWin32Projs/ImpConsole/templatechecksum.c ) -endif () -target_precompile_headers(TEVCProj PRIVATE ../../../BungieFrameWork/BFW_Headers/BFW_MasterHeader.h) + target_precompile_headers(TEVCProj PRIVATE ../../../BungieFrameWork/BFW_Headers/BFW_MasterHeader.h) +endif () if (MSVC) target_compile_options(TEVCProj diff --git a/OniProj/OniGameSource/Oni_GameState.c b/OniProj/OniGameSource/Oni_GameState.c index 8e8d468..b040ff8 100644 --- a/OniProj/OniGameSource/Oni_GameState.c +++ b/OniProj/OniGameSource/Oni_GameState.c @@ -155,7 +155,7 @@ UUtBool ONgFastLookups = UUcTrue; BFtFileRef ONgGameDataFolder; ONtGameState *ONgGameState = NULL; -extern ONtLevel *ONgLevel = NULL; +ONtLevel *ONgLevel = NULL; UUtBool ONgTerminateGame; UUtBool ONgRunMainMenu; M3tGeomContext *ONgGeomContext = NULL; diff --git a/OniProj/OniGameSource/Oni_Weapon.c b/OniProj/OniGameSource/Oni_Weapon.c index 11f26b6..0af9e4d 100644 --- a/OniProj/OniGameSource/Oni_Weapon.c +++ b/OniProj/OniGameSource/Oni_Weapon.c @@ -107,7 +107,7 @@ struct WPtWeapon UUtUns32 oct_tree_node_index[WPcWeaponNodeCount]; // S.S. length-prefixed list of oct tree nodes }; -extern const char *WPgPowerupName[WPcPowerup_NumTypes] +const char *WPgPowerupName[WPcPowerup_NumTypes] = {"ammo", "cell", "hypo", "shield", "invis", "lsi"}; WPtWeapon WPgWeapons[WPcMaxWeapons]; From 81622561dd96b81702fc158d1d5d1a23fdc56c02 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 2 Feb 2026 05:59:29 +0100 Subject: [PATCH 2/3] cmake: MinGW is case sensitive when used on Linux --- OniProj/OniCMakeProjs/OniProj/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OniProj/OniCMakeProjs/OniProj/CMakeLists.txt b/OniProj/OniCMakeProjs/OniProj/CMakeLists.txt index 42414d2..5e71f97 100644 --- a/OniProj/OniCMakeProjs/OniProj/CMakeLists.txt +++ b/OniProj/OniCMakeProjs/OniProj/CMakeLists.txt @@ -569,7 +569,7 @@ elseif(WIN32) PRIVATE winmm msacm32 - Ws2_32 + ws2_32 dinput8 dsound dxguid From 54376eaf4d3570a391db4f90f1bdb3f16e63d7ca Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 2 Feb 2026 06:03:06 +0100 Subject: [PATCH 3/3] Split string to avoid warning about trigraphs --- BungieFrameWork/BFW_Source/BFW_AppUtilities/BFW_AppUtilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BungieFrameWork/BFW_Source/BFW_AppUtilities/BFW_AppUtilities.c b/BungieFrameWork/BFW_Source/BFW_AppUtilities/BFW_AppUtilities.c index 8d2dbb9..bc7f746 100644 --- a/BungieFrameWork/BFW_Source/BFW_AppUtilities/BFW_AppUtilities.c +++ b/BungieFrameWork/BFW_Source/BFW_AppUtilities/BFW_AppUtilities.c @@ -2907,7 +2907,7 @@ AUrFlags_PrintFromValue( } inFlagList++; } - fprintf(inFile, "???(%d)", inValue); + fprintf(inFile, "???" "(%d)", inValue); } }