port Lara_State_Wade

This commit is contained in:
Marcin Kurczewski 2023-10-06 09:13:08 +02:00
parent 02c64a7af3
commit 20a6fe972c
No known key found for this signature in database
GPG Key ID: CC65E6FD28CAE42A
7 changed files with 43 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">8.50% (102)</tspan> · <tspan class="known">89.08% (1069)</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">8.58% (103)</tspan> · <tspan class="known">89% (1068)</tspan> · <tspan class="todo">0.67% (8)</tspan> · <tspan class="unused">1.75% (21)</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="63.50" height="6" x="0" y="0" class="decompiled"/>
<rect width="665.45" height="6" x="63.50" y="0" class="known"/>
<rect width="64.12" height="6" x="0" y="0" class="decompiled"/>
<rect width="664.83" height="6" x="64.12" 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>
@ -504,7 +504,7 @@
<rect width="12" height="12" x="360" y="120" class="decompiled"><title>void __cdecl Lara_State_SwanDive(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="375" y="120" class="decompiled"><title>void __cdecl Lara_State_FastDive(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="390" y="120" class="decompiled"><title>void __cdecl Lara_State_WaterOut(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="405" y="120" class="known"><title>void __cdecl Lara_State_Wade(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="405" y="120" class="decompiled"><title>void __cdecl Lara_State_Wade(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="420" y="120" class="known"><title>void __cdecl Lara_State_DeathSlide(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="435" y="120" class="known"><title>void __cdecl Lara_StateExtra_Breath(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="12" height="12" x="450" y="120" class="known"><title>void __cdecl Lara_StateExtra_YetiKill(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">4.82%</tspan> · <tspan class="known">94.85%</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">4.88%</tspan> · <tspan class="known">94.79%</tspan> · <tspan class="todo">0.02%</tspan> · <tspan class="unused">0.31%</tspan></tspan></text>
<g transform="translate(0 20)">
<rect width="35.97" height="6" x="0" y="0" class="decompiled"/>
<rect width="708.56" height="6" x="35.97" y="0" class="known"/>
<rect width="36.42" height="6" x="0" y="0" class="decompiled"/>
<rect width="708.12" height="6" x="36.42" 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>
@ -1722,7 +1722,7 @@
<rect width="9.76" height="9.93" x="519.71" y="198.80" class="known"><title>void __cdecl Demo_LoadLaraPos(void);</title></rect>
<rect width="9.76" height="9.81" x="519.71" y="211.73" class="known"><title>void __cdecl Output_InsertFlatRect(int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t z, uint8_t color_idx);</title></rect>
<rect width="9.76" height="9.81" x="519.71" y="224.53" class="known"><title>int32_t __cdecl Item_TestBoundsCollide(struct ITEM_INFO *src_item, struct ITEM_INFO *dst_item, int32_t radius);</title></rect>
<rect width="9.76" height="9.74" x="519.71" y="237.34" class="known"><title>void __cdecl Lara_State_Wade(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="9.76" height="9.74" x="519.71" y="237.34" class="decompiled"><title>void __cdecl Lara_State_Wade(struct ITEM_INFO *item, struct COLL_INFO *coll);</title></rect>
<rect width="9.76" height="9.68" x="519.71" y="250.08" class="known"><title>void __cdecl DInputKeyboardCreate(void);</title></rect>
<rect width="9.76" height="9.62" x="519.71" y="262.76" class="known"><title>void __cdecl Room_GetNearbyRooms(int32_t x, int32_t y, int32_t z, int32_t r, int32_t h, int16_t room_num);</title></rect>
<rect width="9.76" height="9.62" x="519.71" y="275.38" class="known"><title>BYTE __cdecl FindNearestPaletteEntry(RGB888 *palette, int32_t red, int32_t green, int32_t blue, bool ignoreSysPalette);</title></rect>

Before

Width:  |  Height:  |  Size: 357 KiB

After

Width:  |  Height:  |  Size: 357 KiB

View File

@ -1517,7 +1517,7 @@ typedef enum LARA_GUN_STATE {
00428590 0000002F + void __cdecl Lara_State_SwanDive(struct ITEM_INFO *item, struct COLL_INFO *coll);
004285C0 00000054 + void __cdecl Lara_State_FastDive(struct ITEM_INFO *item, struct COLL_INFO *coll);
00428620 00000015 + void __cdecl Lara_State_WaterOut(struct ITEM_INFO *item, struct COLL_INFO *coll);
00428640 000000CA * void __cdecl Lara_State_Wade(struct ITEM_INFO *item, struct COLL_INFO *coll);
00428640 000000CA + void __cdecl Lara_State_Wade(struct ITEM_INFO *item, struct COLL_INFO *coll);
00428710 00000096 - void __cdecl Lara_State_DeathSlide(struct ITEM_INFO *item, struct COLL_INFO *coll);
004287B0 0000004C - void __cdecl Lara_StateExtra_Breath(struct ITEM_INFO *item, struct COLL_INFO *coll);
00428800 00000047 - void __cdecl Lara_StateExtra_YetiKill(struct ITEM_INFO *item, struct COLL_INFO *coll);

View File

@ -619,3 +619,34 @@ void __cdecl Lara_State_WaterOut(struct ITEM_INFO *item, struct COLL_INFO *coll)
coll->enable_baddie_push = 0;
g_Camera.flags = CF_FOLLOW_CENTRE;
}
void __cdecl Lara_State_Wade(struct ITEM_INFO *item, struct COLL_INFO *coll)
{
if (item->hit_points <= 0) {
item->goal_anim_state = LS_STOP;
return;
}
g_Camera.target_elevation = CAM_WADE_ELEVATION;
if (g_Input & IN_LEFT) {
g_Lara.turn_rate -= LARA_TURN_RATE;
CLAMPL(g_Lara.turn_rate, -LARA_FAST_TURN);
item->pos.z_rot -= LARA_LEAN_RATE;
CLAMPL(item->pos.z_rot, -LARA_LEAN_MAX);
} else if (g_Input & IN_RIGHT) {
g_Lara.turn_rate += LARA_TURN_RATE;
CLAMPG(g_Lara.turn_rate, LARA_FAST_TURN);
item->pos.z_rot += LARA_LEAN_RATE;
CLAMPG(item->pos.z_rot, LARA_LEAN_MAX);
}
if (g_Input & IN_FORWARD) {
if (g_Lara.water_status != LWS_ABOVE_WATER) {
item->goal_anim_state = LS_WADE;
} else {
item->goal_anim_state = IN_FORWARD;
}
} else {
item->goal_anim_state = LS_STOP;
}
}

View File

@ -63,3 +63,4 @@ void __cdecl Lara_State_FastDive(
struct ITEM_INFO *item, struct COLL_INFO *coll);
void __cdecl Lara_State_WaterOut(
struct ITEM_INFO *item, struct COLL_INFO *coll);
void __cdecl Lara_State_Wade(struct ITEM_INFO *item, struct COLL_INFO *coll);

View File

@ -60,3 +60,4 @@
#define CAM_USE_KEY_DISTANCE WALL_L // = 1024
#define CAM_SPECIAL_ANGLE (170 * PHD_DEGREE) // = 30940
#define CAM_SPECIAL_ELEVATION (-25 * PHD_DEGREE) // = -4550
#define CAM_WADE_ELEVATION (-22 * PHD_DEGREE) // = -4004

View File

@ -373,7 +373,6 @@
#define Lara_LookUpDown ((void __cdecl (*)(void))0x00427720)
#define Lara_LookLeftRight ((void __cdecl (*)(void))0x00427790)
#define Lara_ResetLook ((void __cdecl (*)(void))0x00427810)
#define Lara_State_Wade ((void __cdecl (*)(struct ITEM_INFO *item, struct COLL_INFO *coll))0x00428640)
#define Lara_State_DeathSlide ((void __cdecl (*)(struct ITEM_INFO *item, struct COLL_INFO *coll))0x00428710)
#define Lara_StateExtra_Breath ((void __cdecl (*)(struct ITEM_INFO *item, struct COLL_INFO *coll))0x004287B0)
#define Lara_StateExtra_YetiKill ((void __cdecl (*)(struct ITEM_INFO *item, struct COLL_INFO *coll))0x00428800)

View File

@ -119,6 +119,7 @@ static void Inject_Lara_State(void)
INJECT(1, 0x00428590, Lara_State_SwanDive);
INJECT(1, 0x004285C0, Lara_State_FastDive);
INJECT(1, 0x00428620, Lara_State_WaterOut);
INJECT(1, 0x00428640, Lara_State_Wade);
}
static void Inject_S_Audio_Sample(void)