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

Comparing Daodan/src/Daodan.c (file contents):
Revision 705 by alloc, Tue Mar 19 15:00:23 2013 UTC vs.
Revision 838 by alloc, Mon Apr 29 16:29:16 2013 UTC

# Line 1 | Line 1
1   #include <windows.h>
2   #include <string.h>
3 + #include <stdio.h>
4  
5   #include "Daodan.h"
6   #include "Daodan_Patch.h"
# Line 9 | Line 10
10   #include "Daodan_Persistence.h"
11   #include "Daodan_BSL.h"
12   #include "Daodan_Console.h"
13 + #include "Daodan_Config.h"
14  
15   #include "Oni.h"
16  
17   #include "Oni_GL.h"
18   #include "Daodan_GL.h"
19  
18 #include "Inifile_Reader.h"
19
20   HMODULE DDrDLLModule;
21   HMODULE DDrONiModule;
22  
23 bool patch_fonttexturecache = true;
24 bool patch_largetextures = true;
25 bool patch_levelplugins = true;
26 bool patch_pathfinding = true;
27 bool patch_projaware = true;
28 bool patch_directinput = true;
29 bool patch_wpfadetime = true;
30 bool patch_kickguns = false;
31 bool patch_cooldowntimer = true;
32 bool patch_throwtest = false;
33 bool patch_alttab = true;
34 bool patch_particledisablebit = false;
35 bool patch_multibyte = false;
36 bool patch_cheattable = true;
37 bool patch_argb8888 = true;
38 bool patch_killvtune = true;
39 bool patch_getcmdline = true;
40 bool patch_disablecmdline = true;
41 bool patch_optionsvisible = true;
42
43 bool patch_binkplay = true;
44 bool patch_safeprintf = true;
45 bool patch_daodandisplayenum = true;
46 bool patch_usegettickcount = true;
47 bool patch_cheatsenabled = true;
48 bool patch_usedaodangl = true;
49 bool patch_clipcursor = true;
50 bool patch_daodaninit = true;
51 bool patch_bsl = true;
52 bool patch_cheater = true;
53 bool patch_newweapon = true;
54 bool opt_usedaodanbsl = true;
55 bool opt_border = true;
56 bool opt_topmost = false;
57 bool opt_gamma = true;
58
23   typedef int (__cdecl *CHINESEPROC)(DWORD ThreadId);
60 bool patch_chinese = true;
61
24  
25   // Hooked WMrSlider_SetRange() in ONiOGU_Options_InitDialog. Disables a gamma
26   // slider in windowed mode.
# Line 82 | Line 44 | void ONICALL DDrShowOptionsButton(WMtWin
44          WMrWindow_SetVisible(window, 1);
45   }
46  
47 + void ONICALL DDrGame_Init()
48 + {
49 +        if (opt_usedaodanbsl)
50 +                SLrDaodan_Initialize();
51 + }
52 +
53 +
54 + //this was broken
55 + FILE** _UUgError_WarningFile = (FILE**)0x005711B4;
56 + FILE *__fastcall DDrPrintWarning(int filename, int linenumber, unsigned __int16 errornum, int message)
57 + {
58 +
59 +        FILE *v4; // eax@1
60 +        FILE *result; // eax@4
61 +        char v6[512]; // [sp+0h] [bp-100h]@1
62 +        FILE* UUgError_WarningFile = *_UUgError_WarningFile;
63 +
64 +        if (filename && message && (strlen((const char*)filename)+strlen((const char*)message))<420) {
65 +                sprintf(
66 +                        v6,
67 +                        "Error %x reported from File: %s, Line: %d (message follows) \r\n%s",
68 +                        errornum,
69 +                        (const char*)filename,
70 +                        linenumber,
71 +                        (const char*)message);
72 +
73 +                if ( UUgError_WarningFile
74 +                        || (UUgError_WarningFile = oni_fopen("debugger.txt", "wb"), UUgError_WarningFile ) )
75 +                {
76 +                        oni_fprintf(UUgError_WarningFile, "%s\r\n", v6);
77 +                        oni_fflush(UUgError_WarningFile);
78 +                }
79 +        }
80 +        //oni_fprintf(stdout, v6);
81 +        //sprintf(&v6, "%s", message);
82 +        *_UUgError_WarningFile = UUgError_WarningFile;
83 +        result = UUgError_WarningFile;
84 +        return result;
85 + }
86  
87  
88   bool DDrPatch_Init()
89   {
90 <        DDrStartupMessage("patching engine");
90 >        DDrStartupMessage("Daodan: Patching engine");
91          
92          // Font texture cache doubled
93          if (patch_fonttexturecache)
# Line 215 | Line 216 | bool DDrPatch_Init()
216          //Test newweap patch
217          if (patch_newweapon) {
218                  
219 <                //Makes it always say "Recieved weapon_name."
219 >                //Makes it always say "Received weapon_name."
220                  //Needs check for loc_4DFC66
221                  //DDrPatch_NOOP((char*)(OniExe + 0x000E4DF8),2);
222  
# Line 262 | Line 263 | bool DDrPatch_Init()
263          
264          if(patch_chinese)
265          {
266 <                HMODULE dll;
266 <                DWORD err;
267 <
268 <                DDrStartupMessage("Loading chinese DLL");
269 <                dll = LoadLibrary("xfhsm_oni.dll");
270 <                err = GetLastError();
271 <                if( dll )
266 >                if (GetFileAttributes("xfhsm_oni.dll") != INVALID_FILE_ATTRIBUTES)
267                  {
268 <                        void* proc = GetProcAddress( dll, "InstallHook" );
269 <                        if(proc)
268 >                        HMODULE dll;
269 >                        DWORD err;
270 >
271 >                        DDrStartupMessage("Daodan: Loading chinese DLL");
272 >                        dll = LoadLibrary("xfhsm_oni.dll");
273 >                        err = GetLastError();
274 >                        if( dll )
275                          {
276 <                                ((CHINESEPROC)proc)(GetCurrentThreadId());
276 >                                void* proc = GetProcAddress( dll, "InstallHook" );
277 >                                if(proc)
278 >                                {
279 >                                        ((CHINESEPROC)proc)(GetCurrentThreadId());
280 >                                }
281 >                        } else {
282 >                                char msg[100];
283 >                                FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, msg, 100, NULL);
284 >                                DDrStartupMessage("Daodan: Loading DLL failed with error %i: %s", err, msg);
285                          }
278                } else {
279                        char msg[100];
280                        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, msg, 100, NULL);
281                        DDrStartupMessage(" - Module loading failed with error %i: %s", err, msg);
286                  }
287          }
288  
# Line 342 | Line 346 | bool DDrPatch_Init()
346          // call with our hook function.
347          DDrPatch_MakeCall((void*)(OniExe + 0x000d262c), (void*)DD_ONiOGU_GammaSlider_SetRange);
348  
345        return true;
346 }
347
348
349 enum {s_unknown, s_options, s_patch, s_bsl, s_language} ini_section;
350
351 bool DDrIniCallback(char* section, bool newsection, char* name, char* value)
352 {
353        if (newsection)
354        {
355                if (!_stricmp(section, "options"))
356                        ini_section = s_options;
357                else if (!_stricmp(section, "patch"))
358                        ini_section = s_patch;
359                else if (!_stricmp(section, "bsl"))
360                        ini_section = s_bsl;
361                else if (!_stricmp(section, "language"))
362                        ini_section = s_language;
363                else
364                {
365                        ini_section = s_unknown;
366                        DDrStartupMessage("unrecognised section \"%s\"", section);
367                }
368        }
369        
370        switch (ini_section)
371        {
372                case s_options:
373                        if (!_stricmp(name, "usedaodanbsl"))
374                                opt_usedaodanbsl = !_stricmp(inifile_cleanstr(value), "true");
375                        else if (!_stricmp(name, "border"))
376                                opt_border = !_stricmp(inifile_cleanstr(value), "true");
377                        else if (!_stricmp(name, "topmost"))
378                                opt_topmost = !_stricmp(inifile_cleanstr(value), "true");
379                        else if (!_stricmp(name, "multibyte"))
380                                patch_multibyte = !_stricmp(inifile_cleanstr(value), "true");
381                        else if (!_stricmp(name, "debug"))
382                                AKgDebug_DebugMaps = !_stricmp(inifile_cleanstr(value), "true");
383                        else if (!_stricmp(name, "debugfiles"))
384                                BFgDebugFileEnable = !_stricmp(inifile_cleanstr(value), "true");
385                        else if (!_stricmp(name, "findsounds"))
386                                SSgSearchOnDisk = !_stricmp(inifile_cleanstr(value), "true");
387                        else if (!_stricmp(name, "ignore_private_data"))
388                                opt_ignore_private_data = !_stricmp(inifile_cleanstr(value), "true");
389                        else if (!_stricmp(name, "sound"))
390                                opt_sound = !_stricmp(inifile_cleanstr(value), "true");
391                        else if (!_stricmp(name, "switch"))
392                                M3gResolutionSwitch = !_stricmp(inifile_cleanstr(value), "true");
393                        else if (!_stricmp(name, "gamma"))
394                                opt_gamma = !_stricmp(inifile_cleanstr(value), "true");
395                        else
396                                DDrStartupMessage("unrecognised option \"%s\"", name);
397                        break;
398                case s_patch:
399                        if (!_stricmp(name, "fonttexturecache"))
400                                patch_fonttexturecache = !_stricmp(inifile_cleanstr(value), "true");
401                        else if (!_stricmp(name, "largetextures"))
402                                patch_largetextures = !_stricmp(inifile_cleanstr(value), "true");
403                        else if (!_stricmp(name, "levelplugins"))
404                                patch_levelplugins = !_stricmp(inifile_cleanstr(value), "true");
405                        else if (!_stricmp(name, "pathfinding"))
406                                patch_pathfinding = !_stricmp(inifile_cleanstr(value), "true");
407                        else if (!_stricmp(name, "projaware"))
408                                patch_projaware = !_stricmp(inifile_cleanstr(value), "true");
409                        else if (!_stricmp(name, "directinput"))
410                                patch_directinput = !_stricmp(inifile_cleanstr(value), "true");
411                        else if (!_stricmp(name, "wpfadetime"))
412                                patch_wpfadetime = !_stricmp(inifile_cleanstr(value), "true");
413                        else if (!_stricmp(name, "kickguns"))
414                                patch_kickguns = !_stricmp(inifile_cleanstr(value), "true");
415                        else if (!_stricmp(name, "cooldowntimer"))
416                                patch_cooldowntimer = !_stricmp(inifile_cleanstr(value), "true");
417                        else if (!_stricmp(name, "throwtest"))
418                                patch_throwtest = !_stricmp(inifile_cleanstr(value), "true");
419                        else if (!_stricmp(name, "alttab"))
420                                patch_alttab = !_stricmp(inifile_cleanstr(value), "true");
421                        else if (!_stricmp(name, "particledisablebit"))
422                                patch_particledisablebit = !_stricmp(inifile_cleanstr(value), "true");
423                        else if (!_stricmp(name, "multibyte"))
424                                patch_multibyte = !_stricmp(inifile_cleanstr(value), "true");
425                        else if (!_stricmp(name, "cheattable"))
426                                patch_cheattable = !_stricmp(inifile_cleanstr(value), "true");
427                        else if (!_stricmp(name, "argb8888"))
428                                patch_argb8888 = !_stricmp(inifile_cleanstr(value), "true");
429                        else if (!_stricmp(name, "killvtune"))
430                                patch_killvtune = !_stricmp(inifile_cleanstr(value), "true");
431                        else if (!_stricmp(name, "getcmdline"))
432                                patch_getcmdline = !_stricmp(inifile_cleanstr(value), "true");
433                        else if (!_stricmp(name, "disablecmdline"))
434                                patch_disablecmdline = !_stricmp(inifile_cleanstr(value), "true");
435                        else if (!_stricmp(name, "safeprintf"))
436                                patch_safeprintf = !_stricmp(inifile_cleanstr(value), "true");
437                        else if (!_stricmp(name, "daodandisplayenum"))
438                                patch_daodandisplayenum = !_stricmp(inifile_cleanstr(value), "true");
439                        else if (!_stricmp(name, "usegettickcount"))
440                                patch_usegettickcount = !_stricmp(inifile_cleanstr(value), "true");
441                        else if (!_stricmp(name, "cheatsenabled"))
442                                patch_cheatsenabled = !_stricmp(inifile_cleanstr(value), "true");
443                        else if (!_stricmp(name, "usedaodangl"))
444                                patch_usedaodangl = !_stricmp(inifile_cleanstr(value), "true");
445                        else if (!_stricmp(name, "clipcursor"))
446                                patch_clipcursor = !_stricmp(inifile_cleanstr(value), "true");
447                        else if (!_stricmp(name, "daodaninit"))
448                                patch_daodaninit = !_stricmp(inifile_cleanstr(value), "true");
449                        else if (!_stricmp(name, "bsl"))
450                                patch_bsl = !_stricmp(inifile_cleanstr(value), "true");
451                        else if (!_stricmp(name, "cheater"))
452                                patch_cheater = !_stricmp(inifile_cleanstr(value), "true");
453                        else if (!_stricmp(name, "newweap"))
454                                patch_newweapon = !_stricmp(inifile_cleanstr(value), "true");
455                        else if (!_stricmp(name, "optionsvisible"))
456                                patch_optionsvisible = !_stricmp(inifile_cleanstr(value), "true");
457                        else if (!_stricmp(name, "binkplay"))
458                                patch_binkplay = !_stricmp(inifile_cleanstr(value), "true");
459                        else
460                                DDrStartupMessage("unrecognised patch \"%s\"", name);
461                        break;
462                case s_language:
463                        if (!_stricmp(name, "chinese"))
464                                patch_chinese = true;
465                        else if (!_stricmp(name, "savepoint"))
466                        {
467                                char* str = _strdup(value);
468                                DDrPatch_Int32((int*)(OniExe + 0x000fd730), (int)str);
469                                DDrPatch_Int32((int*)(OniExe + 0x000fd738), (int)str);
470                        }
471                        else if (!_stricmp(name, "syndicatewarehouse"))
472                        {
473                                char* str = _strdup(value);
474                                DDrPatch_Int32((int*)(OniExe + 0x000fd71a), (int)str);
475                                DDrPatch_Int32((int*)(OniExe + 0x0010ef75), (int)str);
476                        }
477                        else if (!_stricmp(name, "damn"))
478                                DDrPatch__strdup((int*)(OniExe + 0x0010fb6e), value);
479                        else if (!_stricmp(name, "blam"))
480                                DDrPatch__strdup((int*)(OniExe + 0x0010fb73), value);
481                        else if (!_stricmp(name, "shapeshifter_on"))
482                                DDr_CheatTable[0].message_on = _strdup(value);
483                        else if (!_stricmp(name, "shapeshifter_off"))
484                                DDr_CheatTable[0].message_off = _strdup(value);
485                        else if (!_stricmp(name, "liveforever_on"))
486                                DDr_CheatTable[1].message_on = _strdup(value);
487                        else if (!_stricmp(name, "liveforever_off"))
488                                DDr_CheatTable[1].message_off = _strdup(value);
489                        else if (!_stricmp(name, "touchofdeath_on"))
490                                DDr_CheatTable[2].message_on = _strdup(value);
491                        else if (!_stricmp(name, "touchofdeath_off"))
492                                DDr_CheatTable[2].message_off = _strdup(value);
493                        else if (!_stricmp(name, "canttouchthis_on"))
494                                DDr_CheatTable[3].message_on = _strdup(value);
495                        else if (!_stricmp(name, "canttouchthis_off"))
496                                DDr_CheatTable[3].message_off = _strdup(value);
497                        else if (!_stricmp(name, "fatloot_on"))
498                                DDr_CheatTable[4].message_on = _strdup(value);
499                        else if (!_stricmp(name, "glassworld_on"))
500                                DDr_CheatTable[5].message_on = _strdup(value);
501                        else if (!_stricmp(name, "glassworld_off"))
502                                DDr_CheatTable[5].message_off = _strdup(value);
503                        else if (!_stricmp(name, "winlevel_on"))
504                                DDr_CheatTable[6].message_on = _strdup(value);
505                        else if (!_stricmp(name, "loselevel_on"))
506                                DDr_CheatTable[7].message_on = _strdup(value);
507                        else if (!_stricmp(name, "bighead_on"))
508                                DDr_CheatTable[8].message_on = _strdup(value);
509                        else if (!_stricmp(name, "bighead_off"))
510                                DDr_CheatTable[8].message_off = _strdup(value);
511                        else if (!_stricmp(name, "minime_on"))
512                                DDr_CheatTable[9].message_on = _strdup(value);
513                        else if (!_stricmp(name, "minime_off"))
514                                DDr_CheatTable[9].message_off = _strdup(value);
515                        else if (!_stricmp(name, "superammo_on"))
516                                DDr_CheatTable[10].message_on = _strdup(value);
517                        else if (!_stricmp(name, "superammo_off"))
518                                DDr_CheatTable[10].message_off = _strdup(value);
519                        else if (!_stricmp(name, "devmode_on"))
520                        {
521                                char* str = _strdup(value);
522                                DDr_CheatTable[11].message_on = str;
523                                DDr_CheatTable[cheat_x].message_on = str;
524                        }
525                        else if (!_stricmp(name, "devmode_off"))
526                        {
527                                char* str = _strdup(value);
528                                DDr_CheatTable[11].message_off = str;
529                                DDr_CheatTable[cheat_x].message_off = str;
530                        }
531                        else if (!_stricmp(name, "reservoirdogs_on"))
532                                DDr_CheatTable[12].message_on = _strdup(value);
533                        else if (!_stricmp(name, "reservoirdogs_off"))
534                                DDr_CheatTable[12].message_off = _strdup(value);
535                        else if (!_stricmp(name, "roughjustice_on"))
536                                DDr_CheatTable[13].message_on = _strdup(value);
537                        else if (!_stricmp(name, "roughjustice_off"))
538                                DDr_CheatTable[13].message_off = _strdup(value);
539                        else if (!_stricmp(name, "chenille_on"))
540                                DDr_CheatTable[14].message_on = _strdup(value);
541                        else if (!_stricmp(name, "chenille_off"))
542                                DDr_CheatTable[14].message_off = _strdup(value);
543                        else if (!_stricmp(name, "behemoth_on"))
544                                DDr_CheatTable[15].message_on = _strdup(value);
545                        else if (!_stricmp(name, "behemoth_off"))
546                                DDr_CheatTable[15].message_off = _strdup(value);
547                        else if (!_stricmp(name, "elderrune_on"))
548                                DDr_CheatTable[16].message_on = _strdup(value);
549                        else if (!_stricmp(name, "elderrune_off"))
550                                DDr_CheatTable[16].message_off = _strdup(value);
551                        else if (!_stricmp(name, "moonshadow_on"))
552                                DDr_CheatTable[17].message_on = _strdup(value);
553                        else if (!_stricmp(name, "moonshadow_off"))
554                                DDr_CheatTable[17].message_off = _strdup(value);
555                        else if (!_stricmp(name, "munitionfrenzy_on"))
556                                DDr_CheatTable[18].message_on = _strdup(value);
557                        else if (!_stricmp(name, "fistsoflegend_on"))
558                                DDr_CheatTable[19].message_on = _strdup(value);
559                        else if (!_stricmp(name, "fistsoflegend_off"))
560                                DDr_CheatTable[19].message_off = _strdup(value);
561                        else if (!_stricmp(name, "killmequick_on"))
562                                DDr_CheatTable[20].message_on = _strdup(value);
563                        else if (!_stricmp(name, "killmequick_off"))
564                                DDr_CheatTable[20].message_off = _strdup(value);
565                        else if (!_stricmp(name, "carousel_on"))
566                                DDr_CheatTable[21].message_on = _strdup(value);
567                        else if (!_stricmp(name, "carousel_off"))
568                                DDr_CheatTable[21].message_off = _strdup(value);
569                        else
570                                DDrStartupMessage("unrecognised language item \"%s\"", name);
571                        break;
572                case s_bsl:
573                default:
574                        break;
575        }
576        
577        return true;
578 }
579
580 void DDrConfig()
581 {
582
583        if (GetFileAttributes("daodan.ini") == INVALID_FILE_ATTRIBUTES)
584        {
585                FILE* fp;
586                DDrStartupMessage("daodan.ini doesn't exist, creating");
587                fp = fopen("daodan.ini", "w");
588                if (fp)
589                {
590                        fputs("[Options]\n", fp);
591                        fclose(fp);
592                }
593        }
594        
595        DDrStartupMessage("parsing daodan.ini...");
596        if (!inifile_read("daodan.ini", DDrIniCallback))
597                DDrStartupMessage("error reading daodan.ini, check your syntax!");
598        DDrStartupMessage("finished parsing");
599 }
600
601 void ONICALL DDrGame_Init()
602 {
603        if (opt_usedaodanbsl)
604                SLrDaodan_Initalize();
605 }
606
607 void DDrException() {
608        int* i = 0;
609        *i = 1;
610 }
611 #include <stdio.h>
612
613 //this was broken
614 FILE** _UUgError_WarningFile = (FILE**)0x005711B4;
615 FILE *__fastcall DDrPrintWarning(int filename, int linenumber, unsigned __int16 errornum, int message)
616 {
617
618        FILE *v4; // eax@1
619        FILE *result; // eax@4
620        char v6[512]; // [sp+0h] [bp-100h]@1
621        FILE* UUgError_WarningFile = *_UUgError_WarningFile;
622
623        if (filename && message && (strlen((const char*)filename)+strlen((const char*)message))<420) {
624                sprintf(
625                        v6,
626                        "Error %x reported from File: %s, Line: %d (message follows) \r\n%s",
627                        errornum,
628                        (const char*)filename,
629                        linenumber,
630                        (const char*)message);
631
632                if ( UUgError_WarningFile
633                        || (UUgError_WarningFile = oni_fopen("debugger.txt", "wb"), UUgError_WarningFile ) )
634                {
635                        oni_fprintf(UUgError_WarningFile, "%s\r\n", v6);
636                        oni_fflush(UUgError_WarningFile);
637                }
638        }
639        //oni_fprintf(stdout, v6);
640        //sprintf(&v6, "%s", message);
641        *_UUgError_WarningFile = UUgError_WarningFile;
642        result = UUgError_WarningFile;
643        return result;
644 }
645
646 void __cdecl DDrMain(int argc, char* argv[])
647 {
648        int i;
649        char* section;
650        char* option;
651        bool falseoption;
652
653        DDrStartupMessage("daodan attached!");
654        
655        // Tell Oni to not load non levelX_final-files by default:
656        opt_ignore_private_data = false;
657
658        // Enable sound by default:
659        opt_sound = true;
660        
661        DDrConfig();
662        DDrStartupMessage("parsing command line...");
663        for (i = 1; i < argc; i ++)
664        {
665                if (argv[i][0] == '-')
666                {
667                        section = argv[i] + 1;
668                        if ((option = strchr(argv[i], '.')))
669                        {
670                                *option = '\0';
671                                falseoption = (option[1] == 'n' || option[1] == 'N') && (option[2] = 'o' || option[2] == 'O');
672                                if (i < (argc - 1) && argv[i + 1][0] != '-')
673                                        DDrIniCallback(section, true, option + 1, argv[++i]);
674                                else
675                                        DDrIniCallback(section, true, option + (falseoption ? 3 : 1), (falseoption ? "false" : "true"));
676                                *option = '.';
677                        }
678                        else
679                        {
680                                falseoption = (section[0] == 'n' || section[0] == 'N') && (section[1] = 'o' || section[1] == 'O');
681                                ini_section = s_options;
682                                if (i < (argc - 1) && argv[i + 1][0] != '-')
683                                        DDrIniCallback(NULL, false, section, argv[++i]);
684                                else
685                                        DDrIniCallback(NULL, false, section + (falseoption ? 2 : 0), (falseoption ? "false" : "true"));
686                        }
687                }
688                else
689                {
690                        DDrStartupMessage("parse error \"%s\"", argv[i]);
691                        break;
692                }
693        }
694        DDrStartupMessage("finished parsing");
695        DDrPatch_Init();
696        
349          // Safe startup message printer
350          if (patch_safeprintf)
351                  DDrPatch_MakeJump((void*)UUrStartupMessage, (void*)DDrStartupMessage);
# Line 782 | Line 434 | void __cdecl DDrMain(int argc, char* arg
434          }
435  
436          DDrPatch_MakeJump((void*)(OniExe + 0x000245A0), (void*)DDrPrintWarning);
437 +
438 +
439 +        return true;
440 + }
441 +
442 +
443 + void DDrException() {
444 +        int* i = 0;
445 +        *i = 1;
446 + }
447 +
448 + void __cdecl DDrMain(int argc, char* argv[])
449 + {
450 +        DDrStartupMessage("Daodan: Daodan attached!");
451 +        
452 +        // Tell Oni to not load non levelX_final-files by default:
453 +        opt_ignore_private_data = false;
454 +
455 +        // Enable sound by default:
456 +        opt_sound = true;
457 +        
458 +        DDrConfig(argc, argv);
459 +
460 +        DDrPatch_Init();
461 +        
462          
463          ONiMain(argc, argv);
464   }

Diff Legend

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