diff --git a/docs/tr2/progress.svg b/docs/tr2/progress.svg index c94457fdc..5802384ca 100644 --- a/docs/tr2/progress.svg +++ b/docs/tr2/progress.svg @@ -69,10 +69,10 @@ Tomb2.exe progress according to the physical function order: -67.68% (842) · 29.90% (372) · 0% (0) · 2.41% (30) +67.77% (843) · 29.82% (371) · 0% (0) · 2.41% (30) - - + + @@ -719,7 +719,7 @@ void __cdecl Lift_Control(int16_t item_num); void __cdecl Lift_FloorCeiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *floor, int32_t *ceiling); void __cdecl Lift_Floor(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height); -void __cdecl Lift_Ceiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height); +void __cdecl Lift_Ceiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height); void __cdecl BridgeFlatFloor(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height); void __cdecl BridgeFlatCeiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height); int32_t __cdecl GetOffset(ITEM *item, int32_t x, int32_t z); @@ -1324,10 +1324,10 @@ Tomb2.exe progress according to the function sizes: -72.90% · 26.78% · 0% · 0.33% +72.91% · 26.76% · 0% · 0.33% - - + + @@ -2271,7 +2271,7 @@ void __cdecl Lara_State_ClimbRight(ITEM *item, COLL_INFO *coll); void __cdecl Lift_Initialise(int16_t item_num); void __cdecl Lift_Floor(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height); -void __cdecl Lift_Ceiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height); +void __cdecl Lift_Ceiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height); void __cdecl BridgeTilt1Ceiling(ITEM *item, int32_t x, int32_t y, int32_t z, int32_t *height); void __cdecl ReadSG(void *pointer, int32_t size); void __cdecl WinVidSetGameWindowSize(int32_t width, int32_t height); diff --git a/docs/tr2/progress.txt b/docs/tr2/progress.txt index e00730eda..35782ea20 100644 --- a/docs/tr2/progress.txt +++ b/docs/tr2/progress.txt @@ -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); diff --git a/src/tr2/game/objects/general/lift.c b/src/tr2/game/objects/general/lift.c index 542a47897..da92646a9 100644 --- a/src/tr2/game/objects/general/lift.c +++ b/src/tr2/game/objects/general/lift.c @@ -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; + } +} diff --git a/src/tr2/game/objects/general/lift.h b/src/tr2/game/objects/general/lift.h index 58dec6d36..9856a2586 100644 --- a/src/tr2/game/objects/general/lift.h +++ b/src/tr2/game/objects/general/lift.h @@ -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); diff --git a/src/tr2/global/funcs.h b/src/tr2/global/funcs.h index 3c47bc1f0..e4ec8f5d8 100644 --- a/src/tr2/global/funcs.h +++ b/src/tr2/global/funcs.h @@ -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) diff --git a/src/tr2/inject_exec.c b/src/tr2/inject_exec.c index 01e5414c9..76378cf61 100644 --- a/src/tr2/inject_exec.c +++ b/src/tr2/inject_exec.c @@ -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);