Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-fadely committed Feb 26, 2016
2 parents 0c152b5 + fb08953 commit b7bce9f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions SADXModLoader/FixFOV.cpp
Expand Up @@ -36,14 +36,10 @@ static void DisplayVideoFrame_FixAspectRatio()
}

// Fix for neglected width and height in global NJS_SCREEN
static void __cdecl SetupScreenFix(NJS_MATRIX* m);
static Trampoline SetupScreenTrampoline(0x00788240, 0x00788246, (DetourFunction)SetupScreenFix);
static void __cdecl SetupScreenFix(NJS_MATRIX* m)
FunctionPointer(void, SetupScreen, (NJS_SCREEN*), 0x00788240);
static void __cdecl SetupScreenFix(NJS_SCREEN* screen)
{
_nj_screen_.w = (*m)[1]; // Screen Width
_nj_screen_.h = (*m)[2]; // Screen Height
FunctionPointer(void, SetupScreen, (NJS_MATRIX* m), SetupScreenTrampoline.Target());
SetupScreen(m);
_nj_screen_ = *screen;
}

static void __cdecl njSetScreenDist_hook(Angle bams)
Expand Down Expand Up @@ -93,6 +89,8 @@ void ConfigureFOV()
const uint32_t width = HorizontalResolution;
const uint32_t height = VerticalResolution;

WriteJump(SetupScreen, SetupScreenFix);

// Taking advantage of a nullsub call.
WriteCall((void*)0x00513A88, DisplayVideoFrame_FixAspectRatio);

Expand Down

0 comments on commit b7bce9f

Please sign in to comment.