Skip to content

Commit

Permalink
tr2: port Lift_Ceiling
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Oct 22, 2024
1 parent 2e2eb1f commit 05dc05e
Show file tree
Hide file tree
Showing 6 changed files with 24 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 @@ -3589,7 +3589,7 @@ typedef enum {
0x00435740 0x00D4 + void __cdecl Lift_Control(int16_t item_num);
0x00435820 0x0179 + void __cdecl Lift_FloorCeiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *floor, int32_t *ceiling);
0x004359A0 0x0035 + void __cdecl Lift_Floor(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height);
0x004359E0 0x0035 - void __cdecl Lift_Ceiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height);
0x004359E0 0x0035 + void __cdecl Lift_Ceiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height);
0x00435A20 0x0016 -R void __cdecl BridgeFlatFloor(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height);
0x00435A40 0x001B -R void __cdecl BridgeFlatCeiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height);
0x00435A60 0x003B -R int32_t __cdecl GetOffset(ITEM *item, int32_t x, int32_t z);
Expand Down
12 changes: 12 additions & 0 deletions src/tr2/game/objects/general/lift.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,15 @@ void __cdecl Lift_Floor(
*out_height = floor;
}
}

void __cdecl Lift_Ceiling(
const ITEM *const item, const int32_t x, const int32_t y, const int32_t z,
int32_t *const out_height)
{
int32_t floor;
int32_t height;
Lift_FloorCeiling(item, x, y, z, &floor, &height);
if (height > *out_height) {
*out_height = height;
}
}
2 changes: 2 additions & 0 deletions src/tr2/game/objects/general/lift.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ void __cdecl Lift_FloorCeiling(
int32_t *out_ceiling);
void __cdecl Lift_Floor(
const ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *out_height);
void __cdecl Lift_Ceiling(
const ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *out_height);
1 change: 0 additions & 1 deletion src/tr2/global/funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
#define DrawBridgeFloor ((void __cdecl (*)(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height))0x00435650)
#define DrawBridgeCeiling ((void __cdecl (*)(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height))0x00435690)
#define DrawBridgeCollision ((void __cdecl (*)(int16_t item_num, ITEM *lara_item, COLL_INFO *coll))0x004356D0)
#define Lift_Ceiling ((void __cdecl (*)(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height))0x004359E0)
#define BridgeFlatFloor ((void __cdecl (*)(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height))0x00435A20)
#define BridgeFlatCeiling ((void __cdecl (*)(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height))0x00435A40)
#define GetOffset ((int32_t __cdecl (*)(ITEM *item, int32_t x, int32_t z))0x00435A60)
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 @@ -1021,6 +1021,7 @@ static void M_Objects(const bool enable)
INJECT(enable, 0x00435740, Lift_Control);
INJECT(enable, 0x00435820, Lift_FloorCeiling);
INJECT(enable, 0x004359A0, Lift_Floor);
INJECT(enable, 0x004359E0, Lift_Ceiling);
INJECT(enable, 0x00435D70, Detonator_Control);
INJECT(enable, 0x00437E70, Pickup_Collision);
INJECT(enable, 0x004382F0, Switch_Collision);
Expand Down

0 comments on commit 05dc05e

Please sign in to comment.