Skip to content

Commit

Permalink
tr2: port MovableBlock_Draw
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Oct 17, 2024
1 parent bd27a64 commit 38b4738
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
16 changes: 8 additions & 8 deletions docs/tr2/progress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/tr2/progress.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3530,7 +3530,7 @@ typedef enum {
0x00433D20 0x0137 + int32_t __cdecl MovableBlock_TestPush(ITEM *item, int32_t block_height, uint16_t quadrant);
0x00433E70 0x0225 + int32_t __cdecl MovableBlock_TestPull(ITEM *item, int32_t block_height, uint16_t quadrant);
0x004340B0 0x00BB + void __cdecl Room_AlterFloorHeight(ITEM *item, int32_t height);
0x00434170 0x0022 - void __cdecl MovableBlock_Draw(const ITEM *item);
0x00434170 0x0022 + void __cdecl MovableBlock_Draw(const ITEM *item);
0x004341A0 0x006B - void __cdecl Object_DrawUnclippedItem(const ITEM *item);

# game/objects.c
Expand Down
9 changes: 9 additions & 0 deletions src/tr2/game/objects/general/movable_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,12 @@ void __cdecl MovableBlock_Collision(
Lara_Animate(lara_item);
}
}

void __cdecl MovableBlock_Draw(const ITEM *const item)
{
if (item->status == IS_ACTIVE) {
Object_DrawUnclippedItem(item);
} else {
Object_DrawAnimatingItem(item);
}
}
2 changes: 2 additions & 0 deletions src/tr2/game/objects/general/movable_block.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ void __cdecl MovableBlock_Control(int16_t item_num);

void __cdecl MovableBlock_Collision(
int16_t item_num, ITEM *lara_item, COLL_INFO *coll);

void __cdecl MovableBlock_Draw(const ITEM *item);
1 change: 0 additions & 1 deletion src/tr2/global/funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
#define ControlMissile ((void __cdecl (*)(int16_t fx_num))0x00432FE0)
#define ShootAtLara ((void __cdecl (*)(FX *fx))0x004332B0)
#define BodyPart_Control ((void __cdecl (*)(int16_t fx_num))0x004336F0)
#define MovableBlock_Draw ((void __cdecl (*)(const ITEM *item))0x00434170)
#define Object_DrawUnclippedItem ((void __cdecl (*)(const ITEM *item))0x004341A0)
#define EarthQuake ((void __cdecl (*)(int16_t item_num))0x00434210)
#define ControlCutShotgun ((void __cdecl (*)(int16_t item_num))0x004342F0)
Expand Down
1 change: 1 addition & 0 deletions src/tr2/inject_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@ static void M_Objects(const bool enable)
INJECT(enable, 0x00433CD0, MovableBlock_TestDestination);
INJECT(enable, 0x00433D20, MovableBlock_TestPush);
INJECT(enable, 0x00433E70, MovableBlock_TestPull);
INJECT(enable, 0x00434170, MovableBlock_Draw);
INJECT(enable, 0x00434400, FinalLevelCounter_Control);
INJECT(enable, 0x00434800, GongBonger_Control);
INJECT(enable, 0x004348C0, Zipline_Collision);
Expand Down

0 comments on commit 38b4738

Please sign in to comment.