diff --git a/inc/main.h b/inc/main.h index 89d2297..35475db 100644 --- a/inc/main.h +++ b/inc/main.h @@ -131,6 +131,7 @@ typedef struct IDirectDrawImpl BOOL hidecursor; BOOL accurateTimers; BOOL resizable; + BOOL ddrawrefcount0; BOOL bnetActive; BOOL bnetWasFullscreen; BOOL bnetWasUpscaled; diff --git a/src/main.c b/src/main.c index c4b3355..6b61895 100644 --- a/src/main.c +++ b/src/main.c @@ -1818,6 +1818,9 @@ ULONG __stdcall ddraw_Release(IDirectDrawImpl *This) return 0; } + if (This->ddrawrefcount0) + return 0; + return This->Ref; } diff --git a/src/settings.c b/src/settings.c index 9a71bc6..d1ec6ad 100644 --- a/src/settings.c +++ b/src/settings.c @@ -43,6 +43,7 @@ void Settings_Load() ddraw->vhack = GetBool("vhack", FALSE); ddraw->accurateTimers = GetBool("accuratetimers", FALSE); ddraw->resizable = GetBool("resizable", TRUE); + ddraw->ddrawrefcount0 = GetBool("ddrawrefcount0", FALSE); // Twisted Metal 2 DirectDraw Error hack WindowRect.right = GetInt("width", 0); WindowRect.bottom = GetInt("height", 0); @@ -443,6 +444,13 @@ static void CreateSettingsIni() "maxfps=60\n" "forcefps=true\n" "\n" + "; Twisted Metal 2\n" + "[Tm2]\n" + "renderer=gdi\n" + "maxgameticks=60\n" + "handlemouse=false\n" + "ddrawrefcount0=true\n" + "\n" , fh); fclose(fh);