mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-21 18:35:04 +02:00
Ddraw::Unlock no longer calls present, Device_Present needs to be manually called. This helps performance and visuals.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -265,6 +265,7 @@ void GameOptionsClass::Process(void)
|
||||
bool process = true;
|
||||
pressed = false;
|
||||
while (process) {
|
||||
Device_Present();
|
||||
|
||||
/*
|
||||
** Invoke game callback.
|
||||
|
||||
@@ -1017,6 +1017,8 @@ int Main_Menu(unsigned long )
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Device_Present();
|
||||
}
|
||||
|
||||
Options.Set_Score_Volume(oldvolume, false);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -567,6 +567,8 @@ int Fetch_Difficulty(void)
|
||||
*/
|
||||
Call_Back();
|
||||
|
||||
Device_Present();
|
||||
|
||||
#ifdef WIN32
|
||||
/*
|
||||
** Handle possible surface loss due to a focus switch
|
||||
|
||||
@@ -144,6 +144,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++;
|
||||
curTime = clock();
|
||||
|
||||
@@ -749,6 +749,8 @@ void WWSDL_ProcessEvents(KeyNumType& key, int& flags) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Device_Present();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1041,6 +1041,11 @@ HRESULT __stdcall IDirectDrawSurfaceWrapper::SetPalette(LPDIRECTDRAWPALETTE lpDD
|
||||
*/
|
||||
}
|
||||
|
||||
IDirectDrawWrapper* currentddrawParent = nullptr;
|
||||
void Device_Present(void) {
|
||||
currentddrawParent->Present();
|
||||
}
|
||||
|
||||
// Notifies DirectDraw that the direct surface manipulations are complete.
|
||||
HRESULT __stdcall IDirectDrawSurfaceWrapper::Unlock(LPVOID lpRect)
|
||||
{
|
||||
@@ -1094,12 +1099,14 @@ HRESULT __stdcall IDirectDrawSurfaceWrapper::Unlock(LPVOID lpRect)
|
||||
IDirectDrawSurface7::Lock and IDirectDrawSurface7::Unlock methods.
|
||||
*/
|
||||
|
||||
currentddrawParent = ddrawParent;
|
||||
|
||||
// Present the surface
|
||||
if(!ddrawParent->Present())
|
||||
{
|
||||
// Failed to presnt the surface, error reporting handled previously
|
||||
return DDERR_GENERIC;
|
||||
}
|
||||
//if(!ddrawParent->Present())
|
||||
//{
|
||||
// // Failed to presnt the surface, error reporting handled previously
|
||||
// return DDERR_GENERIC;
|
||||
//}
|
||||
|
||||
// Success
|
||||
return DD_OK;
|
||||
|
||||
Reference in New Issue
Block a user