DXINIT_GetCurrentResolution, PCText_GetTextureSplitID, CGlow and CGlow::SetCentreRGB

This commit is contained in:
krystalgamer 2024-05-27 18:58:37 +02:00
parent 5cffb10f44
commit 2f40d032ba
7 changed files with 55 additions and 3 deletions

View File

@ -1 +1,12 @@
#include "DXinit.h"
#include "DXinit.h"
static int gResolutionX;
static int gResolutionY;
// @NotOk
// Globals
void DXINIT_GetCurrentResolution(int *x, int *y)
{
*x = gResolutionX;
*y = gResolutionY;
}

View File

@ -3,4 +3,8 @@
#ifndef DXINIT_H
#define DXINIT_H
#endif
#include "export.h"
EXPORT void DXINIT_GetCurrentResolution(int *, int *);
#endif

View File

@ -62,6 +62,13 @@ int __inline countLeadingBits(unsigned int value)
return bits;
}
// @NotOk
// Globals
int PCTex_GetTextureSplitID(int index, int id)
{
return gGlobalTextures[index].split[id];
}
void validate_WeirdTextureHolder(void)
{
VALIDATE_SIZE(WeirdTextureHolder, 0x68);
@ -70,4 +77,5 @@ void validate_WeirdTextureHolder(void)
VALIDATE(WeirdTextureHolder, wScale, 0x4);
VALIDATE(WeirdTextureHolder, hScale, 0x8);
VALIDATE(WeirdTextureHolder, flags, 0xC);
VALIDATE(WeirdTextureHolder, split, 0x10);
}

View File

@ -12,7 +12,8 @@ struct WeirdTextureHolder
float wScale;
float hScale;
int flags;
unsigned char pad[0x68-6-0xC];
int *split;
unsigned char pad[0x68-6-0x10];
};
EXPORT void PCTex_SetTextureUserData(int, Bitmap256*);
@ -21,6 +22,7 @@ EXPORT float PCTex_GetTextureHScale(int);
EXPORT int PCTex_GetTextureFlags(int);
EXPORT int countBits(unsigned int);
EXPORT int countLeadingBits(unsigned int);
EXPORT int PCTex_GetTextureSplitID(int, int);
void validate_WeirdTextureHolder(void);

15
bit.cpp
View File

@ -256,6 +256,12 @@ CSpecialDisplay::CSpecialDisplay(void)
this->AttachTo(reinterpret_cast<CBit**>(0x56EB34));
}
// @Ok
void CGlow::SetCentreRGB(unsigned char a2, unsigned char a3, unsigned char a4)
{
this->field_4C = 0x32000000 | (((a4 << 8) | a3) << 8) | a2;
}
void validate_CFlatBit(void){
VALIDATE(CFlatBit, field_58, 0x58);
VALIDATE(CFlatBit, field_5A, 0x5A);
@ -290,6 +296,8 @@ void validate_CQuadBit(void)
VALIDATE(CQuadBit, mTint, 0x6C);
}
void validate_CBit(void)
{
VALIDATE(CBit, mPrevious, 0x4);
@ -309,3 +317,10 @@ void validate_CSmokeTrail(void)
{
VALIDATE_SIZE(CSmokeTrail, 0x58);
}
void validate_CGlow(void)
{
VALIDATE_SIZE(CGlow, 0x5C);
VALIDATE(CGlow, field_4C, 0x4C);
}

11
bit.h
View File

@ -123,6 +123,16 @@ class CSimpleTexturedRibbon : public CSpecialDisplay
public:
};
class CGlow : public CBit
{
public:
EXPORT void SetCentreRGB(unsigned char, unsigned char, unsigned char);
unsigned char padTop[0x10];
int field_4C;
unsigned char padBottom[0x5C-0x4C-4];
};
EXPORT int Bit_MakeSpriteRing(CVector*, int, int, int, int, int, int, int);
EXPORT void MoveList(CBit *);
EXPORT void Bit_SetSparkRGB(unsigned char, unsigned char, unsigned char);
@ -134,3 +144,4 @@ void validate_CQuadBit(void);
void validate_CBit(void);
void validate_CNonRenderedBit(void);
void validate_CSmokeTrail(void);
void validate_CGlow(void);

View File

@ -270,6 +270,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
validate_WeirdTextureHolder();
validate_CPolyLine();
validate_CSonicBubble();
validate_CGlow();
puts("[*] Validation done!");