1
0
Fork 0
forked from suyu/suyu

Pica/DebugUtils: Further cleanups to LookupTexture.

This commit is contained in:
Tony Wasserka 2014-12-19 19:37:37 +01:00
parent 88e9efe4b8
commit 871418e62b

View file

@ -392,13 +392,13 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
{ {
const u8* source_ptr = source + coarse_x * block_height * 2 + coarse_y * info.stride + texel_index_within_tile * 2; const u8* source_ptr = source + coarse_x * block_height * 2 + coarse_y * info.stride + texel_index_within_tile * 2;
// TODO: compoent order not verified // TODO: component order not verified
if (disable_alpha) { if (disable_alpha) {
// Show intensity as red, alpha as green // Show intensity as red, alpha as green
return { *source_ptr, *(source_ptr+1), 0, 255 }; return { source_ptr[0], source_ptr[1], 0, 255 };
} else { } else {
return { *source_ptr, *source_ptr, *source_ptr, *(source_ptr+1)}; return { source_ptr[0], source_ptr[0], source_ptr[0], source_ptr[1]};
} }
} }
@ -423,7 +423,7 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
{ {
const u8* source_ptr = source + coarse_x * block_height / 2 + coarse_y * info.stride + texel_index_within_tile / 2; const u8* source_ptr = source + coarse_x * block_height / 2 + coarse_y * info.stride + texel_index_within_tile / 2;
// TODO: compoent order not verified // TODO: component order not verified
u8 i = (*source_ptr) & 0xF; u8 i = (*source_ptr) & 0xF;
u8 a = ((*source_ptr) & 0xF0) >> 4; u8 a = ((*source_ptr) & 0xF0) >> 4;
@ -442,11 +442,11 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
{ {
const u8* source_ptr = source + coarse_x * block_height / 2 + coarse_y * info.stride + texel_index_within_tile / 2; const u8* source_ptr = source + coarse_x * block_height / 2 + coarse_y * info.stride + texel_index_within_tile / 2;
// TODO: Order? // TODO: component order not verified
u8 a = (coarse_x % 2) ? ((*source_ptr)&0xF) : (((*source_ptr) & 0xF0) >> 4); u8 a = (coarse_x % 2) ? ((*source_ptr)&0xF) : (((*source_ptr) & 0xF0) >> 4);
a |= a << 4; a |= a << 4;
// TODO: Better control this...
if (disable_alpha) { if (disable_alpha) {
return { *source_ptr, *source_ptr, *source_ptr, 255 }; return { *source_ptr, *source_ptr, *source_ptr, 255 };
} else { } else {