| 17 |
|
// slider in windowed mode. |
| 18 |
|
static void ONICALL DD_ONiOGU_GammaSlider_SetRange(void* window, int min_value, int max_value) |
| 19 |
|
{ |
| 20 |
< |
ConfigOption_t* co = DDrConfig_GetOptOfType("options.gamma", C_BOOL); |
| 20 |
> |
ConfigOption_t* co = DDrConfig_GetOptOfType("graphics.gamma", C_BOOL); |
| 21 |
|
WMrWindow_SetEnabled(window, M3gResolutionSwitch && co->value.intBoolVal); |
| 22 |
|
WMrSlider_SetRange(window, min_value, max_value); |
| 23 |
|
} |
| 84 |
|
|
| 85 |
|
void ONICALL DDrGame_Init() |
| 86 |
|
{ |
| 87 |
< |
if (DDrConfig_GetOptOfType("patches.usedaodanbsl", C_BOOL)->value.intBoolVal) |
| 87 |
> |
if (DDrConfig_GetOptOfType("modding.daodanbsl", C_BOOL)->value.intBoolVal) |
| 88 |
|
SLrDaodan_Initialize(); |
| 89 |
|
} |
| 90 |
|
|
| 291 |
|
// Disable UUrPlatform_Initalize/Terminate, this enables the Alt-Tab and the |
| 292 |
|
// Windows key but has the possible side effect of allowing the screensaver |
| 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 |
|
{ |
| 296 |
|
// 0xC3 = ret, so makes those functions just have a "ret" instruction at their start |
| 297 |
|
DDrPatch_Byte((char*)UUrPlatform_Initialize, 0xC3); |
| 299 |
|
} |
| 300 |
|
|
| 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 |
|
{ |
| 304 |
|
// Update conversion lookups in IMgConvertPixelType_List |
| 305 |
|
DDrPatch_Byte((char*)(OniExe + 0x00135af0), 0x07); |
| 310 |
|
// instead of DirectDraw; patch ONiRunGame to use the same method to play |
| 311 |
|
// outro (ie., BKrMovie_Play() instead of ONrMovie_Play_Hardware() as the |
| 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 |
|
{ |
| 315 |
|
// push BINKBUFFERAUTO -> push BINKBUFFERDIBSECTION. |
| 316 |
|
DDrPatch_Byte((void*)(OniExe + 0x0008829b + 1), 0x02); |
| 318 |
|
DDrPatch_MakeCall((void*)(OniExe + 0x000d496f), ONrMovie_Play); |
| 319 |
|
} |
| 320 |
|
|
| 321 |
< |
if (DDrConfig_GetOptOfType("patches.d_regen", C_BOOL)->value.intBoolVal) |
| 321 |
> |
if (DDrConfig_GetOptOfType("modding.d_regen", C_BOOL)->value.intBoolVal) |
| 322 |
|
DD_Patch_Regeneration(); |
| 323 |
|
|
| 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 |
|
{ |
| 327 |
|
DDrPatch_MakeJump((void*)ONrPersist_GetWonGame, (void*)DDrPersist_GetWonGame); |
| 328 |
|
} |
| 329 |
|
|
| 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 |
|
{ |
| 333 |
|
// In ONrGameState_HandleCheats: Replace pointers to orig cheattable |
| 334 |
|
DDrPatch_Int32 ((int*)(OniExe + 0x000f616b), (int)&DDr_CheatTable[0].name); |
| 348 |
|
DDrPatch_MakeJump((void*)(OniExe + 0x0010f021), (void*)DDrCheater_LevelLoad); |
| 349 |
|
} |
| 350 |
|
|
| 351 |
< |
if (DDrConfig_GetOptOfType("patches.chinese", C_BOOL)->value.intBoolVal) |
| 351 |
> |
if (DDrConfig_GetOptOfType("language.chinese", C_BOOL)->value.intBoolVal) |
| 352 |
|
DD_Patch_Chinese(); |
| 353 |
|
|
| 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 |
|
{ |
| 357 |
|
// LIrMode_Set: replace LIrPlatform_Mode_Set call with our hook. |
| 358 |
|
DDrPatch_MakeCall((void*)(OniExe + 0x00003f9f), (void*) DD_LIrPlatform_Mode_Set); |
| 365 |
|
} |
| 366 |
|
|
| 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 |
|
{ |
| 370 |
|
// In WPrRelease: NoOp 4 MOVs |
| 371 |
|
DDrPatch_NOOP((char*)(OniExe + 0x0011a825), 22); |
| 372 |
|
} |
| 373 |
|
|
| 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 |
|
{ |
| 377 |
|
DDrPatch_MakeJump((void*)gl_enumerate_valid_display_modes, (void*)DD_GLrEnumerateDisplayModes); |
| 378 |
|
} |
| 379 |
|
|
| 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 |
|
{ |
| 383 |
|
// LIrPlatform_Initialize: replace conditional jump by unconditional |
| 384 |
|
DDrPatch_Byte((char*)(OniExe + 0x00002e6d), 0xeb); |
| 385 |
|
} |
| 386 |
|
|
| 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 |
|
{ |
| 390 |
|
// Replace start of OniParseCommandLine with XOR eax,eax; RET |
| 391 |
|
DDrPatch_Int32 ((int*)(OniExe + 0x000d3570), 0x00c3c033); |
| 394 |
|
} |
| 395 |
|
|
| 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 |
|
{ |
| 399 |
|
// Double two values in TMrGame_Initialize |
| 400 |
|
DDrPatch_Byte((char*)(OniExe + 0x00020ea7), 0x20); |
| 402 |
|
} |
| 403 |
|
|
| 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 |
|
{ |
| 407 |
|
DDrPatch_MakeJump((void*)M3rDraw_BigBitmap, (void*)DD_M3rDraw_BigBitmap); |
| 408 |
|
} |
| 409 |
|
|
| 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 |
|
{ |
| 413 |
|
Oni_COrTextArea_Resize = DDrPatch_MakeDetour((void*)COrTextArea_Resize, (void*)DD_COrTextArea_Resize); |
| 414 |
|
} |
| 415 |
|
|
| 416 |
|
// Hackish fix for Konoko not kicking guns |
| 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 |
|
{ |
| 420 |
|
// In ONrCharacter_EnablePhysics: Load different values to same addresses as before |
| 421 |
|
const unsigned char kickgun_patch[] = { 0x00, 0x05, 0x00, 0x00, 0x00, 0xC7, 0x05, 0x1C, 0xC9, 0x5E, 0x00, 0x70, 0xB8, 0x43, 0x00, 0xC7, 0x05, 0x20, 0xC9, 0x5E, 0x00, 0x20, 0xBE, 0x43 }; |
| 423 |
|
} |
| 424 |
|
|
| 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 |
|
{ |
| 428 |
|
// Instantly return from UUrLoadVtuneAPI |
| 429 |
|
DDrPatch_Byte((char*)(OniExe + 0x00026340), 0xC3); |
| 430 |
|
} |
| 431 |
|
|
| 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 |
|
{ |
| 435 |
|
DDrPatch_Byte((char*)(OniExe + 0x00005251), 0x10); |
| 436 |
|
} |
| 437 |
|
|
| 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 |
|
{ |
| 441 |
|
// Patch in TMrUtility_LevelInfo_Get: |
| 442 |
|
DDrPatch_Byte((char*)(OniExe + 0x000206a8), 0x01); |
| 443 |
|
} |
| 444 |
|
|
| 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 |
|
{ |
| 448 |
|
//Makes it always say "Received weapon_name." |
| 449 |
|
//Needs check for loc_4DFC66 |
| 463 |
|
} |
| 464 |
|
|
| 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 |
|
{ |
| 468 |
|
// TSiContext_DrawLine: Replace conditional jumps by unconditional ones |
| 469 |
|
DDrPatch_Byte ((char*)(OniExe + 0x0002d8f8), 0xeb); |
| 488 |
|
} |
| 489 |
|
|
| 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 |
|
{ |
| 493 |
|
// replace WMrWindow_SetVisible calls |
| 494 |
|
DDrPatch_MakeCall((void*)(OniExe + 0x000d2d2d), DDrShowOptionsButton); |
| 496 |
|
} |
| 497 |
|
|
| 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 |
|
{ |
| 501 |
|
// Replaces conditional jump (je) with unconditional jump |
| 502 |
|
const unsigned char pathfinding[2] = {0x90 , 0xE9 }; |
| 508 |
|
} |
| 509 |
|
|
| 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 |
|
{ |
| 513 |
|
DDrPatch_Byte ((char*)(OniExe + 0x0009c07c), 0x6c); |
| 514 |
|
DDrPatch_Byte ((char*)(OniExe + 0x0009c080), 0x70); |
| 517 |
|
} |
| 518 |
|
|
| 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 |
|
{ |
| 522 |
|
DDrPatch_MakeJump((void*)UUrStartupMessage, (void*)DDrStartupMessage); |
| 523 |
|
} |
| 524 |
|
|
| 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 |
|
{ |
| 528 |
|
DDrPatch_NOOP((char*)(OniExe + 0x000E1957), 6 ); |
| 529 |
|
} |
| 530 |
|
|
| 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 |
|
{ |
| 534 |
|
Oni_ONrMechanics_Register = DDrPatch_MakeDetour((void*)ONrMechanics_Register, (void*)DD_ONrMechanics_Register); |
| 535 |
|
Oni_ONrGameState_HandleUtilityInput = DDrPatch_MakeDetour((void*)ONrGameState_HandleUtilityInput, (void*)DD_ONrGameState_HandleUtilityInput); |
| 536 |
|
} |
| 537 |
|
|
| 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 |
|
{ |
| 541 |
|
DDrPatch_NOOP((char*)(OniExe + 0x000dc190), 10); |
| 542 |
|
} |
| 543 |
|
|
| 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 |
|
{ |
| 547 |
|
// LIrPlatform_Mode_Set: GetWindowRect -> GetClientRect. |
| 548 |
|
DDrPatch_NOOP((char*) OniExe + 0x00002dd6, 6); |
| 579 |
|
} |
| 580 |
|
|
| 581 |
|
// Performance patch |
| 582 |
< |
if (DDrConfig_GetOptOfType("patches.usegettickcount", C_BOOL)->value.intBoolVal) |
| 582 |
> |
if (DDrConfig_GetOptOfType("windows.usegettickcount", C_BOOL)->value.intBoolVal) |
| 583 |
|
{ |
| 584 |
|
DDrPatch_MakeJump((void*)UUrMachineTime_High, (void*)DDrMachineTime_High); |
| 585 |
|
DDrPatch_MakeJump((void*)UUrMachineTime_High_Frequency, (void*)DDrMachineTime_High_Frequency); |
| 587 |
|
} |
| 588 |
|
|
| 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 |
|
{ |
| 592 |
|
SLrDaodan_Patch(); |
| 593 |
|
} |
| 594 |
|
|
| 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 |
|
{ |
| 598 |
|
// Makes wp_fadetime actually have a function (changes within WPrRelease) |
| 599 |
|
// Patches end of function to instead of use a constant value for fadetime (12c0 = 4800) actually use value of wp_fadetime: |