Created
October 9, 2017 20:24
-
-
Save jkoppel/e3c4c1f5981e64d7240fb3088395a54d to your computer and use it in GitHub Desktop.
Example of making debug output in Ironfist
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
extern int __fastcall InitMenuHandler_orig(struct tag_message & msg); | |
extern font* smallFont; | |
extern font* bigFont; | |
extern heroWindow* gpInitWin; | |
extern void __fastcall FillBitmapArea(class bitmap *, int, int, int, int, int); | |
int __fastcall InitMenuHandler(struct tag_message & msg) { | |
if (msg.eventCode == INPUT_MOUSEMOVE_EVENT_CODE) { | |
FillBitmapArea(gpWindowManager->screenBuffer, 0, 0, 100, 30, 0); | |
char buf[100]; | |
sprintf(buf, "%d,%d", msg.altXCoord, msg.altYCoord); | |
bigFont->DrawBoundedString(buf, 10, 10, 100, 30, 0, 0); | |
gpWindowManager->UpdateScreenRegion(0, 0, 640, 480); | |
} | |
return InitMenuHandler_orig(msg); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment