changeset 621:356634098bd9

* Removed the image chunking size variable from engine settings. * Replaced the existing define of PI and added some math related static const variables
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 01 Oct 2010 14:09:47 +0000
parents 853d25234671
children c0c3f64bfc2d
files engine/core/controller/engine.cpp engine/core/controller/engine.i engine/core/controller/enginesettings.cpp engine/core/controller/enginesettings.h engine/core/model/metamodel/grids/hexgrid.cpp engine/core/util/base/fife_stdint.h engine/core/util/math/angles.h engine/core/util/math/fife_math.h engine/core/util/math/matrix.h engine/core/video/renderbackend.cpp engine/core/video/renderbackend.h engine/core/view/camera.cpp
diffstat 12 files changed, 124 insertions(+), 146 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/controller/engine.cpp	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/controller/engine.cpp	Fri Oct 01 14:09:47 2010 +0000
@@ -189,7 +189,6 @@
 #endif
 		}
 		FL_LOG(_log, "Initializing render backend");
-		m_renderbackend->setChunkingSize(m_settings.getImageChunkingSize());
 		m_renderbackend->setColorKeyEnabled(m_settings.isColorKeyEnabled());
 		m_renderbackend->init();
 
--- a/engine/core/controller/engine.i	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/controller/engine.i	Fri Oct 01 14:09:47 2010 +0000
@@ -68,8 +68,6 @@
 		unsigned int getDefaultFontSize() const;
 		void setDefaultFontGlyphs(const std::string& defaultfontglyphs);
 		std::string getDefaultFontGlyphs() const;
-		void setImageChunkingSize(unsigned int size);
-		unsigned int getImageChunkingSize();
 		void setWindowTitle(const std::string& title);
 		std::string getWindowTitle() const;
 		void setWindowIcon(const std::string& icon);
--- a/engine/core/controller/enginesettings.cpp	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/controller/enginesettings.cpp	Fri Oct 01 14:09:47 2010 +0000
@@ -50,16 +50,15 @@
 		m_defaultfontpath(""),
 		m_defaultfontsize(8),
 		m_defaultfontglyphs(""),
-		m_image_chunking_size(256),
 		m_iscolorkeyenabled(false) {
 			m_colorkey.r = 255;
 			m_colorkey.g = 0;
 			m_colorkey.b = 255;
 	}
-	
+
 	EngineSettings::~EngineSettings() {
 	}
-	
+
 	void EngineSettings::validate() const {
 		if (m_defaultfontpath == "") {
 			throw NotSet("Path for default font is not set");
@@ -91,7 +90,7 @@
 		}
 		throw NotSupported("Given bits per pixel value is not supported");
 	}
-	
+
 	std::vector<unsigned int> EngineSettings::getPossibleBitsPerPixel() const {
 		std::vector<unsigned int> tmp;
 		tmp.push_back(0);
@@ -100,7 +99,7 @@
 		tmp.push_back(32);
 		return tmp;
 	}
-	
+
 	void EngineSettings::setInitialVolume(float volume) {
 		if (volume > getMaxVolume()) {
 			throw NotSupported("Given volume exceeds maximum volume");
@@ -110,11 +109,11 @@
 		}
 		m_initialvolume = volume;
 	}
-	
+
 	float EngineSettings::getMaxVolume() const {
 		return MAXIMUM_VOLUME;
 	}
-	
+
 	void EngineSettings::setRenderBackend(const std::string& renderbackend) {
 		std::vector<std::string> pv = getPossibleRenderBackends();
 		std::vector<std::string>::iterator i = std::find(pv.begin(), pv.end(), renderbackend);
@@ -124,42 +123,42 @@
 		}
 		throw NotSupported("Given render backend is not supported");
 	}
-	
+
 	std::vector<std::string> EngineSettings::getPossibleRenderBackends() {
 		std::vector<std::string> tmp;
 		tmp.push_back("SDL");
 		tmp.push_back("OpenGL");
 		return tmp;
 	}
-	
+
 	void EngineSettings::setSDLRemoveFakeAlpha(bool sdlremovefakealpha) {
 		m_sdlremovefakealpha = sdlremovefakealpha;
 	}
-	
+
 	void EngineSettings::setScreenWidth(unsigned int screenwidth) {
 		m_screenwidth = screenwidth;
 	}
-	
+
 	void EngineSettings::setScreenHeight(unsigned int screenheight) {
 		m_screenheight = screenheight;
 	}
-	
+
 	void EngineSettings::setDefaultFontPath(const std::string& defaultfontpath) {
 		m_defaultfontpath = defaultfontpath;
 	}
-	
+
 	void EngineSettings::setDefaultFontSize(const unsigned int defaultfontsize) {
 		m_defaultfontsize = defaultfontsize;
 	}
-	
+
 	void EngineSettings::setDefaultFontGlyphs(const std::string& defaultfontglyphs) {
 		m_defaultfontglyphs = defaultfontglyphs;
 	}
-	
+
 	void EngineSettings::setWindowTitle(const std::string& title) {
 		m_windowtitle = title;
 	}
-	
+
 	void EngineSettings::setWindowIcon(const std::string& icon) {
 		m_windowicon = icon;
 	}
--- a/engine/core/controller/enginesettings.h	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/controller/enginesettings.h	Fri Oct 01 14:09:47 2010 +0000
@@ -44,26 +44,26 @@
 		/** Constructor
 		 */
 		EngineSettings();
-		
+
 		/** Destructor
 		 */
 		~EngineSettings();
-		
+
 		/** Validates settings. On invalid settings, throws NotSet with message
 		 */
 		void validate() const;
-		
+
 		/** Sets bits per pixel
 		 * @see getPossibleBitsPerPixel
 		 */
 		void setBitsPerPixel(unsigned int bitsperpixel);
-		
+
 		/** Gets currently set bits per pixel value
 		 */
-		unsigned int getBitsPerPixel() const { 
+		unsigned int getBitsPerPixel() const {
 			return m_bitsperpixel;
 		}
-		
+
 		/** Gets all possible bits per pixel values
 		 */
 		std::vector<unsigned int> getPossibleBitsPerPixel() const;
@@ -74,117 +74,105 @@
 
 		/** Sets fullscreen / windowed mode
 		 */
-		void setFullScreen(bool fullscreen) { 
+		void setFullScreen(bool fullscreen) {
 			m_fullscreen = fullscreen;
 		}
-		
+
 		/** True, if set to fullscreen. False = windowed
 		 */
-		bool isFullScreen() const { 
+		bool isFullScreen() const {
 			return m_fullscreen;
 		}
-		
+
 		/** Sets initial engine sound volume
 		 *  @see getInitialMaxVolume
 		 */
 		void setInitialVolume(float volume);
-		
+
 		/** Gets initial engine sound volume
 		 */
 		float getInitialVolume() const {
 			return m_initialvolume;
 		}
-		
+
 		/** Gets maximum volume that can be set
 		 */
 		float getMaxVolume() const;
-		
+
 		/** Sets name for renderbackend
 		 *  @see getPossibleRenderBackends
 		 */
 		void setRenderBackend(const std::string& renderbackend);
-		
+
 		/** Gets currently set renderbackend name
 		 */
 		const std::string getRenderBackend() const {
 			return m_renderbackend;
 		}
-		
+
 		/** Gets all possible renderbackend names
 		 */
 		std::vector<std::string> getPossibleRenderBackends();
-		
+
 		/** Sets if fake alpha is removed in SDL renderbackend
 		 */
 		void setSDLRemoveFakeAlpha(bool sdlremovefakealpha);
-		
+
 		/** Tells if fake alpha is removed in SDL renderbackend
 		 */
 		bool isSDLRemoveFakeAlpha(bool sdlremovefakealpha) const {
 			return m_sdlremovefakealpha;
 		}
-		
+
 		/** Sets screen width (pixels)
 		 */
 		void setScreenWidth(unsigned int screenwidth);
-		
+
 		/** Gets screen width (pixels)
 		 */
 		unsigned int getScreenWidth() const {
 			return m_screenwidth;
 		}
-		
+
 		/** Sets screen height (pixels)
 		 */
 		void setScreenHeight(unsigned int screenheight);
-		
+
 		/** Gets screen height (pixels)
 		 */
 		unsigned int getScreenHeight() const {
 			return m_screenheight;
 		}
-		
+
 		/** Sets path for default font
 		 */
 		void setDefaultFontPath(const std::string& defaultfontpath);
-		
+
 		/** Sets current path for default font
 		 */
 		std::string getDefaultFontPath() const {
 			return m_defaultfontpath;
 		}
-		
+
 		/** Sets size for default font
 		 */
 		void setDefaultFontSize(const unsigned int defaultfontsize);
-		
+
 		/** Gets size for default font
 		 */
 		unsigned int getDefaultFontSize() const {
 			return m_defaultfontsize;
 		}
-		
+
 		/** Sets glyphs for default font
 		 */
 		void setDefaultFontGlyphs(const std::string& defaultfontglyphs);
-		
+
 		/** Gets current glyphs for default font
 		 */
 		std::string getDefaultFontGlyphs() const {
 			return m_defaultfontglyphs;
 		}
-	
-		/** Sets image chunking size, @see RenderBackend::setChunkingSize
-		 */
-		void setImageChunkingSize(unsigned int size) {
-			m_image_chunking_size = size;
-		}
-	
-		/** @see setImageChunkingSize
-		 */
-		unsigned int getImageChunkingSize() const {
-			return m_image_chunking_size;
-		}
 
 		/** Sets the title of the window
 		 */
@@ -195,7 +183,7 @@
 		std::string getWindowTitle() const {
 			return m_windowtitle;
 		}
-	
+
 		/** Sets the icon that appears in the window title bar
 		 */
 		void setWindowIcon(const std::string& icon);
@@ -221,7 +209,7 @@
 		/** Gets the global colorkey setting
 		 */
 		const SDL_Color& getColorKey() const;
-		
+
 	private:
 		unsigned int m_bitsperpixel;
 		bool m_fullscreen;
@@ -232,12 +220,11 @@
 		unsigned int m_screenheight;
 		std::string m_windowtitle;
 		std::string m_windowicon;
-		
-		
+
+
 		std::string m_defaultfontpath;
 		unsigned int m_defaultfontsize;
 		std::string m_defaultfontglyphs;
-		unsigned int m_image_chunking_size;
 		bool m_iscolorkeyenabled;
 		SDL_Color m_colorkey;
 	};
--- a/engine/core/model/metamodel/grids/hexgrid.cpp	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/model/metamodel/grids/hexgrid.cpp	Fri Oct 01 14:09:47 2010 +0000
@@ -38,8 +38,8 @@
 
 	static const double HEX_WIDTH = 1;
 	static const double HEX_TO_EDGE = HEX_WIDTH / 2;
-	static const double HEX_TO_CORNER = 0.5 / cos(M_PI / 6);
-	static const double HEX_EDGE_HALF = HEX_TO_CORNER * sin(M_PI / 6);
+	static const double HEX_TO_CORNER = 0.5 / cos(DBL_PI / 6);
+	static const double HEX_EDGE_HALF = HEX_TO_CORNER * sin(DBL_PI / 6);
 	static const double VERTICAL_MULTIP = sqrt(HEX_WIDTH*HEX_WIDTH - HEX_TO_EDGE*HEX_TO_EDGE);
 	static const double VERTICAL_MULTIP_INV = 1 / VERTICAL_MULTIP;
 
@@ -138,7 +138,7 @@
 		static std::string type("hexagonal");
 		return type;
 	}
-	
+
 	const std::string& HexGrid::getName() const {
 		static std::string hexGrid("Hex Grid");
 		return hexGrid;
@@ -185,32 +185,32 @@
 		FL_DBG(_log, LMsg("elc=") << elc << ", lc=" << lc);
 		FL_DBG(_log, LMsg("x=") << x << ", y=" << y << ", dx=" << dx << ", dy=" << dy);
 		ModelCoordinate result;
-		
+
 		if ((y % 2) == 0) {
 			FL_DBG(_log, "In even row");
 			if ((1 - dy) < HEX_EDGE_HALF) {
 				FL_DBG(_log, "In lower rect area");
 				result = ModelCoordinate(x, y+1);
-			} 
+			}
 			else if (dy < HEX_EDGE_HALF) {
 				FL_DBG(_log, "In upper rect area");
 				if (dx > 0.5) {
 					FL_DBG(_log, "...on right");
 					result = ModelCoordinate(x+1, y);
-				} 
+				}
 				else {
 					FL_DBG(_log, "...on left");
 					result = ModelCoordinate(x, y);
 				}
-			} 
+			}
 			// in middle triangle area
 			else {
 				FL_DBG(_log, "In middle triangle area");
 				if (dx < 0.5) {
 					FL_DBG(_log, "In left triangles");
 					if (ptInTriangle(ExactModelCoordinate(dx, dy),
-					                 ExactModelCoordinate(0, VERTICAL_MULTIP * HEX_EDGE_HALF), 
-					                 ExactModelCoordinate(0, VERTICAL_MULTIP * (1-HEX_EDGE_HALF)), 
+					                 ExactModelCoordinate(0, VERTICAL_MULTIP * HEX_EDGE_HALF),
+					                 ExactModelCoordinate(0, VERTICAL_MULTIP * (1-HEX_EDGE_HALF)),
 					                 ExactModelCoordinate(0.5, VERTICAL_MULTIP * HEX_EDGE_HALF)
 					                 )) {
 						FL_DBG(_log, "..upper part");
@@ -222,8 +222,8 @@
 				} else {
 					FL_DBG(_log, "In right triangles");
 					if (ptInTriangle(ExactModelCoordinate(dx, dy),
-					                 ExactModelCoordinate(1, VERTICAL_MULTIP * HEX_EDGE_HALF), 
-					                 ExactModelCoordinate(1, VERTICAL_MULTIP * (1-HEX_EDGE_HALF)), 
+					                 ExactModelCoordinate(1, VERTICAL_MULTIP * HEX_EDGE_HALF),
+					                 ExactModelCoordinate(1, VERTICAL_MULTIP * (1-HEX_EDGE_HALF)),
 					                 ExactModelCoordinate(0.5, VERTICAL_MULTIP * HEX_EDGE_HALF)
 					                 )) {
 						FL_DBG(_log, "..upper part");
@@ -233,31 +233,31 @@
 						result = ModelCoordinate(x, y+1);
 					}
 				}
-			}		
-		} 
+			}
+		}
 		else {
 			FL_DBG(_log, "In uneven row");
 			if (dy < HEX_EDGE_HALF) {
 				FL_DBG(_log, "In upper rect area");
 				result = ModelCoordinate(x, y);
-			} 
+			}
 			else if ((1 - dy) < HEX_EDGE_HALF) {
 				FL_DBG(_log, "In lower rect area");
 				if (dx > 0.5) {
 					FL_DBG(_log, "...on right");
 					result = ModelCoordinate(x+1, y+1);
-				} 
+				}
 				else {
 					FL_DBG(_log, "...on left");
 					result = ModelCoordinate(x, y+1);
 				}
-			} 
+			}
 			else {
 				FL_DBG(_log, "In middle triangle area");
 				if (dx < 0.5) {
 					FL_DBG(_log, "In left triangles");
 					if (ptInTriangle(ExactModelCoordinate(dx, dy),
-					                 ExactModelCoordinate(0, VERTICAL_MULTIP * HEX_EDGE_HALF), 
+					                 ExactModelCoordinate(0, VERTICAL_MULTIP * HEX_EDGE_HALF),
 					                 ExactModelCoordinate(0, VERTICAL_MULTIP * (1-HEX_EDGE_HALF)),
 					                 ExactModelCoordinate(0.5, VERTICAL_MULTIP * (1-HEX_EDGE_HALF))
 					                 )) {
@@ -270,8 +270,8 @@
 				} else {
 					FL_DBG(_log, "In right triangles");
 					if (ptInTriangle(ExactModelCoordinate(dx, dy),
-					                 ExactModelCoordinate(1, VERTICAL_MULTIP * HEX_EDGE_HALF), 
-					                 ExactModelCoordinate(1, VERTICAL_MULTIP * (1-HEX_EDGE_HALF)), 
+					                 ExactModelCoordinate(1, VERTICAL_MULTIP * HEX_EDGE_HALF),
+					                 ExactModelCoordinate(1, VERTICAL_MULTIP * (1-HEX_EDGE_HALF)),
 					                 ExactModelCoordinate(0.5, VERTICAL_MULTIP * (1-HEX_EDGE_HALF))
 					                 )) {
 					        FL_DBG(_log, "..lower part");
@@ -298,29 +298,29 @@
 			FL_DBG(_log, "on uneven row");
 		}
 		double tx, ty;
-		
+
 		#define ADD_PT(_x, _y) vtx.push_back(ExactModelCoordinate(_x, _y));
 		// FL_DBG(_log, LMsg("Added point ") << _x << ", " << _y)
 		ty = y - VERTICAL_MULTIP_INV * HEX_EDGE_HALF;
 		tx = x - HEX_TO_EDGE - getXZigzagOffset(ty) + horiz_shift;
 		ADD_PT(tx, ty);
-		
+
 		ty = y - VERTICAL_MULTIP_INV * HEX_TO_CORNER;
 		tx = x - getXZigzagOffset(ty) + horiz_shift;
 		ADD_PT(tx, ty);
-		
+
 		ty = y - VERTICAL_MULTIP_INV * HEX_EDGE_HALF;
 		tx = x + HEX_TO_EDGE - getXZigzagOffset(ty) + horiz_shift;
 		ADD_PT(tx, ty);
-		
+
 		ty = y + VERTICAL_MULTIP_INV * HEX_EDGE_HALF;
 		tx = x + HEX_TO_EDGE - getXZigzagOffset(ty) + horiz_shift;
 		ADD_PT(tx, ty);
-		
+
 		ty = y + VERTICAL_MULTIP_INV * HEX_TO_CORNER;
 		tx = x - getXZigzagOffset(ty) + horiz_shift;
 		ADD_PT(tx, ty);
-		
+
 		ty = y + VERTICAL_MULTIP_INV * HEX_EDGE_HALF;
 		tx = x - HEX_TO_EDGE - getXZigzagOffset(ty) + horiz_shift;
 		ADD_PT(tx, ty);
--- a/engine/core/util/base/fife_stdint.h	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/util/base/fife_stdint.h	Fri Oct 01 14:09:47 2010 +0000
@@ -41,7 +41,6 @@
 #endif
 
 // 3rd party library includes
-#include <SDL.h>
 
 // FIFE includes
 // These includes are split up in two parts, separated by one empty line
--- a/engine/core/util/math/angles.h	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/util/math/angles.h	Fri Oct 01 14:09:47 2010 +0000
@@ -52,7 +52,7 @@
 		double dy = (c2.y - c1.y);
 		double dx = (c2.x - c1.x);
 
-		int angle = static_cast<int>(atan2(-dy,dx)*(180.0/M_PI));
+		int angle = static_cast<int>(atan2(-dy,dx)*(180.0/DBL_PI));
 
 		return angle;
 	}
--- a/engine/core/util/math/fife_math.h	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/util/math/fife_math.h	Fri Oct 01 14:09:47 2010 +0000
@@ -1,6 +1,6 @@
 /***************************************************************************
- *   Copyright (C) 2005-2008 by the FIFE team                              *
- *   http://www.fifengine.de                                               *
+ *   Copyright (C) 2005-2010 by the FIFE team                              *
+ *   http://www.fifengine.net                                               *
  *   This file is part of FIFE.                                            *
  *                                                                         *
  *   FIFE is free software; you can redistribute it and/or                 *
@@ -47,10 +47,31 @@
 
 #endif
 
-#ifndef M_PI
-#define M_PI        3.14159265358979323846
+static const float FLT_ZERO_TOLERANCE = 1e-06f;
+static const float FLT_PI = 4.0f*std::atan(1.0f);
+static const float FLT_TWO_PI = 2.0f*FLT_PI;
+static const float FLT_HALF_PI = 0.5f*FLT_PI;
+static const float FLT_INVERSE_PI = 1.0f/FLT_PI;
+static const float FLT_INVERSE_TWO_PI = 1.0f/FLT_TWO_PI;
+static const float FLT_DEG_TO_RAD = FLT_PI/180.0f;
+static const float FLT_RAD_TO_DEG = 180.0f/FLT_PI;
+static const float FLT_LOG_2 = std::log(2.0f);
+static const float FLT_LOG_10 = std::log(10.0f);
+static const float FLT_INV_LOG_2 = 1.0f/std::log(2.0f);
+static const float FLT_INV_LOG_10 = 1.0f/std::log(10.0f);
 
-#endif
+static const double DBL_ZERO_TOLERANCE = 1e-08;
+static const double DBL_PI = 4.0*std::atan(1.0f);
+static const double DBL_TWO_PI = 2.0*DBL_PI;
+static const double DBL_HALF_PI = 0.5*DBL_PI;
+static const double DBL_INVERSE_PI = 1.0/DBL_PI;
+static const double DBL_INVERSE_TWO_PI = 1.0/DBL_TWO_PI;
+static const double DBL_DEG_TO_RAD = DBL_PI/180.0;
+static const double DBL_RAD_TO_DEG = 180.0/DBL_PI;
+static const double DBL_LOG_2 = std::log(2.0f);
+static const double DBL_LOG_10 = std::log(10.0f);
+static const double DBL_INV_LOG_2 = 1.0/std::log(2.0f);
+static const double DBL_INV_LOG_10 = 1.0/std::log(10.0f);
 
 inline unsigned nextPow2(unsigned x)
 {
--- a/engine/core/util/math/matrix.h	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/util/math/matrix.h	Fri Oct 01 14:09:47 2010 +0000
@@ -118,8 +118,8 @@
 					y/=mag;
 					z/=mag;
 				}
-				T c = cos(angle*M_PI/180);
-				T s = sin(angle*M_PI/180);
+				T c = cos(angle*DBL_PI/180);
+				T s = sin(angle*DBL_PI/180);
 				m0 = x*x*(1-c)+c;
 				m1 = y*x*(1-c)+z*s;
 				m2 = z*x*(1-c)-y*s;
@@ -379,7 +379,7 @@
 	 */
 	template<typename T>
 	std::ostream& operator<<(std::ostream& os, const Matrix<T>& m) {
-		
+
 		return os << "\n|" << m[0] << "," << m[4] << "," << m[8] << ","  << m[12] << "|\n" << \
 		               "|" << m[1] << "," << m[5] << "," << m[9] << ","  << m[13] << "|\n" << \
 		               "|" << m[2] << "," << m[6] << "," << m[10] << "," << m[14] << "|\n" << \
--- a/engine/core/video/renderbackend.cpp	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/video/renderbackend.cpp	Fri Oct 01 14:09:47 2010 +0000
@@ -30,14 +30,11 @@
 #include "renderbackend.h"
 
 namespace FIFE {
-	
-	const unsigned int DEFAULT_CHUNKING_SIZE = 256;
-	const unsigned int MAX_CHUNKING_SIZE = 262144;  // pixels!
-	
-	RenderBackend::RenderBackend(const SDL_Color& colorkey): 
-		m_screen(NULL), 
-		m_isalphaoptimized(false), 
-		m_chunkingsize(DEFAULT_CHUNKING_SIZE),
+
+
+	RenderBackend::RenderBackend(const SDL_Color& colorkey):
+		m_screen(NULL),
+		m_isalphaoptimized(false),
 		m_iscolorkeyenabled(false),
 		m_colorkey(colorkey) {
 	}
@@ -55,77 +52,63 @@
 	void RenderBackend::captureScreen(const std::string& filename) {
 		m_screen->saveImage(filename);
 	}
-	
+
 	void RenderBackend::pushClipArea(const Rect& cliparea, bool clear) {
 		assert(m_screen);
 		m_screen->pushClipArea(cliparea, clear);
         }
-	
+
 	void RenderBackend::popClipArea() {
 		assert(m_screen);
 		m_screen->popClipArea();
 	}
-	
+
 	const Rect& RenderBackend::getClipArea() const {
 		assert(m_screen);
 		return m_screen->getClipArea();
 	}
-	
+
 	SDL_Surface* RenderBackend::getSurface() {
 		assert(m_screen);
 		return m_screen->getSurface();
 	}
-	
+
 	unsigned int RenderBackend::getWidth() const {
 		assert(m_screen);
 		return m_screen->getWidth();
 	}
-	
+
 	unsigned int RenderBackend::getHeight() const {
 		assert(m_screen);
 		return m_screen->getHeight();
 	}
-	
+
 	const Rect& RenderBackend::getArea() {
 		assert(m_screen);
 		SDL_Surface* s = m_screen->getSurface();
 		static Rect r(0, 0, s->w, s->h);
 		return r;
 	}
-	
+
 	void RenderBackend::getPixelRGBA(int x, int y, uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a) {
 		assert(m_screen);
 		m_screen->getPixelRGBA(x, y, r, g, b, a);
 	}
-	
+
 	void RenderBackend::saveImage(const std::string& filename) {
 		assert(m_screen);
 		m_screen->saveImage(filename);
 	}
-	
+
 	void RenderBackend::setAlphaOptimizerEnabled(bool enabled) {
 		assert(m_screen);
 		m_screen->setAlphaOptimizerEnabled(enabled);
 	}
-	
+
 	bool RenderBackend::isAlphaOptimizerEnabled() {
 		assert(m_screen);
 		return m_screen->isAlphaOptimizerEnabled();
 	}
-	
-	void RenderBackend::setChunkingSize(unsigned int size) {
-		if (size > MAX_CHUNKING_SIZE) {
-			size = MAX_CHUNKING_SIZE;
-		}
-		m_chunkingsize = 1;
-		while (m_chunkingsize < size) {
-			m_chunkingsize <<= 1;
-		}
-	}
-	
-	unsigned int RenderBackend::getChunkingSize() {
-		return m_chunkingsize;
-	}
 
 	void RenderBackend::setColorKeyEnabled(bool colorkeyenable) {
 		m_iscolorkeyenabled = colorkeyenable;
--- a/engine/core/video/renderbackend.h	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/video/renderbackend.h	Fri Oct 01 14:09:47 2010 +0000
@@ -53,7 +53,7 @@
 		 * @param name The name of the new renderbackend.
 		 */
 		RenderBackend(const SDL_Color& colorkey);
-		
+
 		/** Destructor.
 		 */
 		virtual ~RenderBackend();
@@ -95,7 +95,7 @@
 		 * @return The new Image.
 		 */
 		virtual Image* createImage(const uint8_t* data, unsigned int width, unsigned int height) = 0;
-		
+
 		/** Helper function to create images from SDL_Surfaces.
 		 * Takes ownership over the surface.
 		 * @param surface The surface to convert.
@@ -104,7 +104,7 @@
 		virtual Image* createImage(SDL_Surface* surface) = 0;
 
 		virtual void isClearNeeded(bool clear) = 0;
-		
+
 		/** Returns a pointer to the main screen Image
 		 * @return A pointer to the main screen Image, or 0 if no mainscreen exists.
 		 */
@@ -113,7 +113,7 @@
 		/** Creates a Screenshot and saves it to a file.
 		 */
 		void captureScreen(const std::string& filename);
-		
+
 		SDL_Surface* getSurface();
 		unsigned int getWidth() const;
 		unsigned int getHeight() const;
@@ -128,14 +128,6 @@
 		bool isAlphaOptimizerEnabled();
 		void saveImage(const std::string& filename);
 
-		/** OpenGL image needs to be sliced into power of two sized chunks. 
-		 * You can adjust the size by calling this method.
-		 * Size can be anything (reasonable), it is always changed to the next biggest power of two value
-		 * @example values 50 -> 64, 340 -> 512
-		 */
-		void setChunkingSize(unsigned int size);
-		unsigned int getChunkingSize();
-
 		/** Sets whether to use the colorkey feature
 		*/
 		void setColorKeyEnabled(bool colorkeyenable);
@@ -145,11 +137,11 @@
 		bool isColorKeyEnabled() const;
 
 		/** Sets the global colorkey to use for images
-		 */ 
+		 */
 		void setColorKey(const SDL_Color& colorkey);
 
 		/** Gets the global colorkey setting
-		 */ 
+		 */
 		const SDL_Color& getColorKey() const;
 
 	protected:
--- a/engine/core/view/camera.cpp	Thu Sep 30 21:24:55 2010 +0000
+++ b/engine/core/view/camera.cpp	Fri Oct 01 14:09:47 2010 +0000
@@ -327,7 +327,7 @@
 
 	void Camera::calculateZValue(ScreenPoint& screen_coords) {
 		int dy = -(screen_coords.y - toScreenCoordinates(m_location.getMapCoordinates()).y);
-		screen_coords.z = static_cast<int>(tan(m_tilt * (M_PI / 180.0)) * static_cast<double>(dy));
+		screen_coords.z = static_cast<int>(tan(m_tilt * (DBL_PI / 180.0)) * static_cast<double>(dy));
 	}
 
 	ExactModelCoordinate Camera::toMapCoordinates(ScreenPoint screen_coords, bool z_calculated) {