diff engine/core/gui/base/gui_font.cpp @ 654:5d6b1820b953

* Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes. * Added IEngineChangeListener so the client can update the cameras viewport if the screen mode has been changed. I chose to do it this way because the engine has no way to know which camera it should update. It will be up to the client to do it. * The cursor surface is now correctly freed when exiting. * Added DeviceCaps::getNearestScreenMode() for the client to request a supported screen mode. closes[t:315]
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 21 Oct 2010 18:50:50 +0000
parents 47b49b9b0c0a
children
line wrap: on
line diff
--- a/engine/core/gui/base/gui_font.cpp	Fri Oct 15 18:54:34 2010 +0000
+++ b/engine/core/gui/base/gui_font.cpp	Thu Oct 21 18:50:50 2010 +0000
@@ -38,15 +38,15 @@
 	GuiFont::GuiFont(AbstractFont* font): m_font(font) {
 		assert(font);
 	}
-	
+
 	GuiFont::~GuiFont() {
 		delete m_font;
 	}
-	
+
 	int GuiFont::getStringIndexAt(const std::string& text, int x) const {
 		return m_font->getStringIndexAt(text, x);
 	}
-	
+
 	void GuiFont::drawString(gcn::Graphics* graphics, const std::string& text, int x, int y) {
 		if (text == "") {
 			return;
@@ -90,35 +90,35 @@
 		}
 		image->render(rect);
 	}
-	
+
 	void GuiFont::setRowSpacing (int spacing) {
 		m_font->setRowSpacing(spacing);
 	}
-	
+
 	int GuiFont::getRowSpacing() const {
 		return m_font->getRowSpacing();
 	}
-	
+
 	void GuiFont::setGlyphSpacing(int spacing) {
 		m_font->setGlyphSpacing(spacing);
 	}
-	
+
 	int GuiFont::getGlyphSpacing() const {
 		return m_font->getGlyphSpacing();
 	}
-	
+
 	void GuiFont::setAntiAlias(bool antiAlias) {
 		m_font->setAntiAlias(antiAlias);
 	}
-	
+
 	bool GuiFont::isAntiAlias() {
 		return m_font->isAntiAlias();
 	}
-	
+
 	Image* GuiFont::getAsImage(const std::string& text) {
 		return m_font->getAsImage(text);
 	}
-	
+
 	Image* GuiFont::getAsImageMultiline(const std::string& text) {
 		return m_font->getAsImageMultiline(text);
 	}
@@ -130,16 +130,20 @@
 	void GuiFont::setColor(uint8_t r,uint8_t g,uint8_t b, uint8_t a) {
 		m_font->setColor(r, g, b, a);
 	}
-	
+
 	SDL_Color GuiFont::getColor() const {
 		return m_font->getColor();
 	}
-	
+
 	int GuiFont::getWidth(const std::string& text) const {
 		return m_font->getWidth(text);
 	}
-	
+
 	int GuiFont::getHeight() const {
 		return m_font->getHeight();
 	}
+
+	void GuiFont::invalidate() {
+		m_font->invalidate();
+	}
 }