Erwan
- 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:
@@ -14,8 +14,6 @@ class GameStateAwards: public GameState, public JGuiListener
|
||||
private:
|
||||
WGuiList * listview;
|
||||
WGuiMenu * detailview;
|
||||
JQuad * mBg;
|
||||
JTexture * mBgTex;
|
||||
WSrcCards * setSrc;
|
||||
SimpleMenu * menu;
|
||||
bool showMenu;
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#include "limits.h"
|
||||
|
||||
|
||||
@@ -49,6 +51,7 @@
|
||||
#endif
|
||||
|
||||
// Debug options - comment/uncomment as needed
|
||||
//#define DEBUG_CACHE
|
||||
#ifdef _DEBUG
|
||||
//#define RENDER_AI_STATS
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,6 @@ void GameStateAwards::End()
|
||||
SAFE_DELETE(listview);
|
||||
SAFE_DELETE(setSrc);
|
||||
|
||||
resources.Release(mBgTex);
|
||||
if(saveMe)
|
||||
options.save();
|
||||
}
|
||||
@@ -41,7 +40,6 @@ void GameStateAwards::Start()
|
||||
char buf[256];
|
||||
mState = STATE_LISTVIEW;
|
||||
options.checkProfile();
|
||||
//resources.ClearUnlocked(); //Last resort.
|
||||
|
||||
menu = NULL;
|
||||
saveMe = options.newAward();
|
||||
@@ -114,9 +112,6 @@ void GameStateAwards::Start()
|
||||
detailview = NULL;
|
||||
setSrc = NULL;
|
||||
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()
|
||||
@@ -131,6 +126,8 @@ void GameStateAwards::Render()
|
||||
{
|
||||
JRenderer * r = JRenderer::GetInstance();
|
||||
r->ClearScreen(ARGB(0,0,0,0));
|
||||
|
||||
JQuad * mBg = resources.RetrieveTempQuad("awardback.jpg",TEXTURE_SUB_5551);
|
||||
if(mBg)
|
||||
r->RenderQuad(mBg, 0, 0);
|
||||
|
||||
|
||||
@@ -556,14 +556,17 @@ MTGDeck::MTGDeck(const char * config_file, MTGAllCards * _allcards, int meta_onl
|
||||
size_t found = s.find(" *");
|
||||
if (found != string::npos){
|
||||
nb = atoi(s.substr(found+2).c_str());
|
||||
s=s.substr(0,found);
|
||||
OutputDebugString(s.c_str());
|
||||
s = s.substr(0,found);
|
||||
}
|
||||
MTGCard * card = database->getCardByName(s);
|
||||
if (card){
|
||||
for (int i = 0; i < nb; i++){
|
||||
add(card);
|
||||
}
|
||||
} else {
|
||||
OutputDebugString("could not find Card matching name:");
|
||||
OutputDebugString(s.c_str());
|
||||
OutputDebugString("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ void StoryReward::Update(float dt){
|
||||
|
||||
}
|
||||
void StoryImage::Render() {
|
||||
JQuad * quad = resources.RetrieveQuad(img);
|
||||
JQuad * quad = resources.RetrieveTempQuad(img);
|
||||
if (quad) {
|
||||
float x = mX;
|
||||
if (mX == -1) {
|
||||
|
||||
@@ -45,7 +45,7 @@ void WResourceManager::DebugRender(){
|
||||
return;
|
||||
|
||||
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));
|
||||
char buf[512];
|
||||
@@ -66,6 +66,14 @@ void WResourceManager::DebugRender(){
|
||||
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());
|
||||
font->DrawString(buf, SCREEN_WIDTH-10,SCREEN_HEIGHT-15,JGETEXT_RIGHT);
|
||||
@@ -1341,8 +1349,9 @@ bool WCache<cacheItem, cacheActual>::Cleanup(){
|
||||
|| ramAvailableLineareMax() < MIN_LINEAR_RAM
|
||||
#endif
|
||||
){
|
||||
if (!RemoveOldest())
|
||||
return false;
|
||||
if (!RemoveOldest()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user