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 426 by rossy, Thu Jul 16 01:24:07 2009 UTC vs.
Revision 445 by rossy, Sun Jul 19 11:03:44 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_bsl, 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, "bsl"))
182 +                        ini_section = s_bsl;
183                  else if (!stricmp(section, "language"))
184                          ini_section = s_language;
185                  else
# Line 183 | Line 191 | bool DDrIniCallback(char* section, bool
191          
192          switch (ini_section)
193          {
194 +                case s_options:
195 +                        if (!stricmp(name, "usedaodanbsl"))
196 +                                opt_usedaodanbsl = !stricmp(value, "true");
197 +                        break;
198                  case s_patch:
199                          if (!stricmp(name, "fonttexturecache"))
200                                  patch_fonttexturecache = !stricmp(value, "true");
# Line 226 | Line 238 | bool DDrIniCallback(char* section, bool
238                                  patch_usedaodangl = !stricmp(value, "true");
239                          else if (!stricmp(name, "windowhack"))
240                                  patch_windowhack = !stricmp(value, "true");
241 +                        else if (!stricmp(name, "daodaninit"))
242 +                                patch_daodaninit = !stricmp(value, "true");
243                          else
244                                  DDrStartupMessage("unrecognised patch \"%s\"", name);
245                          break;
246 +                case s_bsl:
247 +                        
248 +                        break;
249                  case s_language:
250                          if (!stricmp(name, "savepoint"))
251                          {
# Line 363 | Line 380 | void DDrConfig()
380          DDrStartupMessage("finished parsing");
381   }
382  
383 + void ONICALL DDrGame_Init()
384 + {
385 +        if (opt_usedaodanbsl)
386 +                SLrDaodan_Initalize();
387 + }
388 +
389   void __cdecl DDrMain(int argc, char* argv[])
390   {
391          DDrStartupMessage("daodan attached!");
# Line 400 | Line 423 | void __cdecl DDrMain(int argc, char* arg
423          if (patch_windowhack)
424                  DDrWindowHack_Install();
425          
426 +        if (patch_daodaninit)
427 +                DDrPatch_MakeCall(OniExe + 0x000d345a, DDrGame_Init);
428 +        
429          init_daodan_gl();
430          
431          ONiMain(argc, argv);

Diff Legend

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