code cleanup. No code changes

- removed unused variables
- added line breaks between methods (not everywhere just where i saw it while removing unused variables)
This commit is contained in:
techdragon.nguyen@gmail.com
2011-01-16 07:49:34 +00:00
parent a79164e800
commit 1be97b76f8
22 changed files with 83 additions and 83 deletions

View File

@@ -3216,20 +3216,23 @@ public:
AResetCost(int id, MTGCardInstance * source, MTGCardInstance * target) :
MTGAbility(id, source, target)
{
MTGCardInstance * _target = (MTGCardInstance *) target;
}
int addToGame()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
_target->controller()->game->putInZone(_target, _target->controller()->game->hand, _target->controller()->game->hand);
return MTGAbility::addToGame();
}
AResetCost * clone() const
{
AResetCost * a = NEW AResetCost(*this);
a->isClone = 1;
return a;
}
~AResetCost()
{
}
@@ -3242,8 +3245,8 @@ public:
ABloodThirst(int id, MTGCardInstance * source, MTGCardInstance * target, int amount) :
MTGAbility(id, source, target), amount(amount)
{
MTGCardInstance * _target = (MTGCardInstance *) target;
}
int addToGame()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
@@ -3257,12 +3260,14 @@ public:
}
return MTGAbility::addToGame();
}
ABloodThirst * clone() const
{
ABloodThirst * a = NEW ABloodThirst(*this);
a->isClone = 1;
return a;
}
~ABloodThirst()
{
}

View File

@@ -445,7 +445,7 @@ int AIAction::getEfficiency()
{
MTGCardInstance * _target = (MTGCardInstance *) (a->target);
MTGAbility * a = AbilityFactory::getCoreAbility(ability);
AManaProducer * amp = dynamic_cast<AManaProducer*> (a);
efficiency = 0;
//trying to encourage Ai to use his foreach manaproducers in first main
if (a->naType == MTGAbility::MANA_PRODUCER && (g->getCurrentGamePhase() == Constants::MTG_PHASE_FIRSTMAIN
@@ -489,7 +489,7 @@ int AIAction::getEfficiency()
case MTGAbility::STANDARDABILITYGRANT:
{
efficiency = 0;
MTGCardInstance * _target = (MTGCardInstance *) (a->target);
if (!target && !dynamic_cast<ALord*> (a))
break;
if(dynamic_cast<ALord*> (a) && !target)
@@ -1264,7 +1264,7 @@ int AIPlayerBaka::computeActions()
else if (p == this && g->mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0)
{ //standard actions
CardDescriptor cd;
MTGCardInstance * card = NULL;
switch (currentGamePhase)
{
case Constants::MTG_PHASE_FIRSTMAIN:

View File

@@ -1097,13 +1097,14 @@ AAWhatsMax::AAWhatsMax(int id, MTGCardInstance * card, MTGCardInstance * source,
int AAWhatsMax::resolve()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if (source)
{
source->MaxLevelUp = value;
}
return 1;
}
AAWhatsMax * AAWhatsMax::clone() const
{
AAWhatsMax * a = NEW AAWhatsMax(*this);
@@ -1428,7 +1429,6 @@ GenericTargetAbility::~GenericTargetAbility()
AAlterCost::AAlterCost(int id, MTGCardInstance * source, MTGCardInstance * target, int amount, int type) :
MTGAbility(id, source, target), amount(amount), type(type)
{
MTGCardInstance * _target = (MTGCardInstance *) target;
}
int AAlterCost::addToGame()
@@ -1483,7 +1483,7 @@ AAlterCost::~AAlterCost()
ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities) :
MTGAbility(id, source, target)
{
MTGCardInstance * _target = (MTGCardInstance *) target;
PopulateAbilityIndexVector(abilities, sabilities);
PopulateColorIndexVector(colors, sabilities);
@@ -1639,7 +1639,6 @@ AForeverTransformer::AForeverTransformer(int id, MTGCardInstance * source, MTGCa
MTGAbility(id, source, target)
{
aType = MTGAbility::STANDARD_BECOMES;
MTGCardInstance * _target = (MTGCardInstance *) target;
PopulateAbilityIndexVector(abilities, sabilities);
PopulateColorIndexVector(colors, sabilities);

View File

@@ -420,7 +420,7 @@ void CardGui::AlternateRender(MTGCard * card, const Pos& pos)
++j;
}
//Has X?
if (int cost = manacost->hasX())
if (manacost->hasX())
{
char buffer[10];
sprintf(buffer, "X");
@@ -662,7 +662,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad)
++j;
}
//Has X?
if (int cost = manacost->hasX())
if (manacost->hasX())
{
char buffer[10];
sprintf(buffer, "X");

View File

@@ -69,7 +69,7 @@ JGuiController(id, listener), fontId(fontId), mShowDetailsScreen( showDetailsOve
float scrollerWidth = 200.0f;
float scrollerHeight = 28.0f;
mScroller = NEW VerticalTextScroller(Fonts::MAIN_FONT, 14, 235, scrollerWidth, 28.0f, kVerticalScrollSpeed);
mScroller = NEW VerticalTextScroller(Fonts::MAIN_FONT, 14, 235, scrollerWidth, scrollerHeight, kVerticalScrollSpeed);
mAutoTranslate = true;
maxItems = 7;

View File

@@ -268,7 +268,6 @@ void StatsWrapper::initStatistics(string deckstats)
if ((deckStat != NULL) && (deckStat->nbgames > 0))
{
int percentVictories = stats->percentVictories(string(smallDeckName));
aiDeckNames.push_back(string(mtgd->meta_name));
aiDeckStats.push_back(deckStat);
}

View File

@@ -293,7 +293,7 @@ ExileTargetCost::ExileTargetCost(TargetChooser *_tc) :
int ExileTargetCost::doPay()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if (target)
{
target->controller()->game->putInExile(target);
@@ -321,7 +321,7 @@ BounceTargetCost::BounceTargetCost(TargetChooser *_tc) :
int BounceTargetCost::doPay()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if (target)
{
target->controller()->game->putInHand(target);
@@ -365,7 +365,7 @@ int Ninja::isPaymentSet()
int Ninja::doPay()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if (target)
{
target->controller()->game->putInHand(target);

View File

@@ -931,7 +931,7 @@ GameOptionAward::GameOptionAward()
bool GameOptionAward::read(string input)
{
//This is quick and dirty.
bool bNumeric = true;
achieved = time(NULL);
tm * at = localtime(&achieved);
viewed = false;
@@ -1040,7 +1040,7 @@ string GameOptionAward::menuStr()
return _("Unlocked.");
char buf[256];
Translator * t = Translator::GetInstance();
tm * lt = localtime(&achieved);
if (!lt)
return "Error";

View File

@@ -16,7 +16,7 @@
vector<DeckMetaData *> GameState::fillDeckMenu(SimpleMenu * _menu, const string& path, const string& smallDeckPrefix,
Player * statsPlayer)
{
bool translate = _menu->autoTranslate;
vector<DeckMetaData *> deckMetaDataVector = getValidDeckMetaData(path, smallDeckPrefix, statsPlayer);
renderDeckMenu(_menu, deckMetaDataVector);
@@ -26,7 +26,7 @@ vector<DeckMetaData *> GameState::fillDeckMenu(SimpleMenu * _menu, const string&
vector<DeckMetaData *> GameState::fillDeckMenu(DeckMenu * _menu, const string& path, const string& smallDeckPrefix,
Player * statsPlayer, int maxDecks)
{
bool translate = _menu->mAutoTranslate;
vector<DeckMetaData *> deckMetaDataVector = getValidDeckMetaData(path, smallDeckPrefix, statsPlayer, maxDecks);
renderDeckMenu(_menu, deckMetaDataVector);

View File

@@ -90,8 +90,9 @@ void GameStateDeckViewer::rotateCards(int direction)
lastPos = getCurrentPos();
lastTotal = total;
}
int i = 0;
}
void GameStateDeckViewer::rebuildFilters()
{
if (!filterMenu) filterMenu = NEW WGuiFilters("Filter by...", NULL);
@@ -106,6 +107,7 @@ void GameStateDeckViewer::rebuildFilters()
if (stw && myDeck)
stw->updateStats( myDeck );;
}
void GameStateDeckViewer::updateFilters()
{
if (!displayed_deck) return;
@@ -136,6 +138,7 @@ void GameStateDeckViewer::updateFilters()
stw->updateStats( myDeck );;
return;
}
void GameStateDeckViewer::loadIndexes()
{
for (int i = 0; i < 7; i++)
@@ -316,7 +319,7 @@ void GameStateDeckViewer::saveDeck()
*/
void GameStateDeckViewer::saveAsAIDeck(string deckName)
{
DeckManager * deckManager = DeckManager::GetInstance();
vector<DeckMetaData *> aiDecks = GameState::getValidDeckMetaData(JGE_GET_RES("ai/baka"), "ai_baka", NULL);
int nbAiDecks = aiDecks.size() + 1;
aiDecks.clear();
@@ -340,8 +343,6 @@ void GameStateDeckViewer::saveAsAIDeck(string deckName)
void GameStateDeckViewer::Update(float dt)
{
int myD = (displayed_deck == myDeck);
int x, y;
unsigned int distance2;
unsigned int minDistance2 = -1;
@@ -619,7 +620,6 @@ void GameStateDeckViewer::renderOnScreenBasicInfo()
JRenderer *renderer = JRenderer::GetInstance();
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
char buffer[256];
int myD = (displayed_deck == myDeck);
float y = 0;
int allCopies, nowCopies;

View File

@@ -192,7 +192,6 @@ void GameStateMenu::fillScroller()
char buff2[512];
DeckStats * stats = DeckStats::GetInstance();
DeckManager *deckManager = DeckManager::GetInstance();
vector<DeckMetaData *> playerDecks = getValidDeckMetaData(options.profileFile(), "", NULL, 6);
int totalGames = 0;
for (size_t j = 0; j < playerDecks.size(); j++)
@@ -731,7 +730,6 @@ void GameStateMenu::Render()
void GameStateMenu::ButtonPressed(int controllerId, int controlId)
{
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MENU_FONT);
DebugTrace("GameStateMenu: controllerId " << controllerId << " selected");
switch (controllerId)

View File

@@ -371,9 +371,6 @@ void GameStateShop::updateCounts()
}
void GameStateShop::load()
{
int nbsets = 0;
int nbboostersets = 0;
for (int i = 0; i < BOOSTER_SLOTS; i++)
{
mBooster[i].randomize(packlist);
@@ -891,7 +888,7 @@ void ShopBooster::randomCustom(MTGPacks * packlist)
}
void ShopBooster::randomStandard()
{
int mSet = -1;
MTGSetInfo * si = setlist.randomSet(-1);
mainSet = si;
altSet = NULL;

View File

@@ -1089,7 +1089,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
{
size_t end = s.find(")", found);
string sname = s.substr(found + 5, end - found - 5);
size_t previous = end + 1;
ANamer * tok = NEW ANamer(id, card, NULL, sname, 0);
return tok;
}

View File

@@ -962,7 +962,7 @@ MTGSetInfo* MTGSets::getInfo(int setID)
MTGSetInfo* MTGSets::randomSet(int blockId, int atleast)
{
char * unlocked = (char *) calloc(size(), sizeof(char));
int attempts = 50;
//Figure out which sets are available.
for (int i = 0; i < size(); i++)
{

View File

@@ -102,7 +102,7 @@ void MTGPlayerCards::OptimizedHand(Player * who,int amount, int lands, int creat
Player * p = who;
MTGCardInstance * card = NULL;
MTGGameZone * z = p->game->library;
MTGGameZone * e = p->game->temp;
int optimizedland = 0;
int optimizedothercards = 0;
int optimizedcreatures = 0;

View File

@@ -28,10 +28,6 @@ int MTGPackEntryRandom::addCard(WSrcCards *pool, MTGDeck *to)
}
int MTGPackEntrySpecific::addCard(WSrcCards *pool, MTGDeck *to)
{
int fails = 0;
//Ignores pool entirely.
MTGAllCards * ac = GameApp::collection;
if (!card)
return copies;
for (int i = 0; i < copies; i++)

View File

@@ -25,7 +25,7 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
&& game->players[0]->game->exile->nb_cards == 0
)
{
Player * p = game->currentPlayer;
if (card->basicAbilities[Constants::LEYLINE])
{
MTGCardInstance * copy = player->game->putInZone(card, player->game->hand, player->game->temp);
@@ -52,8 +52,6 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
{
ManaCost * playerMana = player->getManaPool();
ManaCost * cost = card->getManaCost();
ManaCost * alternative = card->getManaCost()->alternative;
ManaCost * BuyBack = card->getManaCost()->BuyBack;
#ifdef WIN32
cost->Dump();
@@ -124,7 +122,7 @@ int MTGPutInPlayRule::reactToClick(MTGCardInstance * card)
return 0;
Player * player = game->currentlyActing();
ManaCost * cost = card->getManaCost();
ManaCost * playerMana = player->getManaPool();
//this handles extra cost payments at the moment a card is played.
if (cost->isExtraPaymentSet())
@@ -237,7 +235,7 @@ MTGAlternativeCostRule::MTGAlternativeCostRule(int _id) :
}
int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
{
int cardsinhand = game->players[0]->game->hand->nb_cards;
Player * player = game->currentlyActing();
Player * currentPlayer = game->currentPlayer;
if (!player->game->hand->hasCard(card))
@@ -259,10 +257,9 @@ int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *
)
{
ManaCost * playerMana = player->getManaPool();
ManaCost * cost = card->getManaCost();
ManaCost * alternative = card->getManaCost()->alternative;
#ifdef WIN32
ManaCost * cost = card->getManaCost();
cost->Dump();
#endif
if (player->castrestrictedspell == true && !card->hasType("land"))
@@ -428,7 +425,7 @@ MTGBuyBackRule::MTGBuyBackRule(int _id) :
}
int MTGBuyBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
{
int cardsinhand = game->players[0]->game->hand->nb_cards;
Player * player = game->currentlyActing();
Player * currentPlayer = game->currentPlayer;
if (!player->game->hand->hasCard(card))
@@ -448,10 +445,10 @@ int MTGBuyBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
== Constants::MTG_PHASE_SECONDMAIN)))
{
ManaCost * playerMana = player->getManaPool();
ManaCost * cost = card->getManaCost();
ManaCost * BuyBack = card->getManaCost()->BuyBack;
#ifdef WIN32
ManaCost * cost = card->getManaCost();
cost->Dump();
#endif
if (player->castrestrictedspell == true && !card->hasType("land"))
@@ -621,7 +618,7 @@ MTGFlashBackRule::MTGFlashBackRule(int _id) :
}
int MTGFlashBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
{
int cardsingraveyard = game->players[0]->game->graveyard->nb_cards;
Player * player = game->currentlyActing();
Player * currentPlayer = game->currentPlayer;
if (!player->game->graveyard->hasCard(card))
@@ -634,11 +631,12 @@ int MTGFlashBackRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|| game->currentGamePhase == Constants::MTG_PHASE_SECONDMAIN))
)
{
ManaCost * playerMana = player->getManaPool();
ManaCost * cost = card->getManaCost();
ManaCost * FlashBack = card->getManaCost()->FlashBack;
ManaCost * playerMana = player->getManaPool();
#ifdef WIN32
ManaCost * cost = card->getManaCost();
cost->Dump();
#endif
if (player->castrestrictedspell == true && !card->hasType("land"))
@@ -807,7 +805,7 @@ MTGRetraceRule::MTGRetraceRule(int _id) :
}
int MTGRetraceRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
{
int cardsingraveyard = game->players[0]->game->graveyard->nb_cards;
Player * player = game->currentlyActing();
Player * currentPlayer = game->currentPlayer;
if (!player->game->graveyard->hasCard(card))
@@ -821,10 +819,10 @@ int MTGRetraceRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
)
{
ManaCost * playerMana = player->getManaPool();
ManaCost * cost = card->getManaCost();
ManaCost * Retrace = card->getManaCost()->Retrace;
#ifdef WIN32
ManaCost * cost = card->getManaCost();
cost->Dump();
#endif
if (player->castrestrictedspell == true && !card->hasType("land"))
@@ -1118,7 +1116,7 @@ int MTGCombatTriggersRule::receiveEvent(WEvent *e)
}
//---------------
}
if (WEventAttackersChosen * event = dynamic_cast<WEventAttackersChosen*>(e))
if (dynamic_cast<WEventAttackersChosen*>(e))
{
MTGCardInstance * lonelyAttacker = NULL;
int nbattackers = 0;
@@ -1141,7 +1139,7 @@ int MTGCombatTriggersRule::receiveEvent(WEvent *e)
else
lonelyAttacker = NULL;
}
if (WEventBlockersChosen * event = dynamic_cast<WEventBlockersChosen*>(e))
if (dynamic_cast<WEventBlockersChosen*>(e))
{
Player * p = game->currentPlayer;
MTGGameZone * z = p->game->inPlay;

View File

@@ -21,10 +21,9 @@ void OptionInteger::Render()
{
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
mFont->SetColor(getColor(WGuiColor::TEXT));
JRenderer * renderer = JRenderer::GetInstance();
mFont->DrawString(_(displayValue).c_str(), x + 2, y + 3);
char buf[512];
if (maxValue == 1)
{
if (value)
@@ -80,8 +79,6 @@ void OptionSelect::Render()
{
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
mFont->SetColor(getColor(WGuiColor::TEXT));
JRenderer * renderer = JRenderer::GetInstance();
mFont->DrawString(_(displayValue).c_str(), x, y + 2);
if (value < selections.size())

View File

@@ -51,7 +51,6 @@ void SimplePopup::Render()
// draws a bounding box around the popup.
void SimplePopup::drawBoundingBox( float x, float y, float width, float height )
{
JRenderer *r = JRenderer::GetInstance();
//draw the corners
string topCornerImageName = "top_corner.png";

View File

@@ -171,7 +171,7 @@ int WSrcCards::loadMatches(WSrcCards* src, bool all)
if (!src) return count;
MTGCard * c = NULL;
size_t t = 0;
int oldp = src->getOffset();
src->setOffset(0);
for (int t = 0; t < src->Size(all); t++)
@@ -257,8 +257,6 @@ int WSrcCards::addToDeck(MTGDeck * i, int num)
bool WSrcCards::next()
{
int oldpos = currentPos;
bool bMatch = true;
int size = (int) cards.size();
if (filtersRoot) size = (int) validated.size();
if (currentPos + 1 >= size) return false;
@@ -268,8 +266,6 @@ bool WSrcCards::next()
bool WSrcCards::prev()
{
int oldpos = currentPos;
bool bMatch = true;
if (currentPos == 0) return false;
currentPos--;

View File

@@ -94,7 +94,7 @@ bool WGuiItem::Leaving(JButton key)
void WGuiItem::Render()
{
JRenderer * renderer = JRenderer::GetInstance();
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
DWORD oldcolor = mFont->GetColor();
mFont->SetColor(getColor(WGuiColor::TEXT));
@@ -190,8 +190,6 @@ void WGuiHeader::Render()
{
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
mFont->SetColor(getColor(WGuiColor::TEXT));
JRenderer * renderer = JRenderer::GetInstance();
mFont->DrawString(_(displayValue).c_str(), x + width / 2, y, JGETEXT_CENTER);
}
@@ -441,8 +439,8 @@ void WDecoEnum::Render()
{
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
mFont->SetColor(getColor(WGuiColor::TEXT));
JRenderer * renderer = JRenderer::GetInstance();
mFont->DrawString(_(getDisplay()).c_str(), getX() + 2, getY() + 3);
OptionInteger* opt = dynamic_cast<OptionInteger*> (it);
if (opt) mFont->DrawString(_(lookupVal(opt->value)).c_str(), getWidth() - 5, getY() + 3, JGETEXT_RIGHT);
}
@@ -880,7 +878,6 @@ bool WGuiMenu::CheckUserInput(JButton key)
{
bool result = false;
bool kidModal = false;
bool handledInput = false;
int nbitems = (int) items.size();
JGE * mEngine = JGE::GetInstance();
@@ -998,7 +995,6 @@ bool WGuiMenu::isButtonDir(JButton key, int dir)
void WGuiMenu::Update(float dt)
{
int nbitems = (int) items.size();
JGE * mEngine = JGE::GetInstance();
if (held) duration += dt;
@@ -1348,7 +1344,6 @@ WGuiCardDistort::~WGuiCardDistort()
void WGuiCardDistort::Render()
{
JRenderer * renderer = JRenderer::GetInstance();
JQuad * q = NULL;
if (distortSrc)
@@ -1447,10 +1442,7 @@ WDistort::WDistort(float x1, float y1, float x2, float y2, float x3, float y3, f
void WGuiListRow::Render()
{
JRenderer * renderer = JRenderer::GetInstance();
int listHeight = 40;
int listSelectable = 0;
int adjustedCurrent = 0;
int start = 0, nowPos = 0, vHeight = 0;
int nbitems = (int) items.size();
@@ -1496,7 +1488,6 @@ void WGuiListRow::Render()
items[pos]->setX(x + nowPos);
items[pos]->setY(y + nowVPos);
//items[pos]->setWidth(width/nbitems);
items[pos]->setWidth(items[pos]->minWidth());
float temp = items[pos]->getHeight() + 3;
if (temp > tallestRow) tallestRow = temp;
@@ -1519,6 +1510,7 @@ void WGuiListRow::Render()
}
setHeight(tallestRow * numRows + 10);
}
WGuiListRow::WGuiListRow(string n, WSyncable * s) :
WGuiList(n, s)
{
@@ -1527,6 +1519,7 @@ WGuiListRow::WGuiListRow(string n, WSyncable * s) :
width = SCREEN_WIDTH;
height = 20;
}
//WGuiFilterUI
bool WGuiFilters::Finish(bool emptyset)
{
@@ -1561,6 +1554,7 @@ bool WGuiFilters::Finish(bool emptyset)
}
return true;
}
void WGuiFilters::ButtonPressed(int controllerId, int controlId)
{
if (controllerId == -102)
@@ -1588,6 +1582,7 @@ void WGuiFilters::ButtonPressed(int controllerId, int controlId)
if (list != NULL) list->ButtonPressed(controllerId, controlId);
}
}
void WGuiFilters::buildList()
{
list = NEW WGuiList("");
@@ -1601,18 +1596,20 @@ void WGuiFilters::buildList()
list->Add(wgs);
list->Entering(JGE_BTN_NONE);
}
WGuiFilters::WGuiFilters(string header, WSrcCards * src) :
WGuiItem(header)
WGuiFilters::WGuiFilters(string header, WSrcCards * src) : WGuiItem(header)
{
bFinished = false;
source = src;
recolorTo = -1;
buildList();
}
void WGuiFilters::recolorFilter(int color)
{
recolorTo = color;
}
string WGuiFilters::getCode()
{
if (!list) return "";
@@ -1642,10 +1639,12 @@ string WGuiFilters::getCode()
}
return res;
}
void WGuiFilters::setSrc(WSrcCards * wsc)
{
source = wsc;
}
void WGuiFilters::Update(float dt)
{
if (subMenu && !subMenu->isClosed()) subMenu->Update(dt);
@@ -1667,11 +1666,13 @@ void WGuiFilters::Update(float dt)
if (bDeleted) wgl->Entering(JGE_BTN_NONE);
}
}
void WGuiFilters::Entering(JButton key)
{
bFinished = false;
WGuiItem::Entering(key);
}
void WGuiFilters::Render()
{
if (!list) return; //Hurrah for paranoia.
@@ -1686,6 +1687,7 @@ void WGuiFilters::Render()
if (subMenu && !subMenu->isClosed()) subMenu->Render();
}
bool WGuiFilters::CheckUserInput(JButton key)
{
if (subMenu && !subMenu->isClosed() && subMenu->CheckUserInput(key)) return true;
@@ -1700,11 +1702,13 @@ bool WGuiFilters::CheckUserInput(JButton key)
}
return WGuiItem::CheckUserInput(key);
}
WGuiFilters::~WGuiFilters()
{
SAFE_DELETE(list);
SAFE_DELETE(subMenu);
}
void WGuiFilters::addColumn()
{
if (!list) return;
@@ -1715,6 +1719,7 @@ void WGuiFilters::addColumn()
wgl->Add(NEW WGuiFilterItem(this));
}
}
bool WGuiFilters::isAvailableCode(string code)
{
if (!list) return false;
@@ -1733,6 +1738,7 @@ bool WGuiFilters::isAvailableCode(string code)
}
return false; //For some reason, we don't have any rows?
}
bool WGuiFilters::isAvailable(int type)
{
if (!list) return false;
@@ -1766,10 +1772,12 @@ bool WGuiFilters::isAvailable(int type)
}
return false; //For some reason, we don't have any rows?
}
void WGuiFilters::clearArgs()
{
tempArgs.clear();
}
void WGuiFilters::addArg(string display, string code)
{
if (!subMenu || !isAvailableCode(code)) return;
@@ -1787,7 +1795,7 @@ WGuiFilterItem::WGuiFilterItem(WGuiFilters * parent) :
mParent = parent;
mNew = true;
}
;
void WGuiFilterItem::updateValue()
{
bool delMenu = true;
@@ -2013,6 +2021,7 @@ void WGuiFilterItem::updateValue()
break;
}
}
void WGuiFilterItem::ButtonPressed(int controllerId, int controlId)
{
if (!mParent) return;
@@ -2083,6 +2092,7 @@ WGuiKeyBinder::WGuiKeyBinder(string name, GameStateOptions* parent) :
for (JGE::keybindings_it it = start; it != end; ++it)
Add(NEW OptionKey(parent, it->first, it->second));
}
void WGuiKeyBinder::Update(float dt)
{
OptionKey* o = dynamic_cast<OptionKey*> (items[0]);
@@ -2096,12 +2106,14 @@ void WGuiKeyBinder::Update(float dt)
(*it)->Update(dt);
if (confirmMenu) confirmMenu->Update(dt);
}
bool WGuiKeyBinder::isModal()
{
for (vector<WGuiBase*>::iterator it = items.begin(); it != items.end(); ++it)
if ((*it)->isModal()) return true;
return modal;
}
bool WGuiKeyBinder::CheckUserInput(JButton key)
{
if (confirmMenu) return confirmMenu->CheckUserInput(key);
@@ -2109,6 +2121,7 @@ bool WGuiKeyBinder::CheckUserInput(JButton key)
if (!items[currentItem]->Selectable()) nextItem();
return true;
}
void WGuiKeyBinder::setData()
{
JGE* j = JGE::GetInstance();
@@ -2205,6 +2218,7 @@ WGuiBase::CONFIRM_TYPE WGuiKeyBinder::needsConfirm()
return CONFIRM_OK;
}
void WGuiKeyBinder::ButtonPressed(int controllerId, int controlId)
{
if (2 == controlId)
@@ -2222,6 +2236,7 @@ void WGuiKeyBinder::ButtonPressed(int controllerId, int controlId)
SAFE_DELETE(confirmMenu);
confirmMenu = NULL;
}
void WGuiKeyBinder::Render()
{
WGuiList::Render();
@@ -2245,6 +2260,7 @@ void WGuiKeyBinder::Render()
confirmMenu->Render();
}
}
bool WGuiKeyBinder::yieldFocus()
{
return true;

View File

@@ -249,7 +249,7 @@ JQuad * WResourceManager::RetrieveCard(MTGCard * card, int style, int submode)
}
filename1 = filename + card->data->getName() + ".jpg";
jq = RetrieveQuad(filename1, 0, 0, 0, 0, "", style, submode | TEXTURE_SUB_5551, id);
int i = 0; //TODO remove debug test;
}
lastError = textureWCache.mError;
if (jq)