mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-04 10:03:36 +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];
|
wchar_t wRomName[32];
|
||||||
::mbstowcs(wRomName, RSP.romname, 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
|
m_inited = txfilter_init(maxTextureSize, // max texture width supported by hardware
|
||||||
maxTextureSize, // max texture height supported by hardware
|
maxTextureSize, // max texture height supported by hardware
|
||||||
32, // max texture bpp supported by hardware
|
32, // max texture bpp supported by hardware
|
||||||
options,
|
options,
|
||||||
config.textureFilter.txCacheSize, // cache texture to system memory
|
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
|
wRomName, // name of ROM. must be no longer than 256 characters
|
||||||
displayLoadProgress);
|
displayLoadProgress);
|
||||||
}
|
}
|
||||||
|
|
5
RSP.cpp
5
RSP.cpp
|
@ -283,6 +283,11 @@ void RSP_Init()
|
||||||
if (strstr(RSP.romname, (const char *)"OgreBattle64"))
|
if (strstr(RSP.romname, (const char *)"OgreBattle64"))
|
||||||
config.hacks |= hack_Ogre64;
|
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));
|
memset(&gSP, 0, sizeof(gSPInfo));
|
||||||
|
|
||||||
gSPTexture(1.0f, 1.0f, 0, 0, TRUE);
|
gSPTexture(1.0f, 1.0f, 0, 0, TRUE);
|
||||||
|
|
3
RSP.h
3
RSP.h
|
@ -3,12 +3,15 @@
|
||||||
|
|
||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
|
|
||||||
|
#define PLUGIN_PATH_SIZE 260
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
u32 PC[18], PCi, busy, halt, close, DList, uc_start, uc_dstart, cmd, nextCmd;
|
u32 PC[18], PCi, busy, halt, close, DList, uc_start, uc_dstart, cmd, nextCmd;
|
||||||
s32 count;
|
s32 count;
|
||||||
bool bLLE;
|
bool bLLE;
|
||||||
char romname[21];
|
char romname[21];
|
||||||
|
wchar_t pluginpath[PLUGIN_PATH_SIZE];
|
||||||
} RSPInfo;
|
} RSPInfo;
|
||||||
|
|
||||||
extern RSPInfo RSP;
|
extern RSPInfo RSP;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user