Skip to content

Instantly share code, notes, and snippets.

@jkoppel
Created Oct 9, 2017
Embed
What would you like to do?
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