1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Code cleanup: fix idents in GLideNHQ/TxUtil

This commit is contained in:
Sergey Lipskiy 2015-01-19 12:16:16 +06:00
parent 366c389d56
commit f2ab6d9505
2 changed files with 40 additions and 40 deletions

View File

@ -492,25 +492,25 @@ TxUtil::getNumberofProcessors()
int numcore = 1; int numcore = 1;
try { try {
#if defined (OS_WINDOWS) #if defined (OS_WINDOWS)
SYSTEM_INFO sysinfo; SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo); GetSystemInfo(&sysinfo);
numcore = sysinfo.dwNumberOfProcessors; numcore = sysinfo.dwNumberOfProcessors;
#elif defined (OS_MAC_OS_X) #elif defined (OS_MAC_OS_X)
int nm[2]; int nm[2];
size_t len = 4; size_t len = 4;
uint32_t count; uint32_t count;
nm[0] = CTL_HW; nm[1] = HW_AVAILCPU; nm[0] = CTL_HW; nm[1] = HW_AVAILCPU;
sysctl(nm, 2, &count, &len, NULL, 0);
if (count < 1) {
nm[1] = HW_NCPU;
sysctl(nm, 2, &count, &len, NULL, 0); sysctl(nm, 2, &count, &len, NULL, 0);
if (count < 1) { count = 1; }
} if (count < 1) {
numcore = count; nm[1] = HW_NCPU;
sysctl(nm, 2, &count, &len, NULL, 0);
if (count < 1) { count = 1; }
}
numcore = count;
#elif defined (OS_LINUX) #elif defined (OS_LINUX)
numcore = sysconf(_SC_NPROCESSORS_ONLN); numcore = sysconf(_SC_NPROCESSORS_ONLN);
#endif #endif
} catch (...) { } catch (...) {
DBG_INFO(80, L"Error: number of processor detection failed!\n"); DBG_INFO(80, L"Error: number of processor detection failed!\n");

View File

@ -36,40 +36,40 @@
class TxUtil class TxUtil
{ {
private: private:
uint32 RiceCRC32(const uint8* src, int width, int height, int size, int rowStride); uint32 RiceCRC32(const uint8* src, int width, int height, int size, int rowStride);
boolean RiceCRC32_CI4(const uint8* src, int width, int height, int rowStride, boolean RiceCRC32_CI4(const uint8* src, int width, int height, int rowStride,
uint32* crc32, uint32* cimax); uint32* crc32, uint32* cimax);
boolean RiceCRC32_CI8(const uint8* src, int width, int height, int rowStride, boolean RiceCRC32_CI8(const uint8* src, int width, int height, int rowStride,
uint32* crc32, uint32* cimax); uint32* crc32, uint32* cimax);
public: public:
TxUtil() { } TxUtil() { }
~TxUtil() { } ~TxUtil() { }
int sizeofTx(int width, int height, uint16 format); int sizeofTx(int width, int height, uint16 format);
uint32 checksumTx(uint8 *data, int width, int height, uint16 format); uint32 checksumTx(uint8 *data, int width, int height, uint16 format);
#if 0 /* unused */ #if 0 /* unused */
uint32 chkAlpha(uint32* src, int width, int height); uint32 chkAlpha(uint32* src, int width, int height);
#endif #endif
uint32 checksum(uint8 *src, int width, int height, int size, int rowStride); uint32 checksum(uint8 *src, int width, int height, int size, int rowStride);
uint64 checksum64(uint8 *src, int width, int height, int size, int rowStride, uint8 *palette); uint64 checksum64(uint8 *src, int width, int height, int size, int rowStride, uint8 *palette);
int getNumberofProcessors(); int getNumberofProcessors();
}; };
class TxMemBuf class TxMemBuf
{ {
private: private:
uint8 *_tex[2]; uint8 *_tex[2];
uint32 _size[2]; uint32 _size[2];
TxMemBuf(); TxMemBuf();
public: public:
static TxMemBuf* getInstance() { static TxMemBuf* getInstance() {
static TxMemBuf txMemBuf; static TxMemBuf txMemBuf;
return &txMemBuf; return &txMemBuf;
} }
~TxMemBuf(); ~TxMemBuf();
boolean init(int maxwidth, int maxheight); boolean init(int maxwidth, int maxheight);
void shutdown(void); void shutdown(void);
uint8 *get(unsigned int num); uint8 *get(unsigned int num);
uint32 size_of(unsigned int num); uint32 size_of(unsigned int num);
}; };
void setTextureFormat(uint16 internalFormat, GHQTexInfo * info); void setTextureFormat(uint16 internalFormat, GHQTexInfo * info);