Erwan
- quick patches, attempt at fixing a few crashes
This commit is contained in:
@@ -25,7 +25,6 @@ void GameStateOptions::Start()
|
||||
if (GameApp::HasMusic)
|
||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::MUSICVOLUME,"Music volume",100,10,100),OptionVolume::getInstance()));
|
||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::SFXVOLUME,"SFX volume",100,10,100),OptionVolume::getInstance()));
|
||||
optionsList->Add(NEW OptionInteger(Options::OSD, "Display InGame extra information"));
|
||||
if (options[Options::DIFFICULTY_MODE_UNLOCKED].number){
|
||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::DIFFICULTY,"Difficulty",3,1,0),OptionDifficulty::getInstance()));
|
||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::ECON_DIFFICULTY,"Economic Difficuly",Constants::ECON_EASY)));
|
||||
@@ -45,6 +44,7 @@ void GameStateOptions::Start()
|
||||
optionsList->Add(NEW OptionInteger(Options::REVERSETRIGGERS, "Reverse left and right triggers"));
|
||||
optionsList->Add(NEW OptionInteger(Options::DISABLECARDS,"Disable card images"));
|
||||
optionsList->Add(NEW OptionInteger(Options::TRANSITIONS,"Disable screen transitions"));
|
||||
optionsList->Add(NEW OptionInteger(Options::OSD, "Display InGame extra information"));
|
||||
optionsTabs->Add(optionsList);
|
||||
|
||||
optionsList = NEW WGuiList("User");
|
||||
|
||||
@@ -199,7 +199,7 @@ void GameStateShop::cancelCard(int controlId){
|
||||
//Update prices
|
||||
MTGCard * c = srcCards->getCard(controlId-BOOSTER_SLOTS);
|
||||
if(!c || !c->data || playerdata->credits - mPrices[controlId] < 0)
|
||||
return; //We only care about their oppinion if they /can/ buy it.
|
||||
return; //We only care about their opinion if they /can/ buy it.
|
||||
|
||||
int price = mPrices[controlId];
|
||||
int rnd;
|
||||
@@ -212,7 +212,8 @@ void GameStateShop::cancelCard(int controlId){
|
||||
rnd = rand() % 25; break;
|
||||
}
|
||||
price = price - (rnd * price)/100;
|
||||
pricelist->setPrice(c->getMTGId(),price);
|
||||
if (price < pricelist->getPrice(c->getMTGId())) //filters have a tendancy to increase the price instead of lowering it!
|
||||
pricelist->setPrice(c->getMTGId(),price);
|
||||
//Prices do not immediately go down when you ignore something.
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -172,8 +172,8 @@ void OptionProfile::Render(){
|
||||
sprintf(buf,"player/avatar.jpg");
|
||||
else
|
||||
sprintf(buf,"profiles/%s/avatar.jpg",selections[value].c_str());
|
||||
|
||||
JQuad * mAvatar = resources.RetrieveQuad(buf,0,0,0,0,"temporary",RETRIEVE_NORMAL,TEXTURE_SUB_EXACT);
|
||||
string filename = buf;
|
||||
JQuad * mAvatar = resources.RetrieveTempQuad(filename,TEXTURE_SUB_EXACT);
|
||||
|
||||
if(mAvatar){
|
||||
renderer->RenderQuad(mAvatar,x,pY);
|
||||
@@ -358,8 +358,8 @@ JQuad * OptionTheme::getImage(){
|
||||
sprintf(buf,"graphics/preview.png");
|
||||
else
|
||||
sprintf(buf,"themes/%s/preview.png",val.c_str());
|
||||
|
||||
return resources.RetrieveQuad(buf,0,0,0,0,"temporary",RETRIEVE_NORMAL,TEXTURE_SUB_EXACT);
|
||||
string filename = buf;
|
||||
return resources.RetrieveTempQuad(filename,TEXTURE_SUB_EXACT);
|
||||
}
|
||||
|
||||
float OptionTheme::getHeight(){
|
||||
@@ -372,9 +372,6 @@ void OptionTheme::updateValue(){
|
||||
|
||||
void OptionTheme::Render(){
|
||||
JRenderer * renderer = JRenderer::GetInstance();
|
||||
JQuad * q = getImage();
|
||||
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
|
||||
mFont->SetColor(getColor(WGuiColor::TEXT_HEADER));
|
||||
char buf[512];
|
||||
if(!bChecked){
|
||||
author = "";
|
||||
@@ -396,11 +393,14 @@ void OptionTheme::Render(){
|
||||
}
|
||||
sprintf(buf,_("Theme: %s").c_str(),selections[value].c_str());
|
||||
|
||||
JQuad * q = getImage();
|
||||
if(q){
|
||||
float scale = 128 / q->mHeight;
|
||||
renderer->RenderQuad(q,x, y,0,scale,scale);
|
||||
}
|
||||
|
||||
JLBFont * mFont = resources.GetJLBFont(Constants::OPTION_FONT);
|
||||
mFont->SetColor(getColor(WGuiColor::TEXT_HEADER));
|
||||
mFont->DrawString(buf, x + 2, y + 2);
|
||||
if(bChecked && author.size()){
|
||||
mFont->SetColor(getColor(WGuiColor::TEXT_BODY));
|
||||
|
||||
@@ -152,12 +152,14 @@ WTrackedQuad * WCachedTexture::GetTrackedQuad(float offX, float offY, float widt
|
||||
|
||||
if(!quad){
|
||||
quad = NEW JQuad(texture,offX,offY,width,height);
|
||||
/*
|
||||
There's a risk this erases the texture calling the quad creation.... Erwan 2010/03/13
|
||||
if(!quad) {
|
||||
//Probably out of memory. Try again.
|
||||
resources.Cleanup();
|
||||
quad = NEW JQuad(texture,offX,offY,width,height);
|
||||
}
|
||||
|
||||
*/
|
||||
if(!quad){
|
||||
if(allocated && tq)
|
||||
SAFE_DELETE(tq);
|
||||
|
||||
@@ -742,6 +742,7 @@ WGuiMenu::WGuiMenu(JButton next = JGE_BTN_RIGHT, JButton prev = JGE_BTN_LEFT, bo
|
||||
currentItem = -1;
|
||||
mDPad = m;
|
||||
sync = syncme;
|
||||
held = JGE_BTN_NONE;
|
||||
}
|
||||
WGuiMenu::~WGuiMenu(){
|
||||
for(vector<WGuiBase*>::iterator it = items.begin();it!=items.end();it++)
|
||||
|
||||
Reference in New Issue
Block a user