port Lara_State_ClimbStance

This commit is contained in:
Marcin Kurczewski 2023-10-07 08:41:04 +02:00
parent c02085ba5d
commit 6cb449e02f
No known key found for this signature in database
GPG Key ID: CC65E6FD28CAE42A
7 changed files with 35 additions and 10 deletions

View File

@ -69,10 +69,10 @@
</g>
<g transform="translate(0 116)">
<text x="0" y="7.50">Tomb2.exe progress according to the physical function order:</text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">12.50% (150)</tspan> · <tspan class="known">85.08% (1021)</tspan> · <tspan class="todo">0.67% (8)</tspan> · <tspan class="unused">1.75% (21)</tspan></tspan></text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">12.58% (151)</tspan> · <tspan class="known">85% (1020)</tspan> · <tspan class="todo">0.67% (8)</tspan> · <tspan class="unused">1.75% (21)</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="93.38" height="6" x="0" y="0" class="decompiled"/>
<rect width="635.57" height="6" x="93.38" y="0" class="known"/>
<rect width="94" height="6" x="0" y="0" class="decompiled"/>
<rect width="634.95" height="6" x="94" y="0" class="known"/>
<rect width="4.98" height="6" x="728.95" y="0" class="todo"/>
<rect width="13.07" height="6" x="733.93" y="0" class="unused"/>
</g>
@ -596,7 +596,7 @@
<rect width="12" height="12" x="240" y="150" class="known"><title>void __cdecl AnimatePistols(int32_t weapon_type);</title></rect>
<rect width="12" height="12" x="255" y="150" class="decompiled"><title>void __cdecl Lara_State_ClimbLeft(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="270" y="150" class="decompiled"><title>void __cdecl Lara_State_ClimbRight(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="285" y="150" class="known"><title>void __cdecl Lara_State_ClimbStance(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="285" y="150" class="decompiled"><title>void __cdecl Lara_State_ClimbStance(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="300" y="150" class="known"><title>void __cdecl Lara_State_Climbing(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="315" y="150" class="known"><title>void __cdecl Lara_State_ClimbEnd(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="330" y="150" class="known"><title>void __cdecl Lara_State_ClimbDown(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
@ -1281,10 +1281,10 @@
</g>
<g transform="translate(0 531)">
<text x="0" y="7.50">Tomb2.exe progress according to the function sizes:</text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">6.62%</tspan> · <tspan class="known">93.05%</tspan> · <tspan class="todo">0.02%</tspan> · <tspan class="unused">0.31%</tspan></tspan></text>
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">6.66%</tspan> · <tspan class="known">93.01%</tspan> · <tspan class="todo">0.02%</tspan> · <tspan class="unused">0.31%</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="49.48" height="6" x="0" y="0" class="decompiled"/>
<rect width="695.05" height="6" x="49.48" y="0" class="known"/>
<rect width="49.74" height="6" x="0" y="0" class="decompiled"/>
<rect width="694.80" height="6" x="49.74" y="0" class="known"/>
<rect width="0.13" height="6" x="744.54" y="0" class="todo"/>
<rect width="2.33" height="6" x="744.67" y="0" class="unused"/>
</g>
@ -1942,7 +1942,7 @@
<rect width="6.80" height="6.70" x="588.11" y="239.89" class="known"><title>void __cdecl Lara_State_Glide(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="6.80" height="6.70" x="588.11" y="249.58" class="known"><title>bool __cdecl GetRegistryBoolValue(LPCTSTR lpValueName, bool *pValue, bool defaultValue);</title></rect>
<rect width="6.80" height="6.62" x="588.11" y="259.28" class="known"><title>int16_t __cdecl Lara_FloorFront(struct ITEM_INFO *item, PHD_ANGLE ang, int32_t dist);</title></rect>
<rect width="6.80" height="6.62" x="588.11" y="268.90" class="known"><title>void __cdecl Lara_State_ClimbStance(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="6.80" height="6.62" x="588.11" y="268.90" class="decompiled"><title>void __cdecl Lara_State_ClimbStance(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="6.80" height="6.53" x="588.11" y="278.51" class="known"><title>void __cdecl InitialiseHair(void);</title></rect>
<rect width="6.80" height="6.53" x="588.11" y="288.05" class="decompiled"><title>void __cdecl Lara_Col_Jumper(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="6.80" height="6.45" x="588.11" y="297.58" class="known"><title>void __cdecl GameWindowCalculateSizeFromClient(int32_t *width, int32_t *height);</title></rect>

Before

Width:  |  Height:  |  Size: 357 KiB

After

Width:  |  Height:  |  Size: 357 KiB

View File

@ -1654,7 +1654,7 @@ typedef enum LARA_GUN_STATE {
# game/laraclimb.c
0042D850 00000035 + void __cdecl Lara_State_ClimbLeft(struct ITEM_INFO *item, struct COLL_INFO *coll);
0042D890 00000035 + void __cdecl Lara_State_ClimbRight(struct ITEM_INFO *item, struct COLL_INFO *coll);
0042D8D0 00000075 - void __cdecl Lara_State_ClimbStance(struct ITEM_INFO *item, struct COLL_INFO *coll);
0042D8D0 00000075 + void __cdecl Lara_State_ClimbStance(struct ITEM_INFO *item, struct COLL_INFO *coll);
0042D950 00000014 - void __cdecl Lara_State_Climbing(struct ITEM_INFO *item, struct COLL_INFO *coll);
0042D970 0000001E - void __cdecl Lara_State_ClimbEnd(struct ITEM_INFO *item, struct COLL_INFO *coll);
0042D990 00000014 - void __cdecl Lara_State_ClimbDown(struct ITEM_INFO *item, struct COLL_INFO *coll);

View File

@ -846,3 +846,25 @@ void __cdecl Lara_State_ClimbRight(
item->goal_anim_state = LS_CLIMB_STANCE;
}
}
void __cdecl Lara_State_ClimbStance(
struct ITEM_INFO *item, struct COLL_INFO *coll)
{
coll->enable_spaz = 0;
coll->enable_baddie_push = 0;
g_Camera.target_elevation = CAM_CLIMB_STANCE_ELEVATION;
if (g_Input & IN_LOOK) {
Lara_LookUpDown();
}
if ((g_Input & IN_LEFT) || (g_Input & IN_STEP_LEFT)) {
item->goal_anim_state = LS_CLIMB_LEFT;
} else if ((g_Input & IN_RIGHT) || (g_Input & IN_STEP_RIGHT)) {
item->goal_anim_state = LS_CLIMB_RIGHT;
} else if ((g_Input & IN_JUMP)) {
item->goal_anim_state = LS_BACK_JUMP;
g_Lara.gun_status = LGS_ARMLESS;
g_Lara.move_angle = item->pos.y_rot + PHD_180;
}
}

View File

@ -90,3 +90,5 @@ void __cdecl Lara_State_ClimbLeft(
struct ITEM_INFO *item, struct COLL_INFO *coll);
void __cdecl Lara_State_ClimbRight(
struct ITEM_INFO *item, struct COLL_INFO *coll);
void __cdecl Lara_State_ClimbStance(
struct ITEM_INFO *item, struct COLL_INFO *coll);

View File

@ -81,3 +81,4 @@
#define CAM_CLIMB_LEFT_ELEVATION (-15 * PHD_DEGREE) // = -2730
#define CAM_CLIMB_RIGHT_ANGLE (-CAM_CLIMB_LEFT_ANGLE) // = 5460
#define CAM_CLIMB_RIGHT_ELEVATION CAM_CLIMB_LEFT_ELEVATION // = -2730
#define CAM_CLIMB_STANCE_ELEVATION (-20 * PHD_DEGREE) // = -3640

View File

@ -417,7 +417,6 @@
#define undraw_pistol_mesh_right ((void __cdecl (*)(int32_t weapon_type))0x0042D350)
#define PistolHandler ((void __cdecl (*)(int32_t weapon_type))0x0042D390)
#define AnimatePistols ((void __cdecl (*)(int32_t weapon_type))0x0042D520)
#define Lara_State_ClimbStance ((void __cdecl (*)(struct ITEM_INFO *item, struct COLL_INFO *coll))0x0042D8D0)
#define Lara_State_Climbing ((void __cdecl (*)(struct ITEM_INFO *item, struct COLL_INFO *coll))0x0042D950)
#define Lara_State_ClimbEnd ((void __cdecl (*)(struct ITEM_INFO *item, struct COLL_INFO *coll))0x0042D970)
#define Lara_State_ClimbDown ((void __cdecl (*)(struct ITEM_INFO *item, struct COLL_INFO *coll))0x0042D990)

View File

@ -135,6 +135,7 @@ static void Inject_Lara_State(void)
INJECT(1, 0x00428B50, Lara_State_Extra_FinalAnim);
INJECT(1, 0x0042D850, Lara_State_ClimbLeft);
INJECT(1, 0x0042D890, Lara_State_ClimbRight);
INJECT(1, 0x0042D8D0, Lara_State_ClimbStance);
}
static void Inject_Lara_Col(void)