From d1c5bdef0e58512708841bf4df1f10b8c91a6c12 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Thu, 9 Jan 2025 10:44:55 +0100 Subject: [PATCH 1/2] build: fix warnings --- src/libtrx/config/common.c | 2 +- src/libtrx/game/input/common.c | 4 +- src/libtrx/game/math/util.c | 2 +- src/libtrx/game/shell/common.c | 23 +++-- src/libtrx/game/ui/widgets/console.c | 2 +- src/libtrx/game/ui/widgets/requester.c | 2 +- .../include/libtrx/game/inventory_ring/priv.h | 2 +- src/libtrx/json/bson_parse.c | 4 +- src/libtrx/meson.build | 5 +- src/tr1/game/objects/general/keyhole.c | 1 - src/tr1/game/output.c | 6 +- src/tr1/game/ui/widgets/paginator.c | 2 +- src/tr1/game/ui/widgets/photo_mode.c | 2 +- src/tr1/meson.build | 4 + src/tr2/decomp/savegame.c | 20 ++--- src/tr2/decomp/skidoo.c | 1 - src/tr2/game/creature.c | 2 +- src/tr2/game/inventory_ring/control.c | 12 +-- src/tr2/game/inventory_ring/vars.c | 78 ++++++++--------- src/tr2/game/lara/misc.c | 2 +- .../objects/general/final_level_counter.c | 1 - src/tr2/game/render/hwr.c | 2 +- .../ui/widgets/controls_backend_selector.c | 2 +- src/tr2/game/ui/widgets/controls_column.c | 2 +- src/tr2/game/ui/widgets/controls_dialog.c | 2 +- .../game/ui/widgets/controls_input_selector.c | 2 +- .../game/ui/widgets/controls_layout_editor.c | 2 +- src/tr2/game/ui/widgets/stats_dialog.c | 2 +- src/tr2/global/types_decomp.h | 84 +++++++++---------- src/tr2/global/vars.c | 48 +++++------ src/tr2/meson.build | 5 +- 31 files changed, 170 insertions(+), 158 deletions(-) diff --git a/src/libtrx/config/common.c b/src/libtrx/config/common.c index f0745c57a..cc9c850db 100644 --- a/src/libtrx/config/common.c +++ b/src/libtrx/config/common.c @@ -81,5 +81,5 @@ int32_t Config_SubscribeChanges( void Config_UnsubscribeChanges(const int32_t listener_id) { ASSERT(m_EventManager != NULL); - return EventManager_Unsubscribe(m_EventManager, listener_id); + EventManager_Unsubscribe(m_EventManager, listener_id); } diff --git a/src/libtrx/game/input/common.c b/src/libtrx/game/input/common.c index 0f02b6ed2..a09cbfae4 100644 --- a/src/libtrx/game/input/common.c +++ b/src/libtrx/game/input/common.c @@ -138,7 +138,7 @@ const char *Input_GetKeyName( void Input_ResetLayout(const INPUT_BACKEND backend, const INPUT_LAYOUT layout) { - return M_GetBackend(backend)->reset_layout(layout); + M_GetBackend(backend)->reset_layout(layout); } void Input_EnterListenMode(void) @@ -228,7 +228,7 @@ bool Input_AssignFromJSONObject( if (role == (INPUT_ROLE)-1) { role = ENUM_MAP_GET( INPUT_ROLE, JSON_ObjectGetString(bind_obj, "role", ""), - (INPUT_ROLE)-1); + (int32_t)(INPUT_ROLE)-1); } if (role == (INPUT_ROLE)-1) { diff --git a/src/libtrx/game/math/util.c b/src/libtrx/game/math/util.c index aeb505abe..3562e6277 100644 --- a/src/libtrx/game/math/util.c +++ b/src/libtrx/game/math/util.c @@ -75,7 +75,7 @@ int16_t Math_DirectionToAngle(const DIRECTION dir) case DIR_WEST: return DEG_90; case DIR_SOUTH: - return DEG_180; + return -DEG_180; case DIR_EAST: return -DEG_90; default: diff --git a/src/libtrx/game/shell/common.c b/src/libtrx/game/shell/common.c index b8c6d5996..c0f3e6fdc 100644 --- a/src/libtrx/game/shell/common.c +++ b/src/libtrx/game/shell/common.c @@ -25,17 +25,22 @@ static void M_SetupHiDPI(void) PROCESS_PER_MONITOR_DPI_AWARE = 2 } PROCESS_DPI_AWARENESS; + // Windows 8.1 and later + void *const shcore_dll = SDL_LoadObject("SHCORE.DLL"); + if (shcore_dll == NULL) { + return; + } + + #pragma GCC diagnostic ignored "-Wpedantic" HRESULT(WINAPI * SetProcessDpiAwareness) - (PROCESS_DPI_AWARENESS dpiAwareness); // Windows 8.1 and later - void *shcore_dll = SDL_LoadObject("SHCORE.DLL"); - if (shcore_dll) { - SetProcessDpiAwareness = - (HRESULT(WINAPI *)(PROCESS_DPI_AWARENESS))SDL_LoadFunction( - shcore_dll, "SetProcessDpiAwareness"); - if (SetProcessDpiAwareness) { - SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); - } + (PROCESS_DPI_AWARENESS) = + (HRESULT(WINAPI *)(PROCESS_DPI_AWARENESS))SDL_LoadFunction( + shcore_dll, "SetProcessDpiAwareness"); + #pragma GCC diagnostic pop + if (SetProcessDpiAwareness == NULL) { + return; } + SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); #endif } diff --git a/src/libtrx/game/ui/widgets/console.c b/src/libtrx/game/ui/widgets/console.c index ca59fd96d..fbd4d6f04 100644 --- a/src/libtrx/game/ui/widgets/console.c +++ b/src/libtrx/game/ui/widgets/console.c @@ -153,7 +153,7 @@ static int32_t M_GetHeight(const UI_CONSOLE *const self) static void M_SetPosition(UI_CONSOLE *const self, int32_t x, int32_t y) { - return self->container->set_position(self->container, x, y); + self->container->set_position(self->container, x, y); } static void M_Control(UI_CONSOLE *const self) diff --git a/src/libtrx/game/ui/widgets/requester.c b/src/libtrx/game/ui/widgets/requester.c index 538a8f90a..9cce7163e 100644 --- a/src/libtrx/game/ui/widgets/requester.c +++ b/src/libtrx/game/ui/widgets/requester.c @@ -140,7 +140,7 @@ static int32_t M_GetHeight(const UI_REQUESTER *const self) static void M_SetPosition( UI_REQUESTER *const self, const int32_t x, const int32_t y) { - return self->window->set_position(self->window, x, y); + self->window->set_position(self->window, x, y); } static void M_Control(UI_REQUESTER *const self) diff --git a/src/libtrx/include/libtrx/game/inventory_ring/priv.h b/src/libtrx/include/libtrx/game/inventory_ring/priv.h index cbc8d0e23..b00108f8a 100644 --- a/src/libtrx/include/libtrx/game/inventory_ring/priv.h +++ b/src/libtrx/include/libtrx/game/inventory_ring/priv.h @@ -4,7 +4,7 @@ #include "./types.h" #define INV_RING_FRAMES 2 -#define INV_RING_OPEN_ROTATION DEG_180 +#define INV_RING_OPEN_ROTATION -DEG_180 #define INV_RING_ROTATE_DURATION 24 #define INV_RING_OPEN_FRAMES 32 #define INV_RING_CAMERA_HEIGHT (-0x100) // = -256 diff --git a/src/libtrx/json/bson_parse.c b/src/libtrx/json/bson_parse.c index 8f1c02e71..30a242660 100644 --- a/src/libtrx/json/bson_parse.c +++ b/src/libtrx/json/bson_parse.c @@ -660,8 +660,8 @@ JSON_VALUE *BSON_ParseEx( state.dom += sizeof(JSON_VALUE); M_HandleObjectValue(&state, value); - ASSERT(state.dom == allocation + state.dom_size); - ASSERT(state.data == allocation + state.dom_size + state.data_size); + ASSERT(state.dom == (char *)allocation + state.dom_size); + ASSERT(state.data == (char *)allocation + state.dom_size + state.data_size); return value; } diff --git a/src/libtrx/meson.build b/src/libtrx/meson.build index 3366d25f9..9bac9b612 100644 --- a/src/libtrx/meson.build +++ b/src/libtrx/meson.build @@ -16,8 +16,11 @@ c_compiler = meson.get_compiler('c') relative_dir = fs.relative_to(meson.current_source_dir(), meson.global_build_root()) build_opts = [ '-fmacro-prefix-map=@0@/=libtrx/'.format(relative_dir), + '-Wall', + '-Wpedantic', '-Wno-unused', - '-Wno-address-of-packed-member', + '-Wno-unused-parameter', + '-Wno-microsoft-anon-tag', '-DMESON_BUILD', '-DDWST_STATIC', '-DPCRE2_STATIC', diff --git a/src/tr1/game/objects/general/keyhole.c b/src/tr1/game/objects/general/keyhole.c index aaa57ae07..fe8326784 100644 --- a/src/tr1/game/objects/general/keyhole.c +++ b/src/tr1/game/objects/general/keyhole.c @@ -22,7 +22,6 @@ static const OBJECT_BOUNDS m_KeyHoleBounds = { }; static void M_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll); -; static const OBJECT_BOUNDS *M_Bounds(void); static void M_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll) diff --git a/src/tr1/game/output.c b/src/tr1/game/output.c index c83f9f98f..82d4fbc33 100644 --- a/src/tr1/game/output.c +++ b/src/tr1/game/output.c @@ -244,7 +244,7 @@ static void M_DrawRoomSprites(const ROOM_MESH *const mesh) static bool M_CalcObjectVertices( const XYZ_16 *const vertices, const int16_t count) { - int16_t total_clip = -1; + uint16_t total_clip = 0xFFFF; for (int i = 0; i < count; i++) { const XYZ_16 *const vertex = &vertices[i]; // clang-format off @@ -269,7 +269,7 @@ static bool M_CalcObjectVertices( m_VBuf[i].yv = yv; m_VBuf[i].zv = zv; - int16_t clip_flags; + uint16_t clip_flags; if (zv < Output_GetNearZ()) { clip_flags = 0x8000; } else { @@ -439,7 +439,7 @@ static void M_CalcRoomVertices(const ROOM_MESH *const mesh) vbuf->g = vertex->shade & MAX_LIGHTING; if (zv < Output_GetNearZ()) { - vbuf->clip = 0x8000; + vbuf->clip = (int16_t)0x8000; } else { int16_t clip_flags = 0; const int32_t depth = zv_int >> W2V_SHIFT; diff --git a/src/tr1/game/ui/widgets/paginator.c b/src/tr1/game/ui/widgets/paginator.c index bdfee9a80..1675fd135 100644 --- a/src/tr1/game/ui/widgets/paginator.c +++ b/src/tr1/game/ui/widgets/paginator.c @@ -67,7 +67,7 @@ static int32_t M_GetHeight(const UI_PAGINATOR *const self) static void M_SetPosition(UI_PAGINATOR *const self, int32_t x, int32_t y) { - return self->window->set_position(self->window, x, y); + self->window->set_position(self->window, x, y); } static bool M_SelectPage(UI_PAGINATOR *const self, const int32_t new_page) diff --git a/src/tr1/game/ui/widgets/photo_mode.c b/src/tr1/game/ui/widgets/photo_mode.c index 259e5fc2f..b75695743 100644 --- a/src/tr1/game/ui/widgets/photo_mode.c +++ b/src/tr1/game/ui/widgets/photo_mode.c @@ -52,7 +52,7 @@ static int32_t M_GetHeight(const UI_PHOTO_MODE *const self) static void M_SetPosition(UI_PHOTO_MODE *const self, int32_t x, int32_t y) { - return self->window->set_position(self->window, x, y); + self->window->set_position(self->window, x, y); } static void M_Control(UI_PHOTO_MODE *const self) diff --git a/src/tr1/meson.build b/src/tr1/meson.build index e8f3a3561..293c4b9eb 100644 --- a/src/tr1/meson.build +++ b/src/tr1/meson.build @@ -19,7 +19,11 @@ c_compiler = meson.get_compiler('c') fs = import('fs') relative_dir = fs.relative_to(meson.current_source_dir(), meson.global_build_root()) build_opts = [ + '-Wall', + '-Wpedantic', '-Wno-unused', + '-Wno-unused-parameter', + '-Wno-microsoft-anon-tag', '-DMESON_BUILD', '-DTR_VERSION=1', '-fno-omit-frame-pointer', diff --git a/src/tr2/decomp/savegame.c b/src/tr2/decomp/savegame.c index 6b400df3b..8b3c76e7d 100644 --- a/src/tr2/decomp/savegame.c +++ b/src/tr2/decomp/savegame.c @@ -27,12 +27,12 @@ #define SAVE_CREATURE (1 << 7) #define SPECIAL_READ_WRITES \ - SPECIAL_READ_WRITE(S8, int8_t); \ - SPECIAL_READ_WRITE(S16, int16_t); \ - SPECIAL_READ_WRITE(S32, int32_t); \ - SPECIAL_READ_WRITE(U8, uint8_t); \ - SPECIAL_READ_WRITE(U16, uint16_t); \ - SPECIAL_READ_WRITE(U32, uint32_t); + SPECIAL_READ_WRITE(S8, int8_t) \ + SPECIAL_READ_WRITE(S16, int16_t) \ + SPECIAL_READ_WRITE(S32, int32_t) \ + SPECIAL_READ_WRITE(U8, uint8_t) \ + SPECIAL_READ_WRITE(U16, uint16_t) \ + SPECIAL_READ_WRITE(U32, uint32_t) static int32_t m_BufPos = 0; static char *m_BufPtr = NULL; @@ -43,7 +43,7 @@ static uint32_t m_ReqFlags2[MAX_REQUESTER_ITEMS]; static void M_Read(void *ptr, size_t size); #undef SPECIAL_READ_WRITE #define SPECIAL_READ_WRITE(name, type) static type M_Read##name(void); -SPECIAL_READ_WRITES; +SPECIAL_READ_WRITES static void M_Skip(size_t size); static void M_ReadItems(void); static void M_ReadLara(LARA_INFO *lara); @@ -54,7 +54,7 @@ static void M_ReadFlares(void); static void M_Write(const void *ptr, size_t size); #undef SPECIAL_READ_WRITE #define SPECIAL_READ_WRITE(name, type) static void M_Write##name(type value); -SPECIAL_READ_WRITES; +SPECIAL_READ_WRITES static void M_WriteItems(void); static void M_WriteLara(const LARA_INFO *lara); static void M_WriteLaraArm(const LARA_ARM *arm); @@ -74,7 +74,7 @@ static void M_Read(void *ptr, const size_t size) ReadSG(&result, sizeof(type)); \ return result; \ } -SPECIAL_READ_WRITES; +SPECIAL_READ_WRITES #undef SPECIAL_READ_WRITE #define SPECIAL_READ_WRITE(name, type) \ @@ -82,7 +82,7 @@ SPECIAL_READ_WRITES; { \ M_Write(&value, sizeof(type)); \ } -SPECIAL_READ_WRITES; +SPECIAL_READ_WRITES static void M_Skip(const size_t size) { diff --git a/src/tr2/decomp/skidoo.c b/src/tr2/decomp/skidoo.c index b3842e878..c253b2540 100644 --- a/src/tr2/decomp/skidoo.c +++ b/src/tr2/decomp/skidoo.c @@ -645,7 +645,6 @@ void Skidoo_Animation( M_IsArmed(skidoo_data) ? MX_BATTLE_THEME : MX_SKIDOO_THEME; if (!(g_MusicTrackFlags[music_track] & IF_ONE_SHOT)) { Music_Play(music_track, MPM_ALWAYS); - g_LaraItem = g_LaraItem; g_MusicTrackFlags[music_track] |= IF_ONE_SHOT; } diff --git a/src/tr2/game/creature.c b/src/tr2/game/creature.c index a6ff80b19..da7572064 100644 --- a/src/tr2/game/creature.c +++ b/src/tr2/game/creature.c @@ -782,7 +782,7 @@ int32_t Creature_Vault( } } else if (old_x_sector == x_sector) { if (old_z_sector >= z_sector) { - item->rot.y = PHD_180; + item->rot.y = -PHD_180; item->pos.z = (old_z_sector << WALL_SHIFT) + shift; } else { item->rot.y = 0; diff --git a/src/tr2/game/inventory_ring/control.c b/src/tr2/game/inventory_ring/control.c index eefe13bd5..f5fd4cfb2 100644 --- a/src/tr2/game/inventory_ring/control.c +++ b/src/tr2/game/inventory_ring/control.c @@ -246,7 +246,7 @@ static GAME_FLOW_COMMAND M_Control(INV_RING *const ring) InvRing_MotionRadius(ring, 0); InvRing_MotionCameraPos(ring, INV_RING_CAMERA_START_HEIGHT); InvRing_MotionRotation( - ring, PHD_180, ring->ring_pos.rot.y + PHD_180); + ring, -PHD_180, ring->ring_pos.rot.y + PHD_180); g_Input = (INPUT_STATE) { 0 }; g_InputDB = (INPUT_STATE) { 0 }; } @@ -317,7 +317,7 @@ static GAME_FLOW_COMMAND M_Control(INV_RING *const ring) ring, RNG_CLOSING, RNG_OPTION2MAIN, 24); InvRing_MotionRadius(ring, 0); InvRing_MotionRotation( - ring, PHD_180, ring->ring_pos.rot.y + PHD_180); + ring, -PHD_180, ring->ring_pos.rot.y + PHD_180); InvRing_MotionCameraPitch(ring, 0x2000); ring->motion.misc = 0x2000; } @@ -328,7 +328,7 @@ static GAME_FLOW_COMMAND M_Control(INV_RING *const ring) ring, RNG_CLOSING, RNG_MAIN2KEYS, 24); InvRing_MotionRadius(ring, 0); InvRing_MotionRotation( - ring, PHD_180, ring->ring_pos.rot.y + PHD_180); + ring, -PHD_180, ring->ring_pos.rot.y + PHD_180); InvRing_MotionCameraPitch(ring, 0x2000); ring->motion.misc = 0x2000; } @@ -344,7 +344,7 @@ static GAME_FLOW_COMMAND M_Control(INV_RING *const ring) ring, RNG_CLOSING, RNG_KEYS2MAIN, 24); InvRing_MotionRadius(ring, 0); InvRing_MotionRotation( - ring, PHD_180, ring->ring_pos.rot.y + PHD_180); + ring, -PHD_180, ring->ring_pos.rot.y + PHD_180); InvRing_MotionCameraPitch(ring, -0x2000); ring->motion.misc = -0x2000; } @@ -357,7 +357,7 @@ static GAME_FLOW_COMMAND M_Control(INV_RING *const ring) ring, RNG_CLOSING, RNG_MAIN2OPTION, 24); InvRing_MotionRadius(ring, 0); InvRing_MotionRotation( - ring, PHD_180, ring->ring_pos.rot.y + PHD_180); + ring, -PHD_180, ring->ring_pos.rot.y + PHD_180); InvRing_MotionCameraPitch(ring, -0x2000); ring->motion.misc = -0x2000; } @@ -538,7 +538,7 @@ static GAME_FLOW_COMMAND M_Control(INV_RING *const ring) InvRing_MotionRadius(ring, 0); InvRing_MotionCameraPos(ring, INV_RING_CAMERA_START_HEIGHT); InvRing_MotionRotation( - ring, PHD_180, ring->ring_pos.rot.y + PHD_180); + ring, -PHD_180, ring->ring_pos.rot.y + PHD_180); } break; diff --git a/src/tr2/game/inventory_ring/vars.c b/src/tr2/game/inventory_ring/vars.c index 4934b1c21..6b16534e3 100644 --- a/src/tr2/game/inventory_ring/vars.c +++ b/src/tr2/game/inventory_ring/vars.c @@ -72,12 +72,12 @@ INVENTORY_ITEM g_InvRing_Item_Stopwatch = { .anim_count = 0, .x_rot_pt_sel = 4352, .x_rot_pt = 0, - .x_rot_sel = 64000, + .x_rot_sel = -1536, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, .y_rot = 0, - .y_trans_sel = 4294967126, + .y_trans_sel = -170, .y_trans = 0, .z_trans_sel = 320, .z_trans = 0, @@ -101,7 +101,7 @@ INVENTORY_ITEM g_InvRing_Item_Pistols = { .x_rot_sel = 2848, .x_rot_nosel = 0, .x_rot = 0, - .y_rot_sel = 32768, + .y_rot_sel = -32768, .y_rot = 0, .y_trans_sel = 38, .y_trans = 0, @@ -127,7 +127,7 @@ INVENTORY_ITEM g_InvRing_Item_Flare = { .x_rot_sel = 0, .x_rot_nosel = 0, .x_rot = 0, - .y_rot_sel = 57344, + .y_rot_sel = -8192, .y_rot = 0, .y_trans_sel = 0, .y_trans = 0, @@ -179,7 +179,7 @@ INVENTORY_ITEM g_InvRing_Item_Magnums = { .x_rot_sel = 3360, .x_rot_nosel = 0, .x_rot = 0, - .y_rot_sel = 32768, + .y_rot_sel = -32768, .y_rot = 0, .y_trans_sel = 0, .y_trans = 0, @@ -205,7 +205,7 @@ INVENTORY_ITEM g_InvRing_Item_Uzis = { .x_rot_sel = 2336, .x_rot_nosel = 0, .x_rot = 0, - .y_rot_sel = 32768, + .y_rot_sel = -32768, .y_rot = 0, .y_trans_sel = 56, .y_trans = 0, @@ -228,10 +228,10 @@ INVENTORY_ITEM g_InvRing_Item_Harpoon = { .anim_count = 0, .x_rot_pt_sel = 3200, .x_rot_pt = 0, - .x_rot_sel = 64800, + .x_rot_sel = -736, .x_rot_nosel = 0, .x_rot = 0, - .y_rot_sel = 46080, + .y_rot_sel = -19456, .y_rot = 0, .y_trans_sel = 58, .y_trans = 0, @@ -254,10 +254,10 @@ INVENTORY_ITEM g_InvRing_Item_M16 = { .anim_count = 0, .x_rot_pt_sel = 3200, .x_rot_pt = 0, - .x_rot_sel = 65312, + .x_rot_sel = -224, .x_rot_nosel = 0, .x_rot = 0, - .y_rot_sel = 47104, + .y_rot_sel = -18432, .y_rot = 0, .y_trans_sel = 84, .y_trans = 0, @@ -280,7 +280,7 @@ INVENTORY_ITEM g_InvRing_Item_Grenade = { .anim_count = 0, .x_rot_pt_sel = 3200, .x_rot_pt = 0, - .x_rot_sel = 65312, + .x_rot_sel = -224, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 14336, @@ -306,7 +306,7 @@ INVENTORY_ITEM g_InvRing_Item_PistolAmmo = { .anim_count = 0, .x_rot_pt_sel = 3200, .x_rot_pt = 0, - .x_rot_sel = 61728, + .x_rot_sel = -3808, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -332,7 +332,7 @@ INVENTORY_ITEM g_InvRing_Item_ShotgunAmmo = { .anim_count = 0, .x_rot_pt_sel = 3200, .x_rot_pt = 0, - .x_rot_sel = 61728, + .x_rot_sel = -3808, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -358,7 +358,7 @@ INVENTORY_ITEM g_InvRing_Item_MagnumAmmo = { .anim_count = 0, .x_rot_pt_sel = 3200, .x_rot_pt = 0, - .x_rot_sel = 61728, + .x_rot_sel = -3808, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -384,7 +384,7 @@ INVENTORY_ITEM g_InvRing_Item_UziAmmo = { .anim_count = 0, .x_rot_pt_sel = 3200, .x_rot_pt = 0, - .x_rot_sel = 61728, + .x_rot_sel = -3808, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -410,7 +410,7 @@ INVENTORY_ITEM g_InvRing_Item_HarpoonAmmo = { .anim_count = 0, .x_rot_pt_sel = 3200, .x_rot_pt = 0, - .x_rot_sel = 61728, + .x_rot_sel = -3808, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -436,7 +436,7 @@ INVENTORY_ITEM g_InvRing_Item_M16Ammo = { .anim_count = 0, .x_rot_pt_sel = 3200, .x_rot_pt = 0, - .x_rot_sel = 61728, + .x_rot_sel = -3808, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -462,7 +462,7 @@ INVENTORY_ITEM g_InvRing_Item_GrenadeAmmo = { .anim_count = 0, .x_rot_pt_sel = 3200, .x_rot_pt = 0, - .x_rot_sel = 61728, + .x_rot_sel = -3808, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -488,10 +488,10 @@ INVENTORY_ITEM g_InvRing_Item_SmallMedi = { .anim_count = 0, .x_rot_pt_sel = 4032, .x_rot_pt = 0, - .x_rot_sel = 58240, + .x_rot_sel = -7296, .x_rot_nosel = 0, .x_rot = 0, - .y_rot_sel = 61440, + .y_rot_sel = -4096, .y_rot = 0, .y_trans_sel = 0, .y_trans = 0, @@ -514,10 +514,10 @@ INVENTORY_ITEM g_InvRing_Item_LargeMedi = { .anim_count = 0, .x_rot_pt_sel = 3616, .x_rot_pt = 0, - .x_rot_sel = 57376, + .x_rot_sel = -8160, .x_rot_nosel = 0, .x_rot = 0, - .y_rot_sel = 61440, + .y_rot_sel = -4096, .y_rot = 0, .y_trans_sel = 0, .y_trans = 0, @@ -540,7 +540,7 @@ INVENTORY_ITEM g_InvRing_Item_Pickup1 = { .anim_count = 0, .x_rot_pt_sel = 7200, .x_rot_pt = 0, - .x_rot_sel = 61184, + .x_rot_sel = -4352, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -566,7 +566,7 @@ INVENTORY_ITEM g_InvRing_Item_Pickup2 = { .anim_count = 0, .x_rot_pt_sel = 7200, .x_rot_pt = 0, - .x_rot_sel = 61184, + .x_rot_sel = -4352, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -592,7 +592,7 @@ INVENTORY_ITEM g_InvRing_Item_Puzzle1 = { .anim_count = 0, .x_rot_pt_sel = 7200, .x_rot_pt = 0, - .x_rot_sel = 61184, + .x_rot_sel = -4352, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -618,7 +618,7 @@ INVENTORY_ITEM g_InvRing_Item_Puzzle2 = { .anim_count = 0, .x_rot_pt_sel = 7200, .x_rot_pt = 0, - .x_rot_sel = 61184, + .x_rot_sel = -4352, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -644,7 +644,7 @@ INVENTORY_ITEM g_InvRing_Item_Puzzle3 = { .anim_count = 0, .x_rot_pt_sel = 7200, .x_rot_pt = 0, - .x_rot_sel = 61184, + .x_rot_sel = -4352, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -670,7 +670,7 @@ INVENTORY_ITEM g_InvRing_Item_Puzzle4 = { .anim_count = 0, .x_rot_pt_sel = 7200, .x_rot_pt = 0, - .x_rot_sel = 61184, + .x_rot_sel = -4352, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -696,7 +696,7 @@ INVENTORY_ITEM g_InvRing_Item_Key1 = { .anim_count = 0, .x_rot_pt_sel = 7200, .x_rot_pt = 0, - .x_rot_sel = 61184, + .x_rot_sel = -4352, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -722,7 +722,7 @@ INVENTORY_ITEM g_InvRing_Item_Key2 = { .anim_count = 0, .x_rot_pt_sel = 7200, .x_rot_pt = 0, - .x_rot_sel = 61184, + .x_rot_sel = -4352, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -748,7 +748,7 @@ INVENTORY_ITEM g_InvRing_Item_Key3 = { .anim_count = 0, .x_rot_pt_sel = 7200, .x_rot_pt = 0, - .x_rot_sel = 61184, + .x_rot_sel = -4352, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -774,7 +774,7 @@ INVENTORY_ITEM g_InvRing_Item_Key4 = { .anim_count = 0, .x_rot_pt_sel = 7200, .x_rot_pt = 0, - .x_rot_sel = 61184, + .x_rot_sel = -4352, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -800,7 +800,7 @@ INVENTORY_ITEM g_InvRing_Item_Passport = { .anim_count = 0, .x_rot_pt_sel = 4640, .x_rot_pt = 0, - .x_rot_sel = 61216, + .x_rot_sel = -4320, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -826,7 +826,7 @@ INVENTORY_ITEM g_InvRing_Item_Graphics = { .anim_count = 0, .x_rot_pt_sel = 4224, .x_rot_pt = 0, - .x_rot_sel = 58304, + .x_rot_sel = -7232, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, @@ -852,12 +852,12 @@ INVENTORY_ITEM g_InvRing_Item_Sound = { .anim_count = 0, .x_rot_pt_sel = 4832, .x_rot_pt = 0, - .x_rot_sel = 60128, + .x_rot_sel = -5408, .x_rot_nosel = 0, .x_rot = 0, - .y_rot_sel = 62464, + .y_rot_sel = -3072, .y_rot = 0, - .y_trans_sel = 4294967294, + .y_trans_sel = -2, .y_trans = 0, .z_trans_sel = 350, .z_trans = 0, @@ -878,7 +878,7 @@ INVENTORY_ITEM g_InvRing_Item_Controls = { .anim_count = 0, .x_rot_pt_sel = 5504, .x_rot_pt = 0, - .x_rot_sel = 62976, + .x_rot_sel = -2560, .x_rot_nosel = 5632, .x_rot = 5632, .y_rot_sel = 13312, @@ -904,7 +904,7 @@ INVENTORY_ITEM g_InvRing_Item_Photo = { .anim_count = 0, .x_rot_pt_sel = 4640, .x_rot_pt = 0, - .x_rot_sel = 61216, + .x_rot_sel = -4320, .x_rot_nosel = 0, .x_rot = 0, .y_rot_sel = 0, diff --git a/src/tr2/game/lara/misc.c b/src/tr2/game/lara/misc.c index af0a38be0..d8be1c7cc 100644 --- a/src/tr2/game/lara/misc.c +++ b/src/tr2/game/lara/misc.c @@ -729,7 +729,7 @@ int32_t Lara_TestSlide(ITEM *item, COLL_INFO *coll) } if (coll->z_tilt > 2 && coll->z_tilt > ABS(coll->x_tilt)) { - angle = PHD_180; + angle = -PHD_180; } else if (coll->z_tilt < -2 && -coll->z_tilt > ABS(coll->x_tilt)) { angle = 0; } diff --git a/src/tr2/game/objects/general/final_level_counter.c b/src/tr2/game/objects/general/final_level_counter.c index 56a71cc55..4a7b97640 100644 --- a/src/tr2/game/objects/general/final_level_counter.c +++ b/src/tr2/game/objects/general/final_level_counter.c @@ -36,7 +36,6 @@ static int16_t M_FindBestBoss(void) target.pos.z = item->pos.z; target.room_num = item->room_num; - g_LaraItem = g_LaraItem; if (!LOS_Check(&start, &target)) { const int32_t dx = (g_LaraItem->pos.x - item->pos.x) >> 6; const int32_t dy = (g_LaraItem->pos.y - item->pos.y) >> 6; diff --git a/src/tr2/game/render/hwr.c b/src/tr2/game/render/hwr.c index 0c8b7b8ad..bf6b1abcf 100644 --- a/src/tr2/game/render/hwr.c +++ b/src/tr2/game/render/hwr.c @@ -948,7 +948,7 @@ static void M_InsertTransOctagon_Sorted( RENDERER *const renderer, const PHD_VBUF *const vtx, const int16_t shade) { int8_t clip_or = 0x00; - int8_t clip_and = 0xFF; + uint8_t clip_and = 0xFF; int32_t num_vtx = 8; for (int32_t i = 0; i < num_vtx; i++) { diff --git a/src/tr2/game/ui/widgets/controls_backend_selector.c b/src/tr2/game/ui/widgets/controls_backend_selector.c index cda46a173..9cee0d403 100644 --- a/src/tr2/game/ui/widgets/controls_backend_selector.c +++ b/src/tr2/game/ui/widgets/controls_backend_selector.c @@ -54,7 +54,7 @@ static int32_t M_GetHeight(const UI_CONTROLS_BACKEND_SELECTOR *const self) static void M_SetPosition( UI_CONTROLS_BACKEND_SELECTOR *const self, const int32_t x, const int32_t y) { - return self->container->set_position(self->container, x, y); + self->container->set_position(self->container, x, y); } static void M_Control(UI_CONTROLS_BACKEND_SELECTOR *const self) diff --git a/src/tr2/game/ui/widgets/controls_column.c b/src/tr2/game/ui/widgets/controls_column.c index 6d87a2daa..3236531b2 100644 --- a/src/tr2/game/ui/widgets/controls_column.c +++ b/src/tr2/game/ui/widgets/controls_column.c @@ -32,7 +32,7 @@ static int32_t M_GetHeight(const UI_CONTROLS_COLUMN *const self) static void M_SetPosition( UI_CONTROLS_COLUMN *const self, const int32_t x, const int32_t y) { - return self->container->set_position(self->container, x, y); + self->container->set_position(self->container, x, y); } static void M_Control(UI_CONTROLS_COLUMN *const self) diff --git a/src/tr2/game/ui/widgets/controls_dialog.c b/src/tr2/game/ui/widgets/controls_dialog.c index a8216dee9..b806c5582 100644 --- a/src/tr2/game/ui/widgets/controls_dialog.c +++ b/src/tr2/game/ui/widgets/controls_dialog.c @@ -53,7 +53,7 @@ static int32_t M_GetHeight(const UI_CONTROLS_DIALOG *const self) static void M_SetPosition( UI_CONTROLS_DIALOG *const self, const int32_t x, const int32_t y) { - return self->window->set_position(self->window, x, y); + self->window->set_position(self->window, x, y); } static void M_Control(UI_CONTROLS_DIALOG *const self) diff --git a/src/tr2/game/ui/widgets/controls_input_selector.c b/src/tr2/game/ui/widgets/controls_input_selector.c index 097253c14..a8022e1a8 100644 --- a/src/tr2/game/ui/widgets/controls_input_selector.c +++ b/src/tr2/game/ui/widgets/controls_input_selector.c @@ -48,7 +48,7 @@ static int32_t M_GetHeight(const UI_CONTROLS_INPUT_SELECTOR *const self) static void M_SetPosition( UI_CONTROLS_INPUT_SELECTOR *const self, const int32_t x, const int32_t y) { - return self->container->set_position(self->container, x, y); + self->container->set_position(self->container, x, y); } static void M_Control(UI_CONTROLS_INPUT_SELECTOR *const self) diff --git a/src/tr2/game/ui/widgets/controls_layout_editor.c b/src/tr2/game/ui/widgets/controls_layout_editor.c index ca6d6973f..6bce2f94c 100644 --- a/src/tr2/game/ui/widgets/controls_layout_editor.c +++ b/src/tr2/game/ui/widgets/controls_layout_editor.c @@ -39,7 +39,7 @@ static int32_t M_GetHeight(const UI_CONTROLS_LAYOUT_EDITOR *const self) static void M_SetPosition( UI_CONTROLS_LAYOUT_EDITOR *const self, const int32_t x, const int32_t y) { - return self->outer_stack->set_position(self->outer_stack, x, y); + self->outer_stack->set_position(self->outer_stack, x, y); } static void M_Control(UI_CONTROLS_LAYOUT_EDITOR *const self) diff --git a/src/tr2/game/ui/widgets/stats_dialog.c b/src/tr2/game/ui/widgets/stats_dialog.c index ebaa500ba..3f40df9a7 100644 --- a/src/tr2/game/ui/widgets/stats_dialog.c +++ b/src/tr2/game/ui/widgets/stats_dialog.c @@ -279,7 +279,7 @@ static int32_t M_GetHeight(const UI_STATS_DIALOG *const self) static void M_SetPosition( UI_STATS_DIALOG *const self, const int32_t x, const int32_t y) { - return self->window->set_position(self->window, x, y); + self->window->set_position(self->window, x, y); } static void M_Control(UI_STATS_DIALOG *const self) diff --git a/src/tr2/global/types_decomp.h b/src/tr2/global/types_decomp.h index d85fb49d5..85a63a8bf 100644 --- a/src/tr2/global/types_decomp.h +++ b/src/tr2/global/types_decomp.h @@ -12,9 +12,9 @@ #include #include +// clang-format off #pragma pack(push, 1) -// clang-format off typedef struct { union { uint8_t red; @@ -131,45 +131,6 @@ typedef struct { float g; } POINT_INFO; -typedef struct { - uint16_t no_selector : 1; - uint16_t ready : 1; // not present in the OG - uint16_t pad : 14; - uint16_t items_count; - uint16_t selected; - uint16_t visible_count; - uint16_t line_offset; - uint16_t line_old_offset; - uint16_t pix_width; - uint16_t line_height; - int16_t x_pos; - int16_t y_pos; - int16_t z_pos; - uint16_t item_string_len; - char *pitem_strings1; - char *pitem_strings2; - uint32_t *pitem_flags1; - uint32_t *pitem_flags2; - uint32_t heading_flags1; - uint32_t heading_flags2; - uint32_t background_flags; - uint32_t moreup_flags; - uint32_t moredown_flags; - uint32_t item_flags1[24]; // MAX_REQUESTER_ITEMS - uint32_t item_flags2[24]; // MAX_REQUESTER_ITEMS - TEXTSTRING *heading_text1; - TEXTSTRING *heading_text2; - TEXTSTRING *background_text; - TEXTSTRING *moreup_text; - TEXTSTRING *moredown_text; - TEXTSTRING *item_texts1[24]; // MAX_REQUESTER_ITEMS - TEXTSTRING *item_texts2[24]; // MAX_REQUESTER_ITEMS - char heading_string1[32]; - char heading_string2[32]; - uint32_t render_width; - uint32_t render_height; -} REQUEST_INFO; - typedef struct { uint32_t best_time[10]; uint32_t best_finish[10]; @@ -734,6 +695,45 @@ typedef enum { REQ_NO_TIME = 0x40, } REQUESTER_FLAGS; -// clang-format on - #pragma pack(pop) + +typedef struct { + uint16_t no_selector : 1; + uint16_t ready : 1; // not present in the OG + uint16_t pad : 14; + uint16_t items_count; + uint16_t selected; + uint16_t visible_count; + uint16_t line_offset; + uint16_t line_old_offset; + uint16_t pix_width; + uint16_t line_height; + int16_t x_pos; + int16_t y_pos; + int16_t z_pos; + uint16_t item_string_len; + char *pitem_strings1; + char *pitem_strings2; + uint32_t *pitem_flags1; + uint32_t *pitem_flags2; + uint32_t heading_flags1; + uint32_t heading_flags2; + uint32_t background_flags; + uint32_t moreup_flags; + uint32_t moredown_flags; + uint32_t item_flags1[24]; // MAX_REQUESTER_ITEMS + uint32_t item_flags2[24]; // MAX_REQUESTER_ITEMS + TEXTSTRING *heading_text1; + TEXTSTRING *heading_text2; + TEXTSTRING *background_text; + TEXTSTRING *moreup_text; + TEXTSTRING *moredown_text; + TEXTSTRING *item_texts1[24]; // MAX_REQUESTER_ITEMS + TEXTSTRING *item_texts2[24]; // MAX_REQUESTER_ITEMS + char heading_string1[32]; + char heading_string2[32]; + uint32_t render_width; + uint32_t render_height; +} REQUEST_INFO; + +// clang-format on diff --git a/src/tr2/global/vars.c b/src/tr2/global/vars.c index 4b4295aac..28d7dcf19 100644 --- a/src/tr2/global/vars.c +++ b/src/tr2/global/vars.c @@ -138,9 +138,9 @@ uint16_t g_MusicTrackFlags[64]; WEAPON_INFO g_Weapons[] = { {}, { - .lock_angles = { 54616, 10920, 54616, 10920 }, - .left_angles = { 34596, 10920, 50976, 14560 }, - .right_angles = { 54616, 30940, 50976, 14560 }, + .lock_angles = { -60 * DEG_1, 60 * DEG_1, -60 * DEG_1, 60 * DEG_1 }, + .left_angles = { -170 * DEG_1, 60 * DEG_1, -80 * DEG_1, 80 * DEG_1 }, + .right_angles = { -60 * DEG_1, 170 * DEG_1, -80 * DEG_1, 80 * DEG_1 }, .aim_speed = 1820, .shot_accuracy = 1456, .gun_height = 650, @@ -151,9 +151,9 @@ WEAPON_INFO g_Weapons[] = { .sample_num = 8, }, { - .lock_angles = { 54616, 10920, 54616, 10920 }, - .left_angles = { 34596, 10920, 50976, 14560 }, - .right_angles = { 54616, 30940, 50976, 14560 }, + .lock_angles = { -60 * DEG_1, 60 * DEG_1, -60 * DEG_1, 60 * DEG_1 }, + .left_angles = { -170 * DEG_1, 60 * DEG_1, -80 * DEG_1, 80 * DEG_1 }, + .right_angles = { -60 * DEG_1, 170 * DEG_1, -80 * DEG_1, 80 * DEG_1 }, .aim_speed = 1820, .shot_accuracy = 1456, .gun_height = 650, @@ -164,9 +164,9 @@ WEAPON_INFO g_Weapons[] = { .sample_num = 21, }, { - .lock_angles = { 54616, 10920, 54616, 10920 }, - .left_angles = { 34596, 10920, 50976, 14560 }, - .right_angles = { 54616, 30940, 50976, 14560 }, + .lock_angles = { -60 * DEG_1, 60 * DEG_1, -60 * DEG_1, 60 * DEG_1 }, + .left_angles = { -170 * DEG_1, 60 * DEG_1, -80 * DEG_1, 80 * DEG_1 }, + .right_angles = { -60 * DEG_1, 170 * DEG_1, -80 * DEG_1, 80 * DEG_1 }, .aim_speed = 1820, .shot_accuracy = 1456, .gun_height = 650, @@ -177,9 +177,9 @@ WEAPON_INFO g_Weapons[] = { .sample_num = 43, }, { - .lock_angles = { 54616, 10920, 55526, 10010 }, - .left_angles = { 50976, 14560, 53706, 11830 }, - .right_angles = { 50976, 14560, 53706, 11830 }, + .lock_angles = { -60 * DEG_1, 60 * DEG_1, -55 * DEG_1, 55 * DEG_1 }, + .left_angles = { -80 * DEG_1, 80 * DEG_1, -65 * DEG_1, 65 * DEG_1 }, + .right_angles = { -80 * DEG_1, 80 * DEG_1, -65 * DEG_1, 65 * DEG_1 }, .aim_speed = 1820, .shot_accuracy = 0, .gun_height = 500, @@ -190,9 +190,9 @@ WEAPON_INFO g_Weapons[] = { .sample_num = 45, }, { - .lock_angles = { 54616, 10920, 55526, 10010 }, - .left_angles = { 50976, 14560, 53706, 11830 }, - .right_angles = { 50976, 14560, 53706, 11830 }, + .lock_angles = { -60 * DEG_1, 60 * DEG_1, -55 * DEG_1, 55 * DEG_1 }, + .left_angles = { -80 * DEG_1, 80 * DEG_1, -65 * DEG_1, 65 * DEG_1 }, + .right_angles = { -80 * DEG_1, 80 * DEG_1, -65 * DEG_1, 65 * DEG_1 }, .aim_speed = 1820, .shot_accuracy = 728, .gun_height = 500, @@ -203,9 +203,9 @@ WEAPON_INFO g_Weapons[] = { .sample_num = 0, }, { - .lock_angles = { 54616, 10920, 55526, 10010 }, - .left_angles = { 50976, 14560, 53706, 11830 }, - .right_angles = { 50976, 14560, 53706, 11830 }, + .lock_angles = { -60 * DEG_1, 60 * DEG_1, -55 * DEG_1, 55 * DEG_1 }, + .left_angles = { -80 * DEG_1, 80 * DEG_1, -65 * DEG_1, 65 * DEG_1 }, + .right_angles = { -80 * DEG_1, 80 * DEG_1, -65 * DEG_1, 65 * DEG_1 }, .aim_speed = 1820, .shot_accuracy = 1456, .gun_height = 500, @@ -216,9 +216,9 @@ WEAPON_INFO g_Weapons[] = { .sample_num = 0, }, { - .lock_angles = { 54616, 10920, 53706, 11830 }, - .left_angles = { 50976, 14560, 51886, 13650 }, - .right_angles = { 50976, 14560, 51886, 13650 }, + .lock_angles = { -60 * DEG_1, 60 * DEG_1, -65 * DEG_1, 65 * DEG_1 }, + .left_angles = { -80 * DEG_1, 80 * DEG_1, -75 * DEG_1, 75 * DEG_1 }, + .right_angles = { -80 * DEG_1, 80 * DEG_1, -75 * DEG_1, 75 * DEG_1 }, .aim_speed = 1820, .shot_accuracy = 1456, .gun_height = 500, @@ -230,9 +230,9 @@ WEAPON_INFO g_Weapons[] = { }, {}, { - .lock_angles = { 60076, 5460, 55526, 10010 }, - .left_angles = { 60076, 5460, 55526, 10010 }, - .right_angles = { 60076, 5460, 55526, 10010 }, + .lock_angles = { -30 * DEG_1, 30 * DEG_1, -55 * DEG_1, 55 * DEG_1 }, + .left_angles = { -30 * DEG_1, 30 * DEG_1, -55 * DEG_1, 55 * DEG_1 }, + .right_angles = { -30 * DEG_1, 30 * DEG_1, -55 * DEG_1, 55 * DEG_1 }, .aim_speed = 1820, .shot_accuracy = 1456, .gun_height = 400, diff --git a/src/tr2/meson.build b/src/tr2/meson.build index e1e6c5c15..aa2b32ec8 100644 --- a/src/tr2/meson.build +++ b/src/tr2/meson.build @@ -19,8 +19,11 @@ c_compiler = meson.get_compiler('c') fs = import('fs') relative_dir = fs.relative_to(meson.current_source_dir(), meson.global_build_root()) build_opts = [ + '-Wall', + '-Wpedantic', '-Wno-unused', - '-Wno-address-of-packed-member', + '-Wno-unused-parameter', + '-Wno-microsoft-anon-tag', '-DMESON_BUILD', '-fms-extensions', '-fno-omit-frame-pointer', From 2066ea08171d892d22cf0f80aba42cbfce0e3add Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Thu, 9 Jan 2025 10:47:40 +0100 Subject: [PATCH 2/2] debug: use better crash function --- src/libtrx/include/libtrx/debug.h | 4 ++-- src/libtrx/log_linux.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libtrx/include/libtrx/debug.h b/src/libtrx/include/libtrx/debug.h index 2861a3450..f9bb2ce7a 100644 --- a/src/libtrx/include/libtrx/debug.h +++ b/src/libtrx/include/libtrx/debug.h @@ -6,12 +6,12 @@ do { \ if (!(x)) { \ LOG_DEBUG("Assertion failed: %s", #x); \ - *(int *)0 = 0; \ + __builtin_trap(); \ } \ } while (0) #define ASSERT_FAIL(x) \ do { \ LOG_DEBUG("Assertion failed"); \ - *(int *)0 = 0; \ + __builtin_trap(); \ } while (0) diff --git a/src/libtrx/log_linux.c b/src/libtrx/log_linux.c index 6af46b3c8..96c50dd14 100644 --- a/src/libtrx/log_linux.c +++ b/src/libtrx/log_linux.c @@ -46,6 +46,7 @@ void Log_Init_Extra(const char *path) { signal(SIGSEGV, M_SignalHandler); signal(SIGFPE, M_SignalHandler); + signal(SIGILL, M_SignalHandler); } void Log_Shutdown_Extra(void)