fix bugs that show up on Voodoo3

This commit is contained in:
Chris Danford
2003-05-28 00:50:10 +00:00
parent c3c96f390c
commit 9ab0d6ebee
2 changed files with 24 additions and 4 deletions
+10 -1
View File
@@ -245,9 +245,18 @@ void RageBitmapTexture::Create()
* done *before* we set up the palette, since it might change it. */
FixHiddenAlpha(img);
/* Make we're using a supported format.
* Every card supports either RGBA8 or RGBA4. */
if( !DISPLAY->SupportsTextureFormat(pixfmt) )
{
pixfmt = FMT_RGBA8;
if( !DISPLAY->SupportsTextureFormat(pixfmt) )
pixfmt = FMT_RGBA4;
}
/* Convert the data to the destination format and dimensions
* required by OpenGL if it's not in it already. */
const PixelFormatDesc *pfd = DISPLAY->GetPixelFormatDesc(pixfmt);
ConvertSDLSurface(img, m_iTextureWidth, m_iTextureHeight,
pfd->bpp, pfd->masks[0], pfd->masks[1], pfd->masks[2], pfd->masks[3]);
+14 -3
View File
@@ -253,7 +253,12 @@ RageDisplay_D3D::RageDisplay_D3D( bool windowed, int width, int height, int bpp,
}
SetVideoMode( windowed, width, height, bpp, rate, vsync, sWindowTitle, sIconFile );
if( SetVideoMode( windowed, width, height, bpp, rate, vsync, sWindowTitle, sIconFile ) )
return;
if( SetVideoMode( false, width, height, bpp, rate, vsync, sWindowTitle, sIconFile ) )
return;
if( SetVideoMode( false, width, height, 16, rate, vsync, sWindowTitle, sIconFile ) )
return;
}
void RageDisplay_D3D::Update(float fDeltaTime)
@@ -343,8 +348,8 @@ D3DFORMAT FindBackBufferType(bool bWindowed, int iBPP)
return fmtBackBuffer;
}
SDL_QuitSubSystem(SDL_INIT_VIDEO); // exit out of full screen. The ~RageDisplay will not be called!
RageException::Throw( "Couldn't find an appropriate back buffer format." );
LOG->Trace( "Couldn't find an appropriate back buffer format." );
return (D3DFORMAT)-1;
}
#ifndef _XBOX
@@ -365,6 +370,9 @@ HWND GetHwnd()
/* Set the video mode. */
bool RageDisplay_D3D::SetVideoMode( bool windowed, int width, int height, int bpp, int rate, bool vsync, CString sWindowTitle, CString sIconFile )
{
if( FindBackBufferType( windowed, bpp ) == -1 ) // no possible back buffer formats
return false;
/* Set SDL window title and icon -before- creating the window */
SDL_WM_SetCaption(sWindowTitle, "");
mySDL_WM_SetIcon( sIconFile );
@@ -891,6 +899,9 @@ void RageDisplay_D3D::UpdateTexture(
rect.bottom = height - yoffset;
D3DLOCKED_RECT lr;
pTex->LockRect( 0, &lr, &rect, 0 );
// copy each row