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

Comparing Daodan/src/Daodan.c (file contents):
Revision 438 by rossy, Thu Jul 16 01:24:07 2009 UTC vs.
Revision 439 by rossy, Fri Jul 17 08:34:48 2009 UTC

# Line 6 | Line 6
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  
# Line 44 | Line 45 | bool patch_usegettickcount = true;
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   {
# Line 164 | Line 168 | bool DDrPatch_Init()
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;
# Line 183 | Line 189 | bool DDrIniCallback(char* section, bool
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");
# Line 226 | Line 236 | bool DDrIniCallback(char* section, bool
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;
# Line 363 | Line 375 | void DDrConfig()
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!");
# Line 400 | Line 418 | void __cdecl DDrMain(int argc, char* arg
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);

Diff Legend

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