From 6977fccdbef94c1942015f88fd446b1c6c9b6a56 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Thu, 19 Sep 2024 17:58:35 +0200 Subject: [PATCH] add hack for Flight Simulator 98 --- inc/config.h | 1 + src/config.c | 11 ++++++++++- src/dllmain.c | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/inc/config.h b/inc/config.h index ecb96aa..bdb7d9b 100644 --- a/inc/config.h +++ b/inc/config.h @@ -103,6 +103,7 @@ typedef struct CNCDDRAWCONFIG BOOL homm_hack; BOOL carma95_hack; BOOL sirtech_hack; + BOOL flightsim98_hack; } CNCDDRAWCONFIG; diff --git a/src/config.c b/src/config.c index 7aebc2d..b8eaa73 100644 --- a/src/config.c +++ b/src/config.c @@ -113,7 +113,8 @@ void cfg_load() GET_BOOL(g_config.homm_hack, "homm_hack", FALSE); GET_BOOL(g_config.carma95_hack, "carma95_hack", FALSE); GET_BOOL(g_config.sirtech_hack, "sirtech_hack", FALSE); - + GET_BOOL(g_config.flightsim98_hack, "flightsim98_hack", FALSE); + GameHandlesClose = GameHandlesClose || g_config.infantryhack; if (g_config.lock_mouse_top_left) @@ -847,6 +848,14 @@ static void cfg_create_ini() "[EI]\n" "hook_peekmessage=true\n" "\n" + "; Flight Simulator 98\n" + "[FLTSIM95]\n" + "flightsim98_hack=true\n" + "\n" + "; Flight Simulator 98\n" + "[FLTSIM98]\n" + "flightsim98_hack=true\n" + "\n" "; Fairy Tale About Father Frost, Ivan and Nastya\n" "[mrazik]\n" "guard_lines=0\n" diff --git a/src/dllmain.c b/src/dllmain.c index 90f408b..d025eaf 100644 --- a/src/dllmain.c +++ b/src/dllmain.c @@ -177,7 +177,7 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk HRESULT ret; - if (util_caller_is_ddraw_wrapper(_ReturnAddress())) + if (util_caller_is_ddraw_wrapper(_ReturnAddress()) || g_config.flightsim98_hack) { if (lplpDD) *lplpDD = NULL; @@ -222,7 +222,7 @@ HRESULT WINAPI DirectDrawCreateEx(GUID* lpGuid, LPVOID* lplpDD, REFIID iid, IUnk HRESULT ret; - if (util_caller_is_ddraw_wrapper(_ReturnAddress())) + if (util_caller_is_ddraw_wrapper(_ReturnAddress()) || g_config.flightsim98_hack) { if (lplpDD) *lplpDD = NULL;