diff --git a/xbox1/RetroLaunch/Font.cpp b/xbox1/RetroLaunch/Font.cpp index 51b2bda691..6ea617d7a0 100644 --- a/xbox1/RetroLaunch/Font.cpp +++ b/xbox1/RetroLaunch/Font.cpp @@ -38,10 +38,7 @@ bool Font::Create() if (m_pFont) m_pFont->Release(); - word *wcPathBuf = StringToWChar("D:\\Media\\arial.ttf"); - HRESULT g_hResult = XFONT_OpenTrueTypeFont(wcPathBuf, 256 * 1024, &m_pFont); - - delete [] wcPathBuf; + HRESULT g_hResult = XFONT_OpenTrueTypeFont(L"D:\\Media\\arial.ttf", 256 * 1024, &m_pFont); if (FAILED(g_hResult)) return false; diff --git a/xbox1/RetroLaunch/MenuMain.cpp b/xbox1/RetroLaunch/MenuMain.cpp index c934496565..f25952f92d 100644 --- a/xbox1/RetroLaunch/MenuMain.cpp +++ b/xbox1/RetroLaunch/MenuMain.cpp @@ -26,30 +26,10 @@ CMenuMain::CMenuMain() { // we think that the rom list is unloaded until we know otherwise m_bRomListLoadedState = false; - - ifstream stateFile; - stateFile.open("T:\\RomlistState.dat"); - - if (stateFile.is_open()) - { - int baseIndex; - - stateFile >> baseIndex; - - g_romList.m_iBaseIndex = baseIndex; - - stateFile.close(); - } } CMenuMain::~CMenuMain() { - ofstream stateFile; - stateFile.open("T:\\RomlistState.dat"); - - stateFile << g_romList.GetBaseIndex() << endl; - - stateFile.close(); } bool CMenuMain::Create() diff --git a/xbox1/RetroLaunch/MenuManager.cpp b/xbox1/RetroLaunch/MenuManager.cpp index 2c68f6912a..ae2550e010 100644 --- a/xbox1/RetroLaunch/MenuManager.cpp +++ b/xbox1/RetroLaunch/MenuManager.cpp @@ -47,7 +47,7 @@ bool CMenuManager::SetMenuState(int nMenuID) case MENU_MAIN: //Create the Main Menu g_menuMain.Create(); - break; + break; } return true; } @@ -60,8 +60,8 @@ void CMenuManager::Update() { case MENU_MAIN: g_menuMain.ProcessInput(); - g_menuMain.Render(); - break; + g_menuMain.Render(); + break; } } diff --git a/xbox1/RetroLaunch/Rom.cpp b/xbox1/RetroLaunch/Rom.cpp index 4a58a724a6..cf7505d91d 100644 --- a/xbox1/RetroLaunch/Rom.cpp +++ b/xbox1/RetroLaunch/Rom.cpp @@ -36,27 +36,11 @@ bool Rom::Load(const char *szFilename) return true; } -bool Rom::LoadFromCache(const string &szFilename) -{ - m_szFilename = szFilename; - - m_bLoaded = true; - - return true; -} - string Rom::GetFileName() { return m_szFilename; } -string Rom::GetComments() -{ - //return string(m_iniEntry->szComments); - return "blah"; -} - - CSurface &Rom::GetTexture() { return m_texture; diff --git a/xbox1/RetroLaunch/Rom.h b/xbox1/RetroLaunch/Rom.h index 37321695a0..c0bf815e28 100644 --- a/xbox1/RetroLaunch/Rom.h +++ b/xbox1/RetroLaunch/Rom.h @@ -25,10 +25,8 @@ public: ~Rom(); bool Load(const char *szFilename); - bool LoadFromCache(const string &szFilename); string GetFileName(); - string GetComments(); CSurface &GetTexture(); private: string m_szFilename; diff --git a/xbox1/RetroLaunch/RomList.cpp b/xbox1/RetroLaunch/RomList.cpp index f87db7a01a..bca48369d1 100644 --- a/xbox1/RetroLaunch/RomList.cpp +++ b/xbox1/RetroLaunch/RomList.cpp @@ -36,62 +36,14 @@ RomList::~RomList(void) void RomList::Load() { - ifstream cacheFile; - - cacheFile.open("T:\\RomlistCache.dat"); - - // try and open the cache file, if it doesnt exist, generate the rom list - if (!cacheFile.is_open()) - { - Build(); - } - else - { - while (!cacheFile.eof()) - { - string szFilename; - - getline(cacheFile, szFilename); - - Rom *rom = new Rom(); - - bool bSuccess = rom->LoadFromCache(szFilename); - - if (bSuccess) - m_romList.push_back(rom); - else - delete rom; - } - - cacheFile.close(); - } + Build(); m_bLoaded = true; } -void RomList::Save() -{ - vector::iterator i; - ofstream cacheFile; - - // open/overwrite the rom cache - cacheFile.open("T:\\RomlistCache.dat"); - - for (i = m_romList.begin(); i != m_romList.end(); i++) - { - Rom *rom = *i; - - cacheFile << rom->GetFileName() << endl; - } - - cacheFile.close(); -} - void RomList::Refresh() { Destroy(); - DeleteFile("T:\\RomlistCache.dat"); - DeleteFile("T:\\RomlistState.dat"); } bool RomList::IsLoaded() diff --git a/xbox1/RetroLaunch/RomList.h b/xbox1/RetroLaunch/RomList.h index 5f151f1a53..a2bf9562c2 100644 --- a/xbox1/RetroLaunch/RomList.h +++ b/xbox1/RetroLaunch/RomList.h @@ -22,10 +22,9 @@ class RomList { public: RomList(void); - virtual ~RomList(void); + ~RomList(void); void Load(); - void Save(); void Refresh(); bool IsLoaded();