mirror of
https://github.com/LostArtefacts/TR2X.git
synced 2025-01-07 22:03:19 +00:00
port Output_XGen_XGUVPerspFP
This commit is contained in:
parent
a2b46c0e10
commit
31e1268a81
@ -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">20.42% (245)</tspan> · <tspan class="known">77.08% (925)</tspan> · <tspan class="todo">0.67% (8)</tspan> · <tspan class="unused">1.83% (22)</tspan></tspan></text>
|
||||
<text class="todo" style="font-size: 12px; " x="747" y="9"><tspan text-anchor="end"><tspan class="decompiled">20.50% (246)</tspan> · <tspan class="known">77% (924)</tspan> · <tspan class="todo">0.67% (8)</tspan> · <tspan class="unused">1.83% (22)</tspan></tspan></text>
|
||||
<g transform="translate(0 20)">
|
||||
<rect width="152.51" height="6" x="0" y="0" class="decompiled"/>
|
||||
<rect width="575.81" height="6" x="152.51" y="0" class="known"/>
|
||||
<rect width="153.14" height="6" x="0" y="0" class="decompiled"/>
|
||||
<rect width="575.19" height="6" x="153.14" y="0" class="known"/>
|
||||
<rect width="4.98" height="6" x="728.32" y="0" class="todo"/>
|
||||
<rect width="13.70" height="6" x="733.30" y="0" class="unused"/>
|
||||
</g>
|
||||
@ -113,7 +113,7 @@
|
||||
<rect width="12" height="12" x="495" y="0" class="decompiled"><title>int32_t __cdecl Output_XGenX(const int16_t *obj_ptr);</title></rect>
|
||||
<rect width="12" height="12" x="510" y="0" class="decompiled"><title>int32_t __cdecl Output_XGenXG(const int16_t *obj_ptr);</title></rect>
|
||||
<rect width="12" height="12" x="525" y="0" class="decompiled"><title>int32_t __cdecl Output_XGenXGUV(const int16_t *obj_ptr);</title></rect>
|
||||
<rect width="12" height="12" x="540" y="0" class="known"><title>int32_t __cdecl Output_XGen_XGUVPerspFP(const int16_t *obj_ptr);</title></rect>
|
||||
<rect width="12" height="12" x="540" y="0" class="decompiled"><title>int32_t __cdecl Output_XGen_XGUVPerspFP(const int16_t *obj_ptr);</title></rect>
|
||||
<rect width="12" height="12" x="555" y="0" class="known"><title>void __cdecl Output_GTMap_Persp32FP(int32_t y0, int32_t y1, uint8_t *tex_page);</title></rect>
|
||||
<rect width="12" height="12" x="570" y="0" class="known"><title>void __cdecl Output_WGTmap_Persp32FP(int32_t y0, int32_t y1, uint8_t *tex_page);</title></rect>
|
||||
<rect width="12" height="12" x="585" y="0" class="known"><title>void __cdecl Output_DrawPolyGTMapPersp(const int16_t *obj_ptr);</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">12.42%</tspan> · <tspan class="known">87.25%</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">12.61%</tspan> · <tspan class="known">87.06%</tspan> · <tspan class="todo">0.02%</tspan> · <tspan class="unused">0.31%</tspan></tspan></text>
|
||||
<g transform="translate(0 20)">
|
||||
<rect width="92.75" height="6" x="0" y="0" class="decompiled"/>
|
||||
<rect width="651.79" height="6" x="92.75" y="0" class="known"/>
|
||||
<rect width="94.17" height="6" x="0" y="0" class="decompiled"/>
|
||||
<rect width="650.36" height="6" x="94.17" y="0" class="known"/>
|
||||
<rect width="0.13" height="6" x="744.53" y="0" class="todo"/>
|
||||
<rect width="2.33" height="6" x="744.67" y="0" class="unused"/>
|
||||
</g>
|
||||
@ -1418,7 +1418,7 @@
|
||||
<rect width="20.53" height="19.58" x="341.66" y="318.01" class="known"><title>void __cdecl PuzzleHoleCollision(int16_t item_num, struct ITEM_INFO *laraitem, struct COLL_INFO *coll);</title></rect>
|
||||
<rect width="20.53" height="19.41" x="341.66" y="340.59" class="known"><title>void __cdecl ControlDeathSlide(int16_t item_num);</title></rect>
|
||||
<rect width="18.92" height="20.76" x="365.19" y="0" class="known"><title>void __cdecl DinoControl(int16_t item_num);</title></rect>
|
||||
<rect width="18.92" height="20.65" x="365.19" y="23.76" class="known"><title>int32_t __cdecl Output_XGen_XGUVPerspFP(const int16_t *obj_ptr);</title></rect>
|
||||
<rect width="18.92" height="20.65" x="365.19" y="23.76" class="decompiled"><title>int32_t __cdecl Output_XGen_XGUVPerspFP(const int16_t *obj_ptr);</title></rect>
|
||||
<rect width="18.92" height="20.43" x="365.19" y="47.41" class="known"><title>void __cdecl Tiger_Control(int16_t item_num);</title></rect>
|
||||
<rect width="18.92" height="20.39" x="365.19" y="70.84" class="decompiled"><title>const int16_t *__cdecl Output_CalcRoomVertices(const int16_t *obj_ptr, int32_t far_clip);</title></rect>
|
||||
<rect width="18.92" height="20.36" x="365.19" y="94.24" class="known"><title>void __cdecl SharkControl(int16_t item_num);</title></rect>
|
||||
|
Before Width: | Height: | Size: 360 KiB After Width: | Height: | Size: 360 KiB |
@ -1179,7 +1179,7 @@ typedef enum LARA_MESH {
|
||||
00402C50 000000D2 + int32_t __cdecl Output_XGenX(const int16_t *obj_ptr);
|
||||
00402D30 00000146 + int32_t __cdecl Output_XGenXG(const int16_t *obj_ptr);
|
||||
00402E80 00000219 + int32_t __cdecl Output_XGenXGUV(const int16_t *obj_ptr);
|
||||
004030A0 00000284 - int32_t __cdecl Output_XGen_XGUVPerspFP(const int16_t *obj_ptr);
|
||||
004030A0 00000284 + int32_t __cdecl Output_XGen_XGUVPerspFP(const int16_t *obj_ptr);
|
||||
00403330 00000FC6 - void __cdecl Output_GTMap_Persp32FP(int32_t y0, int32_t y1, uint8_t *tex_page);
|
||||
00404300 000014C4 - void __cdecl Output_WGTmap_Persp32FP(int32_t y0, int32_t y1, uint8_t *tex_page);
|
||||
004057D0 00000037 - void __cdecl Output_DrawPolyGTMapPersp(const int16_t *obj_ptr);
|
||||
|
@ -1056,3 +1056,109 @@ int32_t __cdecl Output_XGenXGUV(const int16_t *obj_ptr)
|
||||
g_XGenY2 = y_max;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t __cdecl Output_XGen_XGUVPerspFP(const int16_t *obj_ptr)
|
||||
{
|
||||
int32_t pt_count = *obj_ptr++;
|
||||
const struct XGEN_XGUVP *pt2 = (const struct XGEN_XGUVP *)obj_ptr;
|
||||
const struct XGEN_XGUVP *pt1 = pt2 + (pt_count - 1);
|
||||
|
||||
int32_t y_min = pt1->y;
|
||||
int32_t y_max = pt1->y;
|
||||
|
||||
while (pt_count--) {
|
||||
const int32_t x1 = pt1->x;
|
||||
const int32_t y1 = pt1->y;
|
||||
const int32_t g1 = pt1->g;
|
||||
const float u1 = pt1->u;
|
||||
const float v1 = pt1->v;
|
||||
|
||||
const float rhw1 = pt1->rhw;
|
||||
const int32_t x2 = pt2->x;
|
||||
const int32_t y2 = pt2->y;
|
||||
const int32_t g2 = pt2->g;
|
||||
const float u2 = pt2->u;
|
||||
const float v2 = pt2->v;
|
||||
const float rhw2 = pt2->rhw;
|
||||
|
||||
pt1 = pt2++;
|
||||
|
||||
if (y1 < y2) {
|
||||
CLAMPG(y_min, y1);
|
||||
const int32_t g_size = g2 - g1;
|
||||
const float u_size = u2 - u1;
|
||||
const float v_size = v2 - v1;
|
||||
const float rhw_size = rhw2 - rhw1;
|
||||
const int32_t x_size = x2 - x1;
|
||||
int32_t y_size = y2 - y1;
|
||||
|
||||
struct XBUF_XGUVP *xguv_ptr = (struct XBUF_XGUVP *)g_XBuffer + y1;
|
||||
const int32_t x_add = PHD_ONE * x_size / y_size;
|
||||
const int32_t g_add = PHD_HALF * g_size / y_size;
|
||||
const float u_add = u_size / (float)y_size;
|
||||
const float v_add = v_size / (float)y_size;
|
||||
const float rhw_add = rhw_size / (float)y_size;
|
||||
int32_t x = x1 * PHD_ONE + (PHD_ONE - 1);
|
||||
int32_t g = g1 * PHD_HALF;
|
||||
float u = u1;
|
||||
float v = v1;
|
||||
float rhw = rhw1;
|
||||
|
||||
while (y_size--) {
|
||||
x += x_add;
|
||||
g += g_add;
|
||||
u += u_add;
|
||||
v += v_add;
|
||||
rhw += rhw_add;
|
||||
xguv_ptr->x2 = x;
|
||||
xguv_ptr->g2 = g;
|
||||
xguv_ptr->u2 = u;
|
||||
xguv_ptr->v2 = v;
|
||||
xguv_ptr->rhw2 = rhw;
|
||||
xguv_ptr++;
|
||||
}
|
||||
} else if (y2 < y1) {
|
||||
CLAMPL(y_max, y1);
|
||||
const int32_t g_size = g1 - g2;
|
||||
const float u_size = u1 - u2;
|
||||
const float v_size = v1 - v2;
|
||||
const float rhw_size = rhw1 - rhw2;
|
||||
const int32_t x_size = x1 - x2;
|
||||
int32_t y_size = y1 - y2;
|
||||
|
||||
struct XBUF_XGUVP *xguv_ptr = (struct XBUF_XGUVP *)g_XBuffer + y2;
|
||||
const int32_t x_add = PHD_ONE * x_size / y_size;
|
||||
const int32_t g_add = PHD_HALF * g_size / y_size;
|
||||
const float u_add = u_size / (float)y_size;
|
||||
const float v_add = v_size / (float)y_size;
|
||||
const float rhw_add = rhw_size / (float)y_size;
|
||||
int32_t x = x2 * PHD_ONE + 1;
|
||||
int32_t g = g2 * PHD_HALF;
|
||||
float u = u2;
|
||||
float v = v2;
|
||||
float rhw = rhw2;
|
||||
|
||||
while (y_size--) {
|
||||
x += x_add;
|
||||
g += g_add;
|
||||
u += u_add;
|
||||
v += v_add;
|
||||
rhw += rhw_add;
|
||||
xguv_ptr->x1 = x;
|
||||
xguv_ptr->g1 = g;
|
||||
xguv_ptr->u1 = u;
|
||||
xguv_ptr->v1 = v;
|
||||
xguv_ptr->rhw1 = rhw;
|
||||
xguv_ptr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (y_min == y_max) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
g_XGenY1 = y_min;
|
||||
g_XGenY2 = y_max;
|
||||
return 1;
|
||||
}
|
||||
|
@ -32,3 +32,4 @@ void __cdecl Output_DrawPolyWGTMap(const int16_t *obj_ptr);
|
||||
int32_t __cdecl Output_XGenX(const int16_t *obj_ptr);
|
||||
int32_t __cdecl Output_XGenXG(const int16_t *obj_ptr);
|
||||
int32_t __cdecl Output_XGenXGUV(const int16_t *obj_ptr);
|
||||
int32_t __cdecl Output_XGen_XGUVPerspFP(const int16_t *obj_ptr);
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
// clang-format off
|
||||
#define Output_InsertInventoryBackground ((void __cdecl (*)(const int16_t *obj_ptr))0x00401D50)
|
||||
#define Output_XGen_XGUVPerspFP ((int32_t __cdecl (*)(const int16_t *obj_ptr))0x004030A0)
|
||||
#define Output_GTMap_Persp32FP ((void __cdecl (*)(int32_t y0, int32_t y1, uint8_t *tex_page))0x00403330)
|
||||
#define Output_WGTmap_Persp32FP ((void __cdecl (*)(int32_t y0, int32_t y1, uint8_t *tex_page))0x00404300)
|
||||
#define Output_DrawPolyGTMapPersp ((void __cdecl (*)(const int16_t *obj_ptr))0x004057D0)
|
||||
|
@ -1562,4 +1562,26 @@ typedef struct XBUF_XGUV {
|
||||
int32_t v2;
|
||||
} XBUF_XGUV;
|
||||
|
||||
typedef struct XGEN_XGUVP {
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
uint16_t g;
|
||||
float rhw;
|
||||
float u;
|
||||
float v;
|
||||
} XGEN_XGUVP;
|
||||
|
||||
typedef struct XBUF_XGUVP {
|
||||
int32_t x1;
|
||||
int32_t g1;
|
||||
float u1;
|
||||
float v1;
|
||||
float rhw1;
|
||||
int32_t x2;
|
||||
int32_t g2;
|
||||
float u2;
|
||||
float v2;
|
||||
float rhw2;
|
||||
} XBUF_XGUVP;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
@ -113,6 +113,7 @@ static void Inject_Output(void)
|
||||
INJECT(1, 0x00402C50, Output_XGenX);
|
||||
INJECT(1, 0x00402D30, Output_XGenXG);
|
||||
INJECT(1, 0x00402E80, Output_XGenXGUV);
|
||||
INJECT(1, 0x004030A0, Output_XGen_XGUVPerspFP);
|
||||
}
|
||||
|
||||
static void Inject_Music(void)
|
||||
|
Loading…
Reference in New Issue
Block a user