From b58320d7dcfc09d000197f995dd59d8d672b5879 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 17 May 2014 11:29:49 -0700 Subject: [PATCH] GL: Small simplification. --- rpcs3/Emu/GS/GL/GLGSRender.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/GS/GL/GLGSRender.h b/rpcs3/Emu/GS/GL/GLGSRender.h index b13fb585ea..0cb4080c5a 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.h +++ b/rpcs3/Emu/GS/GL/GLGSRender.h @@ -83,9 +83,11 @@ public: void Init(RSXTexture& tex) { Bind(); - if(!Memory.IsGoodAddr(GetAddress(tex.GetOffset(), tex.GetLocation()))) + + const u64 texaddr = GetAddress(tex.GetOffset(), tex.GetLocation()); + if (!Memory.IsGoodAddr(texaddr)) { - ConLog.Error("Bad texture address=0x%x", GetAddress(tex.GetOffset(), tex.GetLocation())); + ConLog.Error("Bad texture address=0x%x", texaddr); return; } //ConLog.Warning("texture addr = 0x%x, width = %d, height = %d, max_aniso=%d, mipmap=%d, remap=0x%x, zfunc=0x%x, wraps=0x%x, wrapt=0x%x, wrapr=0x%x, minlod=0x%x, maxlod=0x%x", @@ -96,8 +98,8 @@ public: int format = tex.GetFormat() & ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN); bool is_swizzled = !(tex.GetFormat() & CELL_GCM_TEXTURE_LN); - u8* pixels = (u8*)Memory.GetMemFromAddr(GetAddress(tex.GetOffset(), tex.GetLocation())); - u8* unswizzledPixels; + const u8 *pixels = const_cast(Memory.GetMemFromAddr(texaddr)); + u8 *unswizzledPixels; static const GLint glRemapStandard[4] = {GL_ALPHA, GL_RED, GL_GREEN, GL_BLUE}; // NOTE: This must be in ARGB order in all forms below. const GLint *glRemap = glRemapStandard;