View Single Post
Old 30 August 2011, 22:09   #75
NovaCoder
Registered User
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 3,444
Ok, I think I've spotted the problem, I'll upload a new version to the Zone for you to test now.


I've changed this:

Code:
    p = 0;
    
	// Indivision GFX uses 15bit palette
	for (i=0; i<128; i++) {
		byte *color1 = (byte*)&(_currentPalette[p]);   
		
		p += 3;
		
        byte *color2 = (byte*)&(_currentPalette[p]);            
        
        video_colourtable[ptranslate[i]]= ((((UBYTE)(color2[0]) & 0xf8) >> 3) |
                                          (((UBYTE)(color2[1]) & 0xf8) << 2) |
                                          (((UBYTE)(color2[2]) & 0xf8) << 7) |
                                          (((UBYTE)(color1[0]) & 0xf8) << 13) |
                                          (((UBYTE)(color1[1]) & 0xf8) << 18) |
                                          (((UBYTE)(color1[2]) & 0xf8) << 23));
                                          
                                          
       	p += 3;                                   
	}
To the standard way:

Code:
	for (i=0; i<128; i++) {
        video_colourtable[ptranslate[i]] =
        	( (((UBYTE)(_currentPalette[6*i+3]) & 0xf8) >> 3) |
        	(((UBYTE)(_currentPalette[6*i+4]) & 0xf8) << 2) |
        	(((UBYTE)(_currentPalette[6*i+5]) & 0xf8) << 7) |

        	(((UBYTE)(_currentPalette[6*i+0]) & 0xf8) << 13) |
        	(((UBYTE)(_currentPalette[6*i+1]) & 0xf8) << 18) |
        	(((UBYTE)(_currentPalette[6*i+2]) & 0xf8) << 23) );
	}

Last edited by NovaCoder; 30 August 2011 at 22:30.
NovaCoder is offline  
 
Page generated in 0.07999 seconds with 9 queries