Update of /cvsroot/vba/VisualBoyAdvance/src/win32
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27216
Modified Files:
DirectDraw.cpp
Log Message:
Moved vsync code where it probably should be, past the backbuffer lock/blit/unlock section. I also disabled the call when fullscreen triple buffering is enabled, assuming that the surface Flip() calls are being synced unless a no sync flag is passed.
Index: DirectDraw.cpp
===================================================================
RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/DirectDraw.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** DirectDraw.cpp 13 May 2004 15:06:49 -0000 1.6
--- DirectDraw.cpp 15 Sep 2004 22:08:53 -0000 1.7
***************
*** 27,30 ****
--- 27,31 ----
#include "../Globals.h"
#include "../Text.h"
+ #include "../Util.h"
#include "VBA.h"
***************
*** 40,44 ****
extern int Init_2xSaI(u32);
- extern int RGB_LOW_BITS_MASK;
extern void winlog(const char *,...);
extern int systemSpeed;
--- 41,44 ----
***************
*** 552,556 ****
systemGreenShift++;
Init_2xSaI(565);
- RGB_LOW_BITS_MASK=0x821;
} else if((px.dwFlags&DDPF_RGB) != 0 &&
px.dwRBitMask == 0x7C00 &&
--- 552,555 ----
***************
*** 558,562 ****
px.dwBBitMask == 0x001F) {
Init_2xSaI(555);
- RGB_LOW_BITS_MASK=0x421;
} else if((px.dwFlags&DDPF_RGB) != 0 &&
px.dwRBitMask == 0x001F &&
--- 557,560 ----
***************
*** 565,569 ****
systemGreenShift++;
Init_2xSaI(565);
- RGB_LOW_BITS_MASK=0x821;
} else if((px.dwFlags&DDPF_RGB) != 0 &&
px.dwRBitMask == 0x001F &&
--- 563,566 ----
***************
*** 571,575 ****
px.dwBBitMask == 0x7C00) {
Init_2xSaI(555);
- RGB_LOW_BITS_MASK=0x421;
} else {
// 32-bit or 24-bit
--- 568,571 ----
***************
*** 589,613 ****
}
! switch(systemColorDepth) {
! case 16:
! {
! for(int i = 0; i < 0x10000; i++) {
! systemColorMap16[i] = ((i & 0x1f) << systemRedShift) |
! (((i & 0x3e0) >> 5) << systemGreenShift) |
! (((i & 0x7c00) >> 10) << systemBlueShift);
! }
! }
! break;
! case 24:
! case 32:
! {
! for(int i = 0; i < 0x10000; i++) {
! systemColorMap32[i] = ((i & 0x1f) << systemRedShift) |
! (((i & 0x3e0) >> 5) << systemGreenShift) |
! (((i & 0x7c00) >> 10) << systemBlueShift);
! }
! }
! break;
! }
width = w;
height = h;
--- 585,589 ----
}
! utilUpdateSystemColorMaps();
width = w;
height = h;
***************
*** 653,660 ****
return;
- if(theApp.vsync && !speedup) {
- hret = pDirectDraw->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, 0);
- }
-
DDSURFACEDESC2 ddsDesc;
--- 629,632 ----
***************
*** 805,808 ****
--- 777,783 ----
if(hret == DD_OK) {
+ if(theApp.vsync && !(theApp.tripleBuffering && theApp.videoOption > VIDEO_4X) && !speedup) { // isn't the Flip() call synced unless a certain flag is passed to it?
+ hret = pDirectDraw->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, 0);
+ }
ddsOffscreen->PageLock(0);
if(theApp.tripleBuffering && theApp.videoOption > VIDEO_4X) {
|