1st step in refactoring some of the card rendering logic - currently, each 'client' has duplicated code having to deal with how to render the full card graphic vs text mode vs using a 'back' image if a card isn't found. This is a first pass at consolidating some of that logic to one location - the ultimate goal being, eventually, the resource cache will actually own the notion of whether it's handing out a real card image or a default filler if the card isn't available, and the client code rendering the card should be oblivious.
In this change, I made the CardGui's RenderBig() and AlternateRender() functions protected; anyone wanting to render a card simply calls RenderCard(), and the card drawing mode is passed along as a param.
This commit is contained in:
@@ -12,14 +12,6 @@ using std::vector;
|
||||
class PlayGuiObject;
|
||||
class DuelLayers;
|
||||
|
||||
|
||||
enum {
|
||||
BIG_MODE_SHOW = 0,
|
||||
BIG_MODE_TEXT = 1,
|
||||
BIG_MODE_HIDE = 2,
|
||||
NB_BIG_MODES = 3
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct LimitorFunctor
|
||||
{
|
||||
@@ -32,7 +24,7 @@ class CardSelectorBase : public GuiLayer
|
||||
{
|
||||
public:
|
||||
|
||||
CardSelectorBase(int inDrawMode) : mDrawMode(inDrawMode) {};
|
||||
CardSelectorBase(int inDrawMode = DrawMode::kNormal) : mDrawMode(inDrawMode) {};
|
||||
virtual void Add(PlayGuiObject*) = 0;
|
||||
virtual void Remove(PlayGuiObject*) = 0;
|
||||
virtual bool CheckUserInput(JButton key) = 0;
|
||||
|
||||
Reference in New Issue
Block a user