Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKissaki <kissaki@gmx.de>2013-04-21 05:42:00 +0400
committerKissaki <kissaki@gmx.de>2013-06-05 00:37:39 +0400
commitbb47083b9fe36cd01f699b66a117e8d68024f85f (patch)
tree09a90f975844c16ce2bc6413f695b3966411b6df /overlay
parent85fa2ce57a0a2159e2065855ec6e2b1e1045671e (diff)
Reduce varscopes and improve debugtext.
Diffstat (limited to 'overlay')
-rw-r--r--overlay/d3d10.cpp10
-rw-r--r--overlay/d3d9.cpp10
-rw-r--r--overlay/opengl.cpp10
3 files changed, 15 insertions, 15 deletions
diff --git a/overlay/d3d10.cpp b/overlay/d3d10.cpp
index de05440e2..34e0f5ed4 100644
--- a/overlay/d3d10.cpp
+++ b/overlay/d3d10.cpp
@@ -37,7 +37,6 @@
DXGIData *dxgi = NULL;
static bool bHooked = false;
-static bool bChaining = false;
static HardHook hhPresent;
static HardHook hhResize;
static HardHook hhAddRef;
@@ -550,15 +549,16 @@ static void HookResizeRaw(voidFunc vfResize) {
}
void checkDXGIHook(bool preonly) {
- if (bChaining) {
- ods("DXGI: Causing a chain");
+ static bool bCHActive = false;
+ if (bCHActive) {
+ ods("DXGI: Recursion in checkDXGIHook");
return;
}
if (! dxgi->iOffsetPresent || ! dxgi->iOffsetResize)
return;
- bChaining = true;
+ bCHActive = true;
HMODULE hDXGI = GetModuleHandleW(L"DXGI.DLL");
HMODULE hD3D10 = GetModuleHandleW(L"D3D10CORE.DLL");
@@ -593,7 +593,7 @@ void checkDXGIHook(bool preonly) {
}
}
- bChaining = false;
+ bCHActive = false;
}
extern "C" __declspec(dllexport) void __cdecl PrepareDXGI() {
diff --git a/overlay/d3d9.cpp b/overlay/d3d9.cpp
index 0165710cf..3eb85f818 100644
--- a/overlay/d3d9.cpp
+++ b/overlay/d3d9.cpp
@@ -74,7 +74,6 @@ class DevState : public Pipe {
static map<IDirect3DDevice9 *, DevState *> devMap;
static bool bHooked = false;
-static bool bChaining = false;
static bool bPresenting = false;
DevState::DevState() {
@@ -689,12 +688,13 @@ static void HookCreateRawEx(voidFunc vfCreate) {
}
void checkD3D9Hook(bool preonly) {
- if (bChaining) {
- ods("D3D9: Causing a chain");
+ static bool bCHActive = false;
+ if (bCHActive) {
+ ods("D3D9: Recursion in checkD3D9Hook");
return;
}
- bChaining = true;
+ bCHActive = true;
HMODULE hD3D = GetModuleHandle("D3D9.DLL");
@@ -749,7 +749,7 @@ void checkD3D9Hook(bool preonly) {
}
}
- bChaining = false;
+ bCHActive = false;
}
extern "C" __declspec(dllexport) void __cdecl PrepareD3D9() {
diff --git a/overlay/opengl.cpp b/overlay/opengl.cpp
index 4885b5f25..f3fdd7c5b 100644
--- a/overlay/opengl.cpp
+++ b/overlay/opengl.cpp
@@ -131,7 +131,6 @@ INJDEF(BOOL, wglSwapBuffers, (HDC));
INJDEF(BOOL, SwapBuffers, (HDC));
static bool bHooked = false;
-static bool bChaining = false;
class Context : protected Pipe {
public:
@@ -368,12 +367,13 @@ static BOOL __stdcall mywglSwapLayerBuffers(HDC hdc, UINT fuPlanes) {
#define GLDEF(name) o##name = reinterpret_cast<t##name>(GetProcAddress(hGL, #name))
void checkOpenGLHook() {
- if (bChaining) {
- ods("Causing a chain");
+ static bool bCHActive = false;
+ if (bCHActive) {
+ ods("Recursion in checkOpenGLHook");
return;
}
- bChaining = true;
+ bCHActive = true;
HMODULE hGL = GetModuleHandle("OpenGL32.DLL");
@@ -431,5 +431,5 @@ void checkOpenGLHook() {
}
}
- bChaining = false;
+ bCHActive = false;
}