Revert my Graphic changes

I think it's the one who cause those crashes
This commit is contained in:
Anthony Calosa
2016-08-13 16:45:46 +08:00
parent f1bc268f58
commit 8530292fef
32 changed files with 233 additions and 453 deletions

View File

@@ -54,7 +54,6 @@ void GameObserver::cleanup()
gameTurn.clear();
OpenedDisplay = NULL;
AffinityNeedsUpdate = false;
legendNeedUpdate = false;
}
GameObserver::~GameObserver()
@@ -900,17 +899,7 @@ void GameObserver::gameStateBasedEffects()
int nbcards = z->nb_cards;
//------------------------------
p->nomaxhandsize = (z->hasAbility(Constants::NOMAXHAND));
//legendary
if (legendNeedUpdate)
{
for (int cl = 0; cl < nbcards; cl++)
{
MTGCardInstance * c = z->cards[cl];
if (!c->isPhased && c->hasType(Subtypes::TYPE_LEGENDARY) && !c->has(Constants::NOLEGEND))
checkLegendary(c);
}
legendNeedUpdate = false;
}
/////////////////////////////////////////////////
//handle end of turn effects while we're at it.//
/////////////////////////////////////////////////
@@ -1030,43 +1019,6 @@ void GameObserver::gameStateBasedEffects()
}
}
void GameObserver::checkLegendary(MTGCardInstance * card)
{
map<MTGCardInstance *, bool>::iterator it;
int destroy = 0;
vector<MTGCardInstance*>oldCards;
for (it = cards.begin(); it != cards.end(); it++)
{
MTGCardInstance * comparison = (*it).first;
if (comparison != card && comparison->controller() == card->controller() && !(comparison->getName().compare(card->getName())))
{
oldCards.push_back(comparison);
destroy = 1;
}
}
if(destroy)
{
vector<MTGAbility*>selection;
MultiAbility * multi = NEW MultiAbility(this, this->mLayers->actionLayer()->getMaxId(), card, card, NULL);
for(unsigned int i = 0;i < oldCards.size();i++)
{
AAMover *a = NEW AAMover(this, this->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New");
a->oneShot = true;
multi->Add(a);
}
multi->oneShot = 1;
MTGAbility * a1 = multi;
selection.push_back(a1);
AAMover *b = NEW AAMover(this, this->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old");
b->oneShot = true;
MTGAbility * b1 = b;
selection.push_back(b1);
MTGAbility * menuChoice = NEW MenuAbility(this, this->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule");
menuChoice->addToGame();
}
}
void GameObserver::enchantmentStatus()
{
for (int i = 0; i < 2; i++)