summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-11-03 23:50:35 -0400
committerChuck Miller <shadowmil@gmail.com>2010-11-07 23:26:37 -0500
commitc81b3c269e39700be94fd9e2629b0bdfb0d093f8 (patch)
treec4dbca3f9dbb288151fec3171089e12295d33e04 /src/gui
parent671a465fa2c9469bde36b78c49e84bd0325c4cf1 (diff)
downloadmana-c81b3c269e39700be94fd9e2629b0bdfb0d093f8.tar.gz
mana-c81b3c269e39700be94fd9e2629b0bdfb0d093f8.tar.bz2
mana-c81b3c269e39700be94fd9e2629b0bdfb0d093f8.tar.xz
mana-c81b3c269e39700be94fd9e2629b0bdfb0d093f8.zip
Convert the emote system to use particles
Reviewed-by: Jared Adams
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/emotepopup.cpp4
-rw-r--r--src/gui/emotepopup.h4
-rw-r--r--src/gui/viewport.cpp1
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp6
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.h5
5 files changed, 9 insertions, 11 deletions
diff --git a/src/gui/emotepopup.cpp b/src/gui/emotepopup.cpp
index f9dc8e0f..bd40a932 100644
--- a/src/gui/emotepopup.cpp
+++ b/src/gui/emotepopup.cpp
@@ -22,7 +22,7 @@
#include "gui/emotepopup.h"
-#include "animatedsprite.h"
+#include "imagesprite.h"
#include "configuration.h"
#include "emoteshortcut.h"
#include "graphics.h"
@@ -53,7 +53,7 @@ EmotePopup::EmotePopup():
// Setup emote sprites
for (int i = 0; i <= EmoteDB::getLast(); ++i)
{
- mEmotes.push_back(EmoteDB::getAnimation(i));
+ mEmotes.push_back(EmoteDB::get(i)->sprite);
}
mSelectionImage = Theme::getImageFromTheme("selection.png");
diff --git a/src/gui/emotepopup.h b/src/gui/emotepopup.h
index 62a3f24a..d2cabc44 100644
--- a/src/gui/emotepopup.h
+++ b/src/gui/emotepopup.h
@@ -30,7 +30,7 @@
#include <list>
#include <vector>
-class AnimatedSprite;
+class ImageSprite;
class Image;
namespace gcn {
@@ -105,7 +105,7 @@ class EmotePopup : public Popup
*/
void distributeValueChangedEvent();
- std::vector<const AnimatedSprite*> mEmotes;
+ std::vector<const ImageSprite*> mEmotes;
Image *mSelectionImage;
int mSelectedEmoteIndex;
int mHoveredEmoteIndex;
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 368eef17..06dbd43e 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -215,7 +215,6 @@ void Viewport::draw(gcn::Graphics *gcnGraphics)
Being *b = static_cast<Being*>(*it);
b->drawSpeech((int) mPixelViewX, (int) mPixelViewY);
- b->drawEmotion(graphics, (int) mPixelViewX, (int) mPixelViewY);
}
if (miniStatusWindow)
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 7a24c464..f7a6ca2b 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -20,11 +20,11 @@
#include "gui/widgets/emoteshortcutcontainer.h"
-#include "animatedsprite.h"
#include "configuration.h"
#include "emoteshortcut.h"
#include "graphics.h"
#include "inventory.h"
+#include "imagesprite.h"
#include "item.h"
#include "itemshortcut.h"
#include "keyboardconfig.h"
@@ -56,7 +56,7 @@ EmoteShortcutContainer::EmoteShortcutContainer():
// Setup emote sprites
for (int i = 0; i <= EmoteDB::getLast(); i++)
{
- mEmoteImg.push_back(EmoteDB::getAnimation(i));
+ mEmoteImg.push_back(EmoteDB::get(i)->sprite);
}
mMaxItems = EmoteDB::getLast() < MAX_ITEMS ? EmoteDB::getLast() : MAX_ITEMS;
@@ -106,7 +106,7 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics)
if (mEmoteMoved)
{
// Draw the emote image being dragged by the cursor.
- const AnimatedSprite* sprite = mEmoteImg[mEmoteMoved - 1];
+ const ImageSprite* sprite = mEmoteImg[mEmoteMoved - 1];
if (sprite)
{
const int tPosX = mCursorPosX - (sprite->getWidth() / 2);
diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h
index e90612b4..c3fb9d14 100644
--- a/src/gui/widgets/emoteshortcutcontainer.h
+++ b/src/gui/widgets/emoteshortcutcontainer.h
@@ -25,8 +25,7 @@
#include <vector>
-class AnimatedSprite;
-class Image;
+class ImageSprite;
/**
* An emote shortcut container. Used to quickly use emoticons.
@@ -67,7 +66,7 @@ class EmoteShortcutContainer : public ShortcutContainer
void mouseReleased(gcn::MouseEvent &event);
private:
- std::vector<const AnimatedSprite*> mEmoteImg;
+ std::vector<const ImageSprite*> mEmoteImg;
bool mEmoteClicked;
int mEmoteMoved;