-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b2b8f8
commit e748826
Showing
5 changed files
with
172 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#include <injector\injector.hpp> | ||
#include <injector\hooking.hpp> | ||
#include <injector\calling.hpp> | ||
#include <injector\utility.hpp> | ||
#include <injector\assembly.hpp> | ||
#include "xrd11.h" | ||
|
||
void Init() | ||
{ | ||
WaterDrops::ReadIniSettings(); | ||
|
||
WaterDrops::ms_rainIntensity = 0.0f; | ||
|
||
auto pattern = hook::pattern("E8 ? ? ? ? F3 0F 10 45 ? 56 51 8B CF"); | ||
static auto BeforeUpdateRain = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs) | ||
{ | ||
//auto right = *(RwV3d*)(regs.ebx + 0x6C); | ||
//auto up = *(RwV3d*)(regs.ebx + 0x7C); | ||
//auto at = *(RwV3d*)(regs.ebx + 0x8C); | ||
//auto pos = *(RwV3d*)(regs.ebx + 0x9C); | ||
// | ||
//WaterDrops::right = right; | ||
//WaterDrops::up = up; | ||
//WaterDrops::at = at; | ||
//WaterDrops::pos = pos; | ||
|
||
WaterDrops::ms_rainIntensity = 0.0f; | ||
}); | ||
|
||
pattern = hook::pattern("F3 0F 11 44 24 ? F3 0F 11 45 ? F3 0F 11 04 24 E8 ? ? ? ? 8B 7D F0 8A 55 0B"); | ||
static auto OnUpdateRain = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs) | ||
{ | ||
WaterDrops::ms_rainIntensity = 1.0f; | ||
regs.xmm0.f32[0] = 0.0f; // disables original droplets | ||
}); | ||
|
||
pattern = hook::pattern("83 C4 1C 8B CB E8"); | ||
static auto BeforeRenderHUDPrimitives = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs) | ||
{ | ||
WaterDrops::Process(); | ||
WaterDrops::Render(); | ||
}); | ||
|
||
pattern = hook::pattern("89 85 ? ? ? ? 85 C0 79 07"); | ||
static auto AfterD3D11CreateDeviceAndSwapChain = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs) | ||
{ | ||
auto pSwapChain = *(IDXGISwapChain**)(regs.edi + 0x330); | ||
|
||
static bool bOnce = false; | ||
if (!bOnce) | ||
{ | ||
bOnce = true; | ||
ID3D11Device* pDevice = nullptr; | ||
HRESULT ret = pSwapChain->GetDevice(__uuidof(ID3D11Device), (PVOID*)&pDevice); | ||
ID3D10Multithread* multithread = nullptr; | ||
if (SUCCEEDED(pDevice->QueryInterface(__uuidof(ID3D10Multithread), (void**)&multithread))) { | ||
multithread->SetMultithreadProtected(TRUE); | ||
multithread->Release(); | ||
} | ||
pDevice->Release(); | ||
} | ||
|
||
Sire::Init(Sire::SIRE_RENDERER_DX11, pSwapChain); | ||
}); | ||
} | ||
|
||
extern "C" __declspec(dllexport) void InitializeASI() | ||
{ | ||
std::call_once(CallbackHandler::flag, []() | ||
{ | ||
CallbackHandler::RegisterCallback(Init); | ||
}); | ||
} | ||
|
||
BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD reason, LPVOID /*lpReserved*/) | ||
{ | ||
if (reason == DLL_PROCESS_ATTACH) | ||
{ | ||
if (!IsUALPresent()) { InitializeASI(); } | ||
} | ||
return TRUE; | ||
} |
9 changes: 9 additions & 0 deletions
9
source/resources/inis/SplinterCellBlacklist.XboxRainDroplets.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[MAIN] | ||
MinSize = 5 | ||
MaxSize = 16 | ||
MaxDrops = 350 | ||
MaxMovingDrops = 600 | ||
RadialMovement = 1 | ||
EnableGravity = 1 | ||
SpeedAdjuster = 1.0 | ||
MoveStep = 1.0 |