mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 05:25:14 +00:00
Fix small mistake in DynOS_Tex_Get
This commit is contained in:
parent
c8bf12754f
commit
b08fc74a3d
1 changed files with 6 additions and 2 deletions
|
@ -451,6 +451,10 @@ void DynOS_Tex_AddCustom(const SysPath &aFilename, const char *aTexName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool IsPowerOfTwo(int n) {
|
||||||
|
return (ceil(log2(n)) == floor(log2(n)));
|
||||||
|
}
|
||||||
|
|
||||||
bool DynOS_Tex_Get(const char* aTexName, struct TextureInfo* aOutTexInfo) {
|
bool DynOS_Tex_Get(const char* aTexName, struct TextureInfo* aOutTexInfo) {
|
||||||
#define CONVERT_TEXINFO { \
|
#define CONVERT_TEXINFO { \
|
||||||
/* translate bit size */ \
|
/* translate bit size */ \
|
||||||
|
@ -483,8 +487,8 @@ bool DynOS_Tex_Get(const char* aTexName, struct TextureInfo* aOutTexInfo) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// texture width or height is NPOT
|
// texture width or height is NPOT
|
||||||
if (!(_Data->mRawWidth > 0 && _Data->mRawWidth & (_Data->mRawWidth - 1) == 0) ||
|
if ((_Data->mRawWidth > 0 && _Data->mRawWidth & (_Data->mRawWidth - 1) == 0) ||
|
||||||
!(_Data->mRawHeight > 0 && _Data->mRawHeight & (_Data->mRawHeight - 1) == 0)) {
|
(_Data->mRawHeight > 0 && _Data->mRawHeight & (_Data->mRawHeight - 1) == 0)) {
|
||||||
PrintError("Attempted to load tex file with non power of two width or height: %s", aTexName);
|
PrintError("Attempted to load tex file with non power of two width or height: %s", aTexName);
|
||||||
PrintConsole(CONSOLE_MESSAGE_ERROR, "Attempted to load tex file with non power of two width or height: %s", aTexName);
|
PrintConsole(CONSOLE_MESSAGE_ERROR, "Attempted to load tex file with non power of two width or height: %s", aTexName);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue