ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Patches/Cheater.c
(Generate patch)

Comparing Daodan/src/Patches/Cheater.c (file contents):
Revision 1016 by alloc, Sun May 4 18:17:11 2014 UTC vs.
Revision 1017 by alloc, Mon Mar 23 23:29:19 2015 UTC

# Line 9 | Line 9
9   #include "../Daodan.h"
10   #include "../Daodan_Config.h"
11   #include "Cheater.h"
12 + #include "Input.h"
13 + #include "Utility.h"
14  
15   union MSVC_EVIL_FLOAT_HACK
16   {
# Line 292 | Line 294 | void __stdcall FallingFrames(void* Ebp)
294          if (inc_fallingframes)
295                  ++*((unsigned int*)((char*)Ebp + 0xf6));
296   }
297 <
297 >
298 >
299 > static void BindableCheatCallback (CustomActionCallbackArgument cheatnum) {
300 >        uint8_t res = DDrCheater (cheatnum);
301 >        if (res)
302 >                COrMessage_Print(DDr_CheatTable[cheatnum].message_on, 0, 240);
303 >        else
304 >                COrMessage_Print(DDr_CheatTable[cheatnum].message_off, 0, 240);
305 > }
306 >
307 > void InitBindableCheats() {
308 >        oniCheatCode* cur;
309 >        for (cur = DDr_CheatTable; cur->name != 0; cur++) {
310 > //              char* val = malloc(20);
311 > //              sprintf(val, "cheat_%s", cur->name);
312 >                Input_RegisterCustomAction (cur->name, EVENT_KEYPRESS, 0, BindableCheatCallback, cur->func);
313 >        }
314 > }
315 >

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)