port LaraDeflectEdgeJump

This commit is contained in:
rr- 2021-02-17 16:28:35 +01:00
parent 9f2d1935bc
commit acea05df14
4 changed files with 54 additions and 9 deletions

View file

@ -389,7 +389,7 @@
<rect width="12.00" height="12.00" x="504.00" y="115.00" fill="forestgreen"/>
<rect width="12.00" height="12.00" x="518.00" y="115.00" fill="forestgreen"/>
<rect width="12.00" height="12.00" x="532.00" y="115.00" fill="forestgreen"/>
<rect width="12.00" height="12.00" x="546.00" y="115.00" fill="lightpink"/>
<rect width="12.00" height="12.00" x="546.00" y="115.00" fill="forestgreen"/>
<rect width="12.00" height="12.00" x="560.00" y="115.00" fill="lightpink"/>
<rect width="12.00" height="12.00" x="574.00" y="115.00" fill="lightpink"/>
<rect width="12.00" height="12.00" x="588.00" y="115.00" fill="lightpink"/>
@ -1005,7 +1005,7 @@
<rect width="10.83" height="11.61" x="672.39" y="367.38" fill="lightpink"/>
<rect width="10.78" height="11.61" x="685.22" y="367.38" fill="lightpink"/>
<rect width="10.86" height="11.52" x="527.82" y="380.99" fill="lightpink"/>
<rect width="10.86" height="11.52" x="527.82" y="394.51" fill="lightpink"/>
<rect width="10.86" height="11.52" x="527.82" y="394.51" fill="forestgreen"/>
<rect width="10.86" height="11.35" x="527.82" y="408.04" fill="lightpink"/>
<rect width="10.86" height="11.29" x="527.82" y="421.38" fill="forestgreen"/>
<rect width="10.86" height="11.11" x="527.82" y="434.67" fill="lightpink"/>
@ -1403,10 +1403,10 @@
<rect width="-0.56" height="0.65" x="696.56" y="534.29" fill="mistyrose"/>
<rect width="0.16" height="-0.94" x="695.12" y="536.94" fill="mistyrose"/>
<rect width="-1.28" height="-0.94" x="697.28" y="536.94" fill="lightpink"/>
<rect width="12.00" height="12.00" x="0.00" y="564.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="570.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (count): 16.55%</text>
<rect width="12.00" height="12.00" x="0.00" y="582.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="588.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (bytesize): 8.57%</text>
<rect width="12.00" height="12.00" x="0.00" y="600.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="606.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (count): 67.76%</text>
<rect width="12.00" height="12.00" x="0.00" y="618.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="624.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (bytesize): 73.84%</text>
<rect width="12.00" height="12.00" x="0.00" y="564.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="570.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (count): 16.69%</text>
<rect width="12.00" height="12.00" x="0.00" y="582.50" fill="forestgreen"/><text alignment-baseline="central" x="17.00" y="588.50" style="font-family: sans-serif; font-size: 15px">Functions decompiled (bytesize): 8.67%</text>
<rect width="12.00" height="12.00" x="0.00" y="600.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="606.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (count): 67.62%</text>
<rect width="12.00" height="12.00" x="0.00" y="618.50" fill="lightpink"/><text alignment-baseline="central" x="17.00" y="624.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, but with known names (bytesize): 73.75%</text>
<rect width="12.00" height="12.00" x="0.00" y="636.50" fill="mistyrose"/><text alignment-baseline="central" x="17.00" y="642.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, with unknown names (count): 15.69%</text>
<rect width="12.00" height="12.00" x="0.00" y="654.50" fill="mistyrose"/><text alignment-baseline="central" x="17.00" y="660.50" style="font-family: sans-serif; font-size: 15px">Functions not decompiled, with unknown names (bytesize): 17.59%</text>
</svg>

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Before After
Before After

View file

@ -392,7 +392,7 @@ LaraColSwanDive 0x004250A0 0x00000089 +
LaraColFastDive 0x00425130 0x00000099 +
LaraSlideSlope 0x004251D0 0x00000176 +
LaraHangTest 0x00425350 0x00000229 +
LaraDeflectEdgeJump 0x004255A0 0x000000E4 -
LaraDeflectEdgeJump 0x004255A0 0x000000E4 +
TestLaraVault 0x004256C0 0x000001C8 -
LaraTestHangJump 0x00425890 0x0000024B -
LaraTestHangJumpUp 0x00425AE0 0x0000016A -

View file

@ -442,9 +442,10 @@ void __cdecl LaraAsCompress(ITEM_INFO* item, COLL_INFO* coll)
Lara.move_angle = item->pos.y_rot - 0x8000;
}
if (item->fall_speed > LARA_FASTFALL_SPEED)
if (item->fall_speed > LARA_FASTFALL_SPEED) {
item->goal_anim_state = AS_FASTFALL;
}
}
void __cdecl LaraAsBack(ITEM_INFO* item, COLL_INFO* coll)
{
@ -1728,6 +1729,49 @@ int32_t __cdecl LaraDeflectEdge(ITEM_INFO* item, COLL_INFO* coll)
return 0;
}
void __cdecl LaraDeflectEdgeJump(ITEM_INFO* item, COLL_INFO* coll)
{
ShiftItem(item, coll);
switch (coll->coll_type) {
case COLL_LEFT:
item->pos.y_rot += LARA_DEF_ADD_EDGE;
break;
case COLL_RIGHT:
item->pos.y_rot -= LARA_DEF_ADD_EDGE;
break;
case COLL_FRONT:
case COLL_TOPFRONT:
item->goal_anim_state = AS_FASTFALL;
item->current_anim_state = AS_FASTFALL;
item->anim_number = AA_FASTFALL;
item->frame_number = AF_FASTFALL;
item->speed /= 4;
Lara.move_angle += -PHD_ONE / 2;
if (item->fall_speed <= 0) {
item->fall_speed = 1;
}
break;
case COLL_TOP:
if (item->fall_speed <= 0) {
item->fall_speed = 1;
}
break;
case COLL_CLAMP:
item->pos.z -= (phd_cos(coll->facing) * 100) >> W2V_SHIFT;
item->pos.x -= (phd_sin(coll->facing) * 100) >> W2V_SHIFT;
item->speed = 0;
coll->mid_floor = 0;
if (item->fall_speed <= 0) {
item->fall_speed = 16;
}
break;
}
}
void __cdecl LaraSlideEdgeJump(ITEM_INFO* item, COLL_INFO* coll)
{
ShiftItem(item, coll);
@ -1843,4 +1887,5 @@ void TR1MInjectLara()
INJECT(0x004251D0, LaraSlideSlope);
INJECT(0x00425350, LaraHangTest);
INJECT(0x004255A0, LaraDeflectEdgeJump);
}

View file

@ -12,7 +12,6 @@
#define AnimateLara ((void __cdecl(*)(ITEM_INFO* item))0x00427C00)
#define LaraGun ((void __cdecl(*)())0x00426BD0)
#define LaraWaterCurrent ((void __cdecl(*)(COLL_INFO* coll))0x00429440)
#define LaraDeflectEdgeJump ((void __cdecl(*)(ITEM_INFO *item, COLL_INFO* coll))0x004255A0)
#define LaraLandedBad ((int32_t __cdecl(*)(ITEM_INFO *item, COLL_INFO* coll))0x00425D70)
#define LaraTestHangJump ((int32_t __cdecl(*)(ITEM_INFO *item, COLL_INFO *coll))0x00425890)
#define LaraTestHangJumpUp ((int32_t __cdecl(*)(ITEM_INFO *item, COLL_INFO *coll))0x00425AE0)
@ -107,6 +106,7 @@ void __cdecl LaraSlideSlope(ITEM_INFO* item, COLL_INFO* coll);
int32_t __cdecl LaraHitCeiling(ITEM_INFO* item, COLL_INFO* coll);
void __cdecl LaraHangTest(ITEM_INFO* item, COLL_INFO* coll);
int32_t __cdecl LaraDeflectEdge(ITEM_INFO* item, COLL_INFO* coll);
void __cdecl LaraDeflectEdgeJump(ITEM_INFO* item, COLL_INFO* coll);
void __cdecl LaraSlideEdgeJump(ITEM_INFO* item, COLL_INFO* coll);
int16_t __cdecl LaraFloorFront(ITEM_INFO* item, PHD_ANGLE ang, int32_t dist);
void __cdecl UseItem(__int16 object_num);