Skip to content

GTASA - Added INI toggle to avoid the drawing issue with CLEO/ASI mods. #1677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion data/GTASA.WidescreenFix/scripts/GTASA.WidescreenFix.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RadarWidthScale = 0.82 ; Original value is 1.0.
RadarHeightScale = 0.0 ; Original value is 1.0.
SubtitlesScale = 0.0 ; Original value is 1.0.
ProportionalWeaponIcon = 0
EnableSCMDrawingFixes = 1 ; Turn OFF IF HAVING SCM DRAWING ISSUE WITH CLEO/ASI MODS

[MISC]
; Same as in VCS PCE, cutscene border size will be adjusted to fit your resolution. On resolutions bigger than 16:9 vertical borders will be used. Note that you can enable or disable cutscene borders via 'WIDESCREEN'/'BORDERS' option in game menu (0|1).
Expand All @@ -29,4 +30,4 @@ HideAABug = 0
; Disable the small white dot that appears while aiming with some weapons (0|1).
DisableWhiteCrosshairDot = 0
; Replaces text shadow with outline (0|1|2).
ReplaceTextShadowWithOutline = 2
ReplaceTextShadowWithOutline = 2
33 changes: 19 additions & 14 deletions source/GTASA.WidescreenFix/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ float fDefaultWidth;
float fDefaultCoords;
float fFrontendDefaultWidth;
bool bProportionalWeaponIcon = false;
bool bEnableSCMDrawingFixes = true;

void ReadSettings()
{
Expand All @@ -33,6 +34,7 @@ void ReadSettings()
fRadarHeightScale = iniReader.ReadFloat("MAIN", "RadarHeightScale", 0.0f); fRadarHeightScale == 0.0f ? fRadarHeightScale = 1.0f : fRadarHeightScale;
fSubtitlesScale = iniReader.ReadFloat("MAIN", "SubtitlesScale", 0.0f); fSubtitlesScale == 0.0f ? fSubtitlesScale = 1.0f : fSubtitlesScale;
bProportionalWeaponIcon = iniReader.ReadInteger("MAIN", "ProportionalWeaponIcon", 0) != 0;
bEnableSCMDrawingFixes = iniReader.ReadInteger("MAIN", "EnableSCMDrawingFixes", 1) != 0;

bSmartCutsceneBorders = iniReader.ReadInteger("MISC", "SmartCutsceneBorders", 1) != 0;
bAllowAltTabbingWithoutPausing = iniReader.ReadInteger("MISC", "AllowAltTabbingWithoutPausing", 0) != 0;
Expand Down Expand Up @@ -667,26 +669,29 @@ void __stdcall DrawWindowHook(CRect *rect, char *titleKey, char fadeState, CRGBA

void InstallSCMDrawingFixes()
{
hbDrawRect.fun = injector::MakeCALL(0x464A53, DrawRectHook).get();
injector::MakeCALL(0x464A53, DrawRectHook);
if (bEnableSCMDrawingFixes)
{
hbDrawRect.fun = injector::MakeCALL(0x464A53, DrawRectHook).get();
injector::MakeCALL(0x464A53, DrawRectHook);

hbDraw.fun = injector::MakeCALL(0x464A90, DrawSpriteHook).get();
injector::MakeCALL(0x464A90, DrawSpriteHook);
hbDraw.fun = injector::MakeCALL(0x464A90, DrawSpriteHook).get();
injector::MakeCALL(0x464A90, DrawSpriteHook);

hbDraw2.fun = injector::MakeCALL(0x464B7F, DrawSpriteHook2).get();
injector::MakeCALL(0x464B7F, DrawSpriteHook2);
hbDraw2.fun = injector::MakeCALL(0x464B7F, DrawSpriteHook2).get();
injector::MakeCALL(0x464B7F, DrawSpriteHook2);

hbPrintString.fun = injector::MakeCALL(0x58C229, PrintStringHook).get();
injector::MakeCALL(0x58C229, PrintStringHook);
hbPrintString.fun = injector::MakeCALL(0x58C229, PrintStringHook).get();
injector::MakeCALL(0x58C229, PrintStringHook);

hbSetScale.fun = injector::MakeCALL(0x58C0E8, SetScaleHook).get();
injector::MakeCALL(0x58C0E8, SetScaleHook);
hbSetScale.fun = injector::MakeCALL(0x58C0E8, SetScaleHook).get();
injector::MakeCALL(0x58C0E8, SetScaleHook);

hbSetWrapx.fun = injector::MakeCALL(0x58C137, SetWrapxHook).get();
injector::MakeCALL(0x58C137, SetWrapxHook);
hbSetWrapx.fun = injector::MakeCALL(0x58C137, SetWrapxHook).get();
injector::MakeCALL(0x58C137, SetWrapxHook);

hbDrawWindow.fun = injector::MakeCALL(0x464A24, DrawWindowHook).get();
injector::MakeCALL(0x464A24, DrawWindowHook);
hbDrawWindow.fun = injector::MakeCALL(0x464A24, DrawWindowHook).get();
injector::MakeCALL(0x464A24, DrawWindowHook);
}
}

void InstallAspectRatioFixes()
Expand Down