Files
wagic/projects/mtg/include/MTGCard.h
T
wrenczes@gmail.com 224b140f9f 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.
2011-04-22 16:04:41 +00:00

53 lines
922 B
C++

#ifndef _MTGCARD_H_
#define _MTGCARD_H_
#define MTGCARD_NAME_SIZE 16
#define MTG_IMAGE_WIDTH 200
#define MTG_IMAGE_HEIGHT 285
#define MTG_MINIIMAGE_WIDTH 45
#define MTG_MINIIMAGE_HEIGHT 64
#include <string>
#include <vector>
#include <map>
class CardPrimitive;
using namespace std;
class MTGCard
{
protected:
friend class MTGSetInfo;
int mtgid;
char rarity;
char image_name[MTGCARD_NAME_SIZE];
vector<string> mFormattedText;
int init();
public:
int setId;
CardPrimitive * data;
MTGCard();
MTGCard(int set_id);
MTGCard(MTGCard * source);
virtual ~MTGCard();
void setMTGId(int id);
void setRarity(char _rarity);
//void setImageName( char * value);
void setPrimitive(CardPrimitive * cp);
const vector<string>& GetFormattedText();
int getMTGId() const;
int getId() const;
char getRarity() const;
char * getImageName();
};
#endif