Skip to content

Instantly share code, notes, and snippets.

@jkoppel
Created October 9, 2017 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkoppel/e3c4c1f5981e64d7240fb3088395a54d to your computer and use it in GitHub Desktop.
Save jkoppel/e3c4c1f5981e64d7240fb3088395a54d to your computer and use it in GitHub Desktop.
Example of making debug output in Ironfist
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