--- Daodan/src/Daodan.c 2009/07/16 01:24:07 426 +++ Daodan/src/Daodan.c 2009/07/17 08:34:48 439 @@ -6,6 +6,7 @@ #include "Daodan_Win32.h" #include "Daodan_Cheater.h" #include "Daodan_Persistence.h" +#include "Daodan_BSL.h" #include "Daodan_WindowHack.h" @@ -44,6 +45,9 @@ bool patch_usegettickcount = true; bool patch_cheatsenabled = true; bool patch_usedaodangl = false; bool patch_windowhack = true; +bool patch_daodaninit = true; + +bool opt_usedaodanbsl = true; bool DDrPatch_Init() { @@ -164,13 +168,15 @@ bool DDrPatch_Init() return true; } -enum {s_unknown, s_patch, s_language} ini_section; +enum {s_unknown, s_options, s_patch, s_language} ini_section; bool DDrIniCallback(char* section, bool newsection, char* name, char* value) { if (newsection) { - if (!stricmp(section, "patch")) + if (!stricmp(section, "options")) + ini_section = s_options; + else if (!stricmp(section, "patch")) ini_section = s_patch; else if (!stricmp(section, "language")) ini_section = s_language; @@ -183,6 +189,10 @@ bool DDrIniCallback(char* section, bool switch (ini_section) { + case s_options: + if (!stricmp(name, "usedaodanbsl")) + opt_usedaodanbsl = !stricmp(value, "true"); + break; case s_patch: if (!stricmp(name, "fonttexturecache")) patch_fonttexturecache = !stricmp(value, "true"); @@ -226,6 +236,8 @@ bool DDrIniCallback(char* section, bool patch_usedaodangl = !stricmp(value, "true"); else if (!stricmp(name, "windowhack")) patch_windowhack = !stricmp(value, "true"); + else if (!stricmp(name, "daodaninit")) + patch_daodaninit = !stricmp(value, "true"); else DDrStartupMessage("unrecognised patch \"%s\"", name); break; @@ -363,6 +375,12 @@ void DDrConfig() DDrStartupMessage("finished parsing"); } +void ONICALL DDrGame_Init() +{ + if (opt_usedaodanbsl) + SLrDaodan_Initalize(); +} + void __cdecl DDrMain(int argc, char* argv[]) { DDrStartupMessage("daodan attached!"); @@ -400,6 +418,9 @@ void __cdecl DDrMain(int argc, char* arg if (patch_windowhack) DDrWindowHack_Install(); + if (patch_daodaninit) + DDrPatch_MakeCall(OniExe + 0x000d345a, DDrGame_Init); + init_daodan_gl(); ONiMain(argc, argv);