2020-03-27 21:47:29 +01:00
|
|
|
#include "THISDUST.H"
|
|
|
|
#include "TEXTURE.H"
|
2020-04-03 00:44:09 +02:00
|
|
|
#include "SYSTEM.H"
|
2020-04-06 01:06:00 +02:00
|
|
|
#include "OVERMAP.H"
|
|
|
|
#include "MISSION.H"
|
2020-04-11 00:12:50 +02:00
|
|
|
#include "DRAW.H"
|
2020-03-27 21:47:29 +01:00
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
#include <string.h>
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
SXYPAIR tpagepos[20] =
|
|
|
|
{
|
2020-04-03 00:44:09 +02:00
|
|
|
{ 640, 0 },
|
|
|
|
{ 704, 0 },
|
|
|
|
{ 768, 0 },
|
|
|
|
{ 832, 0 },
|
|
|
|
{ 896, 0 },
|
|
|
|
{ 960, 0 },
|
|
|
|
{ 512, 256 },
|
|
|
|
{ 576, 256 },
|
|
|
|
{ 640, 256 },
|
|
|
|
{ 704, 256 },
|
|
|
|
{ 768, 256 },
|
|
|
|
{ 832, 256 },
|
|
|
|
{ 896, 256 },
|
|
|
|
{ 448, 0 },
|
|
|
|
{ 512, 0 },
|
|
|
|
{ 576, 0 },
|
|
|
|
{ 320, 256 },
|
|
|
|
{ 384, 256 },
|
|
|
|
{ 448, 256 },
|
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
{ -1, -1 }
|
2020-03-27 21:47:29 +01:00
|
|
|
};
|
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
char specTpages[4][12] = {
|
|
|
|
{ 0x36, 0x37, 0x42, 0x43, 0x38, 0x39, 0x44, 0x45, 0x3D, 0x40, 0x3D, 0x40},
|
|
|
|
{ 0x26, 0x27, 0x26, 0x27, 0x2A, 0x2B, 0x2C, 0x2D, 0x30, 0x31, 0x30, 0x31},
|
|
|
|
{ 0x12, 0x13, 0x41, 0x42, 0x43, 0x44, 0xB, 0xC, 0x3F, 0x40, 0x3F, 0x40},
|
|
|
|
{ 0x42, 0x43, 0x4D, 0x4E, 0x49, 0x4A, 0x4B, 0x4C, 0x45, 0x46, 0x47, 0x48}
|
|
|
|
};
|
|
|
|
|
|
|
|
char carTpages[4][8] = {
|
|
|
|
{1, 0x41, 0x3E, 0x32, 0x3F, 0x3A, 0x36, 0x37},
|
|
|
|
{0xA, 0x23, 0x14, 0x25, 0x33, 0x24, 0x26, 0x27},
|
|
|
|
{0x29, 0x36, 0x3E, 0x11, 0x20, 0x3B, 0x12, 0},
|
|
|
|
{0x37, 0x39, 0x44, 0x3A, 0x3C, 0x3B, 0x42, 0x43}
|
|
|
|
};
|
|
|
|
|
|
|
|
char *palette_lump;
|
|
|
|
|
2020-03-27 21:47:29 +01:00
|
|
|
int texture_is_icon = 0;
|
2020-04-05 15:53:08 +02:00
|
|
|
char* texturename_buffer = NULL;
|
2020-04-06 01:06:00 +02:00
|
|
|
int NoTextureMemory = 0;
|
|
|
|
|
2020-04-15 16:15:54 +02:00
|
|
|
unsigned short texture_pages[128];
|
|
|
|
unsigned short texture_cluts[128][32];
|
2020-04-06 01:06:00 +02:00
|
|
|
unsigned char tpageloaded[128];
|
|
|
|
|
|
|
|
int MaxSpecCluts;
|
|
|
|
int slotsused;
|
|
|
|
|
|
|
|
RECT16 clutpos;
|
|
|
|
RECT16 fontclutpos;
|
|
|
|
RECT16 mapclutpos;
|
|
|
|
DVECTOR slot_clutpos[19];
|
|
|
|
DVECTOR slot_tpagepos[19];
|
|
|
|
unsigned char tpageslots[19];
|
|
|
|
|
|
|
|
RECT16 tpage; // stupid naming, absolute ass
|
|
|
|
|
|
|
|
short specialSlot;
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ IncrementClutNum(struct RECT *clut /*$a0*/)
|
|
|
|
// line 116, offset 0x00080ddc
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1163
|
|
|
|
/* end block 1 */
|
|
|
|
// End Line: 1164
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 232
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 233
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 1164
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 1165
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
// [D]
|
2020-04-06 01:06:00 +02:00
|
|
|
void IncrementClutNum(RECT16 *clut)
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-03 00:44:09 +02:00
|
|
|
short sVar1;
|
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
sVar1 = clut->x + 16;
|
2020-04-03 00:44:09 +02:00
|
|
|
clut->x = sVar1;
|
2020-04-06 01:06:00 +02:00
|
|
|
|
|
|
|
if (sVar1 == 1024) {
|
|
|
|
clut->x = 960;
|
2020-04-03 00:44:09 +02:00
|
|
|
clut->y = clut->y + 1;
|
|
|
|
}
|
|
|
|
return;
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ IncrementTPageNum(struct RECT *tpage /*$t0*/)
|
|
|
|
// line 126, offset 0x00080528
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 127
|
|
|
|
// Start offset: 0x00080528
|
|
|
|
// Variables:
|
|
|
|
// int i; // $a3
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x000805EC
|
|
|
|
// End Line: 153
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 252
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 253
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 255
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 256
|
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
// [D]
|
|
|
|
void IncrementTPageNum(RECT16 *tpage)
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-06 17:49:09 +02:00
|
|
|
int i;
|
|
|
|
i = 1;
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-06 17:49:09 +02:00
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
if (tpage->x == tpagepos[i-1].x && // proper tpage position
|
|
|
|
tpage->y == tpagepos[i-1].y ||
|
|
|
|
tpagepos[i].x == -1) // or out of tpages?
|
|
|
|
break;
|
|
|
|
i++;
|
2020-04-03 00:44:09 +02:00
|
|
|
}
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-06 17:49:09 +02:00
|
|
|
tpage->x = tpagepos[i].x;
|
|
|
|
tpage->y = tpagepos[i].y;
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-06 17:49:09 +02:00
|
|
|
if (tpagepos[i].x == -1)
|
2020-04-06 01:06:00 +02:00
|
|
|
{
|
2020-04-03 00:44:09 +02:00
|
|
|
NoTextureMemory = 100;
|
2020-04-06 17:49:09 +02:00
|
|
|
|
|
|
|
tpage->x = tpagepos[i-1].x;
|
|
|
|
tpage->y = tpagepos[i-1].y;
|
2020-04-03 00:44:09 +02:00
|
|
|
}
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// int /*$ra*/ LoadTPageAndCluts(struct RECT *tpage /*$s5*/, struct RECT *cluts /*$s2*/, int tpage2send /*$s6*/, char *tpageaddress /*$s0*/)
|
|
|
|
// line 155, offset 0x00080e14
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 156
|
|
|
|
// Start offset: 0x00080E14
|
|
|
|
// Variables:
|
|
|
|
// int i; // $s3
|
|
|
|
// int npalettes; // $s4
|
|
|
|
// struct RECT temptpage; // stack offset -40
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x00080F3C
|
|
|
|
// End Line: 185
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 1243
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 1244
|
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
// [D]
|
|
|
|
// Originally ASM function
|
|
|
|
char* unpackTexture(char *dest, char *src)
|
|
|
|
{
|
|
|
|
bool bVar1;
|
|
|
|
char cVar2;
|
|
|
|
char *pcVar3;
|
|
|
|
char *pcVar4;
|
|
|
|
uint uVar5;
|
|
|
|
|
|
|
|
pcVar4 = dest + 0x7fff;
|
|
|
|
do {
|
|
|
|
uVar5 = (*src);
|
|
|
|
pcVar3 = src + 1;
|
|
|
|
cVar2 = *pcVar3;
|
|
|
|
if ((uVar5 & 0x80) == 0) {
|
|
|
|
while (true) {
|
|
|
|
pcVar3 = pcVar3 + 1;
|
|
|
|
*pcVar4 = cVar2;
|
|
|
|
pcVar4 = pcVar4 + -1;
|
|
|
|
bVar1 = uVar5 == 0;
|
|
|
|
uVar5 = uVar5 - 1;
|
|
|
|
if (bVar1) break;
|
|
|
|
cVar2 = *pcVar3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pcVar3 = src + 2;
|
|
|
|
*pcVar4 = cVar2;
|
|
|
|
pcVar4 = pcVar4 + -1;
|
|
|
|
do {
|
|
|
|
*pcVar4 = cVar2;
|
|
|
|
pcVar4 = pcVar4 + -1;
|
|
|
|
bVar1 = uVar5 != 0;
|
|
|
|
uVar5 = uVar5 + 1;
|
|
|
|
} while (bVar1);
|
|
|
|
}
|
|
|
|
src = pcVar3;
|
|
|
|
} while (dest <= pcVar4);
|
|
|
|
return pcVar3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// [D]
|
|
|
|
int LoadTPageAndCluts(RECT16 *tpage, RECT16 *cluts, int tpage2send, char *tpageaddress)
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-03 00:44:09 +02:00
|
|
|
u_short uVar1;
|
2020-04-06 01:06:00 +02:00
|
|
|
u_long *puVar2;
|
|
|
|
u_short *puVar3;
|
2020-04-03 00:44:09 +02:00
|
|
|
int iVar4;
|
2020-04-06 01:06:00 +02:00
|
|
|
int iVar5;
|
|
|
|
RECT16 local_28;
|
|
|
|
|
|
|
|
iVar5 = *(int *)tpageaddress;
|
|
|
|
puVar2 = (u_long *)(tpageaddress + 4);
|
|
|
|
iVar4 = 0;
|
|
|
|
|
|
|
|
if (0 < iVar5) {
|
|
|
|
puVar3 = (u_short *)(texture_cluts[tpage2send]);
|
2020-04-03 00:44:09 +02:00
|
|
|
do {
|
2020-04-06 01:06:00 +02:00
|
|
|
LoadImage(cluts, puVar2);
|
|
|
|
puVar2 = puVar2 + 8;
|
|
|
|
iVar4 = iVar4 + 1;
|
2020-04-03 00:44:09 +02:00
|
|
|
uVar1 = GetClut((int)cluts->x, (int)cluts->y);
|
2020-04-06 01:06:00 +02:00
|
|
|
*puVar3 = uVar1;
|
2020-04-03 00:44:09 +02:00
|
|
|
IncrementClutNum(cluts);
|
2020-04-06 01:06:00 +02:00
|
|
|
puVar3 = puVar3 + 1;
|
|
|
|
} while (iVar4 < iVar5);
|
2020-04-03 00:44:09 +02:00
|
|
|
}
|
2020-04-06 01:06:00 +02:00
|
|
|
|
|
|
|
local_28.x = tpage->x;
|
|
|
|
local_28.y = tpage->y;
|
|
|
|
local_28.w = tpage->w;
|
|
|
|
local_28.h = 0x100;
|
|
|
|
|
|
|
|
unpackTexture(_other_buffer, (char*)puVar2);
|
2020-04-06 17:49:09 +02:00
|
|
|
LoadImage(&local_28, (u_long *)&_other_buffer);
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
uVar1 = GetTPage(0, 0, (int)tpage->x, (int)tpage->y);
|
2020-04-06 01:06:00 +02:00
|
|
|
texture_pages[tpage2send] = uVar1;
|
2020-04-03 00:44:09 +02:00
|
|
|
IncrementTPageNum(tpage);
|
|
|
|
return 1;
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// int /*$ra*/ Find_TexID(struct MODEL *model /*$t0*/, int t_id /*$a1*/)
|
|
|
|
// line 191, offset 0x000805ec
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 192
|
|
|
|
// Start offset: 0x000805EC
|
|
|
|
// Variables:
|
|
|
|
// char *polylist; // $a2
|
|
|
|
// int i; // $a3
|
|
|
|
|
|
|
|
/* begin block 1.1 */
|
|
|
|
// Start line: 203
|
|
|
|
// Start offset: 0x00080638
|
|
|
|
/* end block 1.1 */
|
|
|
|
// End offset: 0x00080650
|
|
|
|
// End Line: 206
|
|
|
|
|
|
|
|
/* begin block 1.2 */
|
|
|
|
// Start line: 209
|
|
|
|
// Start offset: 0x00080650
|
|
|
|
/* end block 1.2 */
|
|
|
|
// End offset: 0x00080650
|
|
|
|
// End Line: 212
|
|
|
|
|
|
|
|
/* begin block 1.3 */
|
|
|
|
// Start line: 215
|
|
|
|
// Start offset: 0x00080650
|
|
|
|
/* end block 1.3 */
|
|
|
|
// End offset: 0x00080650
|
|
|
|
// End Line: 218
|
|
|
|
|
|
|
|
/* begin block 1.4 */
|
|
|
|
// Start line: 222
|
|
|
|
// Start offset: 0x00080650
|
|
|
|
/* end block 1.4 */
|
|
|
|
// End offset: 0x00080650
|
|
|
|
// End Line: 225
|
|
|
|
|
|
|
|
/* begin block 1.5 */
|
|
|
|
// Start line: 229
|
|
|
|
// Start offset: 0x00080650
|
|
|
|
/* end block 1.5 */
|
|
|
|
// End offset: 0x00080650
|
|
|
|
// End Line: 232
|
|
|
|
|
|
|
|
/* begin block 1.6 */
|
|
|
|
// Start line: 235
|
|
|
|
// Start offset: 0x00080650
|
|
|
|
/* end block 1.6 */
|
|
|
|
// End offset: 0x00080650
|
|
|
|
// End Line: 238
|
|
|
|
|
|
|
|
/* begin block 1.7 */
|
|
|
|
// Start line: 241
|
|
|
|
// Start offset: 0x00080650
|
|
|
|
/* end block 1.7 */
|
|
|
|
// End offset: 0x00080650
|
|
|
|
// End Line: 244
|
|
|
|
|
|
|
|
/* begin block 1.8 */
|
|
|
|
// Start line: 247
|
|
|
|
// Start offset: 0x00080650
|
|
|
|
/* end block 1.8 */
|
|
|
|
// End offset: 0x00080650
|
|
|
|
// End Line: 250
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x00080688
|
|
|
|
// End Line: 258
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 356
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 357
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 395
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 396
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
int Find_TexID(MODEL *model, int t_id)
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-11 00:12:50 +02:00
|
|
|
char *polylist = (char *)model->poly_block;
|
2020-04-03 00:44:09 +02:00
|
|
|
|
2020-04-11 00:12:50 +02:00
|
|
|
for (int i = 0; i < model->num_polys; i++)
|
|
|
|
{
|
|
|
|
switch (*polylist & 0x1F) {
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
case 20:
|
|
|
|
case 21:
|
|
|
|
case 22:
|
|
|
|
case 23:
|
|
|
|
if (polylist[2] == t_id)
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
polylist += PolySizes[*polylist];
|
2020-04-03 00:44:09 +02:00
|
|
|
}
|
2020-04-11 00:12:50 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
return 0;
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// struct TEXINF * /*$ra*/ GetTEXINFName(char *name /*$fp*/, int *tpagenum /*stack 4*/, int *texturenum /*stack 8*/)
|
|
|
|
// line 261, offset 0x00080f3c
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 262
|
|
|
|
// Start offset: 0x00080F3C
|
|
|
|
// Variables:
|
|
|
|
// int i; // $s4
|
|
|
|
// int j; // $s1
|
|
|
|
// int texamt; // $s2
|
|
|
|
// struct TEXINF *texinf; // $s3
|
|
|
|
// char *nametable; // $s6
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x00081038
|
|
|
|
// End Line: 287
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 1407
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 1408
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 1484
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 1485
|
|
|
|
|
|
|
|
/* begin block 4 */
|
|
|
|
// Start line: 1490
|
|
|
|
/* end block 4 */
|
|
|
|
// End Line: 1491
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
TEXINF * GetTEXINFName(char *name, int *tpagenum, int *texturenum)
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-03 00:44:09 +02:00
|
|
|
UNIMPLEMENTED();
|
|
|
|
return 0;
|
|
|
|
/*
|
|
|
|
char *pcVar1;
|
|
|
|
int iVar2;
|
|
|
|
TEXINF *pTVar3;
|
|
|
|
int iVar4;
|
|
|
|
int iVar5;
|
|
|
|
TEXINF *pTVar6;
|
|
|
|
int iVar7;
|
|
|
|
int *piVar8;
|
|
|
|
TEXINF **ppTVar9;
|
|
|
|
|
|
|
|
pcVar1 = texturename_buffer;
|
|
|
|
iVar7 = 0;
|
|
|
|
pTVar6 = (TEXINF *)0x0;
|
|
|
|
if (0 < tpage_amount) {
|
|
|
|
ppTVar9 = tpage_ids128;
|
|
|
|
piVar8 = &tpage_texamts;
|
|
|
|
do {
|
|
|
|
iVar5 = *piVar8;
|
|
|
|
pTVar6 = *ppTVar9;
|
|
|
|
iVar4 = 0;
|
|
|
|
pTVar3 = pTVar6;
|
|
|
|
if (0 < iVar5) {
|
|
|
|
do {
|
|
|
|
iVar2 = strcmp(pcVar1 + pTVar3->nameoffset, name);
|
|
|
|
if (iVar2 == 0) {
|
|
|
|
*tpagenum = iVar7;
|
|
|
|
*texturenum = iVar4;
|
|
|
|
return pTVar3;
|
|
|
|
}
|
|
|
|
iVar4 = iVar4 + 1;
|
|
|
|
pTVar3 = pTVar3 + 1;
|
|
|
|
} while (iVar4 < iVar5);
|
|
|
|
}
|
|
|
|
ppTVar9 = ppTVar9 + 1;
|
|
|
|
iVar7 = iVar7 + 1;
|
|
|
|
piVar8 = piVar8 + 1;
|
|
|
|
} while (iVar7 < tpage_amount);
|
|
|
|
}
|
|
|
|
return pTVar6;
|
|
|
|
*/
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// struct TEXINF * /*$ra*/ GetTextureInfoName(char *name /*$a0*/, struct TPAN *result /*$s0*/)
|
|
|
|
// line 290, offset 0x00080da0
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 291
|
|
|
|
// Start offset: 0x00080DA0
|
|
|
|
// Variables:
|
|
|
|
// int tpagenum; // stack offset -16
|
|
|
|
// int texturenum; // stack offset -12
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x00080DDC
|
|
|
|
// End Line: 300
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 580
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 581
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
TEXINF * GetTextureInfoName(char *name, TPAN *result)
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-03 00:44:09 +02:00
|
|
|
UNIMPLEMENTED();
|
2020-04-04 02:14:39 +02:00
|
|
|
return 0;
|
2020-04-03 00:44:09 +02:00
|
|
|
/*
|
|
|
|
TEXINF *pTVar1;
|
|
|
|
uchar local_10[4];
|
|
|
|
uchar local_c[4];
|
|
|
|
|
|
|
|
pTVar1 = GetTEXINFName(name, (int *)local_10, (int *)local_c);
|
|
|
|
result->texture_page = local_10[0];
|
|
|
|
result->texture_number = local_c[0];
|
|
|
|
return pTVar1;
|
|
|
|
*/
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ update_slotinfo(int tpage /*$a0*/, int slot /*$a1*/, struct RECT *pos /*$a2*/)
|
|
|
|
// line 334, offset 0x00081038
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1606
|
|
|
|
/* end block 1 */
|
|
|
|
// End Line: 1607
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 1654
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 1655
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 1655
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 1656
|
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
// [D]
|
|
|
|
void update_slotinfo(int tpage, int slot, RECT16 *pos)
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-06 01:06:00 +02:00
|
|
|
tpageslots[slot] = tpage;
|
|
|
|
tpageloaded[tpage] = slot;
|
|
|
|
slot_tpagepos[slot].vx = pos->x;
|
|
|
|
slot_tpagepos[slot].vy = pos->y;
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ ProcessTextureInfo(char *lump_ptr /*$a1*/)
|
|
|
|
// line 347, offset 0x00081080
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 348
|
|
|
|
// Start offset: 0x00081080
|
|
|
|
// Variables:
|
|
|
|
// int i; // $a0
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x00081118
|
|
|
|
// End Line: 375
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 1686
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 1687
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
TP *tpage_position = NULL;
|
|
|
|
TEXINF* tpage_ids[128] = {0};
|
|
|
|
int texamount = 0;
|
|
|
|
int tpage_amount = 0;
|
|
|
|
int tpage_texamts[128];
|
|
|
|
|
|
|
|
int nspecpages = 0;
|
|
|
|
int nperms = 0;
|
|
|
|
XYPAIR *speclist = NULL;
|
|
|
|
XYPAIR *permlist = NULL;
|
|
|
|
|
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void ProcessTextureInfo(char *lump_ptr)
|
|
|
|
{
|
2020-04-11 00:12:50 +02:00
|
|
|
tpage_amount = *(int *)lump_ptr;
|
2020-04-03 00:44:09 +02:00
|
|
|
texamount = *(int *)(lump_ptr + 4);
|
|
|
|
tpage_position = (TP *)(lump_ptr + 8);
|
2020-04-05 22:04:37 +02:00
|
|
|
|
2020-04-11 19:48:12 +02:00
|
|
|
char *ptr = (char *)&tpage_position[tpage_amount + 1];
|
2020-04-05 22:04:37 +02:00
|
|
|
|
2020-04-11 00:12:50 +02:00
|
|
|
if (tpage_amount > 0) {
|
|
|
|
for (int i = 0; i < tpage_amount; i++)
|
|
|
|
{
|
2020-04-11 19:48:12 +02:00
|
|
|
texamount = *(int *)ptr;
|
|
|
|
ptr += 4;
|
2020-04-05 22:04:37 +02:00
|
|
|
|
2020-04-11 19:48:12 +02:00
|
|
|
tpage_ids[i] = (TEXINF *)ptr;
|
|
|
|
ptr += (texamount * sizeof(TEXINF));
|
2020-04-11 00:12:50 +02:00
|
|
|
|
|
|
|
tpage_texamts[i] = texamount;
|
|
|
|
}
|
2020-04-03 00:44:09 +02:00
|
|
|
}
|
2020-04-05 22:04:37 +02:00
|
|
|
|
2020-04-11 19:48:12 +02:00
|
|
|
nperms = *(int *)ptr;
|
|
|
|
permlist = (XYPAIR *)(ptr + 4);
|
2020-04-11 00:12:50 +02:00
|
|
|
|
2020-04-11 19:48:12 +02:00
|
|
|
ptr = (char *)&permlist[16];
|
2020-04-11 00:12:50 +02:00
|
|
|
|
2020-04-11 19:48:12 +02:00
|
|
|
nspecpages = *(int *)ptr;
|
|
|
|
speclist = (XYPAIR *)(ptr + 4);
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ LoadPermanentTPages(int *sector /*$fp*/)
|
|
|
|
// line 378, offset 0x00080688
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 379
|
|
|
|
// Start offset: 0x00080688
|
|
|
|
// Variables:
|
|
|
|
// int tloop; // $s1
|
|
|
|
// int i; // $s1
|
|
|
|
// int tset; // $s0
|
|
|
|
// int nsectors; // $s3
|
|
|
|
// char *tpagebuffer; // $s2
|
|
|
|
|
|
|
|
/* begin block 1.1 */
|
|
|
|
// Start line: 445
|
|
|
|
// Start offset: 0x000808DC
|
|
|
|
// Variables:
|
|
|
|
// int specmodel; // $a1
|
|
|
|
// int page1; // $s6
|
|
|
|
// int page2; // $s5
|
|
|
|
|
|
|
|
/* begin block 1.1.1 */
|
|
|
|
// Start line: 465
|
|
|
|
// Start offset: 0x00080984
|
|
|
|
// Variables:
|
|
|
|
// int temp; // $s4
|
|
|
|
// int clutsLoaded; // $s7
|
|
|
|
/* end block 1.1.1 */
|
|
|
|
// End offset: 0x00080AD8
|
|
|
|
// End Line: 504
|
|
|
|
/* end block 1.1 */
|
|
|
|
// End offset: 0x00080AD8
|
|
|
|
// End Line: 505
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x00080BB0
|
|
|
|
// End Line: 575
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 762
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 763
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 883
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 884
|
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
|
|
|
|
#ifndef PSX
|
|
|
|
extern char g_CurrentLevelFileName[64];
|
|
|
|
#endif // !PSX
|
|
|
|
|
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void LoadPermanentTPages(int *sector)
|
|
|
|
{
|
2020-04-07 12:56:13 +02:00
|
|
|
int page1;
|
|
|
|
int page2;
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
bool bVar3;
|
|
|
|
short sVar5;
|
|
|
|
short sVar6;
|
|
|
|
short sVar7;
|
|
|
|
short sVar8;
|
|
|
|
u_short uVar9;
|
|
|
|
int nsectors;
|
|
|
|
int iVar10;
|
2020-04-06 01:06:00 +02:00
|
|
|
unsigned char *puVar11;
|
2020-04-03 00:44:09 +02:00
|
|
|
int *addr;
|
|
|
|
int *piVar12;
|
|
|
|
int iVar13;
|
2020-04-15 16:15:54 +02:00
|
|
|
ushort *psVar14;
|
2020-04-06 01:06:00 +02:00
|
|
|
u_short *puVar15;
|
2020-04-07 12:56:13 +02:00
|
|
|
int tpageId;
|
2020-04-06 01:06:00 +02:00
|
|
|
DVECTOR *pDVar16;
|
2020-04-03 00:44:09 +02:00
|
|
|
int nsectors_00;
|
2020-04-06 01:06:00 +02:00
|
|
|
int iVar17;
|
|
|
|
uint uVar18;
|
2020-04-03 00:44:09 +02:00
|
|
|
char *tpageaddress;
|
2020-04-06 01:06:00 +02:00
|
|
|
DVECTOR *pDVar19;
|
2020-04-03 00:44:09 +02:00
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
psVar14 = texture_pages;
|
2020-04-03 00:44:09 +02:00
|
|
|
nsectors_00 = 0x7f;
|
|
|
|
MaxSpecCluts = 0;
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
do {
|
2020-04-06 01:06:00 +02:00
|
|
|
uVar9 = GetTPage(0, 0, 960, 0);
|
|
|
|
*psVar14 = uVar9;
|
2020-04-03 00:44:09 +02:00
|
|
|
nsectors_00 = nsectors_00 + -1;
|
2020-04-15 16:15:54 +02:00
|
|
|
psVar14 = ((u_short *)psVar14 + 1);
|
2020-04-03 00:44:09 +02:00
|
|
|
} while (-1 < nsectors_00);
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
nsectors_00 = 0;
|
2020-04-06 01:06:00 +02:00
|
|
|
iVar17 = 1;
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
do {
|
2020-04-06 01:06:00 +02:00
|
|
|
puVar15 = (u_short *)(texture_cluts[nsectors_00]);
|
2020-04-07 12:56:13 +02:00
|
|
|
nsectors_00 = 31;
|
2020-04-03 00:44:09 +02:00
|
|
|
do {
|
2020-04-07 12:56:13 +02:00
|
|
|
uVar9 = GetClut(960, 16);
|
2020-04-06 01:06:00 +02:00
|
|
|
*puVar15 = uVar9;
|
2020-04-03 00:44:09 +02:00
|
|
|
nsectors_00 = nsectors_00 + -1;
|
2020-04-06 01:06:00 +02:00
|
|
|
puVar15 = puVar15 + 1;
|
2020-04-03 00:44:09 +02:00
|
|
|
} while (-1 < nsectors_00);
|
2020-04-07 12:56:13 +02:00
|
|
|
bVar3 = iVar17 < 128;
|
2020-04-06 01:06:00 +02:00
|
|
|
nsectors_00 = iVar17;
|
|
|
|
iVar17 = iVar17 + 1;
|
2020-04-03 00:44:09 +02:00
|
|
|
} while (bVar3);
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
slotsused = 0;
|
2020-04-06 01:06:00 +02:00
|
|
|
memset(tpageloaded, 0, sizeof(tpageloaded));
|
|
|
|
|
|
|
|
clutpos.x = 960;
|
|
|
|
clutpos.y = 256;
|
2020-04-07 12:56:13 +02:00
|
|
|
clutpos.w = 16;
|
|
|
|
clutpos.h = 1;
|
|
|
|
|
|
|
|
tpage.w = 64;
|
|
|
|
tpage.h = 256;
|
|
|
|
|
|
|
|
mapclutpos.x = 960;
|
|
|
|
mapclutpos.y = 256;
|
|
|
|
mapclutpos.w = 16;
|
2020-04-03 00:44:09 +02:00
|
|
|
mapclutpos.h = 1;
|
2020-04-07 12:56:13 +02:00
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
tpage.x = tpagepos[0].x;
|
|
|
|
tpage.y = tpagepos[0].y;
|
2020-04-03 00:44:09 +02:00
|
|
|
nsectors_00 = 0;
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
IncrementClutNum(&clutpos);
|
|
|
|
fontclutpos.x = clutpos.x;
|
|
|
|
fontclutpos.y = clutpos.y;
|
2020-04-06 01:06:00 +02:00
|
|
|
fontclutpos.w = clutpos.w;
|
|
|
|
fontclutpos.h = clutpos.h;
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
IncrementClutNum(&clutpos);
|
|
|
|
ProcessPalletLump(palette_lump, 0);
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
load_civ_palettes(&clutpos);
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
tpageaddress = mallocptr;
|
|
|
|
if (0 < nperms) {
|
|
|
|
addr = &permlist->y;
|
2020-04-06 01:06:00 +02:00
|
|
|
iVar17 = nperms;
|
2020-04-03 00:44:09 +02:00
|
|
|
do {
|
|
|
|
nsectors = *addr + 0x7ff;
|
|
|
|
if (nsectors < 0) {
|
|
|
|
nsectors = *addr + 0xffe;
|
|
|
|
}
|
|
|
|
nsectors_00 = nsectors_00 + (nsectors >> 0xb);
|
2020-04-06 01:06:00 +02:00
|
|
|
iVar17 = iVar17 + -1;
|
2020-04-03 00:44:09 +02:00
|
|
|
addr = addr + 2;
|
2020-04-06 01:06:00 +02:00
|
|
|
} while (iVar17 != 0);
|
2020-04-03 00:44:09 +02:00
|
|
|
}
|
2020-04-06 01:06:00 +02:00
|
|
|
|
|
|
|
#ifdef PSX
|
2020-04-03 00:44:09 +02:00
|
|
|
loadsectors(mallocptr, *sector, nsectors_00);
|
2020-04-06 01:06:00 +02:00
|
|
|
#else
|
|
|
|
loadsectorsPC(g_CurrentLevelFileName, mallocptr, *sector, nsectors_00);
|
|
|
|
#endif // PSX
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
*sector = *sector + nsectors_00;
|
|
|
|
nsectors_00 = 0;
|
|
|
|
if (0 < nperms) {
|
|
|
|
do {
|
|
|
|
nsectors = nsectors_00 + 1;
|
2020-04-06 01:06:00 +02:00
|
|
|
iVar17 = permlist[nsectors_00].y;
|
2020-04-03 00:44:09 +02:00
|
|
|
nsectors_00 = permlist[nsectors_00].x;
|
2020-04-11 18:34:29 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
update_slotinfo(nsectors_00, slotsused, &tpage);
|
2020-04-11 18:34:29 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
LoadTPageAndCluts(&tpage, &clutpos, nsectors_00, tpageaddress);
|
2020-04-11 18:34:29 +02:00
|
|
|
slotsused++;
|
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
tpageaddress = tpageaddress + (iVar17 + 0x7ffU & 0xfffff800);
|
2020-04-03 00:44:09 +02:00
|
|
|
nsectors_00 = nsectors;
|
|
|
|
} while (nsectors < nperms);
|
|
|
|
}
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
addr = (int *)mallocptr;
|
2020-04-07 12:56:13 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
slot_clutpos[slotsused].vx = clutpos.x;
|
2020-04-07 12:56:13 +02:00
|
|
|
slot_clutpos[slotsused].vy = clutpos.y;
|
|
|
|
|
|
|
|
iVar13 = (MissionHeader->residentModels[4] - 8) * 2; // int specmodel
|
2020-04-03 00:44:09 +02:00
|
|
|
specialSlot = (short)slotsused;
|
2020-04-07 12:56:13 +02:00
|
|
|
|
|
|
|
page1 = specTpages[GameLevel][iVar13];
|
|
|
|
page2 = specTpages[GameLevel][iVar13 + 1];
|
|
|
|
|
|
|
|
carTpages[GameLevel][6] = page1;
|
|
|
|
carTpages[GameLevel][7] = page2;
|
|
|
|
|
2020-04-06 01:06:00 +02:00
|
|
|
iVar17 = nspecpages;
|
2020-04-03 00:44:09 +02:00
|
|
|
bVar3 = nspecpages != 0;
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
if (bVar3) {
|
|
|
|
iVar13 = 0;
|
|
|
|
nsectors_00 = 0;
|
|
|
|
nsectors = 0;
|
2020-04-06 01:06:00 +02:00
|
|
|
if (0 < iVar17) {
|
2020-04-03 00:44:09 +02:00
|
|
|
piVar12 = &speclist->y;
|
|
|
|
do {
|
|
|
|
iVar10 = *piVar12 + 0x7ff;
|
|
|
|
if (iVar10 < 0) {
|
|
|
|
iVar10 = *piVar12 + 0xffe;
|
|
|
|
}
|
|
|
|
nsectors = nsectors + (iVar10 >> 0xb);
|
2020-04-06 01:06:00 +02:00
|
|
|
iVar17 = iVar17 + -1;
|
2020-04-03 00:44:09 +02:00
|
|
|
piVar12 = piVar12 + 2;
|
2020-04-06 01:06:00 +02:00
|
|
|
} while (iVar17 != 0);
|
2020-04-03 00:44:09 +02:00
|
|
|
}
|
2020-04-06 01:06:00 +02:00
|
|
|
|
|
|
|
#ifdef PSX
|
2020-04-03 00:44:09 +02:00
|
|
|
loadsectors((char *)addr, *sector, nsectors);
|
2020-04-06 01:06:00 +02:00
|
|
|
#else
|
|
|
|
loadsectorsPC(g_CurrentLevelFileName, (char *)addr, *sector, nsectors);
|
|
|
|
#endif // PSX
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
*sector = *sector + nsectors;
|
2020-04-06 01:06:00 +02:00
|
|
|
uVar18 = 0;
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
if (0 < nspecpages) {
|
|
|
|
do {
|
|
|
|
iVar13 = iVar13 + *addr;
|
2020-04-06 01:06:00 +02:00
|
|
|
iVar17 = speclist[uVar18].y;
|
|
|
|
tpageId = speclist[uVar18].x;
|
|
|
|
if ((uVar18 & 1) != 0) {
|
2020-04-03 00:44:09 +02:00
|
|
|
if (MaxSpecCluts < iVar13) {
|
|
|
|
MaxSpecCluts = iVar13;
|
|
|
|
}
|
|
|
|
iVar13 = 0;
|
|
|
|
}
|
2020-04-07 12:56:13 +02:00
|
|
|
if ((tpageId == page1) || (tpageId == page2)) {
|
2020-04-06 01:06:00 +02:00
|
|
|
update_slotinfo(tpageId, slotsused, &tpage);
|
|
|
|
LoadTPageAndCluts(&tpage, &clutpos, tpageId, (char *)addr);
|
2020-04-03 00:44:09 +02:00
|
|
|
nsectors_00 = nsectors_00 + *addr;
|
|
|
|
slotsused = slotsused + 1;
|
|
|
|
}
|
2020-04-06 01:06:00 +02:00
|
|
|
uVar18 = uVar18 + 1;
|
|
|
|
addr = (int *)((int)addr + (iVar17 + 0x7ffU & 0xfffff800));
|
|
|
|
} while ((int)uVar18 < nspecpages);
|
2020-04-03 00:44:09 +02:00
|
|
|
}
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
if (nsectors_00 < MaxSpecCluts) {
|
|
|
|
do {
|
|
|
|
nsectors_00 = nsectors_00 + 1;
|
|
|
|
IncrementClutNum(&clutpos);
|
|
|
|
} while (nsectors_00 < MaxSpecCluts);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (clutpos.x != 0x3c0) {
|
|
|
|
clutpos.y = clutpos.y + 1;
|
|
|
|
clutpos.x = 0x3c0;
|
|
|
|
}
|
2020-04-11 18:34:29 +02:00
|
|
|
if (slotsused < 19)
|
|
|
|
{
|
2020-04-06 01:06:00 +02:00
|
|
|
pDVar19 = &slot_tpagepos[slotsused];
|
|
|
|
pDVar16 = &slot_clutpos[slotsused];
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
nsectors_00 = slotsused;
|
|
|
|
do {
|
|
|
|
sVar8 = clutpos.y;
|
|
|
|
sVar7 = clutpos.x;
|
|
|
|
sVar6 = tpage.y;
|
|
|
|
sVar5 = tpage.x;
|
2020-04-06 01:06:00 +02:00
|
|
|
puVar11 = &tpageslots[nsectors_00];
|
2020-04-03 00:44:09 +02:00
|
|
|
nsectors_00 = nsectors_00 + 1;
|
|
|
|
*puVar11 = -1;
|
2020-04-06 01:06:00 +02:00
|
|
|
pDVar16->vx = sVar7;
|
|
|
|
pDVar16->vy = sVar8;
|
|
|
|
pDVar19->vx = sVar5;
|
|
|
|
pDVar19->vy = sVar6;
|
2020-04-03 00:44:09 +02:00
|
|
|
IncrementTPageNum(&tpage);
|
2020-04-06 01:06:00 +02:00
|
|
|
pDVar19 = pDVar19 + 1;
|
2020-04-03 00:44:09 +02:00
|
|
|
clutpos.y = clutpos.y + 8;
|
2020-04-06 01:06:00 +02:00
|
|
|
pDVar16 = pDVar16 + 1;
|
|
|
|
} while (nsectors_00 < 19);
|
2020-04-03 00:44:09 +02:00
|
|
|
}
|
2020-04-06 01:06:00 +02:00
|
|
|
|
2020-04-08 16:46:06 +02:00
|
|
|
//Emulator_SaveVRAM("VRAM_CLUTS_TPAGES.TGA", 0, 0, VRAM_WIDTH, VRAM_HEIGHT, TRUE);
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ ReloadIcons()
|
|
|
|
// line 578, offset 0x00081118
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 580
|
|
|
|
// Start offset: 0x00081118
|
|
|
|
// Variables:
|
|
|
|
// struct RECT tpage; // stack offset -88
|
|
|
|
// struct RECT clutpos; // stack offset -80
|
|
|
|
// char name[64]; // stack offset -72
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x00081140
|
|
|
|
// End Line: 599
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 1965
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 1966
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 2169
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 2170
|
|
|
|
|
|
|
|
/* begin block 4 */
|
|
|
|
// Start line: 2170
|
|
|
|
/* end block 4 */
|
|
|
|
// End Line: 2171
|
|
|
|
|
|
|
|
/* begin block 5 */
|
|
|
|
// Start line: 2174
|
|
|
|
/* end block 5 */
|
|
|
|
// End Line: 2175
|
|
|
|
|
|
|
|
/* WARNING: Unknown calling convention yet parameter storage is locked */
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void ReloadIcons(void)
|
|
|
|
{
|
2020-04-03 00:44:09 +02:00
|
|
|
ReportMode(0);
|
|
|
|
ReportMode(1);
|
|
|
|
return;
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ GetTextureDetails(char *name /*stack 0*/, struct TEXTURE_DETAILS *info /*$s3*/)
|
|
|
|
// line 602, offset 0x00080bb0
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 603
|
|
|
|
// Start offset: 0x00080BB0
|
|
|
|
// Variables:
|
|
|
|
// int i; // $s2
|
|
|
|
// int j; // $s1
|
|
|
|
// int texamt; // $s4
|
|
|
|
// struct TEXINF *texinf; // $v1
|
|
|
|
// char *nametable; // stack offset -56
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x00080D70
|
|
|
|
// End Line: 647
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 1517
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 1518
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 1545
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 1546
|
|
|
|
|
|
|
|
/* begin block 4 */
|
|
|
|
// Start line: 1552
|
|
|
|
/* end block 4 */
|
|
|
|
// End Line: 1553
|
|
|
|
|
2020-04-03 00:44:09 +02:00
|
|
|
void GetTextureDetails(char *name, TEXTURE_DETAILS *info)
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-03 00:44:09 +02:00
|
|
|
UNIMPLEMENTED();
|
|
|
|
/*
|
|
|
|
ushort uVar1;
|
|
|
|
char *pcVar2;
|
|
|
|
int iVar3;
|
|
|
|
TEXINF *pTVar4;
|
|
|
|
TEXINF **ppTVar5;
|
|
|
|
int iVar6;
|
|
|
|
int iVar7;
|
|
|
|
int iVar8;
|
|
|
|
ushort *puVar9;
|
|
|
|
int *piVar10;
|
|
|
|
|
|
|
|
pcVar2 = texturename_buffer;
|
|
|
|
iVar7 = 0;
|
|
|
|
if (0 < tpage_amount) {
|
|
|
|
ppTVar5 = tpage_ids128;
|
|
|
|
piVar10 = &tpage_texamts;
|
|
|
|
puVar9 = &texture_pages;
|
|
|
|
do {
|
|
|
|
iVar8 = *piVar10;
|
|
|
|
pTVar4 = *ppTVar5;
|
|
|
|
iVar6 = 0;
|
|
|
|
if (0 < iVar8) {
|
|
|
|
do {
|
|
|
|
iVar3 = strcmp(pcVar2 + pTVar4->nameoffset, name);
|
|
|
|
if ((iVar3 == 0) && ((texture_is_icon == 0 || (iVar7 == environmenttpage)))) {
|
|
|
|
info->tpageid = *puVar9;
|
|
|
|
uVar1 = (&texture_cluts)[iVar7 * 0x20 + iVar6];
|
|
|
|
info->texture_number = (char)iVar6;
|
|
|
|
info->texture_page = (char)iVar7;
|
|
|
|
info->clutid = uVar1;
|
|
|
|
(info->coords).u0 = pTVar4->x;
|
|
|
|
(info->coords).v0 = pTVar4->y;
|
|
|
|
(info->coords).u1 = pTVar4->x + pTVar4->width + -1;
|
|
|
|
(info->coords).v1 = pTVar4->y;
|
|
|
|
(info->coords).u2 = pTVar4->x;
|
|
|
|
(info->coords).v2 = pTVar4->y + pTVar4->height + -1;
|
|
|
|
(info->coords).u3 = pTVar4->x + pTVar4->width + -1;
|
|
|
|
(info->coords).v3 = pTVar4->y + pTVar4->height + -1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
iVar6 = iVar6 + 1;
|
|
|
|
pTVar4 = pTVar4 + 1;
|
|
|
|
} while (iVar6 < iVar8);
|
|
|
|
}
|
|
|
|
ppTVar5 = ppTVar5 + 1;
|
|
|
|
piVar10 = piVar10 + 1;
|
|
|
|
iVar7 = iVar7 + 1;
|
|
|
|
puVar9 = puVar9 + 1;
|
|
|
|
} while (iVar7 < tpage_amount);
|
|
|
|
}
|
|
|
|
texture_is_icon = 0;
|
|
|
|
GetTextureDetails((char *)&PTR_DAT_000aa9c0, info);
|
|
|
|
return;
|
|
|
|
*/
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|