mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +00:00
Code cleanup: remove unused function textureCRC
This commit is contained in:
parent
2bc803dd14
commit
f48ab4828d
24
src/CRC.cpp
24
src/CRC.cpp
|
@ -1,4 +1,4 @@
|
|||
#include "Types.h"
|
||||
#include "CRC.h"
|
||||
|
||||
#define CRC32_POLYNOMIAL 0x04C11DB7
|
||||
|
||||
|
@ -58,25 +58,3 @@ u32 CRC_CalculatePalette(u32 crc, const void * buffer, u32 count )
|
|||
|
||||
return crc ^ orig;
|
||||
}
|
||||
|
||||
u32 textureCRC(u8 * addr, u32 height, u32 stride)
|
||||
{
|
||||
const u32 width = stride / 8;
|
||||
const u32 line = stride % 8;
|
||||
u64 crc = 0;
|
||||
u64 twopixel_crc;
|
||||
|
||||
u32 * pixelpos = (u32*)addr;
|
||||
for (; height; height--) {
|
||||
int col = 0;
|
||||
for (u32 i = width; i; --i) {
|
||||
twopixel_crc = i * ((u64)(pixelpos[1] & 0xFFFEFFFE) + (u64)(pixelpos[0] & 0xFFFEFFFE) + crc);
|
||||
crc = (twopixel_crc >> 32) + twopixel_crc;
|
||||
pixelpos += 2;
|
||||
}
|
||||
crc = (height * crc >> 32) + height * crc;
|
||||
pixelpos = (u32*)((u8*)pixelpos + line);
|
||||
}
|
||||
|
||||
return crc&0xFFFFFFFF;
|
||||
}
|
||||
|
|
|
@ -5,5 +5,3 @@ void CRC_BuildTable();
|
|||
// CRC32
|
||||
u32 CRC_Calculate( u32 crc, const void *buffer, u32 count );
|
||||
u32 CRC_CalculatePalette( u32 crc, const void *buffer, u32 count );
|
||||
// Fast checksum calculation from Glide64
|
||||
u32 textureCRC(u8 * addr, u32 height, u32 stride);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "Types.h"
|
||||
#include "CRC.h"
|
||||
|
||||
void CRC_BuildTable()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user