1
0
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:
Sergey Lipskiy 2014-11-28 13:34:32 +06:00
parent acf8f6e14b
commit 9c6fe7dfab
3 changed files with 9 additions and 6 deletions

View File

@ -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);
}

View File

@ -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);

3
RSP.h
View File

@ -3,12 +3,15 @@
#include "Types.h"
#define PLUGIN_PATH_SIZE 260
typedef struct
{
u32 PC[18], PCi, busy, halt, close, DList, uc_start, uc_dstart, cmd, nextCmd;
s32 count;
bool bLLE;
char romname[21];
wchar_t pluginpath[PLUGIN_PATH_SIZE];
} RSPInfo;
extern RSPInfo RSP;