Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implemented checkpoint time scaling
  • Loading branch information
michael-fadely committed Feb 17, 2016
1 parent c80cc48 commit c6a2acd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions SADXModLoader/HudScale.cpp
Expand Up @@ -31,6 +31,7 @@ static Trampoline* scaleRodMeters;
static Trampoline* scaleAnimalPickup;
static Trampoline* scaleItemBoxSprite;
static Trampoline* scaleBalls;
static Trampoline* scaleCheckpointTime;

#pragma endregion

Expand Down Expand Up @@ -210,6 +211,14 @@ static void __cdecl ScaleBalls(ObjectMaster* a1)
ScaleObjFunc(Align::Right, a1, scaleBalls);
}

static void __cdecl ScaleCheckpointTime(int a1, int a2, int a3)
{
ScalePush(Align::Right);
FunctionPointer(void, original, (int, int, int), scaleCheckpointTime->Target());
original(a1, a2, a3);
ScalePop();
}

#ifdef _DEBUG
static std::vector<NJS_SPRITE*> sprites;
#endif
Expand Down Expand Up @@ -328,4 +337,10 @@ void SetupHudScale()
scaleItemBoxSprite = new Trampoline(0x004C0790, 0x004C0795, (DetourFunction)ScaleItemBoxSprite);

scaleBalls = new Trampoline(0x005C0B70, 0x005C0B75, (DetourFunction)ScaleBalls);

scaleCheckpointTime = new Trampoline(0x004BABE0, 0x004BABE5, (DetourFunction)ScaleCheckpointTime);
WriteData((const float**)0x0044F2E1, &patch_dummy);
WriteData((const float**)0x0044F30B, &patch_dummy);
WriteData((const float**)0x00476742, &patch_dummy);
WriteData((const float**)0x0047676A, &patch_dummy);
}

0 comments on commit c6a2acd

Please sign in to comment.