Update of /cvsroot/vba/VisualBoyAdvance/src/win32
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9214/src/win32
Modified Files:
Direct3D.cpp
Log Message:
small fixes
Index: Direct3D.cpp
===================================================================
RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/Direct3D.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Direct3D.cpp 12 Jun 2006 22:01:51 -0000 1.10
--- Direct3D.cpp 20 Jun 2006 10:35:17 -0000 1.11
***************
*** 61,65 ****
LPDIRECT3DDEVICE9 pDevice;
D3DPRESENT_PARAMETERS dpp;
- LPDIRECT3DSURFACE9 pBackBuffer;
D3DFORMAT screenFormat;
int width;
--- 61,64 ----
***************
*** 98,102 ****
height = 0;
failed = false;
- pBackBuffer = NULL;
pFont = NULL;
}
--- 97,100 ----
***************
*** 307,311 ****
! // check for available fullscreen modes
ZeroMemory(&dpp, sizeof(dpp));
dpp.Windowed = TRUE;
--- 305,313 ----
! theApp.updateFilter();
! theApp.updateIFB();
!
!
! // create device
ZeroMemory(&dpp, sizeof(dpp));
dpp.Windowed = TRUE;
***************
*** 313,318 ****
dpp.BackBufferCount = theApp.tripleBuffering ? 2 : 1;
dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
! dpp.BackBufferWidth = theApp.surfaceSizeX;
! dpp.BackBufferHeight = theApp.surfaceSizeY;
dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
dpp.PresentationInterval = theApp.vsync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE;
--- 315,320 ----
dpp.BackBufferCount = theApp.tripleBuffering ? 2 : 1;
dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
! dpp.BackBufferWidth = theApp.rect.right;
! dpp.BackBufferHeight = theApp.rect.bottom;
dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
dpp.PresentationInterval = theApp.vsync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE;
***************
*** 332,338 ****
createFont();
- theApp.updateFilter();
- theApp.updateIFB();
-
if(failed) return false;
--- 334,337 ----
***************
*** 369,372 ****
--- 368,372 ----
HRESULT hr;
D3DLOCKED_RECT lr;
+ LPDIRECT3DSURFACE9 pBackBuffer;
pDevice->GetBackBuffer( 0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer );
if( FAILED( hr = pBackBuffer->LockRect( &lr, NULL, D3DLOCK_DISCARD ) ) ) {
***************
*** 377,398 ****
copyImage( pix, lr.pBits, theApp.sizeX, theApp.sizeY, lr.Pitch, systemColorDepth );
} else {
! if( systemColorDepth == 16 ) {
! theApp.filterFunction(pix+theApp.filterWidth*2+4,
! theApp.filterWidth*2+4,
! (u8*)theApp.delta,
! (u8*)lr.pBits,
! lr.Pitch,
! theApp.filterWidth,
! theApp.filterHeight);
! }
! if( systemColorDepth == 32 ) {
! theApp.filterFunction(pix+theApp.filterWidth*4+4,
! theApp.filterWidth*4+4,
! (u8*)theApp.delta,
! (u8*)lr.pBits,
! lr.Pitch,
! theApp.filterWidth,
! theApp.filterHeight);
! }
}
pBackBuffer->UnlockRect();
--- 377,387 ----
copyImage( pix, lr.pBits, theApp.sizeX, theApp.sizeY, lr.Pitch, systemColorDepth );
} else {
! theApp.filterFunction( pix + (theApp.filterWidth * (systemColorDepth>>3)) + 4,
! theApp.filterWidth * (systemColorDepth>>3) + 4,
! (u8*)theApp.delta,
! (u8*)lr.pBits,
! lr.Pitch,
! theApp.filterWidth,
! theApp.filterHeight);
}
pBackBuffer->UnlockRect();
***************
*** 524,527 ****
--- 513,518 ----
bool Direct3DDisplay::resetDevice()
{
+ if( !pDevice ) return false;
+
HRESULT hr;
destroyFont();
|