- Attempt at solving issue 247 (missing background image for trophy room). I think I attempted that a while ago and it caused some crashes, so let's revert this change if this happens
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-09-26 06:22:46 +00:00
parent 04ae98466b
commit ac435980ce
6 changed files with 23 additions and 13 deletions
-2
View File
@@ -14,8 +14,6 @@ class GameStateAwards: public GameState, public JGuiListener
private: private:
WGuiList * listview; WGuiList * listview;
WGuiMenu * detailview; WGuiMenu * detailview;
JQuad * mBg;
JTexture * mBgTex;
WSrcCards * setSrc; WSrcCards * setSrc;
SimpleMenu * menu; SimpleMenu * menu;
bool showMenu; bool showMenu;
+3
View File
@@ -13,6 +13,8 @@
#endif #endif
#include "limits.h" #include "limits.h"
@@ -49,6 +51,7 @@
#endif #endif
// Debug options - comment/uncomment as needed // Debug options - comment/uncomment as needed
//#define DEBUG_CACHE
#ifdef _DEBUG #ifdef _DEBUG
//#define RENDER_AI_STATS //#define RENDER_AI_STATS
#endif #endif
+2 -5
View File
@@ -31,7 +31,6 @@ void GameStateAwards::End()
SAFE_DELETE(listview); SAFE_DELETE(listview);
SAFE_DELETE(setSrc); SAFE_DELETE(setSrc);
resources.Release(mBgTex);
if(saveMe) if(saveMe)
options.save(); options.save();
} }
@@ -41,7 +40,6 @@ void GameStateAwards::Start()
char buf[256]; char buf[256];
mState = STATE_LISTVIEW; mState = STATE_LISTVIEW;
options.checkProfile(); options.checkProfile();
//resources.ClearUnlocked(); //Last resort.
menu = NULL; menu = NULL;
saveMe = options.newAward(); saveMe = options.newAward();
@@ -114,9 +112,6 @@ void GameStateAwards::Start()
detailview = NULL; detailview = NULL;
setSrc = NULL; setSrc = NULL;
showMenu = false; showMenu = false;
resources.Unmiss("awardback.jpg"); //Last resort, same as shop.
mBgTex = resources.RetrieveTexture("awardback.jpg",TEXTURE_SUB_5551);
mBg = resources.RetrieveQuad("awardback.jpg");
} }
void GameStateAwards::Create() void GameStateAwards::Create()
@@ -131,6 +126,8 @@ void GameStateAwards::Render()
{ {
JRenderer * r = JRenderer::GetInstance(); JRenderer * r = JRenderer::GetInstance();
r->ClearScreen(ARGB(0,0,0,0)); r->ClearScreen(ARGB(0,0,0,0));
JQuad * mBg = resources.RetrieveTempQuad("awardback.jpg",TEXTURE_SUB_5551);
if(mBg) if(mBg)
r->RenderQuad(mBg, 0, 0); r->RenderQuad(mBg, 0, 0);
+5 -2
View File
@@ -556,14 +556,17 @@ MTGDeck::MTGDeck(const char * config_file, MTGAllCards * _allcards, int meta_onl
size_t found = s.find(" *"); size_t found = s.find(" *");
if (found != string::npos){ if (found != string::npos){
nb = atoi(s.substr(found+2).c_str()); nb = atoi(s.substr(found+2).c_str());
s=s.substr(0,found); s = s.substr(0,found);
OutputDebugString(s.c_str());
} }
MTGCard * card = database->getCardByName(s); MTGCard * card = database->getCardByName(s);
if (card){ if (card){
for (int i = 0; i < nb; i++){ for (int i = 0; i < nb; i++){
add(card); add(card);
} }
} else {
OutputDebugString("could not find Card matching name:");
OutputDebugString(s.c_str());
OutputDebugString("\n");
} }
} }
} }
+1 -1
View File
@@ -162,7 +162,7 @@ void StoryReward::Update(float dt){
} }
void StoryImage::Render() { void StoryImage::Render() {
JQuad * quad = resources.RetrieveQuad(img); JQuad * quad = resources.RetrieveTempQuad(img);
if (quad) { if (quad) {
float x = mX; float x = mX;
if (mX == -1) { if (mX == -1) {
+12 -3
View File
@@ -45,7 +45,7 @@ void WResourceManager::DebugRender(){
return; return;
font->SetScale(DEFAULT_MAIN_FONT_SCALE); font->SetScale(DEFAULT_MAIN_FONT_SCALE);
renderer->FillRect(0,0,SCREEN_WIDTH,20,ARGB(128,155,0,0)); renderer->FillRect(0,0,SCREEN_WIDTH,40,ARGB(128,155,0,0));
renderer->FillRect(0,SCREEN_HEIGHT-20,SCREEN_WIDTH,40,ARGB(128,155,0,0)); renderer->FillRect(0,SCREEN_HEIGHT-20,SCREEN_WIDTH,40,ARGB(128,155,0,0));
char buf[512]; char buf[512];
@@ -66,6 +66,14 @@ void WResourceManager::DebugRender(){
font->DrawString(buf, 10,5); font->DrawString(buf, 10,5);
#if defined (WIN32) || defined (LINUX)
#else
int maxLinear = ramAvailableLineareMax();
int ram = ramAvailable();
sprintf(buf, "Ram : linear max: %i - total : %i\n",maxLinear, ram);
font->DrawString(buf,10, 20);
#endif
sprintf(buf,"Time: %u. Total Size: %lu (%lu cached, %lu managed). ",lastTime,Size(),SizeCached(),SizeManaged()); sprintf(buf,"Time: %u. Total Size: %lu (%lu cached, %lu managed). ",lastTime,Size(),SizeCached(),SizeManaged());
font->DrawString(buf, SCREEN_WIDTH-10,SCREEN_HEIGHT-15,JGETEXT_RIGHT); font->DrawString(buf, SCREEN_WIDTH-10,SCREEN_HEIGHT-15,JGETEXT_RIGHT);
@@ -1341,8 +1349,9 @@ bool WCache<cacheItem, cacheActual>::Cleanup(){
|| ramAvailableLineareMax() < MIN_LINEAR_RAM || ramAvailableLineareMax() < MIN_LINEAR_RAM
#endif #endif
){ ){
if (!RemoveOldest()) if (!RemoveOldest()) {
return false; return false;
}
} }
return true; return true;
} }