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:
wrenczes@gmail.com
2011-04-25 11:20:07 +00:00
parent b8310838f4
commit 1cbf3db582
8 changed files with 162 additions and 120 deletions
+1 -2
View File
@@ -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;