| 6 |  | #include "Daodan_Win32.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 7 |  | #include "Daodan_Cheater.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 8 |  | #include "Daodan_Persistence.h" | 
 
 
 
 
 
 
 
 | 9 | + | #include "Daodan_BSL.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 10 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 |  | #include "Daodan_WindowHack.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 12 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 45 |  | bool patch_cheatsenabled = true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 46 |  | bool patch_usedaodangl = false; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 47 |  | bool patch_windowhack = true; | 
 
 
 
 
 
 
 
 | 48 | + | bool patch_daodaninit = true; | 
 
 
 
 
 
 
 
 | 49 | + |  | 
 
 
 
 
 
 
 
 | 50 | + | bool opt_usedaodanbsl = true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 51 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 52 |  | bool DDrPatch_Init() | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 53 |  | { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 168 |  | return true; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 169 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 170 |  |  | 
 
 
 
 
 
 
 
 
 
 
 | 171 | < | enum {s_unknown, s_patch, s_language} ini_section; | 
 
 
 
 
 
 
 
 
 | 171 | > | enum {s_unknown, s_options, s_patch, s_language} ini_section; | 
 
 
 
 
 
 
 
 
 
 
 | 172 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 173 |  | bool DDrIniCallback(char* section, bool newsection, char* name, char* value) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 174 |  | { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 175 |  | if (newsection) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 176 |  | { | 
 
 
 
 
 
 
 
 
 
 
 | 177 | < | if (!stricmp(section, "patch")) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 177 | > | if (!stricmp(section, "options")) | 
 
 
 
 
 | 178 | > | ini_section = s_options; | 
 
 
 
 
 | 179 | > | else if (!stricmp(section, "patch")) | 
 
 
 
 
 
 
 
 
 
 
 | 180 |  | ini_section = s_patch; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 181 |  | else if (!stricmp(section, "language")) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 182 |  | ini_section = s_language; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 189 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 190 |  | switch (ini_section) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 191 |  | { | 
 
 
 
 
 
 
 
 | 192 | + | case s_options: | 
 
 
 
 
 
 
 
 | 193 | + | if (!stricmp(name, "usedaodanbsl")) | 
 
 
 
 
 
 
 
 | 194 | + | opt_usedaodanbsl = !stricmp(value, "true"); | 
 
 
 
 
 
 
 
 | 195 | + | break; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 196 |  | case s_patch: | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 197 |  | if (!stricmp(name, "fonttexturecache")) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 198 |  | patch_fonttexturecache = !stricmp(value, "true"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 236 |  | patch_usedaodangl = !stricmp(value, "true"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 237 |  | else if (!stricmp(name, "windowhack")) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 238 |  | patch_windowhack = !stricmp(value, "true"); | 
 
 
 
 
 
 
 
 | 239 | + | else if (!stricmp(name, "daodaninit")) | 
 
 
 
 
 
 
 
 | 240 | + | patch_daodaninit = !stricmp(value, "true"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 241 |  | else | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 242 |  | DDrStartupMessage("unrecognised patch \"%s\"", name); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 243 |  | break; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 375 |  | DDrStartupMessage("finished parsing"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 376 |  | } | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 377 |  |  | 
 
 
 
 
 
 
 
 | 378 | + | void ONICALL DDrGame_Init() | 
 
 
 
 
 
 
 
 | 379 | + | { | 
 
 
 
 
 
 
 
 | 380 | + | if (opt_usedaodanbsl) | 
 
 
 
 
 
 
 
 | 381 | + | SLrDaodan_Initalize(); | 
 
 
 
 
 
 
 
 | 382 | + | } | 
 
 
 
 
 
 
 
 | 383 | + |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 384 |  | void __cdecl DDrMain(int argc, char* argv[]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 385 |  | { | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 386 |  | DDrStartupMessage("daodan attached!"); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 418 |  | if (patch_windowhack) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 419 |  | DDrWindowHack_Install(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 420 |  |  | 
 
 
 
 
 
 
 
 | 421 | + | if (patch_daodaninit) | 
 
 
 
 
 
 
 
 | 422 | + | DDrPatch_MakeCall(OniExe + 0x000d345a, DDrGame_Init); | 
 
 
 
 
 
 
 
 | 423 | + |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 424 |  | init_daodan_gl(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 425 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 426 |  | ONiMain(argc, argv); |