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

Comparing Daodan/MSVC/Daodan.c (file contents):
Revision 586 by gumby, Wed Feb 2 08:17:19 2011 UTC vs.
Revision 589 by gumby, Sat Aug 20 09:47:49 2011 UTC

# Line 8 | Line 8
8   #include "Daodan_Persistence.h"
9   #include "Daodan_BSL.h"
10   #include "Daodan_Console.h"
11 <
11 > #include "Daodan_Update.h"
12   #include "Flatline_BSL.h"
13   #include "Flatline_Hooks.h"
14   #include "Daodan_WindowHack.h"
# Line 60 | Line 60 | bool opt_border = true;
60   bool opt_shadow = false;
61   bool opt_topmost = false;
62  
63 + typedef int (__cdecl *CHINESEPROC)(DWORD WINAPI);
64 + bool patch_chinese = false;
65   bool DDrPatch_Init()
66   {
67          DDrStartupMessage("patching engine");
# Line 235 | Line 237 | bool DDrPatch_Init()
237                  DDrPatch_Const(0x0051BB64, regen_patch);
238          }
239          
240 +        if(patch_chinese)
241 +        {
242 +                HMODULE dll = LoadLibrary("xfhsm_oni.dll");
243 +                if( dll )
244 +                {
245 +                        void* proc = GetProcAddress( dll, "InstallHook" );
246 +                        if(proc)
247 +                        {
248 +                                ((CHINESEPROC)proc)(GetCurrentThreadId());
249 +                        }
250 +                }
251 +        }
252 +
253          //Fix crappy ai2_shownames
254          if(1)
255          {
# Line 383 | Line 398 | bool DDrIniCallback(char* section, bool
398                                  DDrStartupMessage("unrecognised patch \"%s\"", name);
399                          break;
400                  case s_language:
401 <                        if (!_stricmp(name, "savepoint"))
401 >                        if (!_stricmp(name, "chinese"))
402 >                                patch_chinese = true;
403 >                        else if (!_stricmp(name, "savepoint"))
404                          {
405                                  char* str = _strdup(value);
406                                  DDrPatch_Int32(OniExe + 0x000fd730, (int)str);
# Line 573 | Line 590 | void __cdecl DDrMain(int argc, char* arg
590          opt_ignore_private_data = false;
591          opt_sound = true;
592          
593 +        DDrStartupMessage("checking for updates...");
594 +
595 +        DDr_CheckForUpdates(argc, argv);
596 +
597          DDrConfig();
598          DDrStartupMessage("parsing command line...");
599          for (i = 1; i < argc; i ++)

Diff Legend

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