Changeset 1000 for Daodan/src
- Timestamp:
- May 4, 2014, 8:17:11 PM (11 years ago)
- Location:
- Daodan/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/Daodan_Config.c
r996 r1000 26 26 27 27 ConfigSection_t config[] = { 28 { "patches", "Patches", { 29 { "alttab", 30 "Allows to Alt-Tab out of Oni and use Windows key. May enable the screensaver as well.", 31 C_BOOL, 32 {.intBoolVal = true}, 33 {.intBoolVal = true} }, 28 { "", "Command line only", { 29 { "help", 30 "Generates this help file.", 31 C_CMD, 32 {.intBoolVal = 0}, 33 {.callback = DDrConfig_PrintHelp} }, 34 { 0, 0, 0, {0}, {0} } 35 } }, 36 { "devmode", "Developer Mode", { 37 { "highres_console", 38 "Fixes bug where console line becomes invisible at higher resolutions.", 39 C_BOOL, 40 {.intBoolVal = true}, 41 {.intBoolVal = true} }, 42 { "showtriggervolumes", 43 "Allows BSL variable \"show_triggervolumes\" and Ctrl+Shift+X (in devmode) to work.", 44 C_BOOL, 45 {.intBoolVal = true}, 46 {.intBoolVal = true} }, 47 { 0, 0, 0, {0}, {0} } 48 } }, 49 { "gameplay", "Gameplay", { 50 { "cheatsenabled", 51 "Enables cheats without having to beat the game first.", 52 C_BOOL, 53 {.intBoolVal = true}, 54 {.intBoolVal = true} }, 55 { "cheattable", 56 "Replaces Oni's cheat table with table that includes new cheats including devmode.", 57 C_BOOL, 58 {.intBoolVal = true}, 59 {.intBoolVal = true} }, 60 { "cooldowntimer", 61 "Disables weapon cooldown exploit.", 62 C_BOOL, 63 {.intBoolVal = true}, 64 {.intBoolVal = true} }, 65 { "kickguns", 66 "EXPERIMENTAL! Unfinished, do not use.", 67 C_BOOL, 68 {.intBoolVal = false}, 69 {.intBoolVal = false} }, 70 { "pathfinding", 71 "Size of pathfinding grid cache increased by eight times in order to prevent crashes in large levels.", 72 C_BOOL, 73 {.intBoolVal = true}, 74 {.intBoolVal = true} }, 75 { "projaware", 76 "Allows AI to dodge incoming gunfire properly.", 77 C_BOOL, 78 {.intBoolVal = true}, 79 {.intBoolVal = true} }, 80 { "throwtest", 81 "EXPERIMENTAL! Experiment with allowing enemies to be thrown over railings.", 82 C_BOOL, 83 {.intBoolVal = false}, 84 {.intBoolVal = false} }, 85 { "wpfadetime", 86 "Adds working function for existing BSL command wp_fadetime, sets fade time to 4800.", 87 C_BOOL, 88 {.intBoolVal = true}, 89 {.intBoolVal = true} }, 90 { 0, 0, 0, {0}, {0} } 91 } }, 92 { "graphics", "Graphics", { 93 { "binkplay", 94 "Fix binkplay calls to use GDI and outro same mode as intro.", 95 C_BOOL, 96 {.intBoolVal = true}, 97 {.intBoolVal = true} }, 98 { "daodangl", 99 "Provides an improved windowed mode (-noswitch).", 100 C_BOOL, 101 {.intBoolVal = true}, 102 {.intBoolVal = true} }, 103 { "displayenum", 104 "Offers a more accurate list of available display modes in the Options menu.", 105 C_BOOL, 106 {.intBoolVal = true}, 107 {.intBoolVal = true} }, 108 { "gamma", 109 "Enable gamma slider in fullscreen, disable in windowed mode.", 110 C_BOOL, 111 {.intBoolVal = true}, 112 {.intBoolVal = true} }, 113 { "newweap", 114 "Standing above a weapon displays a message containing the weapon name and amount of ammo.", 115 C_BOOL, 116 {.intBoolVal = true}, 117 {.intBoolVal = true} }, 118 { "optionsvisible", 119 "Always show options button in main menu, even when pausing from a game.", 120 C_BOOL, 121 {.intBoolVal = true}, 122 {.intBoolVal = true} }, 123 { "showalllasersights", 124 "Show all (also enemies') weapon lasersights.", 125 C_BOOL, 126 {.intBoolVal = false}, 127 {.intBoolVal = false} }, 128 { "widescreenportraits", 129 "Prevents fly-in portraits from being stretched when playing in widescreen resolutions.", 130 C_BOOL, 131 {.intBoolVal = true}, 132 {.intBoolVal = true} }, 133 { 0, 0, 0, {0}, {0} } 134 } }, 135 { "language", "Language", { 136 { "chinese", 137 "Allow for chinese fonts to be shown if the required DLL is available.", 138 C_BOOL, 139 {.intBoolVal = true}, 140 {.intBoolVal = true} }, 141 { "fonttexturecache", 142 "Doubles size of font texture cache.", 143 C_BOOL, 144 {.intBoolVal = true}, 145 {.intBoolVal = true} }, 146 { "language", 147 "Localization for hardcoded strings (e.g. \"Savepoints\").", 148 C_STRING, 149 {.stringVal = "en"}, 150 {.stringVal = "en"} }, 151 { "nomultibyte", 152 "Enables languages which use multibyte coding (such as Chinese).", 153 C_BOOL, 154 {.intBoolVal = true}, 155 {.intBoolVal = true} }, 156 { 0, 0, 0, {0}, {0} } 157 } }, 158 { "modding", "Modding", { 34 159 { "argb8888", 35 160 "Allows using textures with ARGB8888.", … … 37 162 {.intBoolVal = true}, 38 163 {.intBoolVal = true} }, 39 { "binkplay",40 "Fix binkplay calls to use GDI and outro same mode as intro.",41 C_BOOL,42 {.intBoolVal = true},43 {.intBoolVal = true} },44 { "cheatsenabled",45 "Enables cheats without having to beat the game first.",46 C_BOOL,47 {.intBoolVal = true},48 {.intBoolVal = true} },49 { "cheattable",50 "Replaces Oni's cheat table with table that includes new cheats including devmode.",51 C_BOOL,52 {.intBoolVal = true},53 {.intBoolVal = true} },54 { "chinese",55 "Allow for chinese fonts to be shown if the required DLL is available.",56 C_BOOL,57 {.intBoolVal = true},58 {.intBoolVal = true} },59 { "clipcursor",60 "Limit cursor to Oni's window.",61 C_BOOL,62 {.intBoolVal = true},63 {.intBoolVal = true} },64 { "cooldowntimer",65 "Disables weapon cooldown exploit.",66 C_BOOL,67 {.intBoolVal = true},68 {.intBoolVal = true} },69 164 { "d_regen", 70 165 "Enables script command d_regen (query/set regeneration for any character).", … … 72 167 {.intBoolVal = true}, 73 168 {.intBoolVal = true} }, 74 { "daodandisplayenum", 75 "Offers a more accurate list of available display modes in the Options menu.", 76 C_BOOL, 77 {.intBoolVal = true}, 78 {.intBoolVal = true} }, 79 { "directinput", 80 "Enforces the usage of DirectInput on every system. Should be off for Linux/Wine.", 81 C_BOOL, 82 {.intBoolVal = true}, 83 {.intBoolVal = true} }, 84 { "disablecmdline", 85 "Disables Oni's existing command line parser as Daodan has its own.", 86 C_BOOL, 87 {.intBoolVal = true}, 88 {.intBoolVal = true} }, 89 { "fonttexturecache", 90 "Doubles size of font texture cache.", 169 { "daodanbsl", 170 "Adds new BSL commands.", 91 171 C_BOOL, 92 172 {.intBoolVal = true}, … … 97 177 {.intBoolVal = true}, 98 178 {.intBoolVal = true} }, 99 { "highres_console",100 "Fixes bug where console line becomes invisible at higher resolutions.",101 C_BOOL,102 {.intBoolVal = true},103 {.intBoolVal = true} },104 { "kickguns",105 "EXPERIMENTAL! Unfinished, do not use.",106 C_BOOL,107 {.intBoolVal = false},108 {.intBoolVal = false} },109 { "killvtune",110 "Prevent loading of vtuneapi.dll.",111 C_BOOL,112 {.intBoolVal = false},113 {.intBoolVal = false} },114 179 { "largetextures", 115 180 "Textures up to 512x512 can be used.", … … 122 187 {.intBoolVal = true}, 123 188 {.intBoolVal = true} }, 124 { "newweap",125 "Standing above a weapon displays a message containing the weapon name and amount of ammo.",126 C_BOOL,127 {.intBoolVal = true},128 {.intBoolVal = true} },129 { "nomultibyte",130 "Enables languages which use multibyte coding (such as Chinese).",131 C_BOOL,132 {.intBoolVal = true},133 {.intBoolVal = true} },134 { "optionsvisible",135 "Always show options button in main menu, even when pausing from a game.",136 C_BOOL,137 {.intBoolVal = true},138 {.intBoolVal = true} },139 { "pathfinding",140 "Size of pathfinding grid cache increased by eight times in order to prevent crashes in large levels.",141 C_BOOL,142 {.intBoolVal = true},143 {.intBoolVal = true} },144 { "projaware",145 "Allows AI to dodge incoming gunfire properly.",146 C_BOOL,147 {.intBoolVal = true},148 {.intBoolVal = true} },149 { "safeprintf",150 "Replaces Oni's function that prints to startup.txt with a safer one.",151 C_BOOL,152 {.intBoolVal = true},153 {.intBoolVal = true} },154 { "showalllasersights",155 "Show all (also enemies') weapon lasersights.",156 C_BOOL,157 {.intBoolVal = false},158 {.intBoolVal = false} },159 { "showtriggervolumes",160 "Allows BSL variable \"show_triggervolumes\" and Ctrl+Shift+X (in devmode) to work.",161 C_BOOL,162 {.intBoolVal = true},163 {.intBoolVal = true} },164 { "throwtest",165 "EXPERIMENTAL! Experiment with allowing enemies to be thrown over railings.",166 C_BOOL,167 {.intBoolVal = false},168 {.intBoolVal = false} },169 { "usedaodanbsl",170 "Adds new BSL commands.",171 C_BOOL,172 {.intBoolVal = true},173 {.intBoolVal = true} },174 { "usedaodangl",175 "Provides an improved windowed mode (-noswitch).",176 C_BOOL,177 {.intBoolVal = true},178 {.intBoolVal = true} },179 { "usegettickcount",180 "Replaces Oni's timing functions with more accurate ones.",181 C_BOOL,182 {.intBoolVal = true},183 {.intBoolVal = true} },184 { "widescreenportraits",185 "Prevents fly-in portraits from being stretched when playing in widescreen resolutions.",186 C_BOOL,187 {.intBoolVal = true},188 {.intBoolVal = true} },189 { "wpfadetime",190 "Adds working function for existing BSL command wp_fadetime, sets fade time to 4800.",191 C_BOOL,192 {.intBoolVal = true},193 {.intBoolVal = true} },194 189 { 0, 0, 0, {0}, {0} } 195 190 } }, 196 { "options", "Options", { 197 { "border", 198 "Add a border if in windowed mode and \"usedaodangl\" patch is active.", 199 C_BOOL, 200 {.intBoolVal = true}, 201 {.intBoolVal = true} }, 191 { "oni", "Original Oni Options", { 202 192 { "debug", 203 193 "Not useful, probably does nothing.", … … 215 205 {.intBoolVal = false }, 216 206 {.extBoolVal = &SSgSearchOnDisk } }, 217 { "gamma",218 "Enable gamma slider in fullscreen, disable in windowed mode.",219 C_BOOL,220 {.intBoolVal = true},221 {.intBoolVal = true} },222 { "help",223 "Generates this help file.",224 C_CMD,225 {.intBoolVal = 0},226 {.callback = DDrConfig_PrintHelp} },227 207 { "ignore_private_data", 228 208 "Not useful, probably does nothing.", … … 240 220 {.intBoolVal = true}, 241 221 {.extBoolVal = &M3gResolutionSwitch} }, 222 { 0, 0, 0, {0}, {0} } 223 } }, 224 { "windows", "Windows", { 225 { "alttab", 226 "Allows to Alt-Tab out of Oni and use Windows key. May enable the screensaver as well.", 227 C_BOOL, 228 {.intBoolVal = true}, 229 {.intBoolVal = true} }, 230 { "border", 231 "Add a border if in windowed mode and \"usedaodangl\" patch is active.", 232 C_BOOL, 233 {.intBoolVal = true}, 234 {.intBoolVal = true} }, 235 { "clipcursor", 236 "Limit cursor to Oni's window.", 237 C_BOOL, 238 {.intBoolVal = true}, 239 {.intBoolVal = true} }, 240 { "directinput", 241 "Enforces the usage of DirectInput on every system. Should be off for Linux/Wine.", 242 C_BOOL, 243 {.intBoolVal = true}, 244 {.intBoolVal = true} }, 245 { "disablecmdline", 246 "Disables Oni's existing command line parser as Daodan has its own.", 247 C_BOOL, 248 {.intBoolVal = true}, 249 {.intBoolVal = true} }, 250 { "killvtune", 251 "Prevent loading of vtuneapi.dll.", 252 C_BOOL, 253 {.intBoolVal = false}, 254 {.intBoolVal = false} }, 255 { "safeprintf", 256 "Replaces Oni's function that prints to startup.txt with a safer one.", 257 C_BOOL, 258 {.intBoolVal = true}, 259 {.intBoolVal = true} }, 242 260 { "topmost", 243 261 "Keep game window on top in windowed mode, even when switching applications.", … … 245 263 {.intBoolVal = false}, 246 264 {.intBoolVal = false} }, 247 { " language",248 " Localization for hardcoded strings (e.g. \"Savepoints\").",249 C_ STRING,250 {. stringVal = "en"},251 {. stringVal = "en"} },265 { "usegettickcount", 266 "Replaces Oni's timing functions with more accurate ones.", 267 C_BOOL, 268 {.intBoolVal = true}, 269 {.intBoolVal = true} }, 252 270 { 0, 0, 0, {0}, {0} } 253 271 } } … … 299 317 char* desc = co->description; 300 318 const char* tName = DDrConfig_GetOptionTypeName(co->type); 301 int boolV = co->defaultValue.intBoolVal; 302 char* val; 303 switch (co->type) { 304 case C_STRING: 305 val = co->defaultValue.stringVal; 306 break; 307 case EXT_BOOL: 308 val = (boolV ? "true" : "false"); 309 break; 310 case C_BOOL: 311 val = (boolV ? "true" : "false"); 312 break; 313 case C_CMD: 314 val = ""; 315 break; 316 default: 317 val = malloc(20); 318 sprintf(val, "%d", boolV); 319 } 319 const char* val = DDrConfig_GetOptionValueString(co, 1); 320 if (!val) 321 val = ""; 320 322 fprintf(fp, " %-22s %6s=%-5s %s\n", name, tName, val, desc); 321 323 } … … 326 328 fprintf(fp, " [sectionX]\n parameterName = false\n"); 327 329 fprintf(fp, "\nTo pass the parameter on the command line:\n"); 328 fprintf(fp, " Oni.exe - sectionX.parameterName false\n");330 fprintf(fp, " Oni.exe -parameterName false\n"); 329 331 fprintf(fp, "For bool parameters the value can be ommitted so it is regarded as \"true\":\n"); 330 fprintf(fp, " Oni.exe - sectionX.parameterName\n");332 fprintf(fp, " Oni.exe -parameterName\n"); 331 333 fprintf(fp, "To disable a bool parameter you can prefix \"no\" to the parameter name like this:\n"); 332 fprintf(fp, " Oni.exe -sectionX.noparameterName\n"); 333 fprintf(fp, "If no section is given it is assumed to be \"%s\", e.g.\n", defaultSection); 334 fprintf(fp, " Oni.exe -%s.parametername\n", defaultSection); 335 fprintf(fp, "can simply be written as\n"); 336 fprintf(fp, " Oni.exe -parametername\n"); 334 fprintf(fp, " Oni.exe -noparameterName\n"); 337 335 338 336 fclose(fp); … … 362 360 } 363 361 362 const char* DDrConfig_GetOptionValueString(ConfigOption_t* opt, char printdefault) 363 { 364 OptionValue_t* optVal = (printdefault ? &opt->defaultValue : &opt->value); 365 int boolV = optVal->intBoolVal; 366 char* val = 0; 367 switch (opt->type) { 368 case C_STRING: 369 return optVal->stringVal; 370 case EXT_BOOL: 371 if (printdefault) 372 return (boolV ? "true" : "false"); 373 else 374 return (*optVal->extBoolVal ? "true" : "false"); 375 case C_BOOL: 376 return (boolV ? "true" : "false"); 377 case C_CMD: 378 return 0; 379 default: 380 val = malloc(20); 381 sprintf(val, "%d", boolV); 382 return val; 383 } 384 } 385 386 char DDrConfig_NonDefaultOptionValue(ConfigOption_t* opt) 387 { 388 switch (opt->type) { 389 case C_STRING: 390 return _stricmp(opt->defaultValue.stringVal, opt->value.stringVal); 391 case EXT_BOOL: 392 return !opt->defaultValue.intBoolVal != !*opt->value.extBoolVal; 393 case C_BOOL: 394 return !opt->defaultValue.intBoolVal != !opt->value.intBoolVal; 395 case C_CMD: 396 return 0; 397 case C_INT: 398 return opt->defaultValue.intBoolVal != opt->value.intBoolVal; 399 } 400 return 0; 401 } 402 364 403 static ConfigOption_t* DDrConfig_GetOption(const char* fullOptName) 365 404 { … … 374 413 *option++ = 0; 375 414 415 char isWildcardSection = !_stricmp(section, "*"); 416 376 417 for (unsigned int s = 0; s < ARRAY_SIZE(config); s++) { 377 if ( !_stricmp(config[s].name, section)) {418 if (isWildcardSection || !_stricmp(config[s].name, section)) { 378 419 for (ConfigOption_t* co = config[s].options; co->name != 0; co++) { 379 420 if (!_stricmp(co->name, option)) { … … 381 422 } 382 423 } 383 STARTUPMESSAGE("Could not find option \"%s\" in section \"%s\"", option, section); 384 return 0; 385 } 386 } 387 STARTUPMESSAGE("Could not find section \"%s\" for option \"%s\"", section, option); 424 if (!isWildcardSection) { 425 STARTUPMESSAGE("Could not find option \"%s\" in section \"%s\"", option, section); 426 return 0; 427 } 428 } 429 } 430 if (!isWildcardSection) 431 STARTUPMESSAGE("Could not find section \"%s\" for option \"%s\"", section, option); 432 else 433 STARTUPMESSAGE("Could not find option \"%s\"", option); 388 434 return 0; 389 435 } … … 419 465 420 466 421 void DDrConfig_Write TemplateIni()467 void DDrConfig_WriteIni() 422 468 { 423 469 FILE* fp; … … 427 473 { 428 474 for (unsigned int s = 0; s < ARRAY_SIZE(config); s++) { 429 fprintf(fp, "[%s]\n", config[s].name); 475 if (strlen(config[s].name)) { 476 fprintf(fp, "[%s]\n", config[s].name); 477 for (ConfigOption_t* co = config[s].options; co->name != 0; co++) { 478 char* name = co->name; 479 const char* val = DDrConfig_GetOptionValueString(co, 0); 480 if (val && DDrConfig_NonDefaultOptionValue(co)) 481 fprintf(fp, "%s = %s\n", name, val); 482 } 483 fprintf(fp, "\n"); 484 } 430 485 } 431 486 fclose(fp); … … 440 495 void DDrIniCallback(const char* section, const char* name, const char* value) 441 496 { 442 static char curSection[20];443 497 char fullOptName[50]; 444 498 … … 446 500 section = "patches"; 447 501 448 strcpy(curSection, section); 449 450 strcpy(fullOptName, curSection); 451 fullOptName[strlen(curSection)] = '.'; 452 strcpy(fullOptName+strlen(curSection)+1, name); 502 strcpy(fullOptName, section); 503 fullOptName[strlen(section)] = '.'; 504 strcpy(fullOptName+strlen(section)+1, name); 453 505 454 506 ConfigOption_t* co = DDrConfig_GetOption(fullOptName); … … 480 532 } else { 481 533 char buf[50]; 482 sprintf_s(buf, sizeof(buf), " %s.%s\n", section, name); 534 if (!_stricmp(section, "*")) 535 sprintf_s(buf, sizeof(buf), " %s\n", name); 536 else 537 sprintf_s(buf, sizeof(buf), " %s.%s\n", section, name); 483 538 if (strlen(buf) + strlen(invalidCurParamaters) < sizeof(invalidCurParamaters) - 1) { 484 539 strcpy(invalidCurParamaters + strlen(invalidCurParamaters), buf); … … 494 549 if (argv[i][0] == '-') 495 550 { 496 const char* section;497 char* optionsep;498 551 char* option; 499 552 bool invertedOption; 500 553 501 if ((optionsep = strchr(argv[i], '.'))) 502 // Is "section.option" 503 { 504 *optionsep = 0; 505 option = optionsep+1; 506 section = argv[i]+1; 507 } 508 else 509 // Is just "option" 510 { 511 section = defaultSection; 512 option = argv[i]+1; 513 } 554 option = argv[i]+1; 514 555 515 556 invertedOption = (option[0] == 'n' || option[0] == 'N') && (option[1] == 'o' || option[1] == 'O'); … … 520 561 // Has value in next field 521 562 { 522 DDrIniCallback( section, option, argv[++i]);563 DDrIniCallback("*", option, argv[++i]); 523 564 } 524 565 else 525 566 // Implicit value 526 567 { 527 DDrIniCallback(section, option, (invertedOption ? "false" : "true")); 528 } 529 530 if (optionsep) 531 *optionsep = '.'; 568 DDrIniCallback("*", option, (invertedOption ? "false" : "true")); 569 } 532 570 } 533 571 else … … 546 584 547 585 if (GetFileAttributes(iniName) == INVALID_FILE_ATTRIBUTES) 548 DDrConfig_Write TemplateIni();586 DDrConfig_WriteIni(); 549 587 550 588 STARTUPMESSAGE("Parsing daodan.ini...", 0); … … 578 616 } 579 617 618 DDrConfig_WriteIni(); 619 580 620 // DDrConfig_Print(); 581 621 } -
Daodan/src/Daodan_Config.h
r994 r1000 32 32 char* name; 33 33 char* description; 34 ConfigOption_t options[ 50];34 ConfigOption_t options[20]; 35 35 } ConfigSection_t; 36 36 37 37 38 38 void DDrConfig(int argc, char* argv[]); 39 void DDrConfig_WriteIni(); 39 40 40 41 ConfigOption_t* DDrConfig_GetOptOfType(const char* fullOptName, OptionType_t type); 41 42 const char* DDrConfig_GetOptionTypeName(OptionType_t type); 43 const char* DDrConfig_GetOptionValueString(ConfigOption_t* opt, char printdefault); 44 char DDrConfig_NonDefaultOptionValue(ConfigOption_t* opt); 42 45 43 46 #endif -
Daodan/src/Patches/Cheater.c
r995 r1000 253 253 case cheat_elderrune: 254 254 { 255 if (DDrConfig_GetOptOfType(" patches.d_regen", C_BOOL)->value.intBoolVal)255 if (DDrConfig_GetOptOfType("modding.d_regen", C_BOOL)->value.intBoolVal) 256 256 { 257 257 int* Regeneration = &ONgGameState->PlayerCharacter->RegenHax; -
Daodan/src/Patches/GL.c
r994 r1000 254 254 else 255 255 { 256 ConfigOption_t* co = DDrConfig_GetOptOfType(" options.border", C_BOOL);256 ConfigOption_t* co = DDrConfig_GetOptOfType("windows.border", C_BOOL); 257 257 if (co && co->value.intBoolVal) 258 258 { … … 318 318 static void ONICALL DD_GLiGamma_Restore(void) 319 319 { 320 ConfigOption_t* co = DDrConfig_GetOptOfType(" options.gamma", C_BOOL);320 ConfigOption_t* co = DDrConfig_GetOptOfType("graphics.gamma", C_BOOL); 321 321 if (co->value.intBoolVal) 322 322 { … … 330 330 static void ONICALL DD_GLiGamma_Initialize(void) 331 331 { 332 ConfigOption_t* co = DDrConfig_GetOptOfType(" options.gamma", C_BOOL);332 ConfigOption_t* co = DDrConfig_GetOptOfType("graphics.gamma", C_BOOL); 333 333 if (co->value.intBoolVal) 334 334 { … … 402 402 } 403 403 404 ConfigOption_t* co = DDrConfig_GetOptOfType(" options.gamma", C_BOOL);404 ConfigOption_t* co = DDrConfig_GetOptOfType("graphics.gamma", C_BOOL); 405 405 if (!M3gResolutionSwitch && co->value.intBoolVal) 406 406 { -
Daodan/src/Patches/Localization.c
r994 r1000 127 127 void DD_Localization() 128 128 { 129 char* lang = DDrConfig_GetOptOfType(" options.language", C_STRING)->value.stringVal;129 char* lang = DDrConfig_GetOptOfType("language.language", C_STRING)->value.stringVal; 130 130 char filename[50] = "daodan_locales/"; 131 131 strcpy(filename + strlen(filename), lang); -
Daodan/src/Patches/Patches.c
r995 r1000 18 18 static void ONICALL DD_ONiOGU_GammaSlider_SetRange(void* window, int min_value, int max_value) 19 19 { 20 ConfigOption_t* co = DDrConfig_GetOptOfType(" options.gamma", C_BOOL);20 ConfigOption_t* co = DDrConfig_GetOptOfType("graphics.gamma", C_BOOL); 21 21 WMrWindow_SetEnabled(window, M3gResolutionSwitch && co->value.intBoolVal); 22 22 WMrSlider_SetRange(window, min_value, max_value); … … 85 85 void ONICALL DDrGame_Init() 86 86 { 87 if (DDrConfig_GetOptOfType(" patches.usedaodanbsl", C_BOOL)->value.intBoolVal)87 if (DDrConfig_GetOptOfType("modding.daodanbsl", C_BOOL)->value.intBoolVal) 88 88 SLrDaodan_Initialize(); 89 89 } … … 292 292 // Windows key but has the possible side effect of allowing the screensaver 293 293 // to enable itself in-game. 294 if (DDrConfig_GetOptOfType(" patches.alttab", C_BOOL)->value.intBoolVal)294 if (DDrConfig_GetOptOfType("windows.alttab", C_BOOL)->value.intBoolVal) 295 295 { 296 296 // 0xC3 = ret, so makes those functions just have a "ret" instruction at their start … … 300 300 301 301 // Textures using ARGB8888 can be used 302 if (DDrConfig_GetOptOfType(" patches.argb8888", C_BOOL)->value.intBoolVal)302 if (DDrConfig_GetOptOfType("modding.argb8888", C_BOOL)->value.intBoolVal) 303 303 { 304 304 // Update conversion lookups in IMgConvertPixelType_List … … 311 311 // outro (ie., BKrMovie_Play() instead of ONrMovie_Play_Hardware() as the 312 312 // latter has problems on WINE). 313 if (DDrConfig_GetOptOfType(" patches.binkplay", C_BOOL)->value.intBoolVal)313 if (DDrConfig_GetOptOfType("graphics.binkplay", C_BOOL)->value.intBoolVal) 314 314 { 315 315 // push BINKBUFFERAUTO -> push BINKBUFFERDIBSECTION. … … 319 319 } 320 320 321 if (DDrConfig_GetOptOfType(" patches.d_regen", C_BOOL)->value.intBoolVal)321 if (DDrConfig_GetOptOfType("modding.d_regen", C_BOOL)->value.intBoolVal) 322 322 DD_Patch_Regeneration(); 323 323 324 324 // Cheats always enabled 325 if (DDrConfig_GetOptOfType(" patches.cheatsenabled", C_BOOL)->value.intBoolVal)325 if (DDrConfig_GetOptOfType("gameplay.cheatsenabled", C_BOOL)->value.intBoolVal) 326 326 { 327 327 DDrPatch_MakeJump((void*)ONrPersist_GetWonGame, (void*)DDrPersist_GetWonGame); … … 329 329 330 330 // Use Daodan's own cheattable 331 if (DDrConfig_GetOptOfType(" patches.cheattable", C_BOOL)->value.intBoolVal)331 if (DDrConfig_GetOptOfType("gameplay.cheattable", C_BOOL)->value.intBoolVal) 332 332 { 333 333 // In ONrGameState_HandleCheats: Replace pointers to orig cheattable … … 349 349 } 350 350 351 if (DDrConfig_GetOptOfType(" patches.chinese", C_BOOL)->value.intBoolVal)351 if (DDrConfig_GetOptOfType("language.chinese", C_BOOL)->value.intBoolVal) 352 352 DD_Patch_Chinese(); 353 353 354 354 // Limit cursor to Oni's window 355 if (DDrConfig_GetOptOfType(" patches.clipcursor", C_BOOL)->value.intBoolVal)355 if (DDrConfig_GetOptOfType("windows.clipcursor", C_BOOL)->value.intBoolVal) 356 356 { 357 357 // LIrMode_Set: replace LIrPlatform_Mode_Set call with our hook. … … 366 366 367 367 // Disables weapon cooldown exploit 368 if (DDrConfig_GetOptOfType(" patches.cooldowntimer", C_BOOL)->value.intBoolVal)368 if (DDrConfig_GetOptOfType("gameplay.cooldowntimer", C_BOOL)->value.intBoolVal) 369 369 { 370 370 // In WPrRelease: NoOp 4 MOVs … … 373 373 374 374 // Daodan device mode enumeration function 375 if (DDrConfig_GetOptOfType(" patches.daodandisplayenum", C_BOOL)->value.intBoolVal)375 if (DDrConfig_GetOptOfType("graphics.displayenum", C_BOOL)->value.intBoolVal) 376 376 { 377 377 DDrPatch_MakeJump((void*)gl_enumerate_valid_display_modes, (void*)DD_GLrEnumerateDisplayModes); … … 379 379 380 380 // Forced DirectInput (for Windows NT) 381 if (DDrConfig_GetOptOfType(" patches.directinput", C_BOOL)->value.intBoolVal)381 if (DDrConfig_GetOptOfType("windows.directinput", C_BOOL)->value.intBoolVal) 382 382 { 383 383 // LIrPlatform_Initialize: replace conditional jump by unconditional … … 386 386 387 387 // Disable Oni's command line parser so it doesn't interfere with ours 388 if (DDrConfig_GetOptOfType(" patches.disablecmdline", C_BOOL)->value.intBoolVal)388 if (DDrConfig_GetOptOfType("windows.disablecmdline", C_BOOL)->value.intBoolVal) 389 389 { 390 390 // Replace start of OniParseCommandLine with XOR eax,eax; RET … … 395 395 396 396 // Font texture cache doubled 397 if (DDrConfig_GetOptOfType(" patches.fonttexturecache", C_BOOL)->value.intBoolVal)397 if (DDrConfig_GetOptOfType("language.fonttexturecache", C_BOOL)->value.intBoolVal) 398 398 { 399 399 // Double two values in TMrGame_Initialize … … 403 403 404 404 // Allow HD screens on resolutions < 1024*768 405 if (DDrConfig_GetOptOfType(" patches.hdscreens_lowres", C_BOOL)->value.intBoolVal)405 if (DDrConfig_GetOptOfType("modding.hdscreens_lowres", C_BOOL)->value.intBoolVal) 406 406 { 407 407 DDrPatch_MakeJump((void*)M3rDraw_BigBitmap, (void*)DD_M3rDraw_BigBitmap); … … 409 409 410 410 // Allow for console to show on higher resolutions 411 if (DDrConfig_GetOptOfType(" patches.highres_console", C_BOOL)->value.intBoolVal)411 if (DDrConfig_GetOptOfType("devmode.highres_console", C_BOOL)->value.intBoolVal) 412 412 { 413 413 Oni_COrTextArea_Resize = DDrPatch_MakeDetour((void*)COrTextArea_Resize, (void*)DD_COrTextArea_Resize); … … 416 416 // Hackish fix for Konoko not kicking guns 417 417 // Don't use this, it breaks stairs. 418 if (DDrConfig_GetOptOfType(" patches.kickguns", C_BOOL)->value.intBoolVal)418 if (DDrConfig_GetOptOfType("gameplay.kickguns", C_BOOL)->value.intBoolVal) 419 419 { 420 420 // In ONrCharacter_EnablePhysics: Load different values to same addresses as before … … 424 424 425 425 // Disable loading the vtuneapi.dll 426 if (DDrConfig_GetOptOfType(" patches.killvtune", C_BOOL)->value.intBoolVal)426 if (DDrConfig_GetOptOfType("windows.killvtune", C_BOOL)->value.intBoolVal) 427 427 { 428 428 // Instantly return from UUrLoadVtuneAPI … … 431 431 432 432 // Now supports textures up to 512x512 433 if (DDrConfig_GetOptOfType(" patches.largetextures", C_BOOL)->value.intBoolVal)433 if (DDrConfig_GetOptOfType("modding.largetextures", C_BOOL)->value.intBoolVal) 434 434 { 435 435 DDrPatch_Byte((char*)(OniExe + 0x00005251), 0x10); … … 437 437 438 438 // Non-"_Final" levels are now valid 439 if (DDrConfig_GetOptOfType(" patches.levelplugins", C_BOOL)->value.intBoolVal)439 if (DDrConfig_GetOptOfType("modding.levelplugins", C_BOOL)->value.intBoolVal) 440 440 { 441 441 // Patch in TMrUtility_LevelInfo_Get: … … 444 444 445 445 // Weapon on ground shown with name and magazine contents 446 if (DDrConfig_GetOptOfType(" patches.newweap", C_BOOL)->value.intBoolVal)446 if (DDrConfig_GetOptOfType("graphics.newweap", C_BOOL)->value.intBoolVal) 447 447 { 448 448 //Makes it always say "Received weapon_name." … … 464 464 465 465 // Disable Multi-byte character awareness patch (multiple language support) 466 if (DDrConfig_GetOptOfType(" patches.nomultibyte", C_BOOL)->value.intBoolVal)466 if (DDrConfig_GetOptOfType("language.nomultibyte", C_BOOL)->value.intBoolVal) 467 467 { 468 468 // TSiContext_DrawLine: Replace conditional jumps by unconditional ones … … 489 489 490 490 // Fix options not visible in main menu when a game was started 491 if (DDrConfig_GetOptOfType(" patches.optionsvisible", C_BOOL)->value.intBoolVal)491 if (DDrConfig_GetOptOfType("graphics.optionsvisible", C_BOOL)->value.intBoolVal) 492 492 { 493 493 // replace WMrWindow_SetVisible calls … … 497 497 498 498 // Pathfinding grid cache size x8 499 if (DDrConfig_GetOptOfType(" patches.pathfinding", C_BOOL)->value.intBoolVal)499 if (DDrConfig_GetOptOfType("gameplay.pathfinding", C_BOOL)->value.intBoolVal) 500 500 { 501 501 // Replaces conditional jump (je) with unconditional jump … … 509 509 510 510 // Projectile awareness fixed 511 if (DDrConfig_GetOptOfType(" patches.projaware", C_BOOL)->value.intBoolVal)511 if (DDrConfig_GetOptOfType("gameplay.projaware", C_BOOL)->value.intBoolVal) 512 512 { 513 513 DDrPatch_Byte ((char*)(OniExe + 0x0009c07c), 0x6c); … … 518 518 519 519 // Safe startup message printer 520 if (DDrConfig_GetOptOfType(" patches.safeprintf", C_BOOL)->value.intBoolVal)520 if (DDrConfig_GetOptOfType("windows.safeprintf", C_BOOL)->value.intBoolVal) 521 521 { 522 522 DDrPatch_MakeJump((void*)UUrStartupMessage, (void*)DDrStartupMessage); … … 524 524 525 525 // Show all (also enemies') lasersights 526 if (DDrConfig_GetOptOfType(" patches.showalllasersights", C_BOOL)->value.intBoolVal)526 if (DDrConfig_GetOptOfType("graphics.showalllasersights", C_BOOL)->value.intBoolVal) 527 527 { 528 528 DDrPatch_NOOP((char*)(OniExe + 0x000E1957), 6 ); … … 530 530 531 531 // Allow bsl-var show_triggervolumes or ctrl+shift+x (devmode) to work 532 if (DDrConfig_GetOptOfType(" patches.showtriggervolumes", C_BOOL)->value.intBoolVal)532 if (DDrConfig_GetOptOfType("devmode.showtriggervolumes", C_BOOL)->value.intBoolVal) 533 533 { 534 534 Oni_ONrMechanics_Register = DDrPatch_MakeDetour((void*)ONrMechanics_Register, (void*)DD_ONrMechanics_Register); … … 537 537 538 538 // Experiment with allowing enemies to be thrown over railings 539 if (DDrConfig_GetOptOfType(" patches.throwtest", C_BOOL)->value.intBoolVal)539 if (DDrConfig_GetOptOfType("gameplay.throwtest", C_BOOL)->value.intBoolVal) 540 540 { 541 541 DDrPatch_NOOP((char*)(OniExe + 0x000dc190), 10); … … 543 543 544 544 // DaodanGL with windowed mode support 545 if (DDrConfig_GetOptOfType(" patches.usedaodangl", C_BOOL)->value.intBoolVal)545 if (DDrConfig_GetOptOfType("graphics.daodangl", C_BOOL)->value.intBoolVal) 546 546 { 547 547 // LIrPlatform_Mode_Set: GetWindowRect -> GetClientRect. … … 580 580 581 581 // Performance patch 582 if (DDrConfig_GetOptOfType(" patches.usegettickcount", C_BOOL)->value.intBoolVal)582 if (DDrConfig_GetOptOfType("windows.usegettickcount", C_BOOL)->value.intBoolVal) 583 583 { 584 584 DDrPatch_MakeJump((void*)UUrMachineTime_High, (void*)DDrMachineTime_High); … … 588 588 589 589 // Fix displaying the talking portraits in widescreen modes 590 if (DDrConfig_GetOptOfType(" patches.widescreenportraits", C_BOOL)->value.intBoolVal)590 if (DDrConfig_GetOptOfType("graphics.widescreenportraits", C_BOOL)->value.intBoolVal) 591 591 { 592 592 SLrDaodan_Patch(); … … 594 594 595 595 // Adds working function for existing BSL command wp_fadetime, sets fade time to 4800 596 if (DDrConfig_GetOptOfType(" patches.wpfadetime", C_BOOL)->value.intBoolVal)596 if (DDrConfig_GetOptOfType("gameplay.wpfadetime", C_BOOL)->value.intBoolVal) 597 597 { 598 598 // Makes wp_fadetime actually have a function (changes within WPrRelease) -
Daodan/src/Patches/Win32.c
r994 r1000 153 153 else 154 154 { 155 ConfigOption_t* co = DDrConfig_GetOptOfType(" options.border", C_BOOL);155 ConfigOption_t* co = DDrConfig_GetOptOfType("windows.border", C_BOOL); 156 156 int opt_border = 0; 157 157 if (co && co->value.intBoolVal) 158 158 opt_border = 1; 159 co = DDrConfig_GetOptOfType(" options.topmost", C_BOOL);159 co = DDrConfig_GetOptOfType("windows.topmost", C_BOOL); 160 160 int opt_topmost = 0; 161 161 if (co && co->value.intBoolVal)
Note:
See TracChangeset
for help on using the changeset viewer.