From c81b3c269e39700be94fd9e2629b0bdfb0d093f8 Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Wed, 3 Nov 2010 23:50:35 -0400 Subject: Convert the emote system to use particles Reviewed-by: Jared Adams --- src/gui/emotepopup.cpp | 4 ++-- src/gui/emotepopup.h | 4 ++-- src/gui/viewport.cpp | 1 - src/gui/widgets/emoteshortcutcontainer.cpp | 6 +++--- src/gui/widgets/emoteshortcutcontainer.h | 5 ++--- 5 files changed, 9 insertions(+), 11 deletions(-) (limited to 'src/gui') 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 #include -class AnimatedSprite; +class ImageSprite; class Image; namespace gcn { @@ -105,7 +105,7 @@ class EmotePopup : public Popup */ void distributeValueChangedEvent(); - std::vector mEmotes; + std::vector 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(*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 -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 mEmoteImg; + std::vector mEmoteImg; bool mEmoteClicked; int mEmoteMoved; -- cgit v1.2.3-70-g09d2