changeset 244:7887f3854862

'Fixed' segfault in rio de hola. Font system in FIFE is odd. Also don't call onActionFinished in ~Instance.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 25 Mar 2009 09:38:10 +0000
parents a822b1a6e3cd
children ed1565a5a2a0
files engine/core/gui/base/gui_font.h engine/core/model/structures/instance.cpp engine/core/video/fonts/abstractfont.h engine/core/video/fonts/fontbase.cpp engine/core/video/fonts/fontbase.h
diffstat 5 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/gui/base/gui_font.h	Wed Mar 25 08:48:31 2009 +0000
+++ b/engine/core/gui/base/gui_font.h	Wed Mar 25 09:38:10 2009 +0000
@@ -36,7 +36,7 @@
 
 namespace FIFE {
 
-	class GuiFont : public gcn::Font {
+	class GuiFont : public gcn::Font, public AbstractFont {
 	public:
 		/** Constructor
 		 *  Takes the ownership of given font
--- a/engine/core/model/structures/instance.cpp	Wed Mar 25 08:48:31 2009 +0000
+++ b/engine/core/model/structures/instance.cpp	Wed Mar 25 09:38:10 2009 +0000
@@ -178,6 +178,9 @@
 		}
 
 		if(m_activity && m_activity->m_actioninfo) {
+			// Don't ditribute onActionFinished in case we're already
+			// deleting.
+			m_activity->m_actionlisteners.clear();
 			finalizeAction();
 		}
 
--- a/engine/core/video/fonts/abstractfont.h	Wed Mar 25 08:48:31 2009 +0000
+++ b/engine/core/video/fonts/abstractfont.h	Wed Mar 25 09:38:10 2009 +0000
@@ -88,7 +88,7 @@
 		 */
 		virtual bool isAntiAlias() = 0;
 
-		virtual int getStringIndexAt(const std::string &text, int x) = 0;
+		virtual int getStringIndexAt(const std::string &text, int x) const = 0;
 
 		/** Gets given text as Image
 		 *  The rsulting image is pooled, so it's not that time critical
--- a/engine/core/video/fonts/fontbase.cpp	Wed Mar 25 08:48:31 2009 +0000
+++ b/engine/core/video/fonts/fontbase.cpp	Wed Mar 25 09:38:10 2009 +0000
@@ -78,7 +78,7 @@
 		return mColor;
 	}
 
-	int FontBase::getStringIndexAt(const std::string &text, int x) {
+	int FontBase::getStringIndexAt(const std::string &text, int x) const {
 		assert( utf8::is_valid(text.begin(), text.end()) );
 		std::string::const_iterator cur;
 		if (text.size() == 0) return 0;
--- a/engine/core/video/fonts/fontbase.h	Wed Mar 25 08:48:31 2009 +0000
+++ b/engine/core/video/fonts/fontbase.h	Wed Mar 25 09:38:10 2009 +0000
@@ -55,7 +55,7 @@
 		int getGlyphSpacing() const;
 		void setAntiAlias(bool antiAlias);
 		bool isAntiAlias();
-		virtual int getStringIndexAt(const std::string &text, int x);
+		virtual int getStringIndexAt(const std::string &text, int x) const;
 		
 		Image* getAsImage(const std::string& text);
 		Image* getAsImageMultiline(const std::string& text);