Skip to content

Commit 94a8957

Browse files
committed
fix regression in DrawLara
1 parent f4f990e commit 94a8957

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/game/draw.c

+10-8
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,10 @@ void __cdecl DrawLara(ITEM_INFO* item)
470470
int16_t* frmptr[2];
471471
PHD_MATRIX saved_matrix;
472472

473-
int top = PhdTop;
474-
int left = PhdLeft;
475-
int bottom = PhdBottom;
476-
int right = PhdRight;
473+
int32_t top = PhdTop;
474+
int32_t left = PhdLeft;
475+
int32_t bottom = PhdBottom;
476+
int32_t right = PhdRight;
477477
PhdBottom = PhdWinMaxY;
478478
PhdTop = 0;
479479
PhdLeft = 0;
@@ -495,6 +495,7 @@ void __cdecl DrawLara(ITEM_INFO* item)
495495
object = &Objects[item->object_number];
496496
if (Lara.hit_direction >= 0) {
497497
switch (Lara.hit_direction) {
498+
default:
498499
case DIR_NORTH:
499500
frame = Anims[AA_SPAZ_FORWARD].frame_ptr;
500501
break;
@@ -583,7 +584,7 @@ void __cdecl DrawLara(ITEM_INFO* item)
583584

584585
phd_PopMatrix();
585586

586-
int fire_arms = 0;
587+
int32_t fire_arms = 0;
587588
if (Lara.gun_status == LGS_READY || Lara.gun_status == LGS_DRAW
588589
|| Lara.gun_status == LGS_UNDRAW) {
589590
fire_arms = Lara.gun_type;
@@ -830,7 +831,8 @@ void __cdecl CalculateObjectLighting(ITEM_INFO* item, int16_t* frame)
830831
}
831832

832833
void __cdecl DrawLaraInt(
833-
ITEM_INFO* item, int16_t* frame1, int16_t* frame2, int frac, int rate)
834+
ITEM_INFO* item, int16_t* frame1, int16_t* frame2, int32_t frac,
835+
int32_t rate)
834836
{
835837
PHD_MATRIX saved_matrix;
836838

@@ -913,7 +915,7 @@ void __cdecl DrawLaraInt(
913915

914916
phd_PopMatrix_I();
915917

916-
int fire_arms = 0;
918+
int32_t fire_arms = 0;
917919
if (Lara.gun_status == LGS_READY || Lara.gun_status == LGS_DRAW
918920
|| Lara.gun_status == LGS_UNDRAW) {
919921
fire_arms = Lara.gun_type;
@@ -1185,7 +1187,7 @@ void __cdecl phd_RotYXZpack_I(int32_t r1, int32_t r2)
11851187
PhdMatrixPtr = old_matrix;
11861188
}
11871189

1188-
void __cdecl phd_PutPolygons_I(int16_t* ptr, int clip)
1190+
void __cdecl phd_PutPolygons_I(int16_t* ptr, int32_t clip)
11891191
{
11901192
phd_PushMatrix();
11911193
InterpolateMatrix();

src/game/draw.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ void __cdecl DrawLara(ITEM_INFO* item);
2323
void __cdecl DrawGunFlash(int32_t weapon_type, int32_t clip);
2424
void __cdecl CalculateObjectLighting(ITEM_INFO* item, int16_t* frame);
2525
void __cdecl DrawLaraInt(
26-
ITEM_INFO* item, int16_t* frame1, int16_t* frame2, int frac, int rate);
26+
ITEM_INFO* item, int16_t* frame1, int16_t* frame2, int32_t frac,
27+
int32_t rate);
2728
void __cdecl InitInterpolate(int32_t frac, int32_t rate);
2829

2930
void __cdecl phd_PushMatrix_I();
@@ -36,7 +37,7 @@ void __cdecl phd_RotX_I(int16_t ang);
3637
void __cdecl phd_RotZ_I(int16_t ang);
3738
void __cdecl phd_RotYXZ_I(int16_t y, int16_t x, int16_t z);
3839
void __cdecl phd_RotYXZpack_I(int32_t r1, int32_t r2);
39-
void __cdecl phd_PutPolygons_I(int16_t* ptr, int clip);
40+
void __cdecl phd_PutPolygons_I(int16_t* ptr, int32_t clip);
4041

4142
void __cdecl InterpolateMatrix();
4243
void __cdecl InterpolateArmMatrix();

src/game/lara.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "util.h"
66

77
// clang-format off
8-
#define UpdateLaraRoom ((void __cdecl(*)(ITEM_INFO* item, int height))0x004126A0)
8+
#define UpdateLaraRoom ((void __cdecl(*)(ITEM_INFO* item, int32_t height))0x004126A0)
99
#define ShiftItem ((void __cdecl(*)(ITEM_INFO* item, COLL_INFO *coll))0x00412660)
1010
#define InitialiseEvilLara ((void __cdecl(*)(int16_t item_num))0x00428420)
1111
#define ControlEvilLara ((void __cdecl(*)(int16_t item_num))0x00428450)

0 commit comments

Comments
 (0)