Fixed the graphics whiteout bug I introduced when switching profiles. When Refresh() was being called on the texture, the bitmap wasn't been re-transferred back into the openGL context.

While debugging this, I noticed a separate issue:  when changing profiles, we'd actually call refresh twice.  Removed the spurious call, as reloading profiles doesn't need to concern itself with the image cache - that's already covered by the game options menu.

Also did some minor formatting / cleanup in the JGfx code for PSP - stubbed out a bunch of JLOG calls I had put in while debugging the PNG loading code.
This commit is contained in:
wrenczes@gmail.com
2010-12-02 04:04:03 +00:00
parent 8fa6578757
commit 2693f35506
8 changed files with 223 additions and 204 deletions
+1 -1
View File
@@ -248,7 +248,7 @@ public:
//The sanity=false option returns the adjusted path even if the file doesn't exist.
string profileFile(string filename="", string fallback="", bool sanity=false,bool relative=false);
void reloadProfile(bool images = true); //Reloads profile using current options[ACTIVE_PROFILE]
void reloadProfile(); //Reloads profile using current options[ACTIVE_PROFILE]
void checkProfile(); //Confirms that a profile is loaded and contains a collection.
void createUsersFirstDeck(int setId);
+1 -3
View File
@@ -635,12 +635,10 @@ string GameSettings::profileFile(string filename, string fallback, bool sanity,
return buf;
}
void GameSettings::reloadProfile(bool images)
void GameSettings::reloadProfile()
{
SAFE_DELETE(profileOptions);
checkProfile();
if (images)
WResourceManager::Instance()->Refresh(); //Update images
}
void GameSettings::checkProfile()
+1 -1
View File
@@ -509,7 +509,7 @@ void GameStateMenu::Update(float dt)
}
//Reload list of unlocked sets, now that we know about the sets.
options.reloadProfile(false);
options.reloadProfile();
genNbCardsStr();
resetDirectory();
//All major things have been loaded, resize the cache to use it as efficiently as possible
+2 -2
View File
@@ -139,7 +139,7 @@ void GameStateOptions::Update(float dt)
if (newProfile != "")
{
options[Options::ACTIVE_PROFILE] = newProfile;
options.reloadProfile(false);
options.reloadProfile();
optionsTabs->Reload();
}
newProfile = "";
@@ -192,7 +192,7 @@ void GameStateOptions::Update(float dt)
}
if (mReload)
{
options.reloadProfile(true);
options.reloadProfile();
Translator::EndInstance();
Translator::GetInstance()->init();
optionsTabs->Reload();
+3 -1
View File
@@ -252,13 +252,15 @@ void WCachedTexture::Refresh()
texture = NULL;
if (!Attempt(mFilename, loadedMode, error))
SAFE_DELETE(texture);
SAFE_DELETE(texture);
if (!texture)
texture = old;
else
SAFE_DELETE(old);
JRenderer::GetInstance()->TransferTextureToGLContext(*texture);
for (vector<WTrackedQuad*>::iterator it = trackedQuads.begin(); it != trackedQuads.end(); it++)
{
if ((*it) && (*it)->quad) (*it)->quad->mTex = texture;