Ddraw::Unlock no longer calls present, Device_Present needs to be manually called. This helps performance and visuals.

This commit is contained in:
Justin Marshall
2020-06-05 08:24:07 -07:00
parent ca88e13be0
commit 56b557727b
13 changed files with 41 additions and 12 deletions
+4
View File
@@ -416,6 +416,8 @@ void Main_Game(int argc, char * argv[])
break;
}
}
Device_Present();
}
#endif
@@ -502,6 +504,8 @@ void Main_Game(int argc, char * argv[])
}
#endif //WIN32
#endif // !WOLAPI_INTEGRATION
Device_Present();
}
/*
+1
View File
@@ -1073,6 +1073,7 @@ template <>class DynamicVectorClass<EgoClass *>;
extern DynamicVectorClass<EgoClass *> whatever;
void WWSDL_ProcessEvents(KeyNumType& key, int& flags);
void Device_Present(void);
/*
** Debug output. ST - 6/27/2019 10:00PM
+1
View File
@@ -265,6 +265,7 @@ void GameOptionsClass::Process(void)
bool process = true;
pressed = false;
while (process) {
Device_Present();
/*
** Invoke game callback.
+2
View File
@@ -1017,6 +1017,8 @@ int Main_Menu(unsigned long )
default:
break;
}
Device_Present();
}
Options.Set_Score_Volume(oldvolume, false);
+2
View File
@@ -252,6 +252,8 @@ GameType Select_MPlayer_Game (void)
process = true;
pressed = false;
while (process) {
Device_Present();
#ifdef WIN32
/*
** If we have just received input focus again after running in the background then
+2
View File
@@ -254,6 +254,8 @@ int WWMessageBox::Process(const char * msg, const char * b1txt, const char * b2t
pressed = false;
while (process) {
Device_Present();
#ifdef WIN32
/*
** If we have just received input focus again after running in the background then
+1
View File
@@ -617,6 +617,7 @@ int Com_Scenario_Dialog(bool skirmish)
oh_dear_its_a_label:
while (process) {
Device_Present();
#if(SHOW_MONO)
if (!skirmish) {
NullModem.Mono_Debug_Print(0);
+4 -1
View File
@@ -898,10 +898,13 @@ void Do_Win(void)
Fancy_Text_Print(TXT_HACKHACK, x, 110*RESFACTOR, &ColorRemaps[PCOLOR_RED], TBLACK, TPF_CENTER|TPF_VCR|TPF_USE_GRAD_PAL|TPF_DROPSHADOW);
#endif
CountDownTimer = TIMER_SECOND * 3;
while (Is_Speaking()) {};
while (Is_Speaking()) {
Device_Present();
};
Speak(VOX_ACCOMPLISHED);
while (CountDownTimer || Is_Speaking()) {
Call_Back();
Device_Present();
}
}
+5 -5
View File
@@ -1705,8 +1705,8 @@ void Draw_Bar_Graphs(int i, int gkilled, int nkilled)
*=========================================================================*/
void Call_Back_Delay(int time)
{
time;
#if (0)//PG
Device_Present();
if (time < 0 ) time = 0;
if (time > 60) time = 60;
CDTimerClass<SystemTimerClass> cd;
@@ -1721,16 +1721,16 @@ void Call_Back_Delay(int time)
if (ControlQ) time=0;
cd = time;
StreamLowImpact = true;
// StreamLowImpact = true;
do {
if (callbackcd == 0) {
Call_Back();
callbackcd = TIMER_SECOND/4;
}
Animate_Score_Objs();
Device_Present();
} while (cd);
StreamLowImpact = false;
#endif
//StreamLowImpact = false;
}
+2
View File
@@ -567,6 +567,8 @@ int Fetch_Difficulty(void)
*/
Call_Back();
Device_Present();
#ifdef WIN32
/*
** Handle possible surface loss due to a focus switch
+2
View File
@@ -143,6 +143,8 @@ long VQA_Play(_VQAHandle* vqaHandle) {
Buffer_To_Page(0, 0, ScreenWidth, ScreenHeight, vqa_output_buffer, *vqaHandle->video_graphics_buffer);
vqaHandle->video_graphics_buffer->Unlock();
Device_Present();
if (clock() - curTime >= 30) {
currentFrame++;
+3 -1
View File
@@ -719,7 +719,7 @@ void WWSDL_ProcessEvents(KeyNumType& key, int& flags) {
Keyboard->MouseQY = mousey;
// if (flags == LEFTRELEASE || flags == RIGHTRELEASE)
// flags = 0;
// flags = 0;
SDL_Event event;
while (SDL_PollEvent(&event)) {
@@ -749,6 +749,8 @@ void WWSDL_ProcessEvents(KeyNumType& key, int& flags) {
break;
}
}
Device_Present();
}