diff --git a/src/rwbase.h b/src/rwbase.h index 5058697..984ebba 100644 --- a/src/rwbase.h +++ b/src/rwbase.h @@ -601,7 +601,7 @@ libraryIDPack(int version, int build) { if(version <= 0x31000) return version>>8; - return (version-0x30000 & 0x3FF00) << 14 | (version&0x3F) << 16 | + return ((version-0x30000) & 0x3FF00) << 14 | (version&0x3F) << 16 | (build & 0xFFFF); } @@ -609,7 +609,7 @@ inline int libraryIDUnpackVersion(uint32 libid) { if(libid & 0xFFFF0000) - return (libid>>14 & 0x3FF00) + 0x30000 | + return ((libid>>14 & 0x3FF00) + 0x30000) | (libid>>16 & 0x3F); else return libid<<8; diff --git a/src/rwobjects.h b/src/rwobjects.h index d5afdc2..a259e1a 100644 --- a/src/rwobjects.h +++ b/src/rwobjects.h @@ -258,11 +258,11 @@ struct Texture static Texture *fromDict(LLLink *lnk){ return LLLinkGetData(lnk, Texture, inDict); } FilterMode getFilter(void) { return (FilterMode)(filterAddressing & 0xFF); } - void setFilter(FilterMode f) { filterAddressing = filterAddressing & ~0xFF | f; } + void setFilter(FilterMode f) { filterAddressing = (filterAddressing & ~0xFF) | f; } Addressing getAddressU(void) { return (Addressing)((filterAddressing >> 8) & 0xF); } Addressing getAddressV(void) { return (Addressing)((filterAddressing >> 12) & 0xF); } - void setAddressU(Addressing u) { filterAddressing = filterAddressing & ~0xF00 | u<<8; } - void setAddressV(Addressing v) { filterAddressing = filterAddressing & ~0xF000 | v<<12; } + void setAddressU(Addressing u) { filterAddressing = (filterAddressing & ~0xF00) | u<<8; } + void setAddressV(Addressing v) { filterAddressing = (filterAddressing & ~0xF000) | v<<12; } static Texture *streamRead(Stream *stream); bool streamWrite(Stream *stream); uint32 streamGetSize(void);