mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-02 09:03:37 +00:00
Move plugin path detection from TextureFilterHandler::init() to RSP_Init(),
because otherwise it causes crash of Mupen64Plus with Release build.
This commit is contained in:
parent
acf8f6e14b
commit
9c6fe7dfab
|
@ -1286,17 +1286,12 @@ void TextureFilterHandler::init()
|
|||
wchar_t wRomName[32];
|
||||
::mbstowcs(wRomName, RSP.romname, 32);
|
||||
|
||||
wchar_t buffer[MAX_PATH];
|
||||
GetModuleFileNameW(NULL, buffer, MAX_PATH);
|
||||
wstring pluginPath(buffer);
|
||||
wstring::size_type pos = pluginPath.find_last_of(L"\\/");
|
||||
|
||||
m_inited = txfilter_init(maxTextureSize, // max texture width supported by hardware
|
||||
maxTextureSize, // max texture height supported by hardware
|
||||
32, // max texture bpp supported by hardware
|
||||
options,
|
||||
config.textureFilter.txCacheSize, // cache texture to system memory
|
||||
pluginPath.substr(0, pos).c_str(), // plugin path
|
||||
RSP.pluginpath, // plugin path
|
||||
wRomName, // name of ROM. must be no longer than 256 characters
|
||||
displayLoadProgress);
|
||||
}
|
||||
|
|
5
RSP.cpp
5
RSP.cpp
|
@ -283,6 +283,11 @@ void RSP_Init()
|
|||
if (strstr(RSP.romname, (const char *)"OgreBattle64"))
|
||||
config.hacks |= hack_Ogre64;
|
||||
|
||||
GetModuleFileNameW(NULL, RSP.pluginpath, PLUGIN_PATH_SIZE);
|
||||
wstring pluginPath(RSP.pluginpath);
|
||||
wstring::size_type pos = pluginPath.find_last_of(L"\\/");
|
||||
wcscpy(RSP.pluginpath, pluginPath.substr(0, pos).c_str());
|
||||
|
||||
memset(&gSP, 0, sizeof(gSPInfo));
|
||||
|
||||
gSPTexture(1.0f, 1.0f, 0, 0, TRUE);
|
||||
|
|
Loading…
Reference in New Issue
Block a user