(semi-tested) ManMan JA translation, config inis replacing templates, downgrade DivaSound and upgrade DivaMovie, fixes

This commit is contained in:
nastys
2021-11-10 22:44:23 +01:00
parent 770f5649ad
commit 3e15d39a67
58 changed files with 40875 additions and 67165 deletions
@@ -10,8 +10,9 @@
#include <mfapi.h>
#include <mferror.h>
#include <mftransform.h>
#include <SimpleIni.h>
bool forceSoftwareDecoding = false, debug = false;
bool forceSoftwareDecoding = false, forceHybridDecoding = false, debug = false;
IDirect3DDeviceManager9* deviceManager;
@@ -146,6 +147,22 @@ VTABLE_HOOK(HRESULT, IMFTransform, ProcessMessage, MFT_MESSAGE_TYPE eMessage, UL
if (SUCCEEDED(result))
INSTALL_VTABLE_HOOK(This, ProcessOutput, 25);
}
else if (!forceHybridDecoding && eMessage == MFT_MESSAGE_SET_D3D_MANAGER && result == 0)
{
static bool warn = false;
if (!warn)
{
MessageBoxW(0, L"Your system supports DXVA hardware decoding.\nDivaMovie will be disabled.\n\nIt is highly recommended to restart the game now.", L"DivaMovie", MB_ICONWARNING);
CSimpleIniW ini_reader;
ini_reader.SetUnicode(false);
ini_reader.LoadFile(MASTER_CONFIG_FILE);
ini_reader.SetValue(L"plugins", L"DivaMovie.dva", L"0");
ini_reader.SaveFile(MASTER_CONFIG_FILE);
warn = true;
}
}
return result;
}
@@ -177,6 +194,7 @@ HOOK(HRESULT, DXVA2CreateDirect3DDeviceManager, PROC_ADDRESS("dxva2.dll", "DXVA2
void loadConfig() {
forceSoftwareDecoding = GetPrivateProfileIntW(L"general", L"force_software_decoding", 0, CONFIG_FILE) > 0 ? true : false;
forceHybridDecoding = GetPrivateProfileIntW(L"general", L"force_hybrid_decoding", 0, CONFIG_FILE) > 0 ? true : false;
debug = GetPrivateProfileIntW(L"general", L"debug", 0, CONFIG_FILE) > 0 ? true : false;
}
@@ -194,7 +212,8 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
PluginConfig::PluginConfigOption config[] = {
{ PluginConfig::CONFIG_BOOLEAN, new PluginConfig::PluginConfigBooleanData{ L"force_software_decoding", L"general", CONFIG_FILE, L"Force Software Decoding", L"Use software decoding even on systems that support DXVA hardware decoding.", false } },
{ PluginConfig::CONFIG_BOOLEAN, new PluginConfig::PluginConfigBooleanData{ L"debug", L"general", CONFIG_FILE, L"Debug", L"Enable PRINT (possibly at the cost of performance).", false } },
{ PluginConfig::CONFIG_BOOLEAN, new PluginConfig::PluginConfigBooleanData{ L"force_hybrid_decoding", L"general", CONFIG_FILE, L"Force Hybrid Decoding", L"Do not disable DivaMovie on systems that support DXVA hardware decoding.\nCan cause issues on recent drivers.", false } },
{ PluginConfig::CONFIG_BOOLEAN, new PluginConfig::PluginConfigBooleanData{ L"debug", L"general", CONFIG_FILE, L"Debug (slow!)", L"Enable PRINT (possibly at the cost of performance).", false } },
};
extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void)