Reducing the memory footprint: reworked the concept of 'colors' in CardPrimitives. What used to be an array of ints (ie 28 bytes) is now contained in a single byte, we use bit masking to support setting multiple colors on this variable. This also eliminates a lot of silly loops for setting colors in the code - now it's a straight byte copy.
Also thrown in are a couple of string to const string& conversions.
This commit is contained in:
@@ -3113,8 +3113,7 @@ int AbilityFactory::getAbilities(vector<MTGAbility *> * v, Spell * spell, MTGCar
|
||||
card->setColor(0,1);
|
||||
card->name = card->model->data->name;
|
||||
card->types = card->model->data->types;
|
||||
for (int i = 0; i < Constants::MTG_NB_COLORS; ++i)
|
||||
card->colors[i] = card->model->data->colors[i];
|
||||
card->colors = card->model->data->colors;
|
||||
for (map<int, int>::const_iterator it = card->model->data->basicAbilities.begin(); it != card->model->data->basicAbilities.end(); ++it)
|
||||
{
|
||||
int i = it->first;
|
||||
|
||||
Reference in New Issue
Block a user