Switch instead of ifs for the surface flipping
This commit is contained in:
parent
2440cd5191
commit
e2f1267520
|
@ -536,16 +536,19 @@ static int WII_FlipHWSurface(_THIS, SDL_Surface *surface)
|
||||||
GX_InvVtxCache();
|
GX_InvVtxCache();
|
||||||
GX_InvalidateTexAll();
|
GX_InvalidateTexAll();
|
||||||
|
|
||||||
if (surface->format->BytesPerPixel == 1)
|
switch(surface->format->BytesPerPixel)
|
||||||
flipHWSurface_8_16(this, surface);
|
{
|
||||||
else if (surface->format->BytesPerPixel == 2)
|
case 1:
|
||||||
flipHWSurface_16_16(this, surface);
|
flipHWSurface_8_16(this, surface); break;
|
||||||
else if (surface->format->BytesPerPixel == 3)
|
case 2:
|
||||||
flipHWSurface_24_16(this, surface);
|
flipHWSurface_16_16(this, surface); break;
|
||||||
else if (surface->format->BytesPerPixel == 4)
|
case 3:
|
||||||
flipHWSurface_32_16(this, surface);
|
flipHWSurface_24_16(this, surface); break;
|
||||||
else
|
case 4:
|
||||||
|
flipHWSurface_32_16(this, surface); break;
|
||||||
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// load texture into GX
|
// load texture into GX
|
||||||
DCFlushRange(texturemem, TEXTUREMEM_SIZE);
|
DCFlushRange(texturemem, TEXTUREMEM_SIZE);
|
||||||
|
|
Reference in a new issue