Switch instead of ifs for the surface flipping

This commit is contained in:
simon.kagstrom 2009-05-04 16:29:15 +00:00
parent 2440cd5191
commit e2f1267520

View file

@ -536,16 +536,19 @@ static int WII_FlipHWSurface(_THIS, SDL_Surface *surface)
GX_InvVtxCache();
GX_InvalidateTexAll();
if (surface->format->BytesPerPixel == 1)
flipHWSurface_8_16(this, surface);
else if (surface->format->BytesPerPixel == 2)
flipHWSurface_16_16(this, surface);
else if (surface->format->BytesPerPixel == 3)
flipHWSurface_24_16(this, surface);
else if (surface->format->BytesPerPixel == 4)
flipHWSurface_32_16(this, surface);
else
switch(surface->format->BytesPerPixel)
{
case 1:
flipHWSurface_8_16(this, surface); break;
case 2:
flipHWSurface_16_16(this, surface); break;
case 3:
flipHWSurface_24_16(this, surface); break;
case 4:
flipHWSurface_32_16(this, surface); break;
default:
return -1;
}
// load texture into GX
DCFlushRange(texturemem, TEXTUREMEM_SIZE);