[Scummvm-cvs-logs] CVS: scummvm/morphos morphos.cpp,1.3,1.4
Ruediger Hanke
tomjoad at users.sourceforge.net
Wed Apr 10 14:14:40 CEST 2002
Update of /cvsroot/scummvm/scummvm/morphos
In directory usw-pr-cvs1:/tmp/cvs-serv26374
Modified Files:
morphos.cpp
Log Message:
Fixed colors in Super2xSaI and SuperEagle modes for little endian pixelformats (Voodoo, ...)
Index: morphos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/morphos/morphos.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** morphos.cpp 6 Apr 2002 15:56:23 -0000 1.3
--- morphos.cpp 10 Apr 2002 16:45:00 -0000 1.4
***************
*** 87,90 ****
--- 87,91 ----
static bool ScummOrigMouse = false;
static int ScummShakePos = 0;
+ static bool ScummPCMode = false;
static struct MsgPort *TimerMsgPort = NULL;
***************
*** 200,203 ****
--- 201,205 ----
void cd_play( int track, int num_loops, int start_frame, int length )
{
+ scumm._vars[14] = 0;
if( CDrive && start_frame >= 0 )
{
***************
*** 401,409 ****
}
- if( pixfmt == PIXFMT_RGB15PC || pixfmt == PIXFMT_BGR15PC ||
- pixfmt == PIXFMT_RGB16PC || pixfmt == PIXFMT_BGR16PC
- )
- col = ((col >> 8) & 0xff) | ((col << 8) & 0xff00); /* Not really sure about this?!?! */
-
return col;
--- 403,406 ----
***************
*** 505,508 ****
--- 502,511 ----
}
+ ULONG RealDepth = GetBitMapAttr( &ScummScreen->BitMap, BMA_DEPTH );
+ if( RealDepth != ScummDepth )
+ {
+ warning( "Screen did not open in expected depth." );
+ ScummDepth = RealDepth;
+ }
ScummScreenBuffer[ 0 ] = AllocScreenBuffer( ScummScreen, NULL, SB_SCREEN_BITMAP );
ScummScreenBuffer[ 1 ] = AllocScreenBuffer( ScummScreen, NULL, 0 );
***************
*** 624,627 ****
--- 627,635 ----
int pixfmt = GetCyberMapAttr( ScummRenderTo, CYBRMATTR_PIXFMT );
+ ScummPCMode = false;
+ if( pixfmt == PIXFMT_RGB15PC || pixfmt == PIXFMT_BGR15PC ||
+ pixfmt == PIXFMT_RGB16PC || pixfmt == PIXFMT_BGR16PC
+ )
+ ScummPCMode = true;
debug( 1, "Pixelformat = %d", pixfmt );
***************
*** 860,863 ****
--- 868,873 ----
#define Q_INTERPOLATE(A, B, C, D) ((A & qcolorMask) >> 2) + ((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2) + ((((A & qlowpixelMask) + (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask)) >> 2) & qlowpixelMask)
+ #define SWAP_WORD( word ) word = ((word & 0xff) << 8) | (word >> 8)
+
void Super2xSaI( uint32 src_x, uint32 src_y, uint32 dest_x, uint32 dest_y, uint32 width, uint32 height )
{
***************
*** 983,986 ****
--- 993,1003 ----
if (PixelsPerMask == 2)
{
+ if( ScummPCMode )
+ {
+ SWAP_WORD( product1a );
+ SWAP_WORD( product1b );
+ SWAP_WORD( product2a );
+ SWAP_WORD( product2b );
+ }
*((unsigned long *) (&dst_line[0][x * 4])) = (product1a << 16) | product1b;
*((unsigned long *) (&dst_line[1][x * 4])) = (product2a << 16) | product2b;
***************
*** 1204,1207 ****
--- 1221,1231 ----
if (PixelsPerMask == 2)
{
+ if( ScummPCMode )
+ {
+ SWAP_WORD( product1a );
+ SWAP_WORD( product1b );
+ SWAP_WORD( product2a );
+ SWAP_WORD( product2b );
+ }
*((unsigned long *) (&dst_line[0][x * 4])) = (product1a << 16) | product1b;
*((unsigned long *) (&dst_line[1][x * 4])) = (product2a << 16) | product2b;
***************
*** 1331,1334 ****
--- 1355,1361 ----
if( PixelsPerMask == 2 )
{
+ if( ScummPCMode )
+ SWAP_WORD( color );
+
*((unsigned long *) (&dst_line[0][x * 4])) = (color << 16) | color;
*((unsigned long *) (&dst_line[1][x * 4])) = (color << 16) | color;
More information about the Scummvm-git-logs
mailing list