PrismaticFlower / shaderpatch

Improved shaders (and fun stuff for modders) for Star Wars Battlefront II (2005) - Incompatible with Classic Collection
MIT License
39 stars 2 forks source link

Shader Patch seems to break Mod Loader #105

Closed Uroc327 closed 4 years ago

Uroc327 commented 4 years ago

When having Shader Patch installed, Mod Loader is not able to start any more. When double-clicking the .exe, I get the waiting cursor and then nothing happens. This also happens, when Shader Patch is disabled via the yml.

When shader patch is enabled though, the following lines get written to the shader patch.log (only):

Shader Patch log started. Shader Patch version is 1.3.0
[INFO]    23:12:06 Selected GPU Radeon RX 580 Series
[ERROR]   23:12:06 Unimplemented function "struct HMONITOR__ *__stdcall sp::d3d9::Creator::GetAdapterMonitor(unsigned int) noexcept" called.
PrismaticFlower commented 4 years ago

Yes this is an unfortunate consequence of how Shader Patch is implemented. The fact that it works by wrapping, analyzing and implementing the games Direct3D 9 calls isn't so great for other applications that happen to be located in the same folder as the game as they end up picking up Shader Patch as well and then end up crashing.

I'm not entirely sure on the best way to fix this. The only surefire way I can think of would be to include a tool (or option in the installer) that would rename Shader Patch's d3d9.dll to shaderpatch.dll and then patch the game's executable to point it towards the shaderpatch.dll instead of d3d9.dll. It would completely solve any problems like this but increase the complexity of installing/uninstalling Shader Patch. Would that be an okay solution for you?

Uroc327 commented 4 years ago

I guess it would, yeah. Although I fear the additional complexity from this workaround could produce other unforseen problems. Would it be easier instead to patch the mod loader or to check the processes cmdline before installing file hooks?

PrismaticFlower commented 4 years ago

I ended up finding a way to fix the problems that were causing the crash. I'll be posting a new release soon with the needed fixes in it.