diff --git a/docs/progress.svg b/docs/progress.svg index 654df8a..c5b0a35 100644 --- a/docs/progress.svg +++ b/docs/progress.svg @@ -69,10 +69,10 @@ Tomb2.exe progress according to the physical function order: -59.52% (725) · 38.01% (463) · 0% (0) · 2.46% (30) +59.61% (726) · 37.93% (462) · 0% (0) · 2.46% (30) - - + + @@ -428,7 +428,7 @@ void __cdecl Inv_Ring_CalcAdders(RING_INFO *ring, int16_t rotation_duration); void __cdecl Inv_Ring_DoMotions(RING_INFO *ring); void __cdecl Inv_Ring_RotateLeft(RING_INFO *ring); -void __cdecl Inv_Ring_RotateRight(RING_INFO *ring); +void __cdecl Inv_Ring_RotateRight(RING_INFO *ring); void __cdecl Inv_Ring_MotionInit(RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target); void __cdecl Inv_Ring_MotionSetup(RING_INFO *ring, int16_t status, int16_t status_target, int16_t frames); void __cdecl Inv_Ring_MotionRadius(RING_INFO *ring, int16_t target); @@ -1298,10 +1298,10 @@ Tomb2.exe progress according to the function sizes: -64.01% · 35.67% · 0% · 0.33% +64.02% · 35.65% · 0% · 0.33% - - + + @@ -2294,7 +2294,7 @@ void __cdecl Creature_Initialise(int16_t item_num); int32_t __cdecl Room_FindGridShift(int32_t src, int32_t dst); void __cdecl Inv_Ring_RotateLeft(RING_INFO *ring); -void __cdecl Inv_Ring_RotateRight(RING_INFO *ring); +void __cdecl Inv_Ring_RotateRight(RING_INFO *ring); void __cdecl Lara_State_SwanDive(ITEM_INFO *item, COLL_INFO *coll); void __cdecl BridgeTilt2Floor(ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int32_t *height); sub_4471C0 diff --git a/docs/progress.txt b/docs/progress.txt index ef344e3..5870b41 100644 --- a/docs/progress.txt +++ b/docs/progress.txt @@ -3226,7 +3226,7 @@ typedef enum { 0x004251B0 0x002C + void __cdecl Inv_Ring_CalcAdders(RING_INFO *ring, int16_t rotation_duration); 0x004251E0 0x013E + void __cdecl Inv_Ring_DoMotions(RING_INFO *ring); 0x00425320 0x002F + void __cdecl Inv_Ring_RotateLeft(RING_INFO *ring); -0x00425350 0x002F - void __cdecl Inv_Ring_RotateRight(RING_INFO *ring); +0x00425350 0x002F + void __cdecl Inv_Ring_RotateRight(RING_INFO *ring); 0x00425380 0x0063 - void __cdecl Inv_Ring_MotionInit(RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target); 0x004253F0 0x002C - void __cdecl Inv_Ring_MotionSetup(RING_INFO *ring, int16_t status, int16_t status_target, int16_t frames); 0x00425420 0x0026 - void __cdecl Inv_Ring_MotionRadius(RING_INFO *ring, int16_t target); diff --git a/src/game/inventory/ring.c b/src/game/inventory/ring.c index 46f41b0..de424e0 100644 --- a/src/game/inventory/ring.c +++ b/src/game/inventory/ring.c @@ -176,3 +176,15 @@ void __cdecl Inv_Ring_RotateLeft(RING_INFO *const ring) ring->rot_count = RING_ROTATE_DURATION; ring->rot_adder = ring->rot_adder_l; } + +void __cdecl Inv_Ring_RotateRight(RING_INFO *const ring) +{ + ring->rotating = 1; + if (ring->current_object + 1 >= ring->number_of_objects) { + ring->target_object = 0; + } else { + ring->target_object = ring->current_object + 1; + } + ring->rot_count = RING_ROTATE_DURATION; + ring->rot_adder = ring->rot_adder_r; +} diff --git a/src/game/inventory/ring.h b/src/game/inventory/ring.h index cd2083e..4418b92 100644 --- a/src/game/inventory/ring.h +++ b/src/game/inventory/ring.h @@ -10,3 +10,4 @@ void __cdecl Inv_Ring_Light(const RING_INFO *ring); void __cdecl Inv_Ring_CalcAdders(RING_INFO *ring, int16_t rotation_duration); void __cdecl Inv_Ring_DoMotions(RING_INFO *ring); void __cdecl Inv_Ring_RotateLeft(RING_INFO *ring); +void __cdecl Inv_Ring_RotateRight(RING_INFO *ring); diff --git a/src/global/funcs.h b/src/global/funcs.h index 0386de2..8880ecc 100644 --- a/src/global/funcs.h +++ b/src/global/funcs.h @@ -105,7 +105,6 @@ #define Inv_RemoveAllItems ((void __cdecl (*)(void))0x00424CB0) #define Inv_RemoveItem ((int32_t __cdecl (*)(GAME_OBJECT_ID object_num))0x00424CD0) #define RemoveInventoryText ((void __cdecl (*)(void))0x00424FD0) -#define Inv_Ring_RotateRight ((void __cdecl (*)(RING_INFO *ring))0x00425350) #define Inv_Ring_MotionInit ((void __cdecl (*)(RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target))0x00425380) #define Inv_Ring_MotionSetup ((void __cdecl (*)(RING_INFO *ring, int16_t status, int16_t status_target, int16_t frames))0x004253F0) #define Inv_Ring_MotionRadius ((void __cdecl (*)(RING_INFO *ring, int16_t target))0x00425420) diff --git a/src/inject_exec.c b/src/inject_exec.c index 58d27bd..674a7d5 100644 --- a/src/inject_exec.c +++ b/src/inject_exec.c @@ -628,6 +628,7 @@ static void Inject_Inventory(const bool enable) INJECT(enable, 0x004251B0, Inv_Ring_CalcAdders); INJECT(enable, 0x004251E0, Inv_Ring_DoMotions); INJECT(enable, 0x00425320, Inv_Ring_RotateLeft); + INJECT(enable, 0x00425350, Inv_Ring_RotateRight); } static void Inject_Lara_Control(const bool enable)