--- Daodan/src/Daodan.c 2013/03/19 15:00:23 705 +++ Daodan/src/Daodan.c 2013/04/29 15:26:54 837 @@ -86,7 +86,7 @@ void ONICALL DDrShowOptionsButton(WMtWin bool DDrPatch_Init() { - DDrStartupMessage("patching engine"); + DDrStartupMessage("Daodan: Patching engine"); // Font texture cache doubled if (patch_fonttexturecache) @@ -215,7 +215,7 @@ bool DDrPatch_Init() //Test newweap patch if (patch_newweapon) { - //Makes it always say "Recieved weapon_name." + //Makes it always say "Received weapon_name." //Needs check for loc_4DFC66 //DDrPatch_NOOP((char*)(OniExe + 0x000E4DF8),2); @@ -262,23 +262,26 @@ bool DDrPatch_Init() if(patch_chinese) { - HMODULE dll; - DWORD err; - - DDrStartupMessage("Loading chinese DLL"); - dll = LoadLibrary("xfhsm_oni.dll"); - err = GetLastError(); - if( dll ) + if (GetFileAttributes("xfhsm_oni.dll") != INVALID_FILE_ATTRIBUTES) { - void* proc = GetProcAddress( dll, "InstallHook" ); - if(proc) + HMODULE dll; + DWORD err; + + DDrStartupMessage("Daodan: Loading chinese DLL"); + dll = LoadLibrary("xfhsm_oni.dll"); + err = GetLastError(); + if( dll ) { - ((CHINESEPROC)proc)(GetCurrentThreadId()); + void* proc = GetProcAddress( dll, "InstallHook" ); + if(proc) + { + ((CHINESEPROC)proc)(GetCurrentThreadId()); + } + } else { + char msg[100]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, msg, 100, NULL); + DDrStartupMessage("Daodan: Loading DLL failed with error %i: %s", err, msg); } - } else { - char msg[100]; - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, msg, 100, NULL); - DDrStartupMessage(" - Module loading failed with error %i: %s", err, msg); } } @@ -363,7 +366,7 @@ bool DDrIniCallback(char* section, bool else { ini_section = s_unknown; - DDrStartupMessage("unrecognised section \"%s\"", section); + DDrStartupMessage("Daodan: Unrecognised ini section \"%s\"", section); } } @@ -393,7 +396,7 @@ bool DDrIniCallback(char* section, bool else if (!_stricmp(name, "gamma")) opt_gamma = !_stricmp(inifile_cleanstr(value), "true"); else - DDrStartupMessage("unrecognised option \"%s\"", name); + DDrStartupMessage("Daodan: Unrecognised ini option \"%s\"", name); break; case s_patch: if (!_stricmp(name, "fonttexturecache")) @@ -457,7 +460,7 @@ bool DDrIniCallback(char* section, bool else if (!_stricmp(name, "binkplay")) patch_binkplay = !_stricmp(inifile_cleanstr(value), "true"); else - DDrStartupMessage("unrecognised patch \"%s\"", name); + DDrStartupMessage("Daodan: Unrecognised ini patch \"%s\"", name); break; case s_language: if (!_stricmp(name, "chinese")) @@ -567,7 +570,7 @@ bool DDrIniCallback(char* section, bool else if (!_stricmp(name, "carousel_off")) DDr_CheatTable[21].message_off = _strdup(value); else - DDrStartupMessage("unrecognised language item \"%s\"", name); + DDrStartupMessage("Daodan: Unrecognised ini language item \"%s\"", name); break; case s_bsl: default: @@ -583,7 +586,7 @@ void DDrConfig() if (GetFileAttributes("daodan.ini") == INVALID_FILE_ATTRIBUTES) { FILE* fp; - DDrStartupMessage("daodan.ini doesn't exist, creating"); + DDrStartupMessage("Daodan: daodan.ini doesn't exist, creating"); fp = fopen("daodan.ini", "w"); if (fp) { @@ -592,16 +595,16 @@ void DDrConfig() } } - DDrStartupMessage("parsing daodan.ini..."); + DDrStartupMessage("Daodan: Parsing daodan.ini..."); if (!inifile_read("daodan.ini", DDrIniCallback)) - DDrStartupMessage("error reading daodan.ini, check your syntax!"); - DDrStartupMessage("finished parsing"); + DDrStartupMessage("Daodan: Error reading daodan.ini, check your syntax!"); + DDrStartupMessage("Daodan: Finished parsing"); } void ONICALL DDrGame_Init() { if (opt_usedaodanbsl) - SLrDaodan_Initalize(); + SLrDaodan_Initialize(); } void DDrException() { @@ -650,7 +653,7 @@ void __cdecl DDrMain(int argc, char* arg char* option; bool falseoption; - DDrStartupMessage("daodan attached!"); + DDrStartupMessage("Daodan: Daodan attached!"); // Tell Oni to not load non levelX_final-files by default: opt_ignore_private_data = false; @@ -659,7 +662,7 @@ void __cdecl DDrMain(int argc, char* arg opt_sound = true; DDrConfig(); - DDrStartupMessage("parsing command line..."); + DDrStartupMessage("Daodan: Parsing command line..."); for (i = 1; i < argc; i ++) { if (argv[i][0] == '-') @@ -687,11 +690,11 @@ void __cdecl DDrMain(int argc, char* arg } else { - DDrStartupMessage("parse error \"%s\"", argv[i]); + DDrStartupMessage("Daodan: Parse error \"%s\"", argv[i]); break; } } - DDrStartupMessage("finished parsing"); + DDrStartupMessage("Daodan: Finished parsing"); DDrPatch_Init(); // Safe startup message printer