From 22153edc59dcf221a79513b21cd0a51f81a27beb Mon Sep 17 00:00:00 2001 From: daco65 Date: Mon, 3 Nov 2008 01:52:03 +0000 Subject: [PATCH] no more Wx windows saying " could not find xxxxxx.png " git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1054 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/GameListCtrl.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index bdd2211a50..63820477e5 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -456,7 +456,22 @@ void CGameListCtrl::ScanForISOs(bool Loadcache) else PanicAlert("Invalid ISO file %s", ISOFile.GetFileName().c_str());*/ //TODO: stick the banners in 1 file ;_; - ISOFile.m_Image.LoadFile("GameIni\\" + ISOFile.GetUniqueID() + ".png",wxBITMAP_TYPE_PNG); + + strcpy(temp,"Gameini\\"); + strcpy(&temp[8],ISOFile.GetUniqueID().c_str()); + strcpy(&temp[14],".png"); + if(fopen(temp,"rb")) + { + ISOFile.m_Image.LoadFile(temp,wxBITMAP_TYPE_PNG); + } + else + { + PanicAlert("Could not find banner for %s",ISOFile.GetName().c_str()); + //remove any data left of the image of the game before the current. or you'll get the same + //banner twice :P + ISOFile.m_Image.Destroy(); + } + m_ISOFiles.push_back(ISOFile); } break; @@ -519,7 +534,7 @@ void CGameListCtrl::ScanForISOs(bool Loadcache) ISOFile.GetUniqueID().c_str(), ISOFile.GetName().c_str(), ISOFile.GetDescription().c_str() ,ISOFile.GetCountry(), ISOFile.GetCompany().c_str(), ISOFile.GetFileSize()); //why a new fprintf? cause volume size got writen as 0 for some bloody odd reason - fprintf(CacheFile,"V%u\nB%u\n$\n", ISOFile.GetVolumeSize(),ISOFile.IsCompressed()); + fprintf(CacheFile,"V%u\nB%u\n$\n", ISOFile.GetVolumeSize(), ISOFile.IsCompressed()); ISOFile.m_Image.SaveFile("Gameini\\" + ISOFile.GetUniqueID() + ".png",wxBITMAP_TYPE_PNG);//".JPG",wxBITMAP_TYPE_JPEG); //TODO: add the banner saving TO 1 FILE AND JPG as well & make the cache MUCH better. //this is ugly as fuck