Spool_GetModelChecksum

This commit is contained in:
krystalgamer 2024-07-18 20:26:22 +02:00
parent 967a0dbf22
commit eb9c85d9b3
2 changed files with 28 additions and 0 deletions

View File

@ -22,6 +22,12 @@ static const char SuitNames[5][32];
static const char SuitNames[5][32] = { 0 };
#endif
// @Ok
u32 Spool_GetModelChecksum(CItem *pItem)
{
return PSXRegion[pItem->mRegion].pModelChecksums[pItem->mModel];
}
// @SMALLTODO
CItem* Spool_FindEnviroItem(u32)
{
@ -185,6 +191,26 @@ Texture *Spool_FindTextureEntry(char *name)
return Spool_FindTextureEntry(gTextureEntries[index].Checksum);
}
u32 Spool_FindTextureChecksum(char *name)
{
char localName[256];
strcpy(localName, name);
strlwr(localName);
i32 index;
for (index = 0; index < 256; index++)
{
TextureEntry *currentEntry = &gTextureEntries[index];
if (!strcmp(currentEntry->Name, localName) && currentEntry->Active)
break;
}
if (index < 256)
return gTextureEntries[index].Checksum;
return 0;
}
void validate_SPSXRegion(void)
{
VALIDATE_SIZE(SPSXRegion, 0x44);

View File

@ -78,6 +78,8 @@ EXPORT void Spool_ClearPSX(const char*);
EXPORT CItem* Spool_FindEnviroItem(u32);
EXPORT Texture* Spool_FindTextureEntry(u32);
EXPORT Texture* Spool_FindTextureEntry(char *);
EXPORT u32 Spool_FindTextureChecksum(char *);
EXPORT u32 Spool_GetModelChecksum(CItem *);
void validate_SPSXRegion(void);
void validate_TextureEntry(void);