Skip to content

Commit

Permalink
Minor edits to Interface.cpp and ddraw.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaRain committed Aug 22, 2020
1 parent c6da516 commit 57f4deb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion artifacts/ddraw.ini
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ NumbersInDialogue=0
WorldMapFontPatch=0

;Set to 1 to use Fallout's normal text font for death screen subtitles
;Requires changing the color of subtitles in death.pal palette (color index 220) to display the text correctly
;Requires changing the color of subtitles in death.pal palette to white color (index 220) to display the text correctly
DeathScreenFontPatch=0

;Set to 1 to display full item description for weapon/ammo in the barter screen
Expand Down
19 changes: 10 additions & 9 deletions sfall/Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,20 +359,13 @@ static void __declspec(naked) wmInterfaceRefreshCarFuel_hack() {
}
}

static void __declspec(naked) main_death_scene_hook() {
__asm {
mov eax, 101;
call text_font_;
jmp debug_printf_;
}
}

static void WorldMapInterfacePatch() {
if (GetConfigInt("Misc", "WorldMapFontPatch", 0)) {
dlog("Applying world map font patch.", DL_INIT);
HookCall(0x4C2343, wmInterfaceInit_text_font_hook);
dlogr(" Done", DL_INIT);
}

// Fix images for up/down buttons
SafeWrite32(0x4C2C0A, 199); // index of UPARWOFF.FRM
SafeWrite8(0x4C2C7C, 0x43); // dec ebx > inc ebx
Expand Down Expand Up @@ -509,6 +502,14 @@ static void __declspec(naked) gmouse_bk_process_hook() {
}
}

static void __declspec(naked) main_death_scene_hook() {
__asm {
mov eax, 101;
call text_font_;
jmp debug_printf_;
}
}

void InterfaceGmouseHandleHook() {
if (hrpVersionValid) IFACE_BAR_MODE = *(BYTE*)HRPAddress(0x1006EB0C) != 0;
HookCall(0x44C018, gmouse_handle_event_hook); // replaces hack function from HRP
Expand Down Expand Up @@ -537,7 +538,7 @@ void InterfaceInit() {
}

// Corrects the height of the black background for death screen subtitles
if (hrpIsEnabled == false) SafeWrite32(0x48134D, -602 - (640 * 2)); // main_death_scene_ (shift y-offset 2px up, w/o HRP)
if (hrpIsEnabled == false) SafeWrite32(0x48134D, 38 - (640 * 3)); // main_death_scene_ (shift y-offset 2px up, w/o HRP)
if (hrpIsEnabled == false || hrpVersionValid) SafeWrite8(0x481345, 4); // main_death_scene_
if (hrpVersionValid) SafeWrite8(HRPAddress(0x10011738), 10);
}
Expand Down

0 comments on commit 57f4deb

Please sign in to comment.