| 1 |
+ |
#include <windows.h> |
| 2 |
|
#include <string.h> |
| 3 |
|
|
| 4 |
|
#include "Daodan.h" |
| 12 |
|
#include "Daodan_WindowHack.h" |
| 13 |
|
|
| 14 |
|
#include "Oni.h" |
| 14 |
– |
#include "Oni_Persistence.h" |
| 15 |
|
|
| 16 |
< |
#include "BFW_Utility.h" |
| 16 |
> |
#include "Oni_GL.h" |
| 17 |
> |
#include "Daodan_GL.h" |
| 18 |
|
|
| 19 |
< |
#include "oni_gl.h" |
| 19 |
< |
#include "daodan_gl.h" |
| 20 |
< |
|
| 21 |
< |
#include "inifile.h" |
| 19 |
> |
#include "Inifile_Reader.h" |
| 20 |
|
|
| 21 |
|
HMODULE DDrDLLModule; |
| 22 |
|
HMODULE DDrONiModule; |
| 52 |
|
bool patch_newweapon = true; |
| 53 |
|
bool opt_usedaodanbsl = true; |
| 54 |
|
bool opt_border = true; |
| 57 |
– |
bool opt_shadow = false; |
| 55 |
|
bool opt_topmost = false; |
| 56 |
|
|
| 57 |
|
typedef int (__cdecl *CHINESEPROC)(DWORD WINAPI); |
| 140 |
|
// Disable UUrPlatform_Initalize/Terminate, this enables the Alt-Tab and the Windows key but has the possible side effect of allowing the screensaver to enable itself in-game. |
| 141 |
|
if (patch_alttab) |
| 142 |
|
{ |
| 143 |
+ |
// 0xC3 = ret, so makes those functions just have a "ret" instruction at their start |
| 144 |
|
DDrPatch_Byte ((char*)UUrPlatform_Initialize, 0xC3); |
| 145 |
|
DDrPatch_Byte ((char*)UUrPlatform_Terminate, 0xC3); |
| 146 |
|
} |
| 310 |
|
opt_usedaodanbsl = !_stricmp(inifile_cleanstr(value), "true"); |
| 311 |
|
else if (!_stricmp(name, "border")) |
| 312 |
|
opt_border = !_stricmp(inifile_cleanstr(value), "true"); |
| 315 |
– |
else if (!_stricmp(name, "shadow")) |
| 316 |
– |
opt_shadow = !_stricmp(inifile_cleanstr(value), "true"); |
| 313 |
|
else if (!_stricmp(name, "topmost")) |
| 314 |
|
opt_topmost = !_stricmp(inifile_cleanstr(value), "true"); |
| 315 |
|
else if (!_stricmp(name, "multibyte")) |
| 326 |
|
opt_sound = !_stricmp(inifile_cleanstr(value), "true"); |
| 327 |
|
else if (!_stricmp(name, "switch")) |
| 328 |
|
M3gResolutionSwitch = !_stricmp(inifile_cleanstr(value), "true"); |
| 333 |
– |
//else if (!_stricmp(name, "devmode")) |
| 334 |
– |
//turn_dev_mode_on = !_stricmp(inifile_cleanstr(value), "true"); |
| 329 |
|
else |
| 330 |
|
DDrStartupMessage("unrecognised option \"%s\"", name); |
| 331 |
|
break; |
| 582 |
|
|
| 583 |
|
DDrStartupMessage("daodan attached!"); |
| 584 |
|
|
| 585 |
+ |
// Tell Oni to not load non levelX_final-files by default: |
| 586 |
|
opt_ignore_private_data = false; |
| 587 |
+ |
|
| 588 |
+ |
// Enable sound by default: |
| 589 |
|
opt_sound = true; |
| 590 |
|
|
| 591 |
|
DDrConfig(); |
| 676 |
|
DDrPatch_MakeJump((void*)(OniExe + 0x0010f021), (void*)DDrCheater_LevelLoad); |
| 677 |
|
} |
| 678 |
|
|
| 682 |
– |
//DDrPatch_MakeJump((void*)(OniExe + 0x000378c0, (void*)DDrException); |
| 679 |
|
DDrPatch_MakeJump((void*)(OniExe + 0x000245A0), (void*)DDrPrintWarning); |
| 684 |
– |
//init_daodan_gl(); |
| 680 |
|
|
| 681 |
|
ONiMain(argc, argv); |
| 682 |
|
} |