From 7121bc717c262599b261d56edbf964137b7f540e Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Mon, 6 Nov 2023 19:03:57 -0300 Subject: [PATCH] Initialize these variables --- src/hardware/hw_main.c | 8 +++----- src/r_things.c | 7 +++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 481d4bb77..9108df023 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4978,7 +4978,7 @@ static void HWR_ProjectSprite(mobj_t *thing) spriteinfo_t *sprinfo = NULL; #endif md2_t *md2; - unsigned rot; + unsigned rot = 0; UINT16 flip = 0; boolean vflip = (!(thing->eflags & MFE_VERTICALFLIP) != !R_ThingVerticallyFlipped(thing)); boolean mirrored = thing->mirrored; @@ -4992,8 +4992,8 @@ static void HWR_ProjectSprite(mobj_t *thing) float z1, z2; patch_t *gpatch = NULL; - fixed_t spr_width, spr_height; - fixed_t spr_offset, spr_topoffset; + fixed_t spr_width = 0, spr_height = 0; + fixed_t spr_offset = 0, spr_topoffset = 0; #ifdef ROTSPRITE patch_t *rotsprite = NULL; INT32 rollangle = 0; @@ -5204,9 +5204,7 @@ static void HWR_ProjectSprite(mobj_t *thing) rollangle = R_GetRollAngle(InvAngle(spriterotangle)); } else - { rollangle = R_GetRollAngle(spriterotangle); - } if (using_sprite) rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle); diff --git a/src/r_things.c b/src/r_things.c index c0d6f5d43..9f8e2a0d8 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1549,7 +1549,7 @@ static void R_ProjectSprite(mobj_t *thing) INT32 trans; vissprite_t *vis; - patch_t *patch; + patch_t *patch = NULL; spritecut_e cut = SC_NONE; @@ -1577,9 +1577,8 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t this_scale; fixed_t spritexscale, spriteyscale; - // rotsprite - fixed_t spr_width, spr_height; - fixed_t spr_offset, spr_topoffset; + fixed_t spr_width = 0, spr_height = 0; + fixed_t spr_offset = 0, spr_topoffset = 0; #ifdef ROTSPRITE patch_t *rotsprite = NULL;