mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 08:25:35 +00:00
tinsel: fixed endianess issue in psx palette remapper
svn-id: r41142
This commit is contained in:
parent
9673beb082
commit
ee04870cc2
@ -110,7 +110,7 @@ void psxPaletteMapper(PALQ *originalPal, uint8 *psxClut, byte *mapperTable) {
|
||||
}
|
||||
|
||||
// Check for correspondent color
|
||||
for (int i = 0; (i < pal->numColours) && !colorFound; i++) {
|
||||
for (int i = 0; (i < FROM_LE_32(pal->numColours)) && !colorFound; i++) {
|
||||
// get R G B values in the same way as psx format converters
|
||||
uint16 psxEquivalent = TINSEL_PSX_RGB(TINSEL_GetRValue(pal->palRGB[i]) >> 3, TINSEL_GetGValue(pal->palRGB[i]) >> 3, TINSEL_GetBValue(pal->palRGB[i]) >> 3);
|
||||
|
||||
|
@ -39,7 +39,7 @@ typedef uint32 COLORREF;
|
||||
#define TINSEL_GetGValue(rgb) ((uint8)(((uint16)(FROM_LE_32(rgb)))>>8))
|
||||
#define TINSEL_GetBValue(rgb) ((uint8)((FROM_LE_32(rgb))>>16))
|
||||
|
||||
#define TINSEL_PSX_RGB(r,g,b) ((uint16)TO_LE_16(((uint8)(r))|((uint16)(g)<<5)|(((uint16)(b))<<10)))
|
||||
#define TINSEL_PSX_RGB(r,g,b) ((uint16)(((uint8)(r))|((uint16)(g)<<5)|(((uint16)(b))<<10)))
|
||||
|
||||
enum {
|
||||
MAX_COLOURS = 256, //!< maximum number of colours - for VGA 256
|
||||
|
Loading…
x
Reference in New Issue
Block a user