-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a136c4
commit 22594d7
Showing
7 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "Game.h" | ||
|
||
void Game::Init() | ||
{ | ||
} | ||
|
||
Instance* Game::GetPlayerInstance() | ||
{ | ||
return GetGameTracker()->playerInstance; | ||
} | ||
|
||
GameTracker* Game::GetGameTracker() | ||
{ | ||
return (GameTracker*)0x838330; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#pragma once | ||
|
||
#include "instance/Instance.h" | ||
|
||
struct menu_t; | ||
struct MemCardInfo; | ||
struct Level; | ||
struct VertexPool; | ||
|
||
struct WipeInfo | ||
{ | ||
float wipeCur; | ||
float wipeTarget; | ||
float wipeStep; | ||
}; | ||
|
||
struct GameTracker | ||
{ | ||
menu_t* menu; | ||
MemCardInfo* memcard; | ||
Level* level; | ||
Instance* playerInstance; | ||
VertexPool* vertexPool; | ||
|
||
int debugFlags; | ||
int debugFlags2; | ||
int debugFlags3; | ||
int debugFlags4; | ||
|
||
WipeInfo wipes[12]; | ||
|
||
unsigned int displayFrameCount; | ||
unsigned int frameCount; | ||
|
||
int fpsFast; | ||
int gameFlags; | ||
int streamFlags; | ||
Level* mainDrawUnit; | ||
|
||
char baseAreaName[20]; | ||
|
||
char levelDone; | ||
char levelChange; | ||
char loadingDisplayType; | ||
char gameMode; | ||
char cheatMode; | ||
char savingGame; | ||
|
||
char pad1[66]; | ||
|
||
float timeMult; | ||
}; | ||
|
||
class Game | ||
{ | ||
public: | ||
static void Init(); | ||
|
||
static Instance* GetPlayerInstance(); | ||
static GameTracker* GetGameTracker(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "Skew.h" | ||
|
||
#include "instance/Instances.h" | ||
#include "game/Game.h" | ||
|
||
void Skew::ToggleSkew() | ||
{ | ||
auto tracker = Game::GetGameTracker(); | ||
|
||
tracker->cheatMode = !tracker->cheatMode; | ||
Instances::Post(tracker->playerInstance, 1048592, tracker->cheatMode); | ||
} | ||
|
||
void Skew::Process(UINT msg, WPARAM wParam) | ||
{ | ||
// TODO different keyboard layouts | ||
// TODO configurable horizontal speed | ||
|
||
auto player = Game::GetPlayerInstance(); | ||
auto tracker = Game::GetGameTracker(); | ||
|
||
auto speed = 200.f * tracker->timeMult; | ||
|
||
if (msg == WM_KEYDOWN && wParam == 0x51) | ||
{ | ||
player->position.z += speed; | ||
} | ||
|
||
if (msg == WM_KEYDOWN && wParam == 0x5A) | ||
{ | ||
player->position.z -= speed; | ||
} | ||
} | ||
|
||
void Skew::OnInput(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) | ||
{ | ||
if (msg == WM_KEYUP && wParam == VK_F2) | ||
{ | ||
ToggleSkew(); | ||
} | ||
|
||
auto tracker = Game::GetGameTracker(); | ||
|
||
if (tracker->cheatMode) | ||
{ | ||
Process(msg, wParam); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
#include "Module.h" | ||
|
||
class Skew : public Module | ||
{ | ||
private: | ||
void ToggleSkew(); | ||
void Process(UINT msg, WPARAM wParam); | ||
|
||
public: | ||
virtual void OnInput(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); | ||
}; |