Skip to content

Commit

Permalink
Calculate CRC for full textures.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed Dec 15, 2020
1 parent c589261 commit 84110c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/SysVita/Graphics/NativeTextureVita.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <png.h>
#include <vitaGL.h>

#define HIGHRES_TEXTURE_CACHE_SIZE 128
#define HIGHRES_TEXTURE_CACHE_SIZE 256
static int highres_tex_cache_idx = -1;
static int highres_tex_cache_size = -1;
static bool highres_tex_cache_free = false;
Expand Down Expand Up @@ -130,7 +130,7 @@ void CNativeTexture::InstallTexture()
if (gTexturesDumper) DumpForHighRes();
if (gUseHighResTextures) {
if (highResState == HIGH_RES_UNCHECKED) {
if (!crc) crc = daedalus_crc32(0, (u8*)mpData, mCorrectedWidth * mCorrectedHeight);
if (!crc) crc = daedalus_crc32(0, (u8*)mpData, mCorrectedWidth * mCorrectedHeight * 4);
GLuint tex_id = highres_cache_lookup(crc);
if (tex_id != 0xDEADBEEF) {
glDeleteTextures(1, &mTextureId);
Expand Down Expand Up @@ -279,7 +279,7 @@ void CNativeTexture::Dump(const char *filename)
void CNativeTexture::DumpForHighRes()
{
if (!dumped) {
if (!crc) crc = daedalus_crc32(0, (u8*)mpData, mCorrectedWidth * mCorrectedHeight);
if (!crc) crc = daedalus_crc32(0, (u8*)mpData, mCorrectedWidth * mCorrectedHeight * 4);
char filename[128], folder[128];
sprintf(folder, "%s%04X", DAEDALUS_VITA_PATH("Textures/"), g_ROM.rh.CartID);
sprintf(filename, "%s/%08X.png", folder, crc);
Expand Down

0 comments on commit 84110c4

Please sign in to comment.