mirror of
https://github.com/krystalgamer/spidey-decomp.git
synced 2024-11-27 15:20:25 +00:00
countBits
This commit is contained in:
parent
8baca6dae0
commit
02352d288c
23
PCTex.cpp
23
PCTex.cpp
@ -24,10 +24,33 @@ float PCTex_GetTextureHScale(int index)
|
||||
return gGlobalTextures[index].hScale;
|
||||
}
|
||||
|
||||
// @NotOk
|
||||
// globals
|
||||
int PCTex_GetTextureFlags(int index)
|
||||
{
|
||||
return gGlobalTextures[index].flags;
|
||||
}
|
||||
|
||||
// @Ok
|
||||
int __inline countBits(unsigned int value)
|
||||
{
|
||||
int bits = 0;
|
||||
|
||||
while (value)
|
||||
{
|
||||
bits += value & 1;
|
||||
value >>= 1;
|
||||
}
|
||||
|
||||
return bits;
|
||||
}
|
||||
|
||||
void validate_WeirdTextureHolder(void)
|
||||
{
|
||||
VALIDATE_SIZE(WeirdTextureHolder, 0x68);
|
||||
|
||||
VALIDATE(WeirdTextureHolder, texture, 0x0);
|
||||
VALIDATE(WeirdTextureHolder, wScale, 0x4);
|
||||
VALIDATE(WeirdTextureHolder, hScale, 0x8);
|
||||
VALIDATE(WeirdTextureHolder, flags, 0xC);
|
||||
}
|
||||
|
5
PCTex.h
5
PCTex.h
@ -11,12 +11,15 @@ struct WeirdTextureHolder
|
||||
Bitmap256* texture;
|
||||
float wScale;
|
||||
float hScale;
|
||||
unsigned char pad[0x68-6-4];
|
||||
int flags;
|
||||
unsigned char pad[0x68-6-0xC];
|
||||
};
|
||||
|
||||
EXPORT void PCTex_SetTextureUserData(int, Bitmap256*);
|
||||
EXPORT float PCTex_GetTextureWScale(int);
|
||||
EXPORT float PCTex_GetTextureHScale(int);
|
||||
EXPORT int PCTex_GetTextureFlags(int);
|
||||
EXPORT int countBits(unsigned int);
|
||||
|
||||
void validate_WeirdTextureHolder(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user