First pass at reducing the overall memory footprint: moved GetFormattedText() out of CardPrimitives and into MTGCard. The idea being, only keep the formatted text around for cards that are actually in use.

Also fixed a subtle memory pooling issue in the RenderCountersBig() routine:  if you're in regular card display mode, the idea is that formatted text is only fetched if you flip into alternate render mode.  However, in this function, if counters are being drawn, it would fetch the formatted text in order to determine where to draw the counters, EVEN IF the counters count was zero.  So it had nothing to draw, but it meanwhile pooled the formatted strings into memory anyway.
This commit is contained in:
wrenczes@gmail.com
2011-04-22 16:04:41 +00:00
parent 58e340f30c
commit 224b140f9f
8 changed files with 167 additions and 159 deletions

View File

@@ -13,7 +13,6 @@ using namespace std;
class CardPrimitive
{
protected:
vector<string> ftdText;
string lcname;
ManaCost manaCost;
@@ -84,7 +83,6 @@ public:
void getRestrictions();
void setOtherRestrictions(string _restriction);
void getOtherRestrictions();
const vector<string>& formattedText();
};