resolved linux compilation issues

This commit is contained in:
techdragon.nguyen@gmail.com
2010-11-08 11:59:28 +00:00
parent 23937f593e
commit 7fe03d52fd
3 changed files with 6 additions and 29 deletions
+3 -5
View File
@@ -19,16 +19,12 @@ class DeckMenuItem: public JGuiObject
DeckMenu* parent; DeckMenu* parent;
int fontId; int fontId;
string mText; string mText;
float mScale;
float mTargetScale;
public: public:
string imageFilename; string imageFilename;
string desc; string desc;
DeckMetaData *meta; DeckMetaData *meta;
DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus = false, bool autoTranslate = false, DeckMetaData *meta = NULL, const float &scaleFactor = 1.0f);
~DeckMenuItem();
float mX; float mX;
float mY; float mY;
@@ -36,9 +32,11 @@ class DeckMenuItem: public JGuiObject
float GetWidth(); float GetWidth();
bool hasFocus(); bool hasFocus();
DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus = false, bool autoTranslate = false, DeckMetaData *meta = NULL);
~DeckMenuItem();
void RenderWithOffset(float yOffset); void RenderWithOffset(float yOffset);
virtual void Render(); virtual void Render();
virtual void Update(float dt);
virtual void Entering(); virtual void Entering();
virtual bool Leaving(JButton key); virtual bool Leaving(JButton key);
+1 -1
View File
@@ -218,7 +218,7 @@ void DeckMenu::Update(float dt){
} }
void DeckMenu::Add(int id, const char * text,string desc, bool forceFocus, DeckMetaData * deckMetaData) { void DeckMenu::Add(int id, const char * text,string desc, bool forceFocus, DeckMetaData * deckMetaData) {
DeckMenuItem * menuItem = NEW DeckMenuItem(this, id, fontId, text, 0, mY + kVerticalMargin + mCount*kLineHeight, (mCount == 0), autoTranslate, deckMetaData, 0.8f); DeckMenuItem * menuItem = NEW DeckMenuItem(this, id, fontId, text, 0, mY + kVerticalMargin + mCount*kLineHeight, (mCount == 0), autoTranslate, deckMetaData);
menuItem->desc = deckMetaData ? deckMetaData->getDescription() : desc; menuItem->desc = deckMetaData ? deckMetaData->getDescription() : desc;
JGuiController::Add(menuItem); JGuiController::Add(menuItem);
+2 -23
View File
@@ -9,8 +9,8 @@ namespace
const float kMaxDeckNameWidth = 180; // pixel width const float kMaxDeckNameWidth = 180; // pixel width
} }
DeckMenuItem::DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus, bool autoTranslate, DeckMetaData *deckMetaData, const float &scaleFactor) DeckMenuItem::DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus, bool autoTranslate, DeckMetaData *deckMetaData)
: JGuiObject(id), parent(_parent), fontId(fontId), mX(x), mY(y), mScale(scaleFactor) : JGuiObject(id), parent(_parent), fontId(fontId), mX(x), mY(y)
{ {
if (autoTranslate) if (autoTranslate)
mText = _(text); mText = _(text);
@@ -18,8 +18,6 @@ DeckMenuItem::DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, f
mText = text; mText = text;
mHasFocus = hasFocus; mHasFocus = hasFocus;
mScale = 1.0f;
mTargetScale = 1.0f;
if (hasFocus) if (hasFocus)
Entering(); Entering();
@@ -46,23 +44,6 @@ void DeckMenuItem::Render()
RenderWithOffset(0); RenderWithOffset(0);
} }
void DeckMenuItem::Update(float dt)
{
if (mScale < mTargetScale)
{
mScale += 8.0f*dt;
if (mScale > mTargetScale)
mScale = mTargetScale;
}
else if (mScale > mTargetScale)
{
mScale -= 8.0f*dt;
if (mScale < mTargetScale)
mScale = mTargetScale;
}
}
void DeckMenuItem::Entering() void DeckMenuItem::Entering()
{ {
mHasFocus = true; mHasFocus = true;
@@ -104,8 +85,6 @@ ostream& DeckMenuItem::toString(ostream& out) const
return out << "DeckMenuItem ::: mHasFocus : " << mHasFocus return out << "DeckMenuItem ::: mHasFocus : " << mHasFocus
<< " ; parent : " << parent << " ; parent : " << parent
<< " ; mText : " << mText << " ; mText : " << mText
<< " ; mScale : " << mScale
<< " ; mTargetScale : " << mTargetScale
<< " ; mX,mY : " << mX << "," << mY; << " ; mX,mY : " << mX << "," << mY;
} }