Skip to content

Commit

Permalink
build: fix Clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Jan 10, 2025
1 parent fffe6fd commit 6ec0290
Show file tree
Hide file tree
Showing 66 changed files with 358 additions and 340 deletions.
6 changes: 0 additions & 6 deletions docs/tr2/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,6 @@ typedef enum {
SPRF_SEMITRANS = 0x02000000,
SPRF_SCALE = 0x04000000,
SPRF_SHADE = 0x08000000,
SPRF_TINT = 0x10000000,
SPRF_BLEND_ADD = 0x20000000,
SPRF_BLEND_SUB = 0x40000000,
SPRF_BLEND_QRT = SPRF_BLEND_ADD | SPRF_BLEND_SUB,
SPRF_BLEND = SPRF_BLEND_QRT,
SPRF_ITEM = 0x80000000,
} SPRITE_FLAG;

typedef struct __unaligned {
Expand Down
6 changes: 3 additions & 3 deletions src/libtrx/engine/audio_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ typedef struct {
} AUDIO_AV_BUFFER;

static int32_t m_LoadedSamplesCount = 0;
static AUDIO_SAMPLE m_LoadedSamples[AUDIO_MAX_SAMPLES] = { 0 };
static AUDIO_SAMPLE_SOUND m_Samples[AUDIO_MAX_ACTIVE_SAMPLES] = { 0 };
static AUDIO_SAMPLE m_LoadedSamples[AUDIO_MAX_SAMPLES] = {};
static AUDIO_SAMPLE_SOUND m_Samples[AUDIO_MAX_ACTIVE_SAMPLES] = {};

static double M_DecibelToMultiplier(double db_gain);
static bool M_RecalculateChannelVolumes(int32_t sound_id);
Expand Down Expand Up @@ -179,7 +179,7 @@ static bool M_Convert(const int32_t sample_id)
int32_t dst_channels;
int32_t dst_sample_rate;
SwrContext *ctx;
} swr = { 0 };
} swr = {};

int32_t error_code;

Expand Down
4 changes: 2 additions & 2 deletions src/libtrx/engine/audio_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ typedef struct {

extern SDL_AudioDeviceID g_AudioDeviceID;

static AUDIO_STREAM_SOUND m_Streams[AUDIO_MAX_ACTIVE_STREAMS] = { 0 };
static float m_MixBuffer[AUDIO_SAMPLES * AUDIO_WORKING_CHANNELS] = { 0 };
static AUDIO_STREAM_SOUND m_Streams[AUDIO_MAX_ACTIVE_STREAMS] = {};
static float m_MixBuffer[AUDIO_SAMPLES * AUDIO_WORKING_CHANNELS] = {};

static size_t m_DecodeBufferCapacity = 0;
static float *m_DecodeBuffer = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/libtrx/engine/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ static int M_UploadTexture(M_STATE *is, AVFrame *frame)

if (pixels != NULL) {
uint8_t *surf_planes[4] = { pixels, NULL, NULL, NULL };
int surf_linesize[4] = { 0, 0, 0, 0 };
int surf_linesize[4] = {};
if (is->primary_surface_stride > 0) {
surf_linesize[0] = is->primary_surface_stride;
} else {
Expand Down
10 changes: 5 additions & 5 deletions src/libtrx/game/input/backends/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ typedef struct {
} BUILTIN_CONTROLLER_LAYOUT;

static BUILTIN_CONTROLLER_LAYOUT m_BuiltinLayout[] = {
#define INPUT_CONTROLLER_ASSIGN(role, button_type, bind, axis_dir) \
{ role, { button_type, { bind }, axis_dir } },
#define INPUT_CONTROLLER_ASSIGN_BUTTON(role, bind) \
{ role, { BT_BUTTON, { .button = bind }, 0 } },
#define INPUT_CONTROLLER_ASSIGN_AXIS(role, bind, axis_dir) \
{ role, { BT_AXIS, { .axis = bind }, axis_dir } },
#if TR_VERSION == 1
#include "game/input/backends/controller_tr1.def"
#elif TR_VERSION == 2
Expand Down Expand Up @@ -130,9 +132,7 @@ static SDL_GameController *m_Controller = NULL;
static const char *m_ControllerName = NULL;
static SDL_GameControllerType m_ControllerType = SDL_CONTROLLER_TYPE_UNKNOWN;

static bool m_Conflicts[INPUT_LAYOUT_NUMBER_OF][INPUT_ROLE_NUMBER_OF] = {
false
};
static bool m_Conflicts[INPUT_LAYOUT_NUMBER_OF][INPUT_ROLE_NUMBER_OF] = {};

static const char *M_GetButtonName(SDL_GameControllerButton button);
static const char *M_GetAxisName(SDL_GameControllerAxis axis, int16_t axis_dir);
Expand Down
2 changes: 1 addition & 1 deletion src/libtrx/game/input/backends/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ typedef struct {
} BUILTIN_KEYBOARD_LAYOUT;

const Uint8 *m_KeyboardState = NULL;
static bool m_Conflicts[INPUT_LAYOUT_NUMBER_OF][INPUT_ROLE_NUMBER_OF] = { 0 };
static bool m_Conflicts[INPUT_LAYOUT_NUMBER_OF][INPUT_ROLE_NUMBER_OF] = {};

static BUILTIN_KEYBOARD_LAYOUT m_BuiltinLayout[] = {
// clang-format off
Expand Down
6 changes: 3 additions & 3 deletions src/libtrx/game/input/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#include <stdint.h>

INPUT_STATE g_Input = { 0 };
INPUT_STATE g_InputDB = { 0 };
INPUT_STATE g_OldInputDB = { 0 };
INPUT_STATE g_Input = {};
INPUT_STATE g_InputDB = {};
INPUT_STATE g_OldInputDB = {};

static bool m_ListenMode = false;

Expand Down
2 changes: 1 addition & 1 deletion src/libtrx/game/objects/names.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ typedef struct {
char *description;
} M_NAME_ENTRY;

static M_NAME_ENTRY m_NamesTable[O_NUMBER_OF] = { 0 };
static M_NAME_ENTRY m_NamesTable[O_NUMBER_OF] = {};

static void M_ClearNames(void);

Expand Down
2 changes: 1 addition & 1 deletion src/libtrx/game/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef struct {
UT_hash_handle hh;
} M_HASH_ENTRY;

static TEXTSTRING m_TextStrings[TEXT_MAX_STRINGS] = { 0 };
static TEXTSTRING m_TextStrings[TEXT_MAX_STRINGS] = {};

static GLYPH_INFO m_Glyphs[] = {
#define GLYPH_DEFINE(text_, role_, width_, mesh_idx_, ...) \
Expand Down
2 changes: 1 addition & 1 deletion src/libtrx/gfx/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ typedef struct {
GFX_RENDERER *renderer;
} GFX_CONTEXT;

static GFX_CONTEXT m_Context = { 0 };
static GFX_CONTEXT m_Context = {};

static bool M_IsExtensionSupported(const char *name);
static void M_CheckExtensionSupport(const char *name);
Expand Down
58 changes: 29 additions & 29 deletions src/libtrx/include/libtrx/game/input/backends/controller_tr1.def
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_UP, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_UP, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_DOWN, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_DOWN, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_LEFT, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_LEFT, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_RIGHT, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_STEP_L, BT_AXIS, SDL_CONTROLLER_AXIS_TRIGGERLEFT, 1)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_STEP_R, BT_AXIS, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, 1)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_SLOW, BT_BUTTON, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_JUMP, BT_BUTTON, SDL_CONTROLLER_BUTTON_X, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_ACTION, BT_BUTTON, SDL_CONTROLLER_BUTTON_A, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_DRAW, BT_BUTTON, SDL_CONTROLLER_BUTTON_Y, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_LOOK, BT_BUTTON, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_ROLL, BT_BUTTON, SDL_CONTROLLER_BUTTON_B, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_OPTION, BT_BUTTON, SDL_CONTROLLER_BUTTON_BACK, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_PAUSE, BT_BUTTON, SDL_CONTROLLER_BUTTON_START, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_CAMERA_FORWARD, BT_AXIS, SDL_CONTROLLER_AXIS_RIGHTY, -1)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_CAMERA_BACK, BT_AXIS, SDL_CONTROLLER_AXIS_RIGHTY, 1)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_CAMERA_LEFT, BT_AXIS, SDL_CONTROLLER_AXIS_RIGHTX, -1)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_CAMERA_RIGHT, BT_AXIS, SDL_CONTROLLER_AXIS_RIGHTX, 1)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_CHANGE_TARGET, BT_BUTTON, SDL_CONTROLLER_BUTTON_LEFTSTICK, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_CAMERA_UP, BT_AXIS, SDL_CONTROLLER_AXIS_LEFTY, -1)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_CAMERA_DOWN, BT_AXIS, SDL_CONTROLLER_AXIS_LEFTY, 1)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_MENU_UP, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_UP, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_MENU_DOWN, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_DOWN, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_MENU_LEFT, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_LEFT, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_MENU_RIGHT, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_MENU_CONFIRM, BT_BUTTON, SDL_CONTROLLER_BUTTON_A, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_MENU_BACK, BT_BUTTON, SDL_CONTROLLER_BUTTON_B, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_UNBIND_KEY, BT_BUTTON, SDL_CONTROLLER_BUTTON_X, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_RESET_BINDINGS, BT_BUTTON, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, 0)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_UP, SDL_CONTROLLER_BUTTON_DPAD_UP)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_DOWN, SDL_CONTROLLER_BUTTON_DPAD_DOWN)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_LEFT, SDL_CONTROLLER_BUTTON_DPAD_LEFT)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_RIGHT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT)
INPUT_CONTROLLER_ASSIGN_AXIS(INPUT_ROLE_STEP_L, SDL_CONTROLLER_AXIS_TRIGGERLEFT, 1)
INPUT_CONTROLLER_ASSIGN_AXIS(INPUT_ROLE_STEP_R, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, 1)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_SLOW, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_JUMP, SDL_CONTROLLER_BUTTON_X)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_ACTION, SDL_CONTROLLER_BUTTON_A)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_DRAW, SDL_CONTROLLER_BUTTON_Y)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_LOOK, SDL_CONTROLLER_BUTTON_LEFTSHOULDER)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_ROLL, SDL_CONTROLLER_BUTTON_B)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_OPTION, SDL_CONTROLLER_BUTTON_BACK)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_PAUSE, SDL_CONTROLLER_BUTTON_START)
INPUT_CONTROLLER_ASSIGN_AXIS(INPUT_ROLE_CAMERA_FORWARD, SDL_CONTROLLER_AXIS_RIGHTY, -1)
INPUT_CONTROLLER_ASSIGN_AXIS(INPUT_ROLE_CAMERA_BACK, SDL_CONTROLLER_AXIS_RIGHTY, 1)
INPUT_CONTROLLER_ASSIGN_AXIS(INPUT_ROLE_CAMERA_LEFT, SDL_CONTROLLER_AXIS_RIGHTX, -1)
INPUT_CONTROLLER_ASSIGN_AXIS(INPUT_ROLE_CAMERA_RIGHT, SDL_CONTROLLER_AXIS_RIGHTX, 1)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_CHANGE_TARGET, SDL_CONTROLLER_BUTTON_LEFTSTICK)
INPUT_CONTROLLER_ASSIGN_AXIS(INPUT_ROLE_CAMERA_UP, SDL_CONTROLLER_AXIS_LEFTY, -1)
INPUT_CONTROLLER_ASSIGN_AXIS(INPUT_ROLE_CAMERA_DOWN, SDL_CONTROLLER_AXIS_LEFTY, 1)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_MENU_UP, SDL_CONTROLLER_BUTTON_DPAD_UP)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_MENU_DOWN, SDL_CONTROLLER_BUTTON_DPAD_DOWN)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_MENU_LEFT, SDL_CONTROLLER_BUTTON_DPAD_LEFT)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_MENU_RIGHT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_MENU_CONFIRM, SDL_CONTROLLER_BUTTON_A)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_MENU_BACK, SDL_CONTROLLER_BUTTON_B)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_UNBIND_KEY, SDL_CONTROLLER_BUTTON_X)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_RESET_BINDINGS, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
30 changes: 15 additions & 15 deletions src/libtrx/include/libtrx/game/input/backends/controller_tr2.def
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_UP, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_UP, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_DOWN, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_DOWN, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_LEFT, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_LEFT, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_RIGHT, BT_BUTTON, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_STEP_L, BT_AXIS, SDL_CONTROLLER_AXIS_TRIGGERLEFT, 1)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_STEP_R, BT_AXIS, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, 1)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_SLOW, BT_BUTTON, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_JUMP, BT_BUTTON, SDL_CONTROLLER_BUTTON_X, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_ACTION, BT_BUTTON, SDL_CONTROLLER_BUTTON_A, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_DRAW, BT_BUTTON, SDL_CONTROLLER_BUTTON_Y, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_LOOK, BT_BUTTON, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_ROLL, BT_BUTTON, SDL_CONTROLLER_BUTTON_B, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_OPTION, BT_BUTTON, SDL_CONTROLLER_BUTTON_BACK, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_MENU_CONFIRM, BT_BUTTON, SDL_CONTROLLER_BUTTON_A, 0)
INPUT_CONTROLLER_ASSIGN(INPUT_ROLE_MENU_BACK, BT_BUTTON, SDL_CONTROLLER_BUTTON_B, 0)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_UP, SDL_CONTROLLER_BUTTON_DPAD_UP)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_DOWN, SDL_CONTROLLER_BUTTON_DPAD_DOWN)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_LEFT, SDL_CONTROLLER_BUTTON_DPAD_LEFT)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_RIGHT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT)
INPUT_CONTROLLER_ASSIGN_AXIS(INPUT_ROLE_STEP_L, SDL_CONTROLLER_AXIS_TRIGGERLEFT, 1)
INPUT_CONTROLLER_ASSIGN_AXIS(INPUT_ROLE_STEP_R, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, 1)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_SLOW, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_JUMP, SDL_CONTROLLER_BUTTON_X)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_ACTION, SDL_CONTROLLER_BUTTON_A)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_DRAW, SDL_CONTROLLER_BUTTON_Y)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_LOOK, SDL_CONTROLLER_BUTTON_LEFTSHOULDER)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_ROLL, SDL_CONTROLLER_BUTTON_B)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_OPTION, SDL_CONTROLLER_BUTTON_BACK)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_MENU_CONFIRM, SDL_CONTROLLER_BUTTON_A)
INPUT_CONTROLLER_ASSIGN_BUTTON(INPUT_ROLE_MENU_BACK, SDL_CONTROLLER_BUTTON_B)
13 changes: 9 additions & 4 deletions src/libtrx/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(
'c',
default_options: [
'c_std=c2x',
'warning_level=2',
'warning_level=3',
],
meson_version: '>=1.3.0',
)
Expand All @@ -15,13 +15,18 @@ fs = import('fs')
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',
# common options
'-Wno-unused',
'-Wno-unused-parameter',
'-Wno-microsoft-anon-tag',
'-Wno-gnu-binary-literal',
'-Wno-gnu-empty-initializer',
'-Wno-gnu-zero-variadic-macro-arguments',
'-DMESON_BUILD',
'-fms-extensions',
'-fno-omit-frame-pointer',
# end of common options
'-fmacro-prefix-map=@0@/=libtrx/'.format(relative_dir),
'-DDWST_STATIC',
'-DPCRE2_STATIC',
'-DPCRE2_CODE_UNIT_WIDTH=8',
Expand Down
4 changes: 2 additions & 2 deletions src/tr1/game/camera/photo_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
static int32_t m_PhotoSpeed = 0;
static int32_t m_OldFOV;
static int32_t m_CurrentFOV;
static CAMERA_INFO m_OldCamera = { 0 };
static BOUNDS_32 m_WorldBounds = { 0 };
static CAMERA_INFO m_OldCamera = {};
static BOUNDS_32 m_WorldBounds = {};

static int32_t M_GetShiftSpeed(int32_t val);
static int32_t M_GetRotSpeed(void);
Expand Down
2 changes: 1 addition & 1 deletion src/tr1/game/gameflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef struct {
int quantity;
} GAME_FLOW_GIVE_ITEM_DATA;

GAME_FLOW g_GameFlow = { 0 };
GAME_FLOW g_GameFlow = {};

static int32_t M_StringToEnumType(
const char *const str, const STRING_TO_ENUM_TYPE *map);
Expand Down
4 changes: 2 additions & 2 deletions src/tr1/game/inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,7 @@ static void M_ItemPositions(INJECTION *injection)
const int16_t item_num = VFile_ReadS16(fp);
const int16_t y_rot = VFile_ReadS16(fp);

GAME_VECTOR pos = { 0 };
GAME_VECTOR pos = {};
if (injection->version > INJ_VERSION_4) {
pos.x = VFile_ReadS32(fp);
pos.y = VFile_ReadS32(fp);
Expand Down Expand Up @@ -1732,7 +1732,7 @@ void Inject_Cleanup(void)

INJECTION_MESH_META Inject_GetRoomMeshMeta(const int32_t room_index)
{
INJECTION_MESH_META summed_meta = { 0 };
INJECTION_MESH_META summed_meta = {};
if (m_Injections == NULL) {
return summed_meta;
}
Expand Down
Loading

0 comments on commit 6ec0290

Please sign in to comment.