tinsel: fixed endianess issue in psx palette remapper

svn-id: r41142
This commit is contained in:
Fabio Battaglia 2009-06-03 16:15:17 +00:00
parent 9673beb082
commit ee04870cc2
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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