Merge pull request #794 from Nekokabu/master

fix filename
This commit is contained in:
zilmar 2015-12-02 08:21:27 +11:00
commit b81e383f1b
3 changed files with 6 additions and 25 deletions

View File

@ -2,7 +2,6 @@
#include <Common\Util.h>
void FixDirectories(void);
void FixLocale(void);
static void IncreaseThreadPriority(void);
@ -47,7 +46,6 @@ void AppInit(CNotification * Notify)
g_Notify = Notify;
FixDirectories();
FixLocale();
stdstr_f AppName("Project64 %s", VER_FILE_VERSION_STR);
IncreaseThreadPriority();
@ -122,18 +120,7 @@ void FixDirectories(void)
if (!Directory.DirectoryExists()) Directory.DirectoryCreate();
}
#include <windows.h>
void FixLocale(void)
{
char *lbuffer = new char[10];
if (GetLocaleInfoA(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVLANGNAME, lbuffer, 10))
{
setlocale(LC_ALL, lbuffer);
}
delete[] lbuffer;
}
void IncreaseThreadPriority(void)
{
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
}
}

View File

@ -734,10 +734,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
}
stdstr_f MenuString("&%d %s", (count + 1) % 10, LastRom.c_str());
WCHAR *w_LastRom = new WCHAR[MenuString.length() + 1];
::mbstowcs(w_LastRom, MenuString.c_str(), MenuString.length() + 1);
RecentRomMenu.push_back(MENU_ITEM(ID_RECENT_ROM_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, w_LastRom));
delete[] w_LastRom;
RecentRomMenu.push_back(MENU_ITEM(ID_RECENT_ROM_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, MenuString.ToUTF16(CP_ACP).c_str()));
}
/* Recent Dir
@ -755,10 +752,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu)
stdstr_f MenuString("&%d %s", (count + 1) % 10, LastDir.c_str());
WCHAR *w_LastDir = new WCHAR[MenuString.length() + 1];
::mbstowcs(w_LastDir, MenuString.c_str(), MenuString.length() + 1);
RecentDirMenu.push_back(MENU_ITEM(ID_RECENT_DIR_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, w_LastDir));
delete[] w_LastDir;
RecentDirMenu.push_back(MENU_ITEM(ID_RECENT_DIR_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, MenuString.ToUTF16(CP_ACP).c_str()));
}
/* File Menu
@ -1279,4 +1273,4 @@ void CMainMenu::ResetMenu(void)
ResetAccelerators();
WriteTrace(TraceDebug, __FUNCTION__ ": Done");
}
}

View File

@ -1365,7 +1365,7 @@ void CRomBrowser::RomList_GetDispInfo(uint32_t pnmh)
switch (m_FieldType[lpdi->item.iSubItem])
{
case RB_FileName: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->FileName).ToUTF16().c_str(), lpdi->item.cchTextMax); break;
case RB_FileName: wcsncpy(lpdi->item.pszText, stdstr(pRomInfo->FileName).ToUTF16().c_str(CP_ACP), lpdi->item.cchTextMax); break;
case RB_InternalName: wcsncpy(lpdi->item.pszText, pRomInfo->InternalName, lpdi->item.cchTextMax / sizeof(wchar_t)); break;
case RB_GoodName: wcsncpy(lpdi->item.pszText, pRomInfo->GoodName, lpdi->item.cchTextMax / sizeof(wchar_t)); break;
case RB_CoreNotes: wcsncpy(lpdi->item.pszText, pRomInfo->CoreNotes, lpdi->item.cchTextMax / sizeof(wchar_t)); break;
@ -1928,4 +1928,4 @@ void CRomBrowser::WatchThreadStop(void)
m_WatchThread = NULL;
m_WatchThreadID = 0;
WriteTrace(TraceDebug, __FUNCTION__ ": 5");
}
}