fastman92

IPLsectionLimits::SetOccluders

Feb 8th, 2015
224
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // IPL: occluders
  2. void IPLsectionLimits::SetOccluders(int iOccluders)
  3. {
  4. // CPatch::EnableDebugMode();
  5.  
  6. if (CPatch::IsDebugModeActive())
  7. iOccluders = 1000;
  8. else if (iOccluders > 1000)
  9. COcclusion__aOccluders = new tOcclusionBox[iOccluders];
  10.  
  11. OccludersLimit = iOccluders;
  12.  
  13. // Patch references to COcclusion::aOccluders
  14. #if TRUE
  15. CPatch::PatchPointer(0x71DE6D + 3, &COcclusion__aOccluders->midX); // mov word ptr ds:_ZN10COcclusion10aOccludersE.midX[esi], ax; COcclusion::aOccluders
  16. CPatch::PatchPointer(0x71DE83 + 3, &COcclusion__aOccluders->midY); // mov ds:_ZN10COcclusion10aOccludersE.midY[esi], ax
  17. CPatch::PatchPointer(0x71DE93 + 3, &COcclusion__aOccluders->midZ); // mov ds:_ZN10COcclusion10aOccludersE.midZ[esi], ax
  18. CPatch::PatchPointer(0x71DEA9 + 3, &COcclusion__aOccluders->widthY); // mov ds:_ZN10COcclusion10aOccludersE.widthY[esi], ax
  19. CPatch::PatchPointer(0x71DEBF + 3, &COcclusion__aOccluders->widthX); // mov ds:_ZN10COcclusion10aOccludersE.widthX[esi], ax
  20. CPatch::PatchPointer(0x71DEDB + 3, &COcclusion__aOccluders->height); // mov ds:_ZN10COcclusion10aOccludersE.height[esi], ax
  21. CPatch::PatchPointer(0x71DEF1 + 2, &COcclusion__aOccluders->rotation3); // mov ds:_ZN10COcclusion10aOccludersE.rotation3[esi], al
  22. CPatch::PatchPointer(0x71DF06 + 2, &COcclusion__aOccluders->rotation2); // mov ds:_ZN10COcclusion10aOccludersE.rotation2[esi], al
  23. CPatch::PatchPointer(0x71DF11 + 2, &COcclusion__aOccluders->rotation); // mov ds:_ZN10COcclusion10aOccludersE.rotation[esi], al
  24. CPatch::PatchPointer(0x71DF1F + 3, &COcclusion__aOccluders->flags); // or ds:_ZN10COcclusion10aOccludersE.flags[esi], 8000h
  25. CPatch::PatchPointer(0x71DF2A + 2, (void*)((int)&COcclusion__aOccluders->flags+1)); // and byte ptr (_ZN10COcclusion10aOccludersE.flags+1)[esi], 7Fh
  26. CPatch::PatchPointer(0x71DF33 + 3, &COcclusion__aOccluders->flags); // mov ax, ds:_ZN10COcclusion10aOccludersE.flags[esi]
  27. CPatch::PatchPointer(0x71DF4D + 3, &COcclusion__aOccluders->flags); // xor ds:_ZN10COcclusion10aOccludersE.flags[esi], ax
  28. CPatch::PatchPointer(0x720228 + 2, &COcclusion__aOccluders->midX); // lea ecx, _ZN10COcclusion10aOccludersE.midX[ebx]; COcclusion::aOccluders
  29. CPatch::PatchPointer(0x720247 + 3, &COcclusion__aOccluders->flags); // mov ax, ds:_ZN10COcclusion10aOccludersE.flags[ebx]
  30. CPatch::PatchPointer(0x72025E + 3, &COcclusion__aOccluders->flags); // mov dx, ds:_ZN10COcclusion10aOccludersE.flags[ebx]
  31. CPatch::PatchPointer(0x720270 + 4, &COcclusion__aOccluders->flags); // xor dx, ds:_ZN10COcclusion10aOccludersE.flags[eax*2]
  32. CPatch::PatchPointer(0x72027E + 4, &COcclusion__aOccluders->flags); // xor ds:_ZN10COcclusion10aOccludersE.flags[eax*2], dx
  33. CPatch::PatchPointer(0x720286 + 3, &COcclusion__aOccluders->flags); // mov si, ds:_ZN10COcclusion10aOccludersE.flags[ebx]
  34. CPatch::PatchPointer(0x720295 + 4, &COcclusion__aOccluders->flags); // mov dx, ds:_ZN10COcclusion10aOccludersE.flags[eax*2]
  35. CPatch::PatchPointer(0x7202B7 + 4, &COcclusion__aOccluders->flags); // xor ds:_ZN10COcclusion10aOccludersE.flags[eax*2], dx
  36. CPatch::PatchPointer(0x7202C4 + 3, &COcclusion__aOccluders->flags); // mov si, ds:_ZN10COcclusion10aOccludersE.flags[ebx]
  37. CPatch::PatchPointer(0x72031C + 3, &COcclusion__aOccluders->midX); // lea ecx, _ZN10COcclusion10aOccludersE.midX[ecx*2]; COcclusion::aOccluders
  38. CPatch::PatchPointer(0x720341 + 2, &COcclusion__aOccluders->midX); // lea ecx, _ZN10COcclusion10aOccludersE.midX[ebx]; COcclusion::aOccluders
  39. CPatch::PatchPointer(0x72035C + 3, &COcclusion__aOccluders->flags); // mov ax, ds:_ZN10COcclusion10aOccludersE.flags[ebx]
  40. CPatch::PatchPointer(0x720373 + 3, &COcclusion__aOccluders->flags); // mov dx, ds:_ZN10COcclusion10aOccludersE.flags[ebx]
  41. CPatch::PatchPointer(0x720385 + 4, &COcclusion__aOccluders->flags); // xor dx, ds:_ZN10COcclusion10aOccludersE.flags[eax*2]
  42. CPatch::PatchPointer(0x720393 + 4, &COcclusion__aOccluders->flags); // xor ds:_ZN10COcclusion10aOccludersE.flags[eax*2], dx
  43. CPatch::PatchPointer(0x72039B + 3, &COcclusion__aOccluders->flags); // mov si, ds:_ZN10COcclusion10aOccludersE.flags[ebx]
  44. CPatch::PatchPointer(0x7203AA + 4, &COcclusion__aOccluders->flags); // mov dx, ds:_ZN10COcclusion10aOccludersE.flags[eax*2]
  45. CPatch::PatchPointer(0x7203CC + 4, &COcclusion__aOccluders->flags); // xor ds:_ZN10COcclusion10aOccludersE.flags[eax*2], dx
  46. CPatch::PatchPointer(0x7203DA + 3, &COcclusion__aOccluders->flags); // mov si, ds:_ZN10COcclusion10aOccludersE.flags[ebx]
  47. #endif
  48.  
  49. CGenericLogStorage::SaveFormattedTextLn("Modified limit of IPL:occluders to: %d",OccludersLimit);
  50. CGenericLogStorage::WriteLineSeparator();
  51.  
  52. CPatch::DisableDebugMode();
  53. }
RAW Paste Data