diff options
| author | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-12-09 13:51:28 +0000 |
|---|---|---|
| committer | Rodolfo Osvaldo Bogado <rodolfoosvaldobogado@gmail.com> | 2009-12-09 13:51:28 +0000 |
| commit | 0bc7fa7bf5d37463fbb414062335465275712730 (patch) | |
| tree | d092d41c6bae1481fe61fadc84a11e3cf186b49a /Source/Core/VideoCommon/Src/TextureDecoder.cpp | |
| parent | a1d612e94687469a11a89ced9449da03e43b2d6c (diff) | |
Small fix for the last commit, and a little fix for disable fog to really disable it :)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4662 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureDecoder.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureDecoder.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index 01d1c50d4c..b2b8e0ee23 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -465,14 +465,14 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int for (int y = 0; y < height; y += 8) for (int x = 0; x < width; x += 8) for (int iy = 0; iy < 8; iy++, src += 4) - decodebytesC4_5A3_To_BGRA32((u32*)dst + (y + iy) * width + x, src, tlutaddr); + decodebytesC4_5A3_To_BGRA32(((u32*)((u8*)dst + (y + iy) * Pitch)) + x, src, tlutaddr); } else { for (int y = 0; y < height; y += 8) for (int x = 0; x < width; x += 8) for (int iy = 0; iy < 8; iy++, src += 4) - decodebytesC4_To_Raw16((u16*)dst + (y + iy) * width + x, src, tlutaddr); + decodebytesC4_To_Raw16(((u16*)((u8*)dst + (y + iy) * Pitch)) + x, src, tlutaddr); } return GetPCFormatFromTLUTFormat(tlutfmt); case GX_TF_I4: @@ -483,8 +483,8 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int for (int ix = 0; ix < 4; ix++) { int val = src[ix]; - dst[(y + iy) * width + x + ix * 2] = Convert4To8(val >> 4); - dst[(y + iy) * width + x + ix * 2 + 1] = Convert4To8(val & 0xF); + dst[(y + iy) * Pitch + x + ix * 2] = Convert4To8(val >> 4); + dst[(y + iy) * Pitch + x + ix * 2 + 1] = Convert4To8(val & 0xF); } } return PC_TEX_FMT_I4_AS_I8; @@ -493,7 +493,7 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int for (int y = 0; y < height; y += 4) for (int x = 0; x < width; x += 8) for (int iy = 0; iy < 4; iy++, src += 8) - memcpy(dst + (y + iy)*width+x, src, 8); + memcpy((u8*)dst + (y + iy)*Pitch+x, src, 8); } return PC_TEX_FMT_I8; case GX_TF_C8: @@ -503,14 +503,14 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int for (int y = 0; y < height; y += 4) for (int x = 0; x < width; x += 8) for (int iy = 0; iy < 4; iy++, src += 8) - decodebytesC8_5A3_To_BGRA32((u32*)dst + (y + iy) * width + x, src, tlutaddr); + decodebytesC8_5A3_To_BGRA32(((u32*)((u8*)dst + (y + iy) * Pitch)) + x, src, tlutaddr); } else { for (int y = 0; y < height; y += 4) for (int x = 0; x < width; x += 8) for (int iy = 0; iy < 4; iy++, src += 8) - decodebytesC8_To_Raw16((u16*)dst + (y + iy) * width + x, src, tlutaddr); + decodebytesC8_To_Raw16(((u16*)((u8*)dst + (y + iy) * Pitch)) + x, src, tlutaddr); } return GetPCFormatFromTLUTFormat(tlutfmt); case GX_TF_IA4: @@ -518,7 +518,7 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int for (int y = 0; y < height; y += 4) for (int x = 0; x < width; x += 8) for (int iy = 0; iy < 4; iy++, src += 8) - decodebytesIA4((u16*)dst + (y + iy) * width + x, src); + decodebytesIA4(((u16*)((u8*)dst + (y + iy) * Pitch)) + x, src); } return PC_TEX_FMT_IA4_AS_IA8; case GX_TF_IA8: @@ -527,7 +527,7 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int for (int x = 0; x < width; x += 4) for (int iy = 0; iy < 4; iy++, src += 8) { - u16 *ptr = (u16 *)dst + (y + iy) * width + x; + u16 *ptr = ((u16 *)((u8*)dst + (y + iy) * Pitch)) + x; u16 *s = (u16 *)src; for(int j = 0; j < 4; j++) *ptr++ = Common::swap16(*s++); @@ -542,14 +542,14 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int for (int y = 0; y < height; y += 4) for (int x = 0; x < width; x += 4) for (int iy = 0; iy < 4; iy++, src += 8) - decodebytesC14X2_5A3_To_BGRA32((u32*)dst + (y + iy) * width + x, (u16*)src, tlutaddr); + decodebytesC14X2_5A3_To_BGRA32(((u32*)((u8*)dst + (y + iy) * Pitch)) + x, (u16*)src, tlutaddr); } else { for (int y = 0; y < height; y += 4) for (int x = 0; x < width; x += 4) for (int iy = 0; iy < 4; iy++, src += 8) - decodebytesC14X2_To_Raw16((u16*)dst + (y + iy) * width + x, (u16*)src, tlutaddr); + decodebytesC14X2_To_Raw16(((u16*)((u8*)dst + (y + iy) * Pitch)) + x, (u16*)src, tlutaddr); } return GetPCFormatFromTLUTFormat(tlutfmt); case GX_TF_RGB565: @@ -558,7 +558,7 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int for (int x = 0; x < width; x += 4) for (int iy = 0; iy < 4; iy++, src += 8) { - u16 *ptr = (u16 *)dst + (y + iy) * width + x; + u16 *ptr = ((u16 *)(dst + (y + iy) * Pitch)) + x; u16 *s = (u16 *)src; for(int j = 0; j < 4; j++) *ptr++ = Common::swap16(*s++); @@ -571,7 +571,7 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int for (int x = 0; x < width; x += 4) for (int iy = 0; iy < 4; iy++, src += 8) //decodebytesRGB5A3((u32*)dst+(y+iy)*width+x, (u16*)src, 4); - decodebytesRGB5A3((u32*)dst+(y+iy)*width+x, (u16*)src); + decodebytesRGB5A3(((u32*)((u8*)dst+(y+iy)*Pitch))+x, (u16*)src); } return PC_TEX_FMT_BGRA32; case GX_TF_RGBA8: // speed critical @@ -580,7 +580,7 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int for (int x = 0; x < width; x += 4) { for (int iy = 0; iy < 4; iy++) - decodebytesARGB8_4((u32*)dst + (y+iy)*width + x, (u16*)src + 4 * iy, (u16*)src + 4 * iy + 16); + decodebytesARGB8_4(((u32*)((u8*)dst + (y+iy)*Pitch)) + x, (u16*)src + 4 * iy, (u16*)src + 4 * iy + 16); src += 64; } } @@ -611,13 +611,13 @@ PC_TexFormat TexDecoder_DirectDecode_real(u8 *dst, const u8 *src, int width, int { for (int x = 0; x < width; x += 8) { - decodeDXTBlock((u32*)dst + y * width + x, (DXTBlock*)src, width); + decodeDXTBlock(((u32*)((u8*)dst + y * Pitch)) + x, (DXTBlock*)src, width); src += sizeof(DXTBlock); - decodeDXTBlock((u32*)dst + y * width + x + 4, (DXTBlock*)src, width); + decodeDXTBlock(((u32*)((u8*)dst + y * Pitch)) + x + 4, (DXTBlock*)src, width); src += sizeof(DXTBlock); - decodeDXTBlock((u32*)dst + (y + 4) * width + x, (DXTBlock*)src, width); + decodeDXTBlock(((u32*)((u8*)dst + (y + 4) * Pitch)) + x, (DXTBlock*)src, width); src += sizeof(DXTBlock); - decodeDXTBlock((u32*)dst + (y + 4) * width + x + 4, (DXTBlock*)src, width); + decodeDXTBlock(((u32*)((u8*)dst + (y + 4) * Pitch)) + x + 4, (DXTBlock*)src, width); src += sizeof(DXTBlock); } } |
