Skip to content

Commit 91b5eb8

Browse files
authored
[GEN][ZH] Add additional logging for calls to DX8Wrapper::Reset_Device (#883)
1 parent 9ff7ba2 commit 91b5eb8

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,10 @@ bool DX8Wrapper::Set_Render_Device(int dev, int width, int height, int bits, int
10281028
bool ret;
10291029

10301030
if (reset_device)
1031+
{
1032+
WWDEBUG_SAY(("DX8Wrapper::Set_Render_Device is resetting the device.\n"));
10311033
ret = Reset_Device(restore_assets); //reset device without restoring data - we're likely switching out of the app.
1034+
}
10321035
else
10331036
ret = Create_Device();
10341037

@@ -1100,6 +1103,7 @@ void DX8Wrapper::Set_Swap_Interval(int swap)
11001103
default: _PresentParameters.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE ; break;
11011104
}
11021105

1106+
WWDEBUG_SAY(("DX8Wrapper::Set_Swap_Interval is resetting the device.\n"));
11031107
Reset_Device();
11041108
}
11051109

@@ -1169,6 +1173,7 @@ bool DX8Wrapper::Set_Device_Resolution(int width,int height,int bits,int windowe
11691173
Resize_And_Position_Window();
11701174
}
11711175
#pragma message("TODO: support changing windowed status and changing the bit depth")
1176+
WWDEBUG_SAY(("DX8Wrapper::Set_Device_Resolution is resetting the device.\n"));
11721177
return Reset_Device();
11731178
} else {
11741179
return false;
@@ -1604,6 +1609,7 @@ void DX8Wrapper::End_Scene(bool flip_frames)
16041609
if (hr==D3DERR_DEVICELOST) {
16051610
hr=_Get_D3D_Device8()->TestCooperativeLevel();
16061611
if (hr==D3DERR_DEVICENOTRESET) {
1612+
WWDEBUG_SAY(("DX8Wrapper::End_Scene is resetting the device.\n"));
16071613
Reset_Device();
16081614
}
16091615
else {

Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,8 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f
817817
// Check if the device needs to be reset
818818
if( D3DERR_DEVICENOTRESET == hr )
819819
{
820-
DX8Wrapper::Reset_Device();
820+
WWDEBUG_SAY(("WW3D::Begin_Render is resetting the device.\n"));
821+
DX8Wrapper::Reset_Device();
821822
}
822823

823824
return WW3D_ERROR_GENERIC;

GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,10 @@ bool DX8Wrapper::Set_Render_Device(int dev, int width, int height, int bits, int
11181118
bool ret;
11191119

11201120
if (reset_device)
1121+
{
1122+
WWDEBUG_SAY(("DX8Wrapper::Set_Render_Device is resetting the device.\n"));
11211123
ret = Reset_Device(restore_assets); //reset device without restoring data - we're likely switching out of the app.
1124+
}
11221125
else
11231126
ret = Create_Device();
11241127

@@ -1190,6 +1193,7 @@ void DX8Wrapper::Set_Swap_Interval(int swap)
11901193
default: _PresentParameters.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE ; break;
11911194
}
11921195

1196+
WWDEBUG_SAY(("DX8Wrapper::Set_Swap_Interval is resetting the device.\n"));
11931197
Reset_Device();
11941198
}
11951199

@@ -1259,6 +1263,7 @@ bool DX8Wrapper::Set_Device_Resolution(int width,int height,int bits,int windowe
12591263
Resize_And_Position_Window();
12601264
}
12611265
#pragma message("TODO: support changing windowed status and changing the bit depth")
1266+
WWDEBUG_SAY(("DX8Wrapper::Set_Device_Resolution is resetting the device.\n"));
12621267
return Reset_Device();
12631268
} else {
12641269
return false;
@@ -1749,6 +1754,7 @@ void DX8Wrapper::End_Scene(bool flip_frames)
17491754
if (hr==D3DERR_DEVICELOST) {
17501755
hr=_Get_D3D_Device8()->TestCooperativeLevel();
17511756
if (hr==D3DERR_DEVICENOTRESET) {
1757+
WWDEBUG_SAY(("DX8Wrapper::End_Scene is resetting the device.\n"));
17521758
Reset_Device();
17531759
}
17541760
else {

GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,8 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f
810810
// Check if the device needs to be reset
811811
if( D3DERR_DEVICENOTRESET == hr )
812812
{
813-
DX8Wrapper::Reset_Device();
813+
WWDEBUG_SAY(("WW3D::Begin_Render is resetting the device.\n"));
814+
DX8Wrapper::Reset_Device();
814815
}
815816

816817
return WW3D_ERROR_GENERIC;

0 commit comments

Comments
 (0)