ソースを参照

Converted all space indentation to tabs.

Ivan Safrin 9 年 前
コミット
f80bb40afd
100 ファイル変更4275 行追加4275 行削除
  1. 1 1
      include/Polycode.h
  2. 1 1
      include/polycode/bindings/javascript/PolycodeJSWrappers.h
  3. 24 24
      include/polycode/core/PolyBasicFileProvider.h
  4. 40 40
      include/polycode/core/PolyBezierCurve.h
  5. 13 13
      include/polycode/core/PolyBone.h
  6. 110 110
      include/polycode/core/PolyCamera.h
  7. 20 20
      include/polycode/core/PolyCocoaCore.h
  8. 1 1
      include/polycode/core/PolyColor.h
  9. 92 92
      include/polycode/core/PolyCore.h
  10. 49 49
      include/polycode/core/PolyCoreFileProvider.h
  11. 18 18
      include/polycode/core/PolyCoreInput.h
  12. 14 14
      include/polycode/core/PolyCoreServices.h
  13. 1 1
      include/polycode/core/PolyCubemap.h
  14. 1 1
      include/polycode/core/PolyEmscriptenCore.h
  15. 285 285
      include/polycode/core/PolyEntity.h
  16. 8 8
      include/polycode/core/PolyEvent.h
  17. 14 14
      include/polycode/core/PolyEventDispatcher.h
  18. 6 6
      include/polycode/core/PolyFontGlyphSheet.h
  19. 67 67
      include/polycode/core/PolyGPUDrawBuffer.h
  20. 18 18
      include/polycode/core/PolyGlobals.h
  21. 58 58
      include/polycode/core/PolyIOSCore.h
  22. 37 37
      include/polycode/core/PolyImage.h
  23. 3 3
      include/polycode/core/PolyInputEvent.h
  24. 2 2
      include/polycode/core/PolyInputKeys.h
  25. 114 114
      include/polycode/core/PolyLabel.h
  26. 1 1
      include/polycode/core/PolyLogger.h
  27. 20 20
      include/polycode/core/PolyMaterial.h
  28. 11 11
      include/polycode/core/PolyMaterialManager.h
  29. 133 133
      include/polycode/core/PolyMatrix4.h
  30. 159 159
      include/polycode/core/PolyMesh.h
  31. 2 2
      include/polycode/core/PolyObject.h
  32. 59 59
      include/polycode/core/PolyOpenGLGraphicsInterface.h
  33. 19 19
      include/polycode/core/PolyPAAudioInterface.h
  34. 151 151
      include/polycode/core/PolyParticleEmitter.h
  35. 2 2
      include/polycode/core/PolyPeer.h
  36. 21 21
      include/polycode/core/PolyPerlin.h
  37. 24 24
      include/polycode/core/PolyPhysFSFileProvider.h
  38. 6 6
      include/polycode/core/PolyQuaternion.h
  39. 1 1
      include/polycode/core/PolyQuaternionCurve.h
  40. 107 107
      include/polycode/core/PolyRenderDataArray.h
  41. 207 207
      include/polycode/core/PolyRenderer.h
  42. 8 8
      include/polycode/core/PolyResource.h
  43. 127 127
      include/polycode/core/PolyResourceManager.h
  44. 1 1
      include/polycode/core/PolySDLCore.h
  45. 18 18
      include/polycode/core/PolyScene.h
  46. 38 38
      include/polycode/core/PolySceneEntityInstance.h
  47. 1 1
      include/polycode/core/PolySceneImage.h
  48. 11 11
      include/polycode/core/PolySceneLabel.h
  49. 44 44
      include/polycode/core/PolySceneLight.h
  50. 63 63
      include/polycode/core/PolySceneLine.h
  51. 10 10
      include/polycode/core/PolySceneManager.h
  52. 72 72
      include/polycode/core/PolySceneMesh.h
  53. 64 64
      include/polycode/core/PolyScenePrimitive.h
  54. 14 14
      include/polycode/core/PolySceneRenderTexture.h
  55. 11 11
      include/polycode/core/PolySceneSound.h
  56. 183 183
      include/polycode/core/PolySceneSprite.h
  57. 53 53
      include/polycode/core/PolyScript.h
  58. 4 4
      include/polycode/core/PolyServer.h
  59. 95 95
      include/polycode/core/PolyShader.h
  60. 40 40
      include/polycode/core/PolySkeleton.h
  61. 13 13
      include/polycode/core/PolySocket.h
  62. 52 52
      include/polycode/core/PolySound.h
  63. 41 41
      include/polycode/core/PolySoundManager.h
  64. 7 7
      include/polycode/core/PolyString.h
  65. 31 31
      include/polycode/core/PolyTexture.h
  66. 3 3
      include/polycode/core/PolyTween.h
  67. 1 1
      include/polycode/core/PolyTweenManager.h
  68. 8 8
      include/polycode/core/PolyVector2.h
  69. 5 5
      include/polycode/core/PolyVector3.h
  70. 13 13
      include/polycode/core/PolyVector4.h
  71. 4 4
      include/polycode/core/PolyWinCore.h
  72. 8 8
      include/polycode/core/PolyXAudio2AudioInterface.h
  73. 47 47
      include/polycode/ide/EditorGrid.h
  74. 32 32
      include/polycode/ide/EntityEditorPropertyView.h
  75. 9 9
      include/polycode/ide/EntityEditorSettingsView.h
  76. 31 31
      include/polycode/ide/EntityEditorTreeView.h
  77. 2 2
      include/polycode/ide/NewFileWindow.h
  78. 2 2
      include/polycode/ide/NewProjectWindow.h
  79. 2 2
      include/polycode/ide/PolycodeClipboard.h
  80. 12 12
      include/polycode/ide/PolycodeConsole.h
  81. 7 7
      include/polycode/ide/PolycodeEditor.h
  82. 290 290
      include/polycode/ide/PolycodeEntityEditor.h
  83. 10 10
      include/polycode/ide/PolycodeFrame.h
  84. 2 2
      include/polycode/ide/PolycodeIDEApp.h
  85. 1 1
      include/polycode/ide/PolycodeImageEditor.h
  86. 22 22
      include/polycode/ide/PolycodeMaterialEditor.h
  87. 2 2
      include/polycode/ide/PolycodeMeshEditor.h
  88. 4 4
      include/polycode/ide/PolycodeProject.h
  89. 3 3
      include/polycode/ide/PolycodeProjectBrowser.h
  90. 1 1
      include/polycode/ide/PolycodeProjectEditor.h
  91. 331 331
      include/polycode/ide/PolycodeProps.h
  92. 5 5
      include/polycode/ide/PolycodeRemoteDebugger.h
  93. 299 299
      include/polycode/ide/PolycodeSpriteEditor.h
  94. 22 22
      include/polycode/ide/TextureBrowser.h
  95. 37 37
      include/polycode/ide/ToolWindows.h
  96. 11 11
      include/polycode/ide/TrackballCamera.h
  97. 116 116
      include/polycode/ide/TransformGizmo.h
  98. 9 9
      include/polycode/modules/TUIO/TuioClient.h
  99. 1 1
      include/polycode/modules/TUIO/TuioContainer.h
  100. 2 2
      include/polycode/modules/TUIO/TuioCursor.h

+ 1 - 1
include/Polycode.h

@@ -91,7 +91,7 @@
 
 #if defined(__APPLE__) && defined(__MACH__)
 	#include <TargetConditionals.h>
-    #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
+	#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
 		#include "polycode/core/PolyIOSCore.h"
  	#endif
 #else

+ 1 - 1
include/polycode/bindings/javascript/PolycodeJSWrappers.h

@@ -2,7 +2,7 @@
 
 extern "C" {
 	#include <stdio.h>
- 	#include "duktape.h"
+	#include "duktape.h"
 } 
 
 #include "polycode/core/PolyBasicFileProvider.h"

+ 24 - 24
include/polycode/core/PolyBasicFileProvider.h

@@ -25,28 +25,28 @@
 #include "polycode/core/PolyCoreFileProvider.h"
 
 namespace Polycode {
-    
-    class _PolyExport BasicFile : public CoreFile {
-    public:
-        
-        long read( void * ptr, size_t size, size_t count);
-        long write( const void * ptr, size_t size, size_t count);
-        int seek(long int offset, int origin);
-        long tell();
-        
-        FILE *file;
-    };
-    
-    class _PolyExport BasicFileProvider : public CoreFileProvider {
-        public:
-            BasicFileProvider();
-            Polycode::CoreFile *openFile(const String &fileName, const String &opts);
-            void closeFile(Polycode::CoreFile *file);
-            void addSource(const String &source);
-            void removeSource(const String &source);
-      
-            std::vector<String> sourceFolders;
-        
-    };
-    
+	
+	class _PolyExport BasicFile : public CoreFile {
+	public:
+		
+		long read( void * ptr, size_t size, size_t count);
+		long write( const void * ptr, size_t size, size_t count);
+		int seek(long int offset, int origin);
+		long tell();
+		
+		FILE *file;
+	};
+	
+	class _PolyExport BasicFileProvider : public CoreFileProvider {
+		public:
+			BasicFileProvider();
+			Polycode::CoreFile *openFile(const String &fileName, const String &opts);
+			void closeFile(Polycode::CoreFile *file);
+			void addSource(const String &source);
+			void removeSource(const String &source);
+	  
+			std::vector<String> sourceFolders;
+		
+	};
+	
 }

+ 40 - 40
include/polycode/core/PolyBezierCurve.h

@@ -156,58 +156,58 @@ namespace Polycode {
 		*/																				
 		Vector3 getPointBetween(Number a, BezierPoint *bp1, BezierPoint *bp2);
 
-        /**
-         * Removes all curve control points.
-         */
+		/**
+		 * Removes all curve control points.
+		 */
 		void clearControlPoints();
-        
-        /**
-         * Returns the Y-axis value of the curve at specified X-axis value.
-         */
-        Number getYValueAtX(Number x);
+		
+		/**
+		 * Returns the Y-axis value of the curve at specified X-axis value.
+		 */
+		Number getYValueAtX(Number x);
 
-        /**
-         * Returns the normalized curve position value at specified X-axis value.
-         */
+		/**
+		 * Returns the normalized curve position value at specified X-axis value.
+		 */
 		Number getTValueAtX(Number x);
 		
 		/**
 		* Removes (and deletes!) a given point by pointer.
 		*/
 		void removePoint(BezierPoint *point);
-        
-        void setHeightCacheResolution(Number resolution);
-        void rebuildHeightCache();
-        
-        /**
-        * The point after which new control points should be added. If NULL, new control points are added to the end of the curve.
-        */
+		
+		void setHeightCacheResolution(Number resolution);
+		void rebuildHeightCache();
+		
+		/**
+		* The point after which new control points should be added. If NULL, new control points are added to the end of the curve.
+		*/
 		BezierPoint *insertPoint;
 		
-        /**
-         * Accuracy value for X-axis curve evaluation. The higher this number, the faster but less accurate X-axis curve evaluation is.
-            Defaults to 0.01
-         */
-        Number evaluationAccuracy;
-        
-        void recalculateDistances();
-        
-        static bool cacheHeightValues;
-        static unsigned int defaultHeightCacheResolution;
+		/**
+		 * Accuracy value for X-axis curve evaluation. The higher this number, the faster but less accurate X-axis curve evaluation is.
+			Defaults to 0.01
+		 */
+		Number evaluationAccuracy;
+		
+		void recalculateDistances();
+		
+		static bool cacheHeightValues;
+		static unsigned int defaultHeightCacheResolution;
 		
 		protected:
-        
-            unsigned int heightCacheResolution;
-            std::vector<BezierPoint*> controlPoints;
-            std::vector<Number> distances;
-        
-            std::vector<Number> heightCache;
-		
-            Number minX;
-            Number maxX;
-            Number midX;
-        
-            bool distancesDirty;
+		
+			unsigned int heightCacheResolution;
+			std::vector<BezierPoint*> controlPoints;
+			std::vector<Number> distances;
+		
+			std::vector<Number> heightCache;
+		
+			Number minX;
+			Number maxX;
+			Number midX;
+		
+			bool distancesDirty;
 			
 	};
 

+ 13 - 13
include/polycode/core/PolyBone.h

@@ -138,12 +138,12 @@ namespace Polycode {
 			* @return Full base matrix.
 			*/						
 			Matrix4 getFullBaseMatrix() const;
-        
-            void rebuildFinalMatrix();
-            Matrix4 buildFinalMatrix() const;
-        
-        
-            void intializeBone(const Vector3 &basePosition, const Vector3 &baseScale, const Quaternion &baseRotation, const Vector3 &restPosition, const Vector3 &restScale, const Quaternion &restRotation);
+		
+			void rebuildFinalMatrix();
+			Matrix4 buildFinalMatrix() const;
+		
+		
+			void intializeBone(const Vector3 &basePosition, const Vector3 &baseScale, const Quaternion &baseRotation, const Vector3 &restPosition, const Vector3 &restScale, const Quaternion &restRotation);
 		
 			/**
 			* Id of the bone.
@@ -153,14 +153,14 @@ namespace Polycode {
 			Matrix4 boneMatrix;
 			Matrix4 restMatrix;
 			Matrix4 baseMatrix;
-            Matrix4 finalMatrix;
+			Matrix4 finalMatrix;
+		
+			Quaternion baseRotation;
+			Vector3 baseScale;
+			Vector3 basePosition;
+		
+			bool disableAnimation;
 		
-            Quaternion baseRotation;
-            Vector3 baseScale;
-            Vector3 basePosition;
-        
-            bool disableAnimation;
-        
 		protected:
 			Bone* parentBone;
 			std::vector<Bone*> childBones;

+ 110 - 110
include/polycode/core/PolyCamera.h

@@ -33,7 +33,7 @@ namespace Polycode {
 	class Material;
 	class ShaderBinding;
 	class Texture;
-    class GPUDrawCall;
+	class GPUDrawCall;
 
 	/**
 	* Camera in a 3D scene. Cameras can be added to a scene and changed between dynamically. You can also set a shader to a camera that will run as a screen shader for post-processing effects.
@@ -58,10 +58,10 @@ namespace Polycode {
 
 			/** ProjectionMode: Perspective projection, with bounds set by edges of frustum. */
 			static const int PERSPECTIVE_FRUSTUM = 5;
-        
-            /** ProjectionMode: Manual matrix projection. Use setProjectionMatrix to set the matrix. */
-            static const int MANUAL_MATRIX = 6;
-        
+		
+			/** ProjectionMode: Manual matrix projection. Use setProjectionMatrix to set the matrix. */
+			static const int MANUAL_MATRIX = 6;
+		
 
 			/**
 			* Constructor.
@@ -70,9 +70,9 @@ namespace Polycode {
 			explicit Camera(Scene *parentScene);
 			virtual ~Camera();
 			
-            /**
-             * Builds the frustum clipping planes for this camera using the current render modelview and the camera's projection matrices.
-             */
+			/**
+			 * Builds the frustum clipping planes for this camera using the current render modelview and the camera's projection matrices.
+			 */
 			void buildFrustumPlanes();
 			
 			/**
@@ -83,13 +83,13 @@ namespace Polycode {
 			* @see canSee()
 			*/								
 			bool isSphereInFrustum(const Vector3 &pos, Number fRadius);
-        
-            /**
-             * Checks if an Axis-aligned bounding box is visible to the camera.
-             * @param aabb An axis-aligned bounding box
-             * @return Returns true if the AABB is within the camera's frustum, false if it isn't.
-             */
-            bool isAABBInFrustum(const AABB &aabb);
+		
+			/**
+			 * Checks if an Axis-aligned bounding box is visible to the camera.
+			 * @param aabb An axis-aligned bounding box
+			 * @return Returns true if the AABB is within the camera's frustum, false if it isn't.
+			 */
+			bool isAABBInFrustum(const AABB &aabb);
 			
 			/**
 			* Toggles orthographic projection mode for camera.
@@ -99,11 +99,11 @@ namespace Polycode {
 			*/			
 			void setOrthoMode(bool mode);
 
-            /**
-             * Sets the orthographic size of the camera.
-             * @param orthoSizeX Orthographic width
-             * @param orthoSizeY Orthographic height
-             */
+			/**
+			 * Sets the orthographic size of the camera.
+			 * @param orthoSizeX Orthographic width
+			 * @param orthoSizeY Orthographic height
+			 */
 			void setOrthoSize(Number orthoSizeX, Number orthoSizeY);
 			
 			/** Switches into frustum mode and sets up the planes. */
@@ -146,49 +146,49 @@ namespace Polycode {
 				return fov;
 			}
 			
-            /**
-             * Sets the clipping planes for the camera.
-             * @param nearClipPlane Near clipping plane.
-             * @param farClipPlane Far clipping plane.
-             */
+			/**
+			 * Sets the clipping planes for the camera.
+			 * @param nearClipPlane Near clipping plane.
+			 * @param farClipPlane Far clipping plane.
+			 */
 			void setClippingPlanes(Number nearClipPlane, Number farClipPlane);
-        
-            /**
-             * Returns the near clipping plane of the camera.
-             * @return Near clipping plane of the camera.
-             */
+		
+			/**
+			 * Returns the near clipping plane of the camera.
+			 * @return Near clipping plane of the camera.
+			 */
 			Number getNearClippingPlane();
-        
-            /**
-             * Returns the far clipping plane of the camera.
-             * @return Far clipping plane of the camera.
-             */
+		
+			/**
+			 * Returns the far clipping plane of the camera.
+			 * @return Far clipping plane of the camera.
+			 */
 			Number getFarClippingPlane();
-        
-            /**
-             * Sets the parent scene of the camera.
-             * @param parentScene New parent scene.
-             */
+		
+			/**
+			 * Sets the parent scene of the camera.
+			 * @param parentScene New parent scene.
+			 */
 			void setParentScene(Scene *parentScene);
-        
-            /**
-             * Returns the camera's parent scene.
-             * @return The camera's parent scene.
-             */
-            Scene *getParentScene() const;
+		
+			/**
+			 * Returns the camera's parent scene.
+			 * @return The camera's parent scene.
+			 */
+			Scene *getParentScene() const;
 			
 
-            Matrix4 createProjectionMatrix();
+			Matrix4 createProjectionMatrix();
 
-            /**
-             * Check if camera has a post filter material applied
-             * @return True if the camera has a filter material applied.
-             */
+			/**
+			 * Check if camera has a post filter material applied
+			 * @return True if the camera has a filter material applied.
+			 */
 			bool hasFilterShader();
-        
-            /**
-             * Binds target buffers and renders the scene in multiple passes based on the post filter material.
-             */
+		
+			/**
+			 * Binds target buffers and renders the scene in multiple passes based on the post filter material.
+			 */
 			void drawFilter(RenderBuffer *targetBuffer);
 
 			/**
@@ -213,90 +213,90 @@ namespace Polycode {
 			*/			
 			Material *getScreenShaderMaterial() { return filterShaderMaterial; }	
 
-            /**
-             * Clones the camera.
-             */
-            virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
+			/**
+			 * Clones the camera.
+			 */
+			virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
 
-            /**
-             * Applies clone parameters to the camera.
-             */
-            virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
+			/**
+			 * Applies clone parameters to the camera.
+			 */
+			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
 			
-            /**
-             * Returns the camera's projection matrix.
-             * @return Projection matrix.
-             */
+			/**
+			 * Returns the camera's projection matrix.
+			 * @return Projection matrix.
+			 */
 			Matrix4 getProjectionMatrix();
-        
-            /**
-             * Manually sets the camera's projection matrix. Projection mode must be set to MANUAL_MATRIX.
-             * @param matrix Custom projection matrix.
-             * @see setProjectionMode
-             */
-            void setCustomProjectionMatrix(Matrix4 matrix);
+		
+			/**
+			 * Manually sets the camera's projection matrix. Projection mode must be set to MANUAL_MATRIX.
+			 * @param matrix Custom projection matrix.
+			 * @see setProjectionMode
+			 */
+			void setCustomProjectionMatrix(Matrix4 matrix);
 			
-            /**
-             * Return's the camera's pixel viewport based on the last render pass.
-             */
+			/**
+			 * Return's the camera's pixel viewport based on the last render pass.
+			 */
 			Polycode::Rectangle getViewport();
 
 			void setViewport(const Polycode::Rectangle &viewport);
-        
+		
 			/**
 			* Toggles the frustum culling of the camera. (Defaults to true).
 			*/
 			bool frustumCulling;
 			
-            /**
-             * If set to true, the orthographic projection will be set with the 0,0 coordinate in the top left corner of the viewport. Otherwise, the 0,0 coordinate is in the center.
-             */ 
+			/**
+			 * If set to true, the orthographic projection will be set with the 0,0 coordinate in the top left corner of the viewport. Otherwise, the 0,0 coordinate is in the center.
+			 */ 
 			bool topLeftOrtho;
 		
-            /**
-            * Shifts camera frustum by factor of the frustum size. (x=-1 will shift the frustum to the left by a whole screen width).
-            */
+			/**
+			* Shifts camera frustum by factor of the frustum size. (x=-1 will shift the frustum to the left by a whole screen width).
+			*/
 			Vector2 cameraShift;
-		      
+			  
 			/** @deprecated use setProjectionMode(ProjectionMode mode) */
 			void setOrthoSizeMode(int orthoSizeMode) { setProjectionMode(orthoSizeMode); }
 			/** @deprecated use getProjectionMode() */
 			int getOrthoSizeMode() const { return projectionMode; }
 
-            /**
-             * Sets the projection mode of the camera. Possible values are ORTHO_SIZE_MANUAL, ORTHO_SIZE_LOCK_HEIGHT,ORTHO_SIZE_LOCK_WIDTH, ORTHO_SIZE_LOCK_WIDTH, PERSPECTIVE_FOV, PERSPECTIVE_FRUSTUM and MANUAL_MATRIX.
-                See the documentation of each individual mode for details.
-             * @param mode New projection mode.
-             */
+			/**
+			 * Sets the projection mode of the camera. Possible values are ORTHO_SIZE_MANUAL, ORTHO_SIZE_LOCK_HEIGHT,ORTHO_SIZE_LOCK_WIDTH, ORTHO_SIZE_LOCK_WIDTH, PERSPECTIVE_FOV, PERSPECTIVE_FRUSTUM and MANUAL_MATRIX.
+				See the documentation of each individual mode for details.
+			 * @param mode New projection mode.
+			 */
 			void setProjectionMode(int mode);
-        
-            /**
-             * Returns the current projection mode.
-             * @return Current projection mode.
-             */
+		
+			/**
+			 * Returns the current projection mode.
+			 * @return Current projection mode.
+			 */
 			int getProjectionMode() const { return projectionMode; }
 
-            Vector3 projectRayFrom2DCoordinate(const Vector2 &coordinate, const Polycode::Rectangle &viewport);
+			Vector3 projectRayFrom2DCoordinate(const Vector2 &coordinate, const Polycode::Rectangle &viewport);
 
-            void renderFullScreenQuad(GPUDrawBuffer *drawBuffer, int shaderPass);
-        
-            ShaderPass getShaderPass(unsigned int index);
-            unsigned int getNumShaderPasses();        
-        
+			void renderFullScreenQuad(GPUDrawBuffer *drawBuffer, int shaderPass);
+		
+			ShaderPass getShaderPass(unsigned int index);
+			unsigned int getNumShaderPasses();		  
+		
 		protected:
-        
-            Mesh *screenQuadMesh;
+		
+			Mesh *screenQuadMesh;
 
-            void setOrthoMatrix(Matrix4 &matrix, Number xSize, Number ySize, Number _near, Number _far, bool centered);
-        
-			int projectionMode;        
+			void setOrthoMatrix(Matrix4 &matrix, Number xSize, Number ySize, Number _near, Number _far, bool centered);
+		
+			int projectionMode;		   
 			Matrix4 projectionMatrix;
 
 			Polycode::Rectangle viewport;
 			Number orthoSizeX;
 			Number orthoSizeY;
-        
-            std::vector<ShaderPass> shaderPasses;
+		
+			std::vector<ShaderPass> shaderPasses;
 
 			Number nearClipPlane;
 			Number farClipPlane;
@@ -309,8 +309,8 @@ namespace Polycode {
 			Scene *parentScene;
 
 			Material *filterShaderMaterial;			
-            RenderBuffer *originalFramebuffer;
-        
+			RenderBuffer *originalFramebuffer;
+		
 			bool _hasFilterShader;
 	};	
 }

+ 20 - 20
include/polycode/core/PolyCocoaCore.h

@@ -48,8 +48,8 @@ namespace Polycode {
 	
 	class _PolyExport PosixMutex : public CoreMutex {
 	public:
-        void lock();
-        void unlock();
+		void lock();
+		void unlock();
 		pthread_mutex_t pMutex;
 	};
 	
@@ -61,9 +61,9 @@ namespace Polycode {
 		int mouseX;
 		int mouseY;
 		
-        std::vector<TouchInfo> touches;
-        TouchInfo touch;
-        
+		std::vector<TouchInfo> touches;
+		TouchInfo touch;
+		
 		PolyKEY keyCode;
 		wchar_t unicodeChar;
 		
@@ -94,7 +94,7 @@ namespace Polycode {
 		public:
 			GamepadDeviceEntry() {
 				numAxes = 0;
-                numButtons = 0;
+				numButtons = 0;
 			}
 			vector<HIDGamepadAxis> axisElements;
 			vector<HIDGamepadButton> buttonElements;			
@@ -111,8 +111,8 @@ namespace Polycode {
 		CocoaCore(PolycodeView *view, int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate, int monitorIndex=-1, bool retinaSupport=false);
 		virtual ~CocoaCore();
 		
-        bool createRenderContext();
-        
+		bool createRenderContext();
+		
 		void enableMouse(bool newval);
 		unsigned int getTicks();
 		bool systemUpdate();
@@ -127,14 +127,14 @@ namespace Polycode {
 		void removeDiskItem(const String& itemPath);
 		String openFolderPicker();
 		vector<String> openFilePicker(vector<CoreFileExtension> extensions, bool allowMultiple);
-        String saveFilePicker(std::vector<CoreFileExtension> extensions);
+		String saveFilePicker(std::vector<CoreFileExtension> extensions);
 		
 		String executeExternalCommand(String command, String args, String inDirectory="");
 		
-        void setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, bool retinaSupport=true);
+		void setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, bool retinaSupport=true);
 
-        bool systemParseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector);
-        
+		bool systemParseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector);
+		
 		void launchApplicationWithFile(String application, String file);
 		void openFileWithApplication(String file, String application);
 		
@@ -167,18 +167,18 @@ namespace Polycode {
 		
 		bool checkSpecialKeyEvents(PolyKEY key);		
 
-        Number getBackingXRes();
-        Number getBackingYRes();
-        
-        void handleVideoModeChange(VideoModeChangeInfo *modeInfo);
-        void flushRenderContext();
-        
+		Number getBackingXRes();
+		Number getBackingYRes();
+		
+		void handleVideoModeChange(VideoModeChangeInfo *modeInfo);
+		void flushRenderContext();
+		
 	protected:
 	
 		PolycodeView *glView;
 		uint64_t initTime;
-        bool retinaSupport;
-        
+		bool retinaSupport;
+		
 		IOHIDManagerRef hidManager;
 	};
 }

+ 1 - 1
include/polycode/core/PolyColor.h

@@ -153,7 +153,7 @@ namespace Polycode {
 			void setColorHexFromString(String hex);
 			
 			/** 
-			* Sets the color using a 24-bit RGB integer color value  from a string
+			* Sets the color using a 24-bit RGB integer color value	 from a string
 			* @param hex String with hex RGB color values.
 			*/						
 			void setColorHexRGBFromString(String hex);

+ 92 - 92
include/polycode/core/PolyCore.h

@@ -37,10 +37,10 @@ long getThreadID();
 namespace Polycode {
 
 	class Renderer;
-          
+		  
 	class _PolyExport CoreMutex : public PolyBase {
 	public:
-        virtual ~CoreMutex(){}
+		virtual ~CoreMutex(){}
 
 		virtual void lock() = 0;
 		virtual void unlock() = 0;
@@ -80,22 +80,22 @@ namespace Polycode {
 			int year;
 			int yearDay;
 	};
-    
-    class VideoModeChangeInfo {
-    public:
-        int xRes;
-        int yRes;
-        bool fullScreen;
-        bool vSync;
-        int aaLevel;
-        int anisotropyLevel;
-        bool retinaSupport;
-    };
-    
-    class CoreMotionEvent : public Event {
-        public:
-            Vector3 amount;
-    };
+	
+	class VideoModeChangeInfo {
+	public:
+		int xRes;
+		int yRes;
+		bool fullScreen;
+		bool vSync;
+		int aaLevel;
+		int anisotropyLevel;
+		bool retinaSupport;
+	};
+	
+	class CoreMotionEvent : public Event {
+		public:
+			Vector3 amount;
+	};
 
 	/**
 	* The main core of the framework. The core deals with system-level functions, such as window initialization and OS interaction. Each platform has its own implementation of this base class. NOTE: SOME OF THE FUNCTIONALITY IN THE CORE IS NOT FULLY IMPLEMENTED!!
@@ -116,11 +116,11 @@ namespace Polycode {
 		Core(int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate, int monitorIndex);
 		virtual ~Core();
 		
-        bool Update();
+		bool Update();
 		virtual void Render() = 0;
-        
-        bool fixedUpdate();
-        virtual bool systemUpdate() = 0;
+		
+		bool fixedUpdate();
+		virtual bool systemUpdate() = 0;
 		
 		bool updateAndRender();
 		
@@ -148,7 +148,7 @@ namespace Polycode {
 		/**
 		* Warps the cursor to a specified point in the window.
 		* @param x New cursor x position 
-		* @param y New cursor y position 		
+		* @param y New cursor y position		
 		*/
 		virtual void warpCursor(int x, int y) {}
 		
@@ -166,7 +166,7 @@ namespace Polycode {
 		void lockMutex(CoreMutex *mutex);
 		
 		/**
-		* Unlocks a mutex.  Legacy method. Use the "unlock" method of CoreMutex!
+		* Unlocks a mutex.	Legacy method. Use the "unlock" method of CoreMutex!
 		* @param mutex Mutex to lock.
 		*/		
 		void unlockMutex(CoreMutex *mutex);
@@ -239,16 +239,16 @@ namespace Polycode {
 		Number getYRes();
 
 		/**
-         * Returns actual current horizontal resolution.
-         * @return Current actual horizontal resolution.
-         */
-        virtual Number getBackingXRes() { return getXRes(); }
+		 * Returns actual current horizontal resolution.
+		 * @return Current actual horizontal resolution.
+		 */
+		virtual Number getBackingXRes() { return getXRes(); }
 
-        /**
-         * Returns actual current vertical resolution.
-         * @return Current actual horizontal resolution.
-         */
-        virtual Number getBackingYRes() { return getYRes(); }
+		/**
+		 * Returns actual current vertical resolution.
+		 * @return Current actual horizontal resolution.
+		 */
+		virtual Number getBackingYRes() { return getYRes(); }
 				
 		/**
 		* Provides the current width, height, and refresh rate of the screen.
@@ -258,9 +258,9 @@ namespace Polycode {
 		*/
 		static void getScreenInfo(int *width, int *height, int *hz);
 
-        int getScreenWidth();
-        int getScreenHeight();
-        
+		int getScreenWidth();
+		int getScreenHeight();
+		
 		/**
 		* Creates a folder on disk with the specified path.
 		* @param folderPath Path to create the folder in.
@@ -307,8 +307,8 @@ namespace Polycode {
 
 		virtual void handleVideoModeChange(VideoModeChangeInfo *modeInfo) = 0;
 		virtual void flushRenderContext() = 0;
-        virtual void prepareRenderContext() {}
-        
+		virtual void prepareRenderContext() {}
+		
 		CoreFile *openFile(const Polycode::String& fileName, const Polycode::String& opts);
 		void closeFile(CoreFile *file);
 		
@@ -318,9 +318,9 @@ namespace Polycode {
 		std::vector<OSFileEntry> parseFolder(const Polycode::String& pathString, bool showHidden);
 
 		virtual bool systemParseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector) = 0;
-        
-        virtual String getResourcePathForFile(const String &fileName);
-        
+		
+		virtual String getResourcePathForFile(const String &fileName);
+		
 		/**
 		* Sets a new video mode.
 		* @param xRes New horizontal resolution of the renderer.
@@ -365,7 +365,7 @@ namespace Polycode {
 		long getTimeSleptMs() const {
 			return timeSleptMs;
 		}
-        
+		
 		Number getFixedTimestep();
 		
 		/**
@@ -388,10 +388,10 @@ namespace Polycode {
 		static const int EVENT_CUT = EVENTBASE_CORE+6;
 		static const int EVENT_SELECT_ALL = EVENTBASE_CORE+7;
 		static const int EVENT_PASTE = EVENTBASE_CORE+8;
-        
+		
 		static const int EVENT_GYRO_ROTATION = EVENTBASE_CORE+9;
 		static const int EVENT_ACCELEROMETER_MOTION = EVENTBASE_CORE+10;
-        
+		
 		virtual String executeExternalCommand(String command, String args, String inDirectory) = 0;
 		
 		/**
@@ -434,15 +434,15 @@ namespace Polycode {
 		* Default height of the desktop screen
 		*/		
 		int defaultScreenHeight;
-        
-        Quaternion deviceAttitude;
+		
+		Quaternion deviceAttitude;
 				
 	protected:	
 	
 		virtual bool checkSpecialKeyEvents(PolyKEY key) { return false; }
-        
-        std::vector<CoreFileProvider*> fileProviders;
-        
+		
+		std::vector<CoreFileProvider*> fileProviders;
+		
 		void loseFocus();
 		void gainFocus();
 		
@@ -468,15 +468,15 @@ namespace Polycode {
 		unsigned int lastFrameTicks;
 		unsigned int lastFPSTicks;
 		unsigned int elapsed;
-        
-        double fixedElapsed;
-        double fixedTimestep;
-        double timeLeftOver;
-        double maxFixedElapsed;
+		
+		double fixedElapsed;
+		double fixedTimestep;
+		double timeLeftOver;
+		double maxFixedElapsed;
 		
 		bool mouseEnabled;
 		bool mouseCaptured;
-        int anisotropyLevel;
+		int anisotropyLevel;
 		unsigned int lastSleepFrameTicks;
 		
 		std::vector<Threaded*> threads;
@@ -484,10 +484,10 @@ namespace Polycode {
 		
 		int xRes;
 		int yRes;
-        bool vSync;
-        
-        bool coreResized;
-        
+		bool vSync;
+		
+		bool coreResized;
+		
 		int monitorIndex;
 		
 		int frames;
@@ -496,38 +496,38 @@ namespace Polycode {
 		Renderer *renderer;
 		CoreServices *services;
 	};
-    
-    class _PolyExport DummyCore : public Core {
-    public:
-        
-        DummyCore();
-        ~DummyCore();
-        
-        void Render();
-        bool systemUpdate();
-        void setCursor(int cursorType);
-        void createThread(Threaded *target);
-        CoreMutex *createMutex();
-        void copyStringToClipboard(const String& str);
-        String getClipboardString();
-        void createFolder(const String& folderPath);
-        void copyDiskItem(const String& itemPath, const String& destItemPath);
-        void moveDiskItem(const String& itemPath, const String& destItemPath);
-        void removeDiskItem(const String& itemPath);
-        String openFolderPicker();
-        std::vector<String> openFilePicker(std::vector<CoreFileExtension> extensions, bool allowMultiple);
-        String saveFilePicker(std::vector<CoreFileExtension> extensions);
-        void handleVideoModeChange(VideoModeChangeInfo *modeInfo);
-        void flushRenderContext();
-        void openURL(String url);
-        unsigned int getTicks();
-        String executeExternalCommand(String command, String args, String inDirectory);
-        bool systemParseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector);
-        
-        
-        
-    };
-    
-    
+	
+	class _PolyExport DummyCore : public Core {
+	public:
+		
+		DummyCore();
+		~DummyCore();
+		
+		void Render();
+		bool systemUpdate();
+		void setCursor(int cursorType);
+		void createThread(Threaded *target);
+		CoreMutex *createMutex();
+		void copyStringToClipboard(const String& str);
+		String getClipboardString();
+		void createFolder(const String& folderPath);
+		void copyDiskItem(const String& itemPath, const String& destItemPath);
+		void moveDiskItem(const String& itemPath, const String& destItemPath);
+		void removeDiskItem(const String& itemPath);
+		String openFolderPicker();
+		std::vector<String> openFilePicker(std::vector<CoreFileExtension> extensions, bool allowMultiple);
+		String saveFilePicker(std::vector<CoreFileExtension> extensions);
+		void handleVideoModeChange(VideoModeChangeInfo *modeInfo);
+		void flushRenderContext();
+		void openURL(String url);
+		unsigned int getTicks();
+		String executeExternalCommand(String command, String args, String inDirectory);
+		bool systemParseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector);
+		
+		
+		
+	};
+	
+	
 	
 }

+ 49 - 49
include/polycode/core/PolyCoreFileProvider.h

@@ -26,54 +26,54 @@
 #include "polycode/core/PolyString.h"
 
 namespace Polycode {
-    
-    class _PolyExport OSFileEntry : public PolyBase {
-        
-    public:
-        OSFileEntry() {};
-        OSFileEntry(const Polycode::String& fullPath, int type);
-        OSFileEntry(const Polycode::String& path, const Polycode::String& name, int type);
-        void init(const Polycode::String& path, const Polycode::String& name, int type);
-        
-        Polycode::String name;
-        Polycode::String extension;
-        Polycode::String nameWithoutExtension;
-        Polycode::String basePath;
-        Polycode::String fullPath;
-        int type;
-        
-        static const int TYPE_FILE = 0;
-        static const int TYPE_FOLDER = 1;
-    };
-    
-    class CoreFileProvider;
-    
-    class _PolyExport CoreFile : public PolyBase {
-    public:
-        CoreFile(){}
-        
-        virtual long read( void * ptr, size_t size, size_t count) = 0;
-        virtual long write( const void * ptr, size_t size, size_t count) = 0;
-        virtual int seek(long int offset, int origin) = 0;
-        virtual long tell() = 0;
-        
-        CoreFileProvider *provider;
-    };
-    
-    class _PolyExport CoreFileProvider {
-    public:
-        CoreFileProvider();
-        
-        virtual CoreFile *openFile(const String &fileName, const String &opts) = 0;
-        virtual void closeFile(CoreFile *file) = 0;
-        virtual bool parseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector);
-        
-        virtual void addSource(const String &source);
-        virtual void removeSource(const String &source);
-        
-        String type;
-        bool canListFiles;
-    };
+	
+	class _PolyExport OSFileEntry : public PolyBase {
+		
+	public:
+		OSFileEntry() {};
+		OSFileEntry(const Polycode::String& fullPath, int type);
+		OSFileEntry(const Polycode::String& path, const Polycode::String& name, int type);
+		void init(const Polycode::String& path, const Polycode::String& name, int type);
+		
+		Polycode::String name;
+		Polycode::String extension;
+		Polycode::String nameWithoutExtension;
+		Polycode::String basePath;
+		Polycode::String fullPath;
+		int type;
+		
+		static const int TYPE_FILE = 0;
+		static const int TYPE_FOLDER = 1;
+	};
+	
+	class CoreFileProvider;
+	
+	class _PolyExport CoreFile : public PolyBase {
+	public:
+		CoreFile(){}
+		
+		virtual long read( void * ptr, size_t size, size_t count) = 0;
+		virtual long write( const void * ptr, size_t size, size_t count) = 0;
+		virtual int seek(long int offset, int origin) = 0;
+		virtual long tell() = 0;
+		
+		CoreFileProvider *provider;
+	};
+	
+	class _PolyExport CoreFileProvider {
+	public:
+		CoreFileProvider();
+		
+		virtual CoreFile *openFile(const String &fileName, const String &opts) = 0;
+		virtual void closeFile(CoreFile *file) = 0;
+		virtual bool parseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector);
+		
+		virtual void addSource(const String &source);
+		virtual void removeSource(const String &source);
+		
+		String type;
+		bool canListFiles;
+	};
 
-    
+	
 }

+ 18 - 18
include/polycode/core/PolyCoreInput.h

@@ -76,12 +76,12 @@ namespace Polycode {
 		
 		/**
 		* Right mouse button
-		*/ 		
+		*/		
 		static const int MOUSE_BUTTON2 = 1;
 		
 		/**
 		* Middle mouse button
-		*/ 		
+		*/		
 		static const int MOUSE_BUTTON3 = 2;
 		
 		/** 
@@ -141,11 +141,11 @@ namespace Polycode {
 		JoystickInfo *getJoystickInfoByIndex(unsigned int index);
 
 		/**
-         * Returns joystick info for specified joystick device ID. Returns NULL if the joystick device ID is invalid.
-         * @param deviceID Joystick device ID.
-         * @return Joystick info for specified joystick.
-         * @see JoystickInfo
-         */
+		 * Returns joystick info for specified joystick device ID. Returns NULL if the joystick device ID is invalid.
+		 * @param deviceID Joystick device ID.
+		 * @return Joystick info for specified joystick.
+		 * @see JoystickInfo
+		 */
 		JoystickInfo *getJoystickInfoByID(unsigned int deviceID);
 		void addJoystick(unsigned int deviceID);
 		void removeJoystick(unsigned int deviceID);
@@ -176,22 +176,22 @@ namespace Polycode {
 		*/
 		bool simulateTouchAsPen;
 
-        /**
-         * If set to true, will fire mouse events on touch input. Defaults to false.
-         */
+		/**
+		 * If set to true, will fire mouse events on touch input. Defaults to false.
+		 */
 		bool simulateMouseWithTouch;
-        
-        /**
-         * If set to true, will not send touch events outside of the screen as define by current core resolution. Defaults to false.
-         */
+		
+		/**
+		 * If set to true, will not send touch events outside of the screen as define by current core resolution. Defaults to false.
+		 */
 		bool ignoreOffScreenTouch;	
 		
 		void clearInput();
 		
-        /**
-        * If set to false, will ignore repeat system keypress events if a key is already pressed-down. Defaults to true.
-        */
-        bool keyRepeat;
+		/**
+		* If set to false, will ignore repeat system keypress events if a key is already pressed-down. Defaults to true.
+		*/
+		bool keyRepeat;
 		
 		std::vector<JoystickInfo> joysticks;
 		bool keyboardState[512];

+ 14 - 14
include/polycode/core/PolyCoreServices.h

@@ -38,7 +38,7 @@ namespace Polycode {
 	class ResourceManager;
 	class SoundManager;
 	class Core;
-    class CoreInput;
+	class CoreInput;
 	class CoreMutex;
 	class Logger;
 	
@@ -55,8 +55,8 @@ namespace Polycode {
 			static void setInstance(CoreServices *_instance);
 			static CoreMutex *getRenderMutex();
 			
-            static void createInstance();
-        
+			static void createInstance();
+		
 			void setRenderer(Renderer *renderer);
 
 			/**
@@ -67,24 +67,24 @@ namespace Polycode {
 			Renderer *getRenderer();
 			
 			void Update(int elapsed);
-            void fixedUpdate();
+			void fixedUpdate();
 			void Render(const Polycode::Rectangle &viewport);
 			
 			void setCore(Core *core);
-        
+		
 			/**
 			* Returns the core. 
 			* @return The core.
 			* @see Core
 			*/																														
 			Core *getCore();
-        
-            /**
-             * Returns the core input.
-             * @return Core input.
-             * @see CoreInput
-             */
-            CoreInput *getInput();
+		
+			/**
+			 * Returns the core input.
+			 * @return Core input.
+			 * @see CoreInput
+			 */
+			CoreInput *getInput();
 			
 			void handleEvent(Event *event);
 
@@ -169,8 +169,8 @@ namespace Polycode {
 			SoundManager *soundManager;
 			Renderer *renderer;
 	};
-    
+	
 
 	_PolyExport CoreServices *Services();
-    
+	
 }

+ 1 - 1
include/polycode/core/PolyCubemap.h

@@ -37,7 +37,7 @@ namespace Polycode {
 			
 			virtual void recreateFromTextures(){}
 			
-			virtual ~Cubemap();	
+			virtual ~Cubemap(); 
 			
 			static const int CUBEMAP_XPOS = 0;
 			static const int CUBEMAP_XNEG = 1;

+ 1 - 1
include/polycode/core/PolyEmscriptenCore.h

@@ -83,7 +83,7 @@ namespace Polycode {
 		void removeDiskItem(const String& itemPath);
 		String openFolderPicker();
 		std::vector<String> openFilePicker(std::vector<CoreFileExtension> extensions, bool allowMultiple);
-                String saveFilePicker(std::vector<CoreFileExtension> extensions);
+				String saveFilePicker(std::vector<CoreFileExtension> extensions);
 		void resizeTo(int xRes, int yRes);
 
 		String executeExternalCommand(String command, String args, String inDirectory="");

+ 285 - 285
include/polycode/core/PolyEntity.h

@@ -36,9 +36,9 @@
 namespace Polycode {
 
 	class Renderer;
-    class Scene;
-    class Script;
-    class ScriptInstance;
+	class Scene;
+	class Script;
+	class ScriptInstance;
 
 	class _PolyExport MouseEventResult {
 		public:
@@ -51,12 +51,12 @@ namespace Polycode {
 		String propName;
 		String propValue;		
 	};
-    
-    class _PolyExport AABB {
-        public:
-            Vector3 min;
-            Vector3 max;
-    };
+	
+	class _PolyExport AABB {
+		public:
+			Vector3 min;
+			Vector3 max;
+	};
 
 	class _PolyExport Rotation {
 		public:
@@ -97,25 +97,25 @@ namespace Polycode {
 			* Main update method. Override this to do your updates before the render cycle.
 			*/			
 			virtual void Update();
-        
+		
 			virtual void fixedUpdate(){};
-        
-            void transformAndRender(GPUDrawBuffer *drawBuffer, Polycode::Rectangle *parentScissorBox);
+		
+			void transformAndRender(GPUDrawBuffer *drawBuffer, Polycode::Rectangle *parentScissorBox);
 
 			void renderChildren(GPUDrawBuffer *buffer, Polycode::Rectangle *parentScissorBox);
 		
 			
 			/**
- 			* Clones the entity, return an exact copy. This method must be implemented in an Entity subclass for you to be able to clone it.
- 			* @param deepClone If true, perform a deep clone, cloning all the children.
- 			* @param ignoreEditorOnly If true, ignore all child entities where editorOnly is set to true (will still clone the entity you call Clone() on even if its editorOnly flag is set to true.
- 			* @return The clone of the entity.
- 			*/
+			* Clones the entity, return an exact copy. This method must be implemented in an Entity subclass for you to be able to clone it.
+			* @param deepClone If true, perform a deep clone, cloning all the children.
+			* @param ignoreEditorOnly If true, ignore all child entities where editorOnly is set to true (will still clone the entity you call Clone() on even if its editorOnly flag is set to true.
+			* @return The clone of the entity.
+			*/
 			virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
 
 			/**
- 			* This method must be implemented by all subclasses implementing Clone.
- 			*/
+			* This method must be implemented by all subclasses implementing Clone.
+			*/
 			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
 		
 		
@@ -153,16 +153,16 @@ namespace Polycode {
 			*/
 			Matrix4 getConcatenatedMatrix();
 			
-            /**
-             * Returns the concatenated matrix up to the specified parent entity.
-             * @param relativeEntity Parent entity, relative to which to return the transform matrix.
-             */
+			/**
+			 * Returns the concatenated matrix up to the specified parent entity.
+			 * @param relativeEntity Parent entity, relative to which to return the transform matrix.
+			 */
 			Matrix4 getConcatenatedMatrixRelativeTo(Entity *relativeEntity);
 			
-            /**
-             * Returns the concatenated matrix, multiplied by the entity's anchor adjustment.
-             * @see setAnchorPoint
-             */
+			/**
+			 * Returns the concatenated matrix, multiplied by the entity's anchor adjustment.
+			 * @see setAnchorPoint
+			 */
 			Matrix4 getAnchorAdjustedMatrix();
 			
 			/** 
@@ -206,24 +206,24 @@ namespace Polycode {
 			*/
 			virtual void removeChild(Entity *entityToRemove);
 
-            /**
-             * Moves the specified child one position up the render list.
-             */
+			/**
+			 * Moves the specified child one position up the render list.
+			 */
 			void moveChildUp(Entity *child);
-        
-            /**
-             * Moves the specified child one position down the render list.
-             */
+		
+			/**
+			 * Moves the specified child one position down the render list.
+			 */
 			void moveChildDown(Entity *child);
-        
-            /**
-             * Moves the specified child up to the top of the render list.
-             */
+		
+			/**
+			 * Moves the specified child up to the top of the render list.
+			 */
 			void moveChildTop(Entity *child);
-        
-            /**
-             * Moves the specified child up to the bottom of the render list.
-             */
+		
+			/**
+			 * Moves the specified child up to the bottom of the render list.
+			 */
 			void moveChildBottom(Entity *child);
 
 			/**
@@ -257,9 +257,9 @@ namespace Polycode {
 			bool ownsChildren;										
 			
 			/**
-             * Sets the ownsChildren flag for this entity and recursively for all its child entities.
-             * @see ownsChildren
-             */
+			 * Sets the ownsChildren flag for this entity and recursively for all its child entities.
+			 * @see ownsChildren
+			 */
 			void setOwnsChildrenRecursive(bool val);
 			//@}
 			// ----------------------------------------------------------------------------------------------------------------
@@ -276,9 +276,9 @@ namespace Polycode {
 			*/			
 			Vector3 getPosition() const;
 			
-            /**
-             * Returns the entity's position as a Vector2
-             */
+			/**
+			 * Returns the entity's position as a Vector2
+			 */
 			Vector2 getPosition2D() const;
 			
 			/**
@@ -393,12 +393,12 @@ namespace Polycode {
 			@return Entity's scale as a vector.
 			*/						
 			Vector3 getScale() const;
-        
-            /**
-             * Returns the entity's rotation as euler angles
-             @return Entity's rotation as euler angles
-             */
-            Vector3 getRotationEuler() const;
+		
+			/**
+			 * Returns the entity's rotation as euler angles
+			 @return Entity's rotation as euler angles
+			 */
+			Vector3 getRotationEuler() const;
 		
 			/**
 			* Returns the entity's pitch combined with the combined pitch of its parent.
@@ -423,12 +423,12 @@ namespace Polycode {
 			*/
 			void rebuildRotation();					
 			
-            /**
-             * Sets rotation from euler angles
-             * @param rotation New rotation values
-             */
-            void setRotationEuler(const Vector3 &rotation);
-        
+			/**
+			 * Sets rotation from euler angles
+			 * @param rotation New rotation values
+			 */
+			void setRotationEuler(const Vector3 &rotation);
+		
 			/**
 			* Sets the pitch rotation of the entity.
 			* @param pitch New pitch value in degrees.
@@ -482,35 +482,35 @@ namespace Polycode {
 			* @return Current roll value.
 			*/																										
 			Number getRoll() const;
-			     
-            /**
-             * Returns the bounding box X value.
-             */
+				 
+			/**
+			 * Returns the bounding box X value.
+			 */
 			Number getWidth() const;
 
-            /**
-             * Returns the bounding box Y value.
-             */
+			/**
+			 * Returns the bounding box Y value.
+			 */
 			Number getHeight() const;
-        
-            /**
-             * Returns the bounding box Z value.
-             */
+		
+			/**
+			 * Returns the bounding box Z value.
+			 */
 			Number getDepth() const;
 			
-            /**
-             * Sets the bounding box X value.
-             */
+			/**
+			 * Sets the bounding box X value.
+			 */
 			void setWidth(Number width);
-        
-            /**
-             * Sets the bounding box Y value.
-             */
+		
+			/**
+			 * Sets the bounding box Y value.
+			 */
 			void setHeight(Number height);
-        
-            /**
-             * Sets the bounding box Z value.
-             */
+		
+			/**
+			 * Sets the bounding box Z value.
+			 */
 			void setDepth(Number depth);
 			
 			/**
@@ -518,9 +518,9 @@ namespace Polycode {
 			*/
 			void setRotationQuat(Number w, Number x, Number y, Number z);
 
-            /*
-            * Sets the rotation with quaternion value.
-            */
+			/*
+			* Sets the rotation with quaternion value.
+			*/
 			void setRotationByQuaternion(const Quaternion &quaternion);
 			
 			/**
@@ -529,9 +529,9 @@ namespace Polycode {
 			*/
 			Quaternion getRotationQuat() const;
 			
-        
-            Quaternion getConcatenatedQuat() const;
-        
+		
+			Quaternion getConcatenatedQuat() const;
+		
 			/**
 			* Orients the entity towards the specified location with the provided up vector. The up vector determines which side of the entity will be pointing in that direction.
 			* @param loc Location to look at.
@@ -580,23 +580,23 @@ namespace Polycode {
 			//@}
 
 			
-            /**
-             * Sets the anchor (center) point of the entity as normalized half bounding box coordinates. (i.e. -1.0 or 1.0 will offset the entity by half on a particular axis).
-             * @param anchorPoint Anchor point as a 3D Vector.
-             */
+			/**
+			 * Sets the anchor (center) point of the entity as normalized half bounding box coordinates. (i.e. -1.0 or 1.0 will offset the entity by half on a particular axis).
+			 * @param anchorPoint Anchor point as a 3D Vector.
+			 */
 			void setAnchorPoint(const Vector3 &anchorPoint);
-        
-            /**
-             * Sets the anchor (center) point of the entity as normalized half bounding box coordinates. (i.e. -1.0 or 1.0 will offset the entity by half on a particular axis).
-             * @param x X Offset
-             * @param y Y Offset
-             * @param z Z Offset
-             */
+		
+			/**
+			 * Sets the anchor (center) point of the entity as normalized half bounding box coordinates. (i.e. -1.0 or 1.0 will offset the entity by half on a particular axis).
+			 * @param x X Offset
+			 * @param y Y Offset
+			 * @param z Z Offset
+			 */
 			void setAnchorPoint(Number x, Number y, Number z);
-        
-            /**
-             * Returns the current anchor (center) point of the entity.
-             */
+		
+			/**
+			 * Returns the current anchor (center) point of the entity.
+			 */
 			Vector3 getAnchorPoint() const;
 			
 			virtual MouseEventResult onMouseDown(const Ray &ray, int mouseButton, int timestamp);
@@ -615,7 +615,7 @@ namespace Polycode {
 			* If this flag is true, the entity will always face the camera. False by default.
 			*/						
 			bool billboardMode;
-        
+		
 			/**
 			* The entity's color.
 			*/					
@@ -649,14 +649,14 @@ namespace Polycode {
 			/**
 			* If set to false, the children will be rendered even if the entity is invisible.
 			*/ 
-			bool visibilityAffectsChildren;	
+			bool visibilityAffectsChildren; 
 			
 			/**
 			* If this flag is set to true, this entity will render only into the depth buffer. This, effectively, means that it will be invisible, but still obscuring other entities.
 			*/
 
-            void setDepthOnly(bool val);
-            bool getDepthOnly();
+			void setDepthOnly(bool val);
+			bool getDepthOnly();
 			
 			/**
 			* If this flag is set to true, this entity's transformations will not take into account its parent, making its transforms always relative to 0.
@@ -684,53 +684,53 @@ namespace Polycode {
 			void setBlendingMode(unsigned int newBlendingMode);
 
 			unsigned int getBlendingMode();
-        
-            /**
-             * Returns the first child entity that has the specified string id.
-             * @param id Specified id to search for.
-             * @param recursive If set to true, will search all child entities recursively.
-             * @return Entity with specified string id or NULL if not found.
-             */
+		
+			/**
+			 * Returns the first child entity that has the specified string id.
+			 * @param id Specified id to search for.
+			 * @param recursive If set to true, will search all child entities recursively.
+			 * @return Entity with specified string id or NULL if not found.
+			 */
 			Entity *getEntityById(String id, bool recursive) const;
-        
-            /**
-             * Returns all child entities which have the specified tag.
-             * @param tag Tag to search for.
-             * @param recursive If set to true, will search all child entities recursively.
-             * @return List of child entities that contain the specified tag.
-             */
+		
+			/**
+			 * Returns all child entities which have the specified tag.
+			 * @param tag Tag to search for.
+			 * @param recursive If set to true, will search all child entities recursively.
+			 * @return List of child entities that contain the specified tag.
+			 */
 			std::vector<Entity*> getEntitiesByTag(String tag, bool recursive) const;
 
-            /**
-             * Returns all child entities that have the specified layer ID. Layer IDs are used by the entity instances to separate entities into groups.
-             * @param Layer ID to search for.
-             * @param recursive If set to true, will search all child entities recursively.
-             * @return List of child entities that contain the specified layer ID.
-             */
-            std::vector<Entity*> getEntitiesByLayerID(unsigned char layerID, bool recursive) const;
-        
-            /** 
-             * Returns custom string dictionary property of the entity based on the property name.
-             * @param Property name to look up.
-             * @return String property for specified property name or "null" if this property doesn't exist.
-             */
+			/**
+			 * Returns all child entities that have the specified layer ID. Layer IDs are used by the entity instances to separate entities into groups.
+			 * @param Layer ID to search for.
+			 * @param recursive If set to true, will search all child entities recursively.
+			 * @return List of child entities that contain the specified layer ID.
+			 */
+			std::vector<Entity*> getEntitiesByLayerID(unsigned char layerID, bool recursive) const;
+		
+			/** 
+			 * Returns custom string dictionary property of the entity based on the property name.
+			 * @param Property name to look up.
+			 * @return String property for specified property name or "null" if this property doesn't exist.
+			 */
 			String getEntityProp(const String& propName);
-        
-            /**
-             * Sets the entity property for a specified property name in the entity's custom property dictionary.
-             * @param propName Property name to set.
-             * @param propValue Value to set for the specified property name.
-             */
+		
+			/**
+			 * Sets the entity property for a specified property name in the entity's custom property dictionary.
+			 * @param propName Property name to set.
+			 * @param propValue Value to set for the specified property name.
+			 */
 			void setEntityProp(const String& propName, const String& propValue);
 			
-            /**
-             * If set to true, the y position of the entity matrix will be multiplied by -1.0, inverting its Y-axis coordinate system.
-             */
+			/**
+			 * If set to true, the y position of the entity matrix will be multiplied by -1.0, inverting its Y-axis coordinate system.
+			 */
 			void setInverseY(bool val);
-        
-            /**
-             * Returns true if the entity is set to use an inverse Y-coordinate system.
-             */
+		
+			/**
+			 * Returns true if the entity is set to use an inverse Y-coordinate system.
+			 */
 			bool getInverseY();
 			
 			void doUpdates();
@@ -738,170 +738,170 @@ namespace Polycode {
 			virtual Matrix4 buildPositionMatrix();
 			void setRenderer(Renderer *renderer);
 			
-            /**
-             * Implement this method to do custom ray hit detection beyond a bounding box check. Always returns true by default.
-             */
+			/**
+			 * Implement this method to do custom ray hit detection beyond a bounding box check. Always returns true by default.
+			 */
 			virtual bool customHitDetection(const Ray &ray) { return true; }			
 			/**
-             * If set to true, the entity's transformations will not be affected by its parents. Defaults to false.
-             */
+			 * If set to true, the entity's transformations will not be affected by its parents. Defaults to false.
+			 */
 			bool ignoreParentMatrix;
 						
-            /**
-             * If set to true, will constrain the rendering of this entity into the viewport coordinates defined by scissorBox.
-             * @see scissorBox
-             */
+			/**
+			 * If set to true, will constrain the rendering of this entity into the viewport coordinates defined by scissorBox.
+			 * @see scissorBox
+			 */
 			bool enableScissor;
-        
-            /**
-             * Defines the viewport coordinates to clip rendering to if enableScissor is defined.
-             * @see enableScissor
-             */
+		
+			/**
+			 * Defines the viewport coordinates to clip rendering to if enableScissor is defined.
+			 * @see enableScissor
+			 */
 			Polycode::Rectangle scissorBox;			
 			
-            /**
-             * Flags an editor only entity. If set to true, this entity will not be saved to file by entity instances or show up in the IDE entity editor.
-             */
+			/**
+			 * Flags an editor only entity. If set to true, this entity will not be saved to file by entity instances or show up in the IDE entity editor.
+			 */
 			bool editorOnly;
 
-            /**
-             * String ID of the entity. Can be used to retrieve specific entities by their ID.
-             */
+			/**
+			 * String ID of the entity. Can be used to retrieve specific entities by their ID.
+			 */
 			String id;
 
-            /**
-             * Returns the number of tags this entity has.
-             */
+			/**
+			 * Returns the number of tags this entity has.
+			 */
 			unsigned int getNumTags() const;
-        
-            /**
-             * Returns the tag at specified index or an empty string if index is invalid.
-             */
+		
+			/**
+			 * Returns the tag at specified index or an empty string if index is invalid.
+			 */
 			String getTagAtIndex(unsigned int index) const;
-        
-            /**
-             * Returns true if this entity contains the specified tag.
-             * @param tag Tag to look up.
-             * @return True if this entity contains the specified tag, false if it doesn't.
-             */
+		
+			/**
+			 * Returns true if this entity contains the specified tag.
+			 * @param tag Tag to look up.
+			 * @return True if this entity contains the specified tag, false if it doesn't.
+			 */
 			bool hasTag(String tag) const;
 			
-            /**
-             * Removes all tags from this entity.
-             */
+			/**
+			 * Removes all tags from this entity.
+			 */
 			void clearTags();
-        
-            /**
-             * Adds a string tag to the entity.
-             * @param tag Tag to add.
-             */
+		
+			/**
+			 * Adds a string tag to the entity.
+			 * @param tag Tag to add.
+			 */
 			void addTag(String tag);
 			
-            /**
-             * Entity collision type for physics module. This is set per physics module documentaiton.
-             */
+			/**
+			 * Entity collision type for physics module. This is set per physics module documentaiton.
+			 */
 			unsigned char collisionShapeType;
-        
-            /**
-             * If set to true, will automatically process mouse events and dispatch its own input events if mouse events intersect with the entity's bounding box. Defaults to false.
-                 Attention: All of the entity's parents' processInputEvents flags must be set to true for this to function including the parent Scene's rootEntity!
-             */
+		
+			/**
+			 * If set to true, will automatically process mouse events and dispatch its own input events if mouse events intersect with the entity's bounding box. Defaults to false.
+				 Attention: All of the entity's parents' processInputEvents flags must be set to true for this to function including the parent Scene's rootEntity!
+			 */
 			bool processInputEvents;
-        
-            /**
-             * If set to true, will block input events for entities below itself in the parent's entiy list.
-             */
+		
+			/**
+			 * If set to true, will block input events for entities below itself in the parent's entiy list.
+			 */
 			bool blockMouseInput;
 						
 		
-            /** 
-             * Returns the screen pixel position of the entity using a specified projection matrix, camera matrix and viewport.
-             * @param projectionMatrix Projection matrix to use.
-             * @param cameraMatrix Camera matrix to use.
-             * @param viewport Viewport rectangle.
-             * @return Pixel position of the entity on the screen.
-             */
-            Vector2 getScreenPosition(const Matrix4 &projectionMatrix, const Matrix4 &cameraMatrix, const Polycode::Rectangle &viewport);
-
-            /**
-             * If set to true, will round the position of this entity to integral values. Use this if you need pixel-perfect positioning in 2D.
-             */
+			/** 
+			 * Returns the screen pixel position of the entity using a specified projection matrix, camera matrix and viewport.
+			 * @param projectionMatrix Projection matrix to use.
+			 * @param cameraMatrix Camera matrix to use.
+			 * @param viewport Viewport rectangle.
+			 * @return Pixel position of the entity on the screen.
+			 */
+			Vector2 getScreenPosition(const Matrix4 &projectionMatrix, const Matrix4 &cameraMatrix, const Polycode::Rectangle &viewport);
+
+			/**
+			 * If set to true, will round the position of this entity to integral values. Use this if you need pixel-perfect positioning in 2D.
+			 */
 			bool snapToPixels;
-        
+		
 			bool mouseOver;
-        
-            /**
-             * Sets the default blending mode for all created entities.
-             */
-            static int defaultBlendingMode;
-        
-            void recalculateAABBAllChildren();
-            void recalculateAABB();
-        
-            /**
-             Return axis-aligned bounding box in world space.
-             */
-            AABB getWorldAABB();
-        
-            /**
-             * Returns the bounding box of the entity. This is used for hit-testing as well as visibility calculation.
-             */
-            Vector3 getLocalBoundingBox();
-        
-            /**
-             * Sets the bounding box of the entity as a 3D Vector. This is used for hit-testing as well as visibility calculation.
-             */
-            void setLocalBoundingBox(const Vector3 box);
-        
-            /**
-             * Sets the bounding box of the entity. This is used for hit-testing as well as visibility calculation.
-             */
-            void setLocalBoundingBox(Number x, Number y, Number z);
-        
-            /**
-             * Sets the bounding box X-axis value of the entity.
-             */
-            void setLocalBoundingBoxX(Number x);
-        
-            /**
-             * Sets the bounding box Y-axis value of the entity.
-             */
-            void setLocalBoundingBoxY(Number y);
-
-            /**
-             * Sets the bounding box Z-axis value of the entity.
-             */
-            void setLocalBoundingBoxZ(Number z);
-        
-            bool rendererVis;
-        
-            /**
-            * Layer ID. Used by entity instances to separate entities into groups.
-            */
-            unsigned char layerID;
-
-            std::vector <EntityProp> entityProps;
-        
-            void setContainerScene(Scene *scene);
-    
-            Scene *getContainerScene();
-        
-            void attachScript(Script *script);
-            void detachScript(Script *script);
-            unsigned int getNumScripts();
-            ScriptInstance *getScriptAtIndex(unsigned int index);
-        
+		
+			/**
+			 * Sets the default blending mode for all created entities.
+			 */
+			static int defaultBlendingMode;
+		
+			void recalculateAABBAllChildren();
+			void recalculateAABB();
+		
+			/**
+			 Return axis-aligned bounding box in world space.
+			 */
+			AABB getWorldAABB();
+		
+			/**
+			 * Returns the bounding box of the entity. This is used for hit-testing as well as visibility calculation.
+			 */
+			Vector3 getLocalBoundingBox();
+		
+			/**
+			 * Sets the bounding box of the entity as a 3D Vector. This is used for hit-testing as well as visibility calculation.
+			 */
+			void setLocalBoundingBox(const Vector3 box);
+		
+			/**
+			 * Sets the bounding box of the entity. This is used for hit-testing as well as visibility calculation.
+			 */
+			void setLocalBoundingBox(Number x, Number y, Number z);
+		
+			/**
+			 * Sets the bounding box X-axis value of the entity.
+			 */
+			void setLocalBoundingBoxX(Number x);
+		
+			/**
+			 * Sets the bounding box Y-axis value of the entity.
+			 */
+			void setLocalBoundingBoxY(Number y);
+
+			/**
+			 * Sets the bounding box Z-axis value of the entity.
+			 */
+			void setLocalBoundingBoxZ(Number z);
+		
+			bool rendererVis;
+		
+			/**
+			* Layer ID. Used by entity instances to separate entities into groups.
+			*/
+			unsigned char layerID;
+
+			std::vector <EntityProp> entityProps;
+		
+			void setContainerScene(Scene *scene);
+	
+			Scene *getContainerScene();
+		
+			void attachScript(Script *script);
+			void detachScript(Script *script);
+			unsigned int getNumScripts();
+			ScriptInstance *getScriptAtIndex(unsigned int index);
+		
 		protected:
 
-            std::vector<ScriptInstance*> scripts;
-        
-            GPUDrawCall drawCall;
-        
-            Scene *containerScene;
-        
-            AABB aabb;
-            Vector3 bBox;
-        
+			std::vector<ScriptInstance*> scripts;
+		
+			GPUDrawCall drawCall;
+		
+			Scene *containerScene;
+		
+			AABB aabb;
+			Vector3 bBox;
+		
 			int lastClickTicks;
 			Number yAdjust;
 			std::vector<String> *tags;
@@ -920,7 +920,7 @@ namespace Polycode {
 			
 			bool lockMatrix;
 			bool matrixDirty;
-        
+		
 			Matrix4 transformMatrix;
 			Entity *parentEntity;
 		

+ 8 - 8
include/polycode/core/PolyEvent.h

@@ -41,28 +41,28 @@ namespace Polycode {
 			/**
 			* Initializes the event with an eventCode
 			* @param eventCode Event code to initalize with.
-			*/ 			
+			*/			
 			Event(int eventCode);
 			virtual ~Event();
 			
 			/**
 			* Returns the event code for this event.
 			* @return Event code for the event.
-			*/ 						
+			*/						
 			int getEventCode() const;
 			
 			/**
 			* Returns the event dispatcher which originated the event.
 			* @return Event dispatcher which originated the event.
-			*/ 									
+			*/									
 			EventDispatcher *getDispatcher() const;
 			
 			void setEventCode(int eventCode);			
 			void setDispatcher(EventDispatcher *dispatcher);
 			const String& getEventType() const;
-        
-        
-            void cancelEvent();
+		
+		
+			void cancelEvent();
 			
 			// In order to prevent "namespace" collisions between events of different types, all event integers must be unique.
 			// This is managed by arbitrarily assigning each class a "base" constant, and adding it to all its event type constants.
@@ -94,8 +94,8 @@ namespace Polycode {
 			static const int EVENTBASE_NONPOLYCODE = 0x10000;
 		
 			bool deleteOnDispatch;
-            bool cancelEventFlag;
-        
+			bool cancelEventFlag;
+		
 		protected:
 			
 			String eventType;

+ 14 - 14
include/polycode/core/PolyEventDispatcher.h

@@ -64,21 +64,21 @@ typedef struct {
 			* @see EventHandler
 			*/						
 			void addEventListener(EventHandler *handler, int eventCode);
-        
-            /**
-             * Adds an event listener for specified event code if it hasn't already been added, otherwise does nothing.
-             * @param handler The event handler to add as a listener
-             * @param eventCode The requested event code to listen to.
-             */
+		
+			/**
+			 * Adds an event listener for specified event code if it hasn't already been added, otherwise does nothing.
+			 * @param handler The event handler to add as a listener
+			 * @param eventCode The requested event code to listen to.
+			 */
 			void addEventListenerUnique(EventHandler *handler, int eventCode);
-        
-            /**
-             * Returns true if this event dispatcher is registered with the specified EventHandler with the specified event code.
-             * @param handler EventHandler to check.
-             * @param eventCode The event code to check.
-             */
-            bool hasEventListener(EventHandler *handler, int eventCode);
-        
+		
+			/**
+			 * Returns true if this event dispatcher is registered with the specified EventHandler with the specified event code.
+			 * @param handler EventHandler to check.
+			 * @param eventCode The event code to check.
+			 */
+			bool hasEventListener(EventHandler *handler, int eventCode);
+		
 			/**
 			* Removes a listener for a specific handler and event code. 
 			* @param handler The event handler to remove as a listener

+ 6 - 6
include/polycode/core/PolyFontGlyphSheet.h

@@ -26,7 +26,7 @@ namespace Polycode {
 	};
 
 	/** Wraps a sheet of rendered font glyphs on a Texture.
-	 *  Use in combination with TextMesh to render text from minimal texture creation. */
+	 *	Use in combination with TextMesh to render text from minimal texture creation. */
 	class _PolyExport FontGlyphSheet : public PolyBase {
 		public:
 
@@ -35,13 +35,13 @@ namespace Polycode {
 				ANTIALIAS,
 				/** Using distance-from-edge calculation as described in the Valve paper.
 				 *
-				 *  "Improved Alpha-Tested Magnification for Vector Textures and Special Effects"
-				 *  http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf
+				 *	"Improved Alpha-Tested Magnification for Vector Textures and Special Effects"
+				 *	http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf
 				 *
 				 * To make the most of this:
-				 *   set renderer->alphaTestValue = 0.5
-				 *   set sceneMesh->alphaTest = true
-				 *   set sceneMesh->blendingMode = Renderer::BLEND_MODE_NONE;
+				 *	 set renderer->alphaTestValue = 0.5
+				 *	 set sceneMesh->alphaTest = true
+				 *	 set sceneMesh->blendingMode = Renderer::BLEND_MODE_NONE;
 				 *
 				 * Or use a custom shader - alpha values of 0.5 indicate the boundary.
 				 * */

+ 67 - 67
include/polycode/core/PolyGPUDrawBuffer.h

@@ -31,71 +31,71 @@
 #include <memory>
 
 namespace Polycode {
-    
-    class RenderBuffer;
-    
-    class _PolyExport LightInfo {
-        public:
-            unsigned short importance;
-            Vector3 position;
-            Vector3 direction;
-            unsigned short type;
-            Color diffuseColor;
-            Color specularColor;
-            Number constantAttenuation;
-            Number linearAttenuation;
-            Number quadraticAttenuation;
-            Number intensity;
-            Number spotlightCutoff;
-            Number spotlightExponent;
-            bool shadowsEnabled;
-            Texture *shadowMapTexture;
-            Matrix4 lightViewMatrix;
-    };
-    
-    class _PolyExport GPUDrawOptions {
-    public:
-        bool depthTest;
-        bool depthWrite;
-        float linePointSize;
-        bool alphaTest;
-        bool backfaceCull;
-        bool depthOnly;
-        bool forceMaterial;
-        unsigned int blendingMode;
-        Polycode::Rectangle scissorBox;
-        bool enableScissor;
-        Color drawColor;
-    };
-    
-    
-    class _PolyExport GPUDrawCall {
-    public:
-        std::shared_ptr<MeshGeometry> submesh;
-        GPUDrawOptions options;
-        Matrix4 modelMatrix;
-        Material *material;
-        std::vector<ShaderPass> shaderPasses;
-    };
-    
-    class _PolyExport GPUDrawBuffer {
-    public:
-        GPUDrawBuffer();
-        ~GPUDrawBuffer();
-        
-        RenderBuffer *targetFramebuffer;
-        Matrix4 projectionMatrix;
-        Matrix4 viewMatrix;
-        Matrix4 cameraMatrix;
-        Color clearColor;
-        bool clearDepthBuffer;
-        bool clearColorBuffer;
-        Vector2 backingResolutionScale;
-        Material *globalMaterial;
-        
-        std::vector<LightInfo> lights;
-        
-        Polycode::Rectangle viewport;
-        std::vector<GPUDrawCall> drawCalls;
-    };
+	
+	class RenderBuffer;
+	
+	class _PolyExport LightInfo {
+		public:
+			unsigned short importance;
+			Vector3 position;
+			Vector3 direction;
+			unsigned short type;
+			Color diffuseColor;
+			Color specularColor;
+			Number constantAttenuation;
+			Number linearAttenuation;
+			Number quadraticAttenuation;
+			Number intensity;
+			Number spotlightCutoff;
+			Number spotlightExponent;
+			bool shadowsEnabled;
+			Texture *shadowMapTexture;
+			Matrix4 lightViewMatrix;
+	};
+	
+	class _PolyExport GPUDrawOptions {
+	public:
+		bool depthTest;
+		bool depthWrite;
+		float linePointSize;
+		bool alphaTest;
+		bool backfaceCull;
+		bool depthOnly;
+		bool forceMaterial;
+		unsigned int blendingMode;
+		Polycode::Rectangle scissorBox;
+		bool enableScissor;
+		Color drawColor;
+	};
+	
+	
+	class _PolyExport GPUDrawCall {
+	public:
+		std::shared_ptr<MeshGeometry> submesh;
+		GPUDrawOptions options;
+		Matrix4 modelMatrix;
+		Material *material;
+		std::vector<ShaderPass> shaderPasses;
+	};
+	
+	class _PolyExport GPUDrawBuffer {
+	public:
+		GPUDrawBuffer();
+		~GPUDrawBuffer();
+		
+		RenderBuffer *targetFramebuffer;
+		Matrix4 projectionMatrix;
+		Matrix4 viewMatrix;
+		Matrix4 cameraMatrix;
+		Color clearColor;
+		bool clearDepthBuffer;
+		bool clearColorBuffer;
+		Vector2 backingResolutionScale;
+		Material *globalMaterial;
+		
+		std::vector<LightInfo> lights;
+		
+		Polycode::Rectangle viewport;
+		std::vector<GPUDrawCall> drawCalls;
+	};
 }

+ 18 - 18
include/polycode/core/PolyGlobals.h

@@ -47,9 +47,9 @@ typedef unsigned int PolyRendererIndexType;
 	#endif
 	// Prevent windows.h includes from generating min/max macros that
 	// clash with the templates in <algorithm>
-    #ifndef NOMINMAX
+	#ifndef NOMINMAX
 	#define NOMINMAX
-    #endif
+	#endif
 #endif
 #include <stdint.h>
  
@@ -58,7 +58,7 @@ typedef unsigned int PolyRendererIndexType;
 #endif
  
 #define PI 3.14159265
-#define RADIANS	57.2957795
+#define RADIANS 57.2957795
 
 #define TODEGREES 57.2957795
 #define TORADIANS 0.0174532925
@@ -66,22 +66,22 @@ typedef unsigned int PolyRendererIndexType;
 //#define COMPILE_SDL_CORE		1
 
 #define PLATFORM_WINDOWS  1
-#define PLATFORM_MAC      2
-#define PLATFORM_UNIX     3
-#define PLATFORM_IOS      4
+#define PLATFORM_MAC	  2
+#define PLATFORM_UNIX	  3
+#define PLATFORM_IOS	  4
 
-#if defined(_WINDOWS) || defined(WINAPI_FAMILY)  || defined(WIN32)
+#if defined(_WINDOWS) || defined(WINAPI_FAMILY)	 || defined(WIN32)
 	#define PLATFORM PLATFORM_WINDOWS
 #elif __APPLE__ && __MACH__
-    #ifndef CLDOC
-	    #include <TargetConditionals.h>
-    #endif
-    #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
-        #define PLATFORM PLATFORM_IOS
-        #define STRICT_OPENGLES2 1
-    #else
-        #define PLATFORM PLATFORM_MAC
-    #endif
+	#ifndef CLDOC
+		#include <TargetConditionals.h>
+	#endif
+	#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
+		#define PLATFORM PLATFORM_IOS
+		#define STRICT_OPENGLES2 1
+	#else
+		#define PLATFORM PLATFORM_MAC
+	#endif
 #else
 	#include <cstddef>
 	#define PLATFORM PLATFORM_UNIX
@@ -115,7 +115,7 @@ inline int round(Number x) {
 
 inline Number clampf(Number x, Number a, Number b)
 {
-    return x < a ? a : (x > b ? b : x);
+	return x < a ? a : (x > b ? b : x);
 }
 
 #ifndef MIN
@@ -126,7 +126,7 @@ inline Number clampf(Number x, Number a, Number b)
 #endif
 
 #if PLATFORM == PLATFORM_IOS
-//    #define BGRA_TEXTURE_FORMAT
+//	  #define BGRA_TEXTURE_FORMAT
 #endif
 
 // Special flag read by create_lua_library parser, suppresses Lua bindings for item.

+ 58 - 58
include/polycode/core/PolyIOSCore.h

@@ -47,46 +47,46 @@ using namespace Polycode;
 
 class _PolyExport PosixMutex : public CoreMutex {
 public:
-    void lock();
-    void unlock();
-    pthread_mutex_t pMutex;
+	void lock();
+	void unlock();
+	pthread_mutex_t pMutex;
 };
 
 class IOSEvent {
-    public:
-    int eventGroup;
-    int eventCode;
-    
-    int mouseX;
-    int mouseY;
-    
-    std::vector<TouchInfo> touches;
-    TouchInfo touch;
-    
-    PolyKEY keyCode;
-    wchar_t unicodeChar;
-    
-    char mouseButton;
-    
-    static const int EVENTBASE_PLATFORMEVENT = 0x300;
-    static const int INPUT_EVENT = EVENTBASE_PLATFORMEVENT+0;
-    static const int FOCUS_EVENT = EVENTBASE_PLATFORMEVENT+1;
+	public:
+	int eventGroup;
+	int eventCode;
+	
+	int mouseX;
+	int mouseY;
+	
+	std::vector<TouchInfo> touches;
+	TouchInfo touch;
+	
+	PolyKEY keyCode;
+	wchar_t unicodeChar;
+	
+	char mouseButton;
+	
+	static const int EVENTBASE_PLATFORMEVENT = 0x300;
+	static const int INPUT_EVENT = EVENTBASE_PLATFORMEVENT+0;
+	static const int FOCUS_EVENT = EVENTBASE_PLATFORMEVENT+1;
 };
 
 namespace Polycode {
-    
-    class IOSCoreAudioInterface : public Polycode::AudioInterface {
-    public:
-        IOSCoreAudioInterface();
-        ~IOSCoreAudioInterface();
-        
-        static void CoreAudioCallback(void *custom_data, AudioQueueRef queue, AudioQueueBufferRef buffer);
-    private:
-        AudioQueueBufferRef buffers[NUM_AQ_BUFFERS];
-        AudioStreamBasicDescription format;
-        AudioQueueRef queue;
-        
-    };
+	
+	class IOSCoreAudioInterface : public Polycode::AudioInterface {
+	public:
+		IOSCoreAudioInterface();
+		~IOSCoreAudioInterface();
+		
+		static void CoreAudioCallback(void *custom_data, AudioQueueRef queue, AudioQueueBufferRef buffer);
+	private:
+		AudioQueueBufferRef buffers[NUM_AQ_BUFFERS];
+		AudioStreamBasicDescription format;
+		AudioQueueRef queue;
+		
+	};
 
 	class _PolyExport IOSCore : public Core {
 	public:
@@ -110,41 +110,41 @@ namespace Polycode {
 		String saveFilePicker(std::vector<CoreFileExtension> extensions);
 		void handleVideoModeChange(VideoModeChangeInfo *modeInfo);
 		
-        void flushRenderContext();
-        void prepareRenderContext();
-        
+		void flushRenderContext();
+		void prepareRenderContext();
+		
 		void openURL(String url);
 		unsigned int getTicks();
 		String executeExternalCommand(String command, String args, String inDirectory);
 		bool systemParseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector);
-        
-        String getResourcePathForFile(const String &fileName);
+		
+		String getResourcePathForFile(const String &fileName);
 
 		void checkEvents();
 		void setDeviceSize(Number x, Number y);
-        
-        void renderTest();
+		
+		void renderTest();
 
 		Number getBackingXRes();
 		Number getBackingYRes();
-        
-        void _setAcceleration(const Vector3 &acceleration);
-        void _setGyroRotation(const Vector3 &rotation);
-        
-        std::vector<IOSEvent> iosEvents;
-        
+		
+		void _setAcceleration(const Vector3 &acceleration);
+		void _setGyroRotation(const Vector3 &rotation);
+		
+		std::vector<IOSEvent> iosEvents;
+		
 	private:
-        
-        CADisplayLink *displayLink;
-        
-        GLuint colorRenderbuffer;
-        GLuint depthRenderbuffer;
-        GLuint defaultFBOName;
-        bool retinaSupport;
-        
-        EAGLContext *context;
-        uint64_t initTime;
-        PolycodeView *glView;
+		
+		CADisplayLink *displayLink;
+		
+		GLuint colorRenderbuffer;
+		GLuint depthRenderbuffer;
+		GLuint defaultFBOName;
+		bool retinaSupport;
+		
+		EAGLContext *context;
+		uint64_t initTime;
+		PolycodeView *glView;
 
 	};
 }

+ 37 - 37
include/polycode/core/PolyImage.h

@@ -29,19 +29,19 @@ THE SOFTWARE.
 namespace Polycode {
 
 	class String;
-    
-    #define HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP 0x38000000
-    #define HALF_FLOAT_MAX_BIASED_EXP_AS_SINGLE_FP_EXP 0x47800000
-    #define FLOAT_MAX_BIASED_EXP (0xFF << 23)
-    #define HALF_FLOAT_MAX_BIASED_EXP (0x1F << 10)
-    
-    typedef uint16_t hfloat;
+	
+	#define HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP 0x38000000
+	#define HALF_FLOAT_MAX_BIASED_EXP_AS_SINGLE_FP_EXP 0x47800000
+	#define FLOAT_MAX_BIASED_EXP (0xFF << 23)
+	#define HALF_FLOAT_MAX_BIASED_EXP (0x1F << 10)
+	
+	typedef uint16_t hfloat;
 
-    typedef struct POLYIGNORE  {
-        int size;
-        char **tokens;
-    } TokenArray;
-    
+	typedef struct POLYIGNORE  {
+		int size;
+		char **tokens;
+	} TokenArray;
+	
 	/**
 	* An image in memory. Basic RGB or RGBA images stored in memory. Can be loaded from PNG files, created into textures and written to file.
 	*/
@@ -59,7 +59,7 @@ namespace Polycode {
 			* @param width Width of the image to create.
 			* @param height Height of the image to create.			
 			* @param type Type of image to create. Can be IMAGE_RGBA or IMAGE_RGB.
-			*/ 			
+			*/			
 			Image(int width, int height, int type = Image::IMAGE_RGBA);
 			
 			/**
@@ -68,7 +68,7 @@ namespace Polycode {
 			* @param width Width of the image to create.
 			* @param height Height of the image to create.			
 			* @param type Type of image to create. Can be IMAGE_RGBA or IMAGE_RGB.
-			*/ 						
+			*/						
 			Image(char *data, int width, int height, int type = Image::IMAGE_RGBA);
 			
 			/**
@@ -76,13 +76,13 @@ namespace Polycode {
 			* @param width Width of the image to create.
 			* @param height Height of the image to create.			
 			* @param type Type of image to create. Can be IMAGE_RGBA or IMAGE_RGB.
-			*/ 			
+			*/			
 			static Image *BlankImage(int width, int height, int type = Image::IMAGE_RGBA);
 			
 			/**
 			* Create an image from another image.
 			* @param copyImage The image to copy.
-			*/ 						
+			*/						
 			Image(Image *copyImage);		
 			Image();			
 			virtual ~Image();
@@ -91,16 +91,16 @@ namespace Polycode {
 			* Load an image from a file
 			* @param fileName Path to image file to load.
 			* @return True if successfully loaded, false otherwise.
-			*/ 			
+			*/			
 			bool loadImage(const String& fileName);
-        
-            static POLYIGNORE TokenArray readTokens(char *line, const char *tokens);
-            static POLYIGNORE void freeTokens(TokenArray tokens);
-        
+		
+			static POLYIGNORE TokenArray readTokens(char *line, const char *tokens);
+			static POLYIGNORE void freeTokens(TokenArray tokens);
+		
 			/**
 			* Saves the image to a file. Currently only PNG files are supported.
 			* @param fileName Path to image file to load.	
-			* @return True if successfully loaded, false otherwise.	
+			* @return True if successfully loaded, false otherwise. 
 			*/
 			bool saveImage(const String &fileName);
 			
@@ -108,7 +108,7 @@ namespace Polycode {
 			* Pastes another image into the image using a blending mode
 			* @param image Image to paste
 			* @param x X position of new image within the image 
-			* @param y Y position of new image within the image 			
+			* @param y Y position of new image within the image				
 			* @param blendingMode Blending mode to use. Currently not used.
 			*/
 			void pasteImage(Image *image, int x, int y, int blendingMode = 0, Number blendAmount = 1.0, Color blendColor = Color());
@@ -117,13 +117,13 @@ namespace Polycode {
 			* Recreate the image as an empty image of specified size. The image type stays the same.
 			* @param width Width of the image to create.
 			* @param height Height of the image to create.			
-			*/ 						
+			*/						
 			void createEmpty(int width, int height, const Color &fillColor);
 
 			/**
 			* Fills the image with the specified color values.
 			* @param color The color to fill it with.
-			*/ 									
+			*/									
 			void fill(const Color &color);
 			
 			/**
@@ -228,7 +228,7 @@ namespace Polycode {
 			*
 			* @param subRect The part of the image to copy. (0, 0) refers to the top left of the image.
 			* @return A pointer to an Image object allocated with new. You have to manually delete this
-			*         object using free.
+			*		  object using free.
 			*/
 			Image *getImagePart(Rectangle subRect);
 			
@@ -262,12 +262,12 @@ namespace Polycode {
 			*/						
 			char *getPixels();
 			
-            /**
-             * Multiplies the RGB values by alpha for each pixel.
-             */
+			/**
+			 * Multiplies the RGB values by alpha for each pixel.
+			 */
 			void premultiplyAlpha();
-        
-            bool savePNG(const String &fileName);
+		
+			bool savePNG(const String &fileName);
 		
 			static const int IMAGE_RGB = 0;
 			static const int IMAGE_RGBA = 1;
@@ -275,12 +275,12 @@ namespace Polycode {
 		
 		protected:
 		
-            bool loadHDR(const String &fileName);
-            bool loadSTB(const String &fileName);
-        
-        
-            static inline hfloat convertFloatToHFloat(float f);
-        
+			bool loadHDR(const String &fileName);
+			bool loadSTB(const String &fileName);
+		
+		
+			static inline hfloat convertFloatToHFloat(float f);
+		
 			void setPixelType(int type);
 
 			// transform coordinates from external topleft position mode

+ 3 - 3
include/polycode/core/PolyInputEvent.h

@@ -113,7 +113,7 @@ namespace Polycode {
 		PolyKEY key;
 		
 		
-        wchar_t getCharCode();
+		wchar_t getCharCode();
 		
 		int keyCode() { return key; }
 		
@@ -132,8 +132,8 @@ namespace Polycode {
 		unsigned int joystickButton;
 		unsigned int joystickAxis;
 		unsigned int joystickIndex;
-        
-        Number hitDistance;
+		
+		Number hitDistance;
 		
 		protected:
 		

+ 2 - 2
include/polycode/core/PolyInputKeys.h

@@ -73,7 +73,7 @@ namespace Polycode {
 		/* 
 		 Skip uppercase letters
 		 */
-		KEY_LEFTBRACKET	= 91,
+		KEY_LEFTBRACKET = 91,
 		KEY_BACKSLASH		= 92,
 		KEY_RIGHTBRACKET	= 93,
 		KEY_CARET		= 94,
@@ -219,7 +219,7 @@ namespace Polycode {
 		KEY_KP9		= 265,
 		KEY_KP_PERIOD		= 266,
 		KEY_KP_DIVIDE		= 267,
-		KEY_KP_MULTIPLY	= 268,
+		KEY_KP_MULTIPLY = 268,
 		KEY_KP_MINUS		= 269,
 		KEY_KP_PLUS		= 270,
 		KEY_KP_ENTER		= 271,

+ 114 - 114
include/polycode/core/PolyLabel.h

@@ -35,7 +35,7 @@ THE SOFTWARE.
 
 namespace Polycode {
 
-	class Font;	
+	class Font; 
 	
 	class GlyphData {
 		public:
@@ -60,122 +60,122 @@ namespace Polycode {
 	};
 
 	/**
-     * An image that can render text into itself. This class is mostly used internally in SceneLabel, but can be used by itself to manually create text-based textures.
-     */
+	 * An image that can render text into itself. This class is mostly used internally in SceneLabel, but can be used by itself to manually create text-based textures.
+	 */
 	class _PolyExport Label : public Image {
 		public:
 			
-            /**
-             * Create a text label.
-             * @param font Font to use for this label.
-             * @param text Initial text to render.
-             * @param size Pixel size of the text to render.
-             * @param antiAliasMode Antialiasing mode. Can be ANTIALIAS_FULL, ANTIALIAS_NONE or ANTIALIAS_STRONG.
-             * @param premultiplyAlpha If set to true, will premultiply alpha in the label image.
-             * @see Font
-             */
+			/**
+			 * Create a text label.
+			 * @param font Font to use for this label.
+			 * @param text Initial text to render.
+			 * @param size Pixel size of the text to render.
+			 * @param antiAliasMode Antialiasing mode. Can be ANTIALIAS_FULL, ANTIALIAS_NONE or ANTIALIAS_STRONG.
+			 * @param premultiplyAlpha If set to true, will premultiply alpha in the label image.
+			 * @see Font
+			 */
 			Label(Font *font, const String& text, int size, int antiAliasMode, bool premultiplyAlpha = false, const Color &backgroundColor = Color(0.0, 0.0, 0.0, 0.0), const Color &foregroundColor = Color(1.0, 1.0, 1.0, 1.0));
 			virtual ~Label();
-        
-            /**
-             * Sets the text of the label.
-             * @param text Text to set.
-             */
+		
+			/**
+			 * Sets the text of the label.
+			 * @param text Text to set.
+			 */
 			void setText(const String& text);
-        
-            /**
-             * Returns the current text of the label.
-             * @return Current text.
-             */
+		
+			/**
+			 * Returns the current text of the label.
+			 * @return Current text.
+			 */
 			const String& getText() const;
 			
-            /**
-             * Returns the pixel width for the specified string based on the current label font and size settings.
-             * @param text Text to return width for.
-             * @return Pixel width of specified text.
-             */
+			/**
+			 * Returns the pixel width for the specified string based on the current label font and size settings.
+			 * @param text Text to return width for.
+			 * @return Pixel width of specified text.
+			 */
 			int getTextWidthForString(const String& text);
-        
-            /**
-             * Returns the pixel height for the specified string based on the current label font and size settings.
-             * @param text Text to return height for.
-             * @return Pixel height of specified text.
-             */
+		
+			/**
+			 * Returns the pixel height for the specified string based on the current label font and size settings.
+			 * @param text Text to return height for.
+			 * @return Pixel height of specified text.
+			 */
 			int getTextHeightForString(const String& text);
 
-            /**
-             * Returns the width of the current text.
-             * @return Width of the current text.
-             */
+			/**
+			 * Returns the width of the current text.
+			 * @return Width of the current text.
+			 */
 			Number getTextWidth() const;
-        
-            /**
-             * Returns the height of the current text.
-             * @return Height of the current text.
-             */
+		
+			/**
+			 * Returns the height of the current text.
+			 * @return Height of the current text.
+			 */
 			Number getTextHeight() const;
 		
-            /**
-             * Sets the color for a range of characters in the label. The colors are only applied upon the next call to setText, not the currently rendered text. This call appends the color range to a list of color ranges, so if you are calling this multiple times for the same ranges, you must call clearColors.
-             * @param color The color to set for the specified range.
-             * @param rangeStart Starting index of the specified range.
-             * @param rangeEnd Ending index of the specified range.
-             * @see clearColors
-             */
+			/**
+			 * Sets the color for a range of characters in the label. The colors are only applied upon the next call to setText, not the currently rendered text. This call appends the color range to a list of color ranges, so if you are calling this multiple times for the same ranges, you must call clearColors.
+			 * @param color The color to set for the specified range.
+			 * @param rangeStart Starting index of the specified range.
+			 * @param rangeEnd Ending index of the specified range.
+			 * @see clearColors
+			 */
 			void setColorForRange(Color color, unsigned int rangeStart, unsigned int rangeEnd);
-        
-            /**
-             * Clears the current label colors.
-             * @see setColorForRange
-             */
-            void clearColors();
-		
-            /**
-             * Returns the text color for specified character index.
-             */
+		
+			/**
+			 * Clears the current label colors.
+			 * @see setColorForRange
+			 */
+			void clearColors();
+		
+			/**
+			 * Returns the text color for specified character index.
+			 */
 			Color getColorForIndex(unsigned int index);
-        
-            /**
-             * Returns the premultiply alpha setting.
-             */
-            bool getPremultiplyAlpha() const;
-        
-            /**
-             * If set to true, will premultiply alpha when text is set to the label.
-             */
-            void setPremultiplyAlpha(bool val);
-		
-            /**
-             * Sets the Font used to render text in the label.
-             * @see Font
-             */
+		
+			/**
+			 * Returns the premultiply alpha setting.
+			 */
+			bool getPremultiplyAlpha() const;
+		
+			/**
+			 * If set to true, will premultiply alpha when text is set to the label.
+			 */
+			void setPremultiplyAlpha(bool val);
+		
+			/**
+			 * Sets the Font used to render text in the label.
+			 * @see Font
+			 */
 			void setFont(Font *newFont);
-        
-            /**
-             * Returns the Font currently used to render text in the label.
-             * @see Font
-             */
+		
+			/**
+			 * Returns the Font currently used to render text in the label.
+			 * @see Font
+			 */
 			Font *getFont() const;
 			
-            /**
-             * Sets the vertical pixel size of text rendered in the label.
-             */
+			/**
+			 * Sets the vertical pixel size of text rendered in the label.
+			 */
 			void setSize(int newSize);
-        
-            /**
-             * Return the current vertical pixel size of text rendered in the label.
-             */
+		
+			/**
+			 * Return the current vertical pixel size of text rendered in the label.
+			 */
 			unsigned int getSize() const;
 			
-            /**
-             * Returns the current antialasing mode.
-             */
+			/**
+			 * Returns the current antialasing mode.
+			 */
 			int getAntialiasMode() const;
-        
-            /**
-             * Sets the antialiasing mode used to render text.
-             * @param newMode Antialiasing mode. Can be ANTIALIAS_FULL, ANTIALIAS_NONE or ANTIALIAS_STRONG.
-             */
+		
+			/**
+			 * Sets the antialiasing mode used to render text.
+			 * @param newMode Antialiasing mode. Can be ANTIALIAS_FULL, ANTIALIAS_NONE or ANTIALIAS_STRONG.
+			 */
 			void setAntialiasMode(int newMode);
 					
 			static const int ANTIALIAS_FULL = 0;
@@ -184,33 +184,33 @@ namespace Polycode {
 			static const int ANTIALIAS_LCD = 3;
 			static const int ANTIALIAS_LCD_HINT = 4;
 			static const int ANTIALIAS_FULL_HINT = 5;
-            /**
-             * Returns the pixel distance from top of image to the baseline of the rendered text.
-             */
+			/**
+			 * Returns the pixel distance from top of image to the baseline of the rendered text.
+			 */
 			int getBaselineAdjust();
-        
-            void setBackgroundColor(const Color &color);
-            void setForegroundColor(const Color &color);
-            void setColors(const Color &backgroundColor, const Color &foregroundColor);
-        
-            Color getBackgroundColor();
-            Color getForegroundColor();
-        
+		
+			void setBackgroundColor(const Color &color);
+			void setForegroundColor(const Color &color);
+			void setColors(const Color &backgroundColor, const Color &foregroundColor);
+		
+			Color getBackgroundColor();
+			Color getForegroundColor();
+		
 			bool optionsChanged();
 			
 		protected:
-        
-            Color backgroundColor;
-            Color foregroundColor;
-        
-            void computeStringBbox(GlyphData *glyphData, FT_BBox *abbox);
-            void precacheGlyphs(String text, GlyphData *glyphData);
-            void renderGlyphs(GlyphData *glyphData);
-            void drawGlyphBitmap(FT_Bitmap *bitmap, unsigned int x, unsigned int y, const Color &glyphColor);
+		
+			Color backgroundColor;
+			Color foregroundColor;
+		
+			void computeStringBbox(GlyphData *glyphData, FT_BBox *abbox);
+			void precacheGlyphs(String text, GlyphData *glyphData);
+			void renderGlyphs(GlyphData *glyphData);
+			void drawGlyphBitmap(FT_Bitmap *bitmap, unsigned int x, unsigned int y, const Color &glyphColor);
 		
 			bool _optionsChanged;
 			GlyphData labelData;
-	        
+			
 			std::vector<ColorRange> colorRanges;
 		
 			int baseLineOffset;

+ 1 - 1
include/polycode/core/PolyLogger.h

@@ -59,7 +59,7 @@ namespace Polycode {
 			static void log(const char *format, ...);
 
 			static void log(const String &message);
-        
+		
 			/**
 			* Logs information through wcout
 			* @param str The c-string to log

+ 20 - 20
include/polycode/core/PolyMaterial.h

@@ -32,19 +32,19 @@ namespace Polycode {
 	class Shader;
 	class ShaderBinding;
 	class ShaderRenderTarget;
-    class Mesh;
-    class VertexDataArray;
-    
-    class _PolyExport ShaderPass {
-        public:
-            ShaderPass();
-            ShaderPass(Shader *shader);        
-            Shader *shader;
-            bool wireframe;
-            unsigned short blendingMode;
-            ShaderBinding* shaderBinding;
-            ShaderBinding* materialShaderBinding;
-    };
+	class Mesh;
+	class VertexDataArray;
+	
+	class _PolyExport ShaderPass {
+		public:
+			ShaderPass();
+			ShaderPass(Shader *shader);		   
+			Shader *shader;
+			bool wireframe;
+			unsigned short blendingMode;
+			ShaderBinding* shaderBinding;
+			ShaderBinding* materialShaderBinding;
+	};
 
 	class _PolyExport Material : public Resource {
 		public:
@@ -53,18 +53,18 @@ namespace Polycode {
 
 			void addShaderPass(const ShaderPass &pass);
 			void addShaderPassAtIndex(const ShaderPass &pass, unsigned int shaderIndex);
-        
-            /* DEPRECATED! Use addShaderPass! */
+		
+			/* DEPRECATED! Use addShaderPass! */
 			void addShader(Shader *shader,ShaderBinding *shaderBinding);
-            /* DEPRECATED! Use addShaderPassAtIndex! */
+			/* DEPRECATED! Use addShaderPassAtIndex! */
 			void addShaderAtIndex(Shader *shader,ShaderBinding *shaderBinding, int shaderIndex);			
 			unsigned int getNumShaderPasses() const;
 			
-        
+		
 			void removeShaderPass(int shaderIndex);
 			
-            void recreateExpectedShaderParams();
-        
+			void recreateExpectedShaderParams();
+		
 			void addShaderRenderTarget(ShaderRenderTarget *newTarget);
 			int getNumShaderRenderTargets();
 			ShaderRenderTarget *getShaderRenderTarget(unsigned int index);
@@ -78,7 +78,7 @@ namespace Polycode {
 			ShaderPass getShaderPass(unsigned int index) const;
 			ShaderBinding *getShaderBinding(unsigned int index) const;
 			Shader *getShader(unsigned int index) const;
-        
+		
 			void loadMaterial(const String& fileName);
 			
 			void setName(const String &name);

+ 11 - 11
include/polycode/core/PolyMaterialManager.h

@@ -38,7 +38,7 @@ namespace Polycode {
 	class Shader;
 	class String;
 	class ShaderProgram;
-    class ResourcePool;
+	class ResourcePool;
 	
 	/**
 	* Manages loading and reloading of materials, textures and shaders. This class should be only accessed from the CoreServices singleton.
@@ -63,8 +63,8 @@ namespace Polycode {
 		
 			Texture *getTextureByResourcePath(const String& resourcePath) const;
 			ShaderProgram *createProgramFromFile(String programPath);			
-            void loadMaterialLibraryIntoPool(ResourcePool *pool, const String &materialFile);
-        
+			void loadMaterialLibraryIntoPool(ResourcePool *pool, const String &materialFile);
+		
 			// cubemaps
 		
 			Cubemap *cubemapFromXMLNode(TiXmlNode *node);
@@ -81,10 +81,10 @@ namespace Polycode {
 			std::vector<Material*> loadMaterialsFromFile(ResourcePool *resourcePool, const String &fileName);
 			std::vector<Shader*> loadShadersFromFile(ResourcePool *resourcePool, String fileName);
 			std::vector<Cubemap*> loadCubemapsFromFile(String fileName);
-        
-            void setAnisotropyAmount(unsigned int anisotropy);
-            void setTextureFilteringMode(unsigned int textureFilteringMode);
-            unsigned int getTextureFilteringMode();
+		
+			void setAnisotropyAmount(unsigned int anisotropy);
+			void setTextureFilteringMode(unsigned int textureFilteringMode);
+			unsigned int getTextureFilteringMode();
 						
 			void addMaterial(Material *material);
 			void addShader(Shader *shader);
@@ -98,10 +98,10 @@ namespace Polycode {
 			bool keepTextureData;
 			
 		private:
-        
-            unsigned int textureFilteringMode;
-            unsigned int anisotropyAmount;
-        
+		
+			unsigned int textureFilteringMode;
+			unsigned int anisotropyAmount;
+		
 			std::vector<Texture*> textures;
 			std::vector<Material*> materials;
 			std::vector<Shader*> shaders;

+ 133 - 133
include/polycode/core/PolyMatrix4.h

@@ -41,33 +41,33 @@ namespace Polycode {
 		/**
 		* Construct with 16 matrix values.
 		*/ 
-        inline Matrix4(
-            Number m00, Number m01, Number m02, Number m03,
-            Number m10, Number m11, Number m12, Number m13,
-            Number m20, Number m21, Number m22, Number m23,
-            Number m30, Number m31, Number m32, Number m33 )
-        {
-            m[0][0] = m00;
-            m[0][1] = m01;
-            m[0][2] = m02;
-            m[0][3] = m03;
-            m[1][0] = m10;
-            m[1][1] = m11;
-            m[1][2] = m12;
-            m[1][3] = m13;
-            m[2][0] = m20;
-            m[2][1] = m21;
-            m[2][2] = m22;
-            m[2][3] = m23;
-            m[3][0] = m30;
-            m[3][1] = m31;
-            m[3][2] = m32;
-            m[3][3] = m33;
-        }
+		inline Matrix4(
+			Number m00, Number m01, Number m02, Number m03,
+			Number m10, Number m11, Number m12, Number m13,
+			Number m20, Number m21, Number m22, Number m23,
+			Number m30, Number m31, Number m32, Number m33 )
+		{
+			m[0][0] = m00;
+			m[0][1] = m01;
+			m[0][2] = m02;
+			m[0][3] = m03;
+			m[1][0] = m10;
+			m[1][1] = m11;
+			m[1][2] = m12;
+			m[1][3] = m13;
+			m[2][0] = m20;
+			m[2][1] = m21;
+			m[2][2] = m22;
+			m[2][3] = m23;
+			m[3][0] = m30;
+			m[3][1] = m31;
+			m[3][2] = m32;
+			m[3][3] = m33;
+		}
 
 			/**
 			* Construct with pointer to 16 Number values.
-			*/ 			
+			*/			
 			Matrix4(const Number *m);
 			~Matrix4();			
 			
@@ -121,40 +121,40 @@ namespace Polycode {
 			*/
 			//@{
 
-        
-            inline Matrix4 operator * (Number n) const {
-                return Matrix4(
-                           n*m[0][0], n*m[0][1], n*m[0][2], n*m[0][3],
-                           n*m[1][0], n*m[1][1], n*m[1][2], n*m[1][3],
-                           n*m[2][0], n*m[2][1], n*m[2][2], n*m[2][3],
-                           n*m[3][0], n*m[3][1], n*m[3][2], n*m[3][3]);
-            }
-        
-            inline Vector3 multVector3( const Vector3 &v2 ) const
-            {
-                return Vector3(v2.x*m[0][0] + v2.y*m[1][0] + v2.z*m[2][0] + m[3][0],
-                               v2.x*m[0][1] + v2.y*m[1][1] + v2.z*m[2][1] + m[3][1],
-                               v2.x*m[0][2] + v2.y*m[1][2] + v2.z*m[2][2] + m[3][2]);
-            }
-        
-            inline Vector4 multVector4( const Vector4 &v2 ) const
-            {
-                return Vector4(v2.x*m[0][0] + v2.y*m[1][0] + v2.z*m[2][0] + v2.w*m[3][0],
-                           v2.x*m[0][1] + v2.y*m[1][1] + v2.z*m[2][1] + v2.w*m[3][1],
-                           v2.x*m[0][2] + v2.y*m[1][2] + v2.z*m[2][2] + v2.w*m[3][2],
-                           v2.x*m[0][3] + v2.y*m[1][3] + v2.z*m[2][3] + v2.w*m[3][3]);
-            }
-        
+		
+			inline Matrix4 operator * (Number n) const {
+				return Matrix4(
+						   n*m[0][0], n*m[0][1], n*m[0][2], n*m[0][3],
+						   n*m[1][0], n*m[1][1], n*m[1][2], n*m[1][3],
+						   n*m[2][0], n*m[2][1], n*m[2][2], n*m[2][3],
+						   n*m[3][0], n*m[3][1], n*m[3][2], n*m[3][3]);
+			}
+		
+			inline Vector3 multVector3( const Vector3 &v2 ) const
+			{
+				return Vector3(v2.x*m[0][0] + v2.y*m[1][0] + v2.z*m[2][0] + m[3][0],
+							   v2.x*m[0][1] + v2.y*m[1][1] + v2.z*m[2][1] + m[3][1],
+							   v2.x*m[0][2] + v2.y*m[1][2] + v2.z*m[2][2] + m[3][2]);
+			}
+		
+			inline Vector4 multVector4( const Vector4 &v2 ) const
+			{
+				return Vector4(v2.x*m[0][0] + v2.y*m[1][0] + v2.z*m[2][0] + v2.w*m[3][0],
+						   v2.x*m[0][1] + v2.y*m[1][1] + v2.z*m[2][1] + v2.w*m[3][1],
+						   v2.x*m[0][2] + v2.y*m[1][2] + v2.z*m[2][2] + v2.w*m[3][2],
+						   v2.x*m[0][3] + v2.y*m[1][3] + v2.z*m[2][3] + v2.w*m[3][3]);
+			}
+		
 			inline Vector3 operator * ( const Vector3 &v2 ) const
 			{
 				return multVector3(v2);
 			}
-        
-        
-            inline Vector4 operator * ( const Vector4 &v2 ) const
-            {
-                return multVector4(v2);
-            }
+		
+		
+			inline Vector4 operator * ( const Vector4 &v2 ) const
+			{
+				return multVector4(v2);
+			}
 			
 			inline Number* operator [] ( int row ) { return m[row];}
 			inline const Number* operator [] ( int row ) const { return m[row];}
@@ -212,28 +212,28 @@ namespace Polycode {
 			}	
 			
 			inline Matrix4 operator * (const Matrix4 &m2) const {
-           Matrix4 r;
-            r.m[0][0] = m[0][0] * m2.m[0][0] + m[0][1] * m2.m[1][0] + m[0][2] * m2.m[2][0] + m[0][3] * m2.m[3][0];
-            r.m[0][1] = m[0][0] * m2.m[0][1] + m[0][1] * m2.m[1][1] + m[0][2] * m2.m[2][1] + m[0][3] * m2.m[3][1];
-            r.m[0][2] = m[0][0] * m2.m[0][2] + m[0][1] * m2.m[1][2] + m[0][2] * m2.m[2][2] + m[0][3] * m2.m[3][2];
-            r.m[0][3] = m[0][0] * m2.m[0][3] + m[0][1] * m2.m[1][3] + m[0][2] * m2.m[2][3] + m[0][3] * m2.m[3][3];
+		   Matrix4 r;
+			r.m[0][0] = m[0][0] * m2.m[0][0] + m[0][1] * m2.m[1][0] + m[0][2] * m2.m[2][0] + m[0][3] * m2.m[3][0];
+			r.m[0][1] = m[0][0] * m2.m[0][1] + m[0][1] * m2.m[1][1] + m[0][2] * m2.m[2][1] + m[0][3] * m2.m[3][1];
+			r.m[0][2] = m[0][0] * m2.m[0][2] + m[0][1] * m2.m[1][2] + m[0][2] * m2.m[2][2] + m[0][3] * m2.m[3][2];
+			r.m[0][3] = m[0][0] * m2.m[0][3] + m[0][1] * m2.m[1][3] + m[0][2] * m2.m[2][3] + m[0][3] * m2.m[3][3];
 
-            r.m[1][0] = m[1][0] * m2.m[0][0] + m[1][1] * m2.m[1][0] + m[1][2] * m2.m[2][0] + m[1][3] * m2.m[3][0];
-            r.m[1][1] = m[1][0] * m2.m[0][1] + m[1][1] * m2.m[1][1] + m[1][2] * m2.m[2][1] + m[1][3] * m2.m[3][1];
-            r.m[1][2] = m[1][0] * m2.m[0][2] + m[1][1] * m2.m[1][2] + m[1][2] * m2.m[2][2] + m[1][3] * m2.m[3][2];
-            r.m[1][3] = m[1][0] * m2.m[0][3] + m[1][1] * m2.m[1][3] + m[1][2] * m2.m[2][3] + m[1][3] * m2.m[3][3];
+			r.m[1][0] = m[1][0] * m2.m[0][0] + m[1][1] * m2.m[1][0] + m[1][2] * m2.m[2][0] + m[1][3] * m2.m[3][0];
+			r.m[1][1] = m[1][0] * m2.m[0][1] + m[1][1] * m2.m[1][1] + m[1][2] * m2.m[2][1] + m[1][3] * m2.m[3][1];
+			r.m[1][2] = m[1][0] * m2.m[0][2] + m[1][1] * m2.m[1][2] + m[1][2] * m2.m[2][2] + m[1][3] * m2.m[3][2];
+			r.m[1][3] = m[1][0] * m2.m[0][3] + m[1][1] * m2.m[1][3] + m[1][2] * m2.m[2][3] + m[1][3] * m2.m[3][3];
 
-            r.m[2][0] = m[2][0] * m2.m[0][0] + m[2][1] * m2.m[1][0] + m[2][2] * m2.m[2][0] + m[2][3] * m2.m[3][0];
-            r.m[2][1] = m[2][0] * m2.m[0][1] + m[2][1] * m2.m[1][1] + m[2][2] * m2.m[2][1] + m[2][3] * m2.m[3][1];
-            r.m[2][2] = m[2][0] * m2.m[0][2] + m[2][1] * m2.m[1][2] + m[2][2] * m2.m[2][2] + m[2][3] * m2.m[3][2];
-            r.m[2][3] = m[2][0] * m2.m[0][3] + m[2][1] * m2.m[1][3] + m[2][2] * m2.m[2][3] + m[2][3] * m2.m[3][3];
+			r.m[2][0] = m[2][0] * m2.m[0][0] + m[2][1] * m2.m[1][0] + m[2][2] * m2.m[2][0] + m[2][3] * m2.m[3][0];
+			r.m[2][1] = m[2][0] * m2.m[0][1] + m[2][1] * m2.m[1][1] + m[2][2] * m2.m[2][1] + m[2][3] * m2.m[3][1];
+			r.m[2][2] = m[2][0] * m2.m[0][2] + m[2][1] * m2.m[1][2] + m[2][2] * m2.m[2][2] + m[2][3] * m2.m[3][2];
+			r.m[2][3] = m[2][0] * m2.m[0][3] + m[2][1] * m2.m[1][3] + m[2][2] * m2.m[2][3] + m[2][3] * m2.m[3][3];
 
-            r.m[3][0] = m[3][0] * m2.m[0][0] + m[3][1] * m2.m[1][0] + m[3][2] * m2.m[2][0] + m[3][3] * m2.m[3][0];
-            r.m[3][1] = m[3][0] * m2.m[0][1] + m[3][1] * m2.m[1][1] + m[3][2] * m2.m[2][1] + m[3][3] * m2.m[3][1];
-            r.m[3][2] = m[3][0] * m2.m[0][2] + m[3][1] * m2.m[1][2] + m[3][2] * m2.m[2][2] + m[3][3] * m2.m[3][2];
-            r.m[3][3] = m[3][0] * m2.m[0][3] + m[3][1] * m2.m[1][3] + m[3][2] * m2.m[2][3] + m[3][3] * m2.m[3][3];
+			r.m[3][0] = m[3][0] * m2.m[0][0] + m[3][1] * m2.m[1][0] + m[3][2] * m2.m[2][0] + m[3][3] * m2.m[3][0];
+			r.m[3][1] = m[3][0] * m2.m[0][1] + m[3][1] * m2.m[1][1] + m[3][2] * m2.m[2][1] + m[3][3] * m2.m[3][1];
+			r.m[3][2] = m[3][0] * m2.m[0][2] + m[3][1] * m2.m[1][2] + m[3][2] * m2.m[2][2] + m[3][3] * m2.m[3][2];
+			r.m[3][3] = m[3][0] * m2.m[0][3] + m[3][1] * m2.m[1][3] + m[3][2] * m2.m[2][3] + m[3][3] * m2.m[3][3];
 
-            return r;
+			return r;
 
 					}
 			
@@ -241,20 +241,20 @@ namespace Polycode {
 			//@}
 			// ----------------------------------------------------------------------------------------------------------------
 
-        
-            /**
-             * Translates the position in the matrix.
-             * @param x X coordinate.
-             * @param y Y coordinate.
-             * @param z Z coordinate.
-             */
-            inline void Translate(Number x, Number y, Number z) {
-                m[3][0] += x;
-                m[3][1] += y;
-                m[3][2] += z;
-            }
-        
-        
+		
+			/**
+			 * Translates the position in the matrix.
+			 * @param x X coordinate.
+			 * @param y Y coordinate.
+			 * @param z Z coordinate.
+			 */
+			inline void Translate(Number x, Number y, Number z) {
+				m[3][0] += x;
+				m[3][1] += y;
+				m[3][2] += z;
+			}
+		
+		
 			/**
 			* Sets the position in the matrix.
 			* @param x X coordinate.
@@ -294,17 +294,17 @@ namespace Polycode {
 				angle_y *= TODEGREES;
 				
 				if(fabsf(C) > 0.005) {
-					tr_x      =  m[2][2] / C; // 10 
-					tr_y      = -m[1][2]  / C; // 6
-					angle_x  = atan2f( tr_y, tr_x ) * TODEGREES;
-					tr_x      =  m[0][0] / C; // 0
-					tr_y      = -m[0][1] / C; // 1
-					angle_z  = atan2f( tr_y, tr_x ) * TODEGREES;
+					tr_x	  =	 m[2][2] / C; // 10 
+					tr_y	  = -m[1][2]  / C; // 6
+					angle_x	 = atan2f( tr_y, tr_x ) * TODEGREES;
+					tr_x	  =	 m[0][0] / C; // 0
+					tr_y	  = -m[0][1] / C; // 1
+					angle_z	 = atan2f( tr_y, tr_x ) * TODEGREES;
 				} else {
-					angle_x  = 0;
-					tr_x      =  m[1][1];
-					tr_y      =  m[1][0];
-					angle_z  = atan2f( tr_y, tr_x ) * TODEGREES;
+					angle_x	 = 0;
+					tr_x	  =	 m[1][1];
+					tr_y	  =	 m[1][0];
+					angle_z	 = atan2f( tr_y, tr_x ) * TODEGREES;
 				}					
 				
 				if (angle_x < 0) angle_x += 360;
@@ -348,45 +348,45 @@ namespace Polycode {
 			 * @param n The number of dimensions in matrix A.
 			 */
 			static Number generalDeterminant(Number const* const*a, int n);
-        
-            // projection stuff
-        
-            inline void setOrthoProjection(Number left, Number right, Number bottom, Number top, Number zNear, Number zFar) {
-                m[0][0] = 2.0/(right-left);
-                m[1][1] = 2.0/(top-bottom);
-                m[2][2] = -2.0/(zFar-zNear);
-                
-                m[3][0] = -((right+left)/(right-left));
-                m[3][1] = -((top+bottom)/(top-bottom));
-                m[3][2] = -((zFar+zNear)/(zFar-zNear));
-            }
-        
-            inline void setProjectionFrustum(Number left, Number right, Number bottom, Number top, Number zNear, Number zFar) {
-                
-                m[0][0] = (2.0*zNear)/(right-left);
-                m[1][1] = (2.0*zNear)/(top-bottom);
-                m[3][3] = 0.0;
+		
+			// projection stuff
+		
+			inline void setOrthoProjection(Number left, Number right, Number bottom, Number top, Number zNear, Number zFar) {
+				m[0][0] = 2.0/(right-left);
+				m[1][1] = 2.0/(top-bottom);
+				m[2][2] = -2.0/(zFar-zNear);
+				
+				m[3][0] = -((right+left)/(right-left));
+				m[3][1] = -((top+bottom)/(top-bottom));
+				m[3][2] = -((zFar+zNear)/(zFar-zNear));
+			}
+		
+			inline void setProjectionFrustum(Number left, Number right, Number bottom, Number top, Number zNear, Number zFar) {
+				
+				m[0][0] = (2.0*zNear)/(right-left);
+				m[1][1] = (2.0*zNear)/(top-bottom);
+				m[3][3] = 0.0;
 
-                m[2][0] = (right+left)/(right-left);
-                m[2][1] = (top+bottom)/(top-bottom);
-                m[2][2] = (zFar+zNear)/(zFar-zNear);
-                m[2][3] = -1.0;
-                
-                m[3][2] = (2.0*zFar*zNear)/(zFar-zNear);
-                
-            }
+				m[2][0] = (right+left)/(right-left);
+				m[2][1] = (top+bottom)/(top-bottom);
+				m[2][2] = (zFar+zNear)/(zFar-zNear);
+				m[2][3] = -1.0;
+				
+				m[3][2] = (2.0*zFar*zNear)/(zFar-zNear);
+				
+			}
 
-            inline void setProjection(Number fov, Number aspect, Number zNear, Number zFar) {
-                
-                m[0][0] = 1.0f/tanf(fov/2.0)/aspect;
-                m[1][1] = 1.0f/tanf(fov/2.0);
-                m[2][2] = (zFar+zNear)/(zNear-zFar);
-                m[3][2] = (2.0f*zFar*zNear)/(zNear-zFar);
-                m[2][3] = -1.0f;
-                m[3][3] = 0.0f;
-            }
-        
-        
+			inline void setProjection(Number fov, Number aspect, Number zNear, Number zFar) {
+				
+				m[0][0] = 1.0f/tanf(fov/2.0)/aspect;
+				m[1][1] = 1.0f/tanf(fov/2.0);
+				m[2][2] = (zFar+zNear)/(zNear-zFar);
+				m[3][2] = (2.0f*zFar*zNear)/(zNear-zFar);
+				m[2][3] = -1.0f;
+				m[3][3] = 0.0f;
+			}
+		
+		
 		protected:
 		
 	};

+ 159 - 159
include/polycode/core/PolyMesh.h

@@ -36,7 +36,7 @@ class CoreFile;
 namespace Polycode {
 	
 	class String;
-    class Mesh;
+	class Mesh;
 		
 	typedef struct {
 		float x;
@@ -63,18 +63,18 @@ namespace Polycode {
 	class _PolyExport MeshGeometry {
 		public:
 			
-        
-            MeshGeometry();
+		
+			MeshGeometry();
 			/**
 			* Construct with an empty mesh of specified type.
 			* @param meshType Type of mesh. Possible values are: Mesh::TRISTRIP_MESH, Mesh::TRI_MESH, Mesh::TRIFAN_MESH, Mesh::TRISTRIP_MESH, Mesh::LINE_MESH, Mesh::POINT_MESH.
 			*/			
 			explicit MeshGeometry(int meshType);
 			virtual ~MeshGeometry();
-        
-            MeshGeometry(const MeshGeometry &geom);
-            MeshGeometry &operator=(const MeshGeometry &geom);
-        
+		
+			MeshGeometry(const MeshGeometry &geom);
+			MeshGeometry &operator=(const MeshGeometry &geom);
+		
 			/**
 			* Clears mesh data.
 			*/
@@ -107,16 +107,16 @@ namespace Polycode {
 			* Creates a 2D circle.
 			* @param w Width of circle.
 			* @param h Height of plane.			
-			* @param numSegments Number of segments 			
+			* @param numSegments Number of segments				
 			*/ 
 			void createCircle(Number w, Number h, unsigned int numSegments, Number tilingValue = 1.0);
 
-            /**
-             * Creates a 2D circle with normals pointing outwards from vertices.
-             * @param w Width of circle.
-             * @param h Height of plane.
-             * @param numSegments Number of segments
-             */
+			/**
+			 * Creates a 2D circle with normals pointing outwards from vertices.
+			 * @param w Width of circle.
+			 * @param h Height of plane.
+			 * @param numSegments Number of segments
+			 */
 			void createLineCircle(Number w, Number h, unsigned int numSegments, Number tilingValue = 1.0);
 
 			/**
@@ -125,7 +125,7 @@ namespace Polycode {
 			* @param tubeRadius Radious of the tube.
 			* @param rSegments Number of radial segments.
 			* @param tSegments Number of tube segments.
-			*/ 	
+			*/	
 			void createTorus(Number radius, Number tubeRadius, int segmentsW, int segmentsH, Number tilingValue = 1.0);
 			
 			/**
@@ -133,7 +133,7 @@ namespace Polycode {
 			* @param w Width of cube.
 			* @param d Depth of cube.			
 			* @param h Height of cube.
-			*/ 			
+			*/			
 			void createBox(Number w, Number d, Number h, Number tilingValue = 1.0);
 			
 			/**
@@ -141,7 +141,7 @@ namespace Polycode {
 			* @param radius Radius of sphere.
 			* @param numRings Number of rings.	
 			* @param numSegments Number of segments.
-			*/ 						
+			*/						
 			void createSphere(Number radius, int numRings, int numSegments, Number tilingValue = 1.0);
 
 			/**
@@ -164,7 +164,7 @@ namespace Polycode {
 			* @param radius Radius of the cylinder.
 			* @param numSegments Number of segments.
 			* @param capped Create the end caps.
-			*/ 								
+			*/								
 			void createCylinder(Number height, Number radius, int numSegments, bool capped = true, Number tilingValue = 1.0);
 
 			/**
@@ -172,7 +172,7 @@ namespace Polycode {
 			* @param height Height of the cone.
 			* @param radius Radius of the cone.
 			* @param numSegments Number of segments.
-			*/ 								
+			*/								
 			void createCone(Number height, Number radius, int numSegments, Number tilingValue = 1.0);
 
 		
@@ -181,37 +181,37 @@ namespace Polycode {
 			*/
 			Vector3 recenterMesh();
 
-            void setVertexAtOffset(unsigned int offset, Number x, Number y, Number z);
-        
-            void addVertexWithUVAndNormal(Number x, Number y, Number z, Number u, Number v, Number nx, Number ny, Number nz);
-		
-            void addTexCoord(Number u, Number v);
-            void addTexCoord2(Number u, Number v);
-        
-            void addTangent(Number x, Number y, Number z);
-        
-            void addVertexWithUV(Number x, Number y, Number z, Number u, Number v);
-        
-            void addVertex(Number x, Number y, Number z);
-        
-            void addNormal(Number nx, Number ny, Number nz);
-            void addNormal(const Vector3 &n);
+			void setVertexAtOffset(unsigned int offset, Number x, Number y, Number z);
+		
+			void addVertexWithUVAndNormal(Number x, Number y, Number z, Number u, Number v, Number nx, Number ny, Number nz);
+		
+			void addTexCoord(Number u, Number v);
+			void addTexCoord2(Number u, Number v);
+		
+			void addTangent(Number x, Number y, Number z);
+		
+			void addVertexWithUV(Number x, Number y, Number z, Number u, Number v);
+		
+			void addVertex(Number x, Number y, Number z);
+		
+			void addNormal(Number nx, Number ny, Number nz);
+			void addNormal(const Vector3 &n);
 
-            void addBoneAssignments(Number b1Weight, unsigned int b1Index, Number b2Weight, unsigned int b2Index, Number b3Weight, unsigned int b3Index, Number b4Weight, unsigned int b4Index);
-        
-            void addColor(Number r, Number g, Number b, Number a);
-            void addColor(const Color &color);
-        
-        
-            Vector3 getVertexPosition(unsigned int vertexOffset);
-        
-            Vector3 getVertexPositionAtIndex(unsigned int index);
+			void addBoneAssignments(Number b1Weight, unsigned int b1Index, Number b2Weight, unsigned int b2Index, Number b3Weight, unsigned int b3Index, Number b4Weight, unsigned int b4Index);
+		
+			void addColor(Number r, Number g, Number b, Number a);
+			void addColor(const Color &color);
+		
+		
+			Vector3 getVertexPosition(unsigned int vertexOffset);
+		
+			Vector3 getVertexPositionAtIndex(unsigned int index);
 
-            Vector2 getVertexTexCoord(unsigned int vertexOffset);
-        
-            Vector2 getVertexTexCoordAtIndex(unsigned int index);
-        
-            MeshGeometry *Copy() const;
+			Vector2 getVertexTexCoord(unsigned int vertexOffset);
+		
+			Vector2 getVertexTexCoordAtIndex(unsigned int index);
+		
+			MeshGeometry *Copy() const;
 			
 			/**
 			* Returns the radius of the mesh (furthest vertex away from origin).
@@ -289,12 +289,12 @@ namespace Polycode {
 			* Line loop based mesh.
 			*/									
 			static const int LINE_LOOP_MESH = 7;
-        
-        
-        
-            void addIndexedFace(unsigned int i1, unsigned int i2);
-            void addIndexedFace(unsigned int i1, unsigned int i2, unsigned int i3);
-            void addIndexedFace(unsigned int i1, unsigned int i2, unsigned int i3, unsigned int i4);
+		
+		
+		
+			void addIndexedFace(unsigned int i1, unsigned int i2);
+			void addIndexedFace(unsigned int i1, unsigned int i2, unsigned int i3);
+			void addIndexedFace(unsigned int i1, unsigned int i2, unsigned int i3, unsigned int i4);
 			void addIndex(unsigned int index);
 
 			/** Removes a range of vertices starting at beginRemoveVertex. vertexRemovalCount should be a multiple of the num
@@ -304,115 +304,115 @@ namespace Polycode {
 			void removeVertexRange(unsigned int beginRemoveVertex, int vertexRemovalCount = 3);
 
 			/** Removes a face from the mesh. Face is defined as a triangle for TRI_MESH, or a line for LI
-			 *  In indexedMesh mode this may result in orphaned vertices.
+			 *	In indexedMesh mode this may result in orphaned vertices.
 			 * @param faceIndex The 0-indexed face of the mesh (and NOT the index into the indices array!) */
 			void removeFace(unsigned int faceIndex);
 
 			/** For indexedMesh only, removes any unused vertices from the mesh. */
 			int removeUnusedVertices();
-        
-            unsigned int getIndexCount();
-        
-            void subdivideToRadius(Number radius, int subdivisions);
-        
-            static Vector3 calculateFaceTangent(const Vector3 &v1, const Vector3 &v2, const Vector3 &v3, const Vector2 &texCoord1, const Vector2 &texCoord2, const Vector2 &texCoord3);
-        
-            void saveAsOBJ(const String fileName);
-        
-            void normalizeBoneWeights();
-        
-            VertexDataArray vertexPositionArray;
-            VertexDataArray vertexColorArray;
-            VertexDataArray vertexNormalArray;
-            VertexDataArray vertexTexCoordArray;
-            VertexDataArray vertexTexCoord2Array;
-            VertexDataArray vertexTangentArray;
-        
-            VertexDataArray vertexBoneWeightArray;
-            VertexDataArray vertexBoneIndexArray;
-        
-            VertexDataArray customVertexArray1;
-            VertexDataArray customVertexArray2;
-            VertexDataArray customVertexArray3;
-            VertexDataArray customVertexArray4;
-        
-            IndexDataArray indexArray;
-        
-            int meshType;
-            bool dataChanged;
-            bool indexedMesh;
+		
+			unsigned int getIndexCount();
+		
+			void subdivideToRadius(Number radius, int subdivisions);
+		
+			static Vector3 calculateFaceTangent(const Vector3 &v1, const Vector3 &v2, const Vector3 &v3, const Vector2 &texCoord1, const Vector2 &texCoord2, const Vector2 &texCoord3);
+		
+			void saveAsOBJ(const String fileName);
+		
+			void normalizeBoneWeights();
+		
+			VertexDataArray vertexPositionArray;
+			VertexDataArray vertexColorArray;
+			VertexDataArray vertexNormalArray;
+			VertexDataArray vertexTexCoordArray;
+			VertexDataArray vertexTexCoord2Array;
+			VertexDataArray vertexTangentArray;
+		
+			VertexDataArray vertexBoneWeightArray;
+			VertexDataArray vertexBoneIndexArray;
+		
+			VertexDataArray customVertexArray1;
+			VertexDataArray customVertexArray2;
+			VertexDataArray customVertexArray3;
+			VertexDataArray customVertexArray4;
+		
+			IndexDataArray indexArray;
+		
+			int meshType;
+			bool dataChanged;
+			bool indexedMesh;
+	};
+	
+	class _PolyExport Mesh : public Resource {
+		public:
+		
+		
+			Mesh();
+			/**
+			 * Construct from a mesh loaded from a file.
+			 * @param fileName Path to mesh file.
+			 */
+			explicit Mesh(const String& fileName);
+		
+			~Mesh();
+		
+			/**
+			 * Construct from a mesh loaded from a file.
+			 * @param fileName Path to mesh file.
+			 */
+			static Mesh *MeshFromFileName(String& fileName);
+		
+		
+			Mesh *Copy() const;
+		
+			/**
+			 * Loads a mesh from a file.
+			 * @param fileName Path to mesh file.
+			 */
+			void loadMesh(const String& fileName);
+			/**
+			 * Saves mesh to a file.
+			 * @param fileName Path to file to save to.
+			 */
+			void saveToFile(const String& fileName, bool writeNormals = true, bool writeTangents = true, bool writeColors = true, bool writeBoneWeights = true, bool writeUVs = true, bool writeSecondaryUVs = false);
+			
+			void loadFromFile(CoreFile *inFile);
+		
+			void saveToFile(CoreFile *outFile, bool writeNormals = true, bool writeTangents = true, bool writeColors = true, bool writeBoneWeights = true, bool writeUVs = true, bool writeSecondaryUVs = false) const;
+		
+			void addSubmesh(const MeshGeometry &newSubmesh);
+			void removeSubmeshAtIndex(unsigned int index);
+		
+			unsigned int getNumSubmeshes() const;
+			MeshGeometry getSubmeshAtIndex(unsigned int index) const;
+		
+			/**
+			 * Returns an unsafe pointer to submesh.
+			 @param index Index of submesh to return pointer to.
+			 **/
+			std::shared_ptr<MeshGeometry> getSubmeshPointer(unsigned int index);
+		
+			void clearMesh();
+		
+			/**
+			 * Calculates the mesh bounding box.
+			 */
+			Vector3 calculateBBox();
+		
+			/**
+			 * Returns the radius of the mesh (furthest vertex away from origin).
+			 * @return Mesh radius.
+			 */
+			Number getRadius();
+		
+		private:
+		
+			std::vector<std::shared_ptr<MeshGeometry>> submeshes;
+		
+			void loadFromFileV2(Polycode::CoreFile *inFile);
+			void loadFromFileLegacyV1(Polycode::CoreFile *inFile);
+			
+			void writeVertexBlock(const VertexDataArray &array, Polycode::CoreFile *outFile) const ;
+			void writeIndexBlock(const IndexDataArray &array, Polycode::CoreFile *outFile) const ;
 	};
-    
-    class _PolyExport Mesh : public Resource {
-        public:
-        
-        
-            Mesh();
-            /**
-             * Construct from a mesh loaded from a file.
-             * @param fileName Path to mesh file.
-             */
-            explicit Mesh(const String& fileName);
-        
-            ~Mesh();
-        
-            /**
-             * Construct from a mesh loaded from a file.
-             * @param fileName Path to mesh file.
-             */
-            static Mesh *MeshFromFileName(String& fileName);
-        
-        
-            Mesh *Copy() const;
-        
-            /**
-             * Loads a mesh from a file.
-             * @param fileName Path to mesh file.
-             */
-            void loadMesh(const String& fileName);
-            /**
-             * Saves mesh to a file.
-             * @param fileName Path to file to save to.
-             */
-            void saveToFile(const String& fileName, bool writeNormals = true, bool writeTangents = true, bool writeColors = true, bool writeBoneWeights = true, bool writeUVs = true, bool writeSecondaryUVs = false);
-            
-            void loadFromFile(CoreFile *inFile);
-        
-            void saveToFile(CoreFile *outFile, bool writeNormals = true, bool writeTangents = true, bool writeColors = true, bool writeBoneWeights = true, bool writeUVs = true, bool writeSecondaryUVs = false) const;
-        
-            void addSubmesh(const MeshGeometry &newSubmesh);
-            void removeSubmeshAtIndex(unsigned int index);
-        
-            unsigned int getNumSubmeshes() const;
-            MeshGeometry getSubmeshAtIndex(unsigned int index) const;
-        
-            /**
-             * Returns an unsafe pointer to submesh.
-             @param index Index of submesh to return pointer to.
-             **/
-            std::shared_ptr<MeshGeometry> getSubmeshPointer(unsigned int index);
-        
-            void clearMesh();
-        
-            /**
-             * Calculates the mesh bounding box.
-             */
-            Vector3 calculateBBox();
-        
-            /**
-             * Returns the radius of the mesh (furthest vertex away from origin).
-             * @return Mesh radius.
-             */
-            Number getRadius();
-        
-        private:
-        
-            std::vector<std::shared_ptr<MeshGeometry>> submeshes;
-        
-            void loadFromFileV2(Polycode::CoreFile *inFile);
-            void loadFromFileLegacyV1(Polycode::CoreFile *inFile);
-            
-            void writeVertexBlock(const VertexDataArray &array, Polycode::CoreFile *outFile) const ;
-            void writeIndexBlock(const IndexDataArray &array, Polycode::CoreFile *outFile) const ;
-    };
 }

+ 2 - 2
include/polycode/core/PolyObject.h

@@ -38,7 +38,7 @@ namespace Polycode {
 		/**
 		* Default constructor
 		*/
-        ObjectEntry();
+		ObjectEntry();
 				
 		/**
 		* Type of entry. Possible values are (FLOAT_ENTRY, INT_ENTRY, BOOL_ENTRY, ARRAY_ENTRY, STRING_ENTRY, CONTAINER_ENTRY).
@@ -368,7 +368,7 @@ namespace Polycode {
 			
 			bool readFile();
 					
-            Polycode::CoreFile *inFile;
+			Polycode::CoreFile *inFile;
 			std::vector<String> keys;
 			Object *object;		
 

+ 59 - 59
include/polycode/core/PolyOpenGLGraphicsInterface.h

@@ -1,4 +1,4 @@
-    
+	
 /*
 Copyright (C) 2015 by Ivan Safrin
 
@@ -30,15 +30,15 @@ THE SOFTWARE.
 #include "polycode/core/PolyMesh.h"
 
 #if PLATFORM == PLATFORM_MAC
-    
+	
 	#include <OpenGL/gl.h>
 	#include <OpenGL/glext.h>
 	#include <OpenGL/glu.h>
 
 #elif PLATFORM == PLATFORM_IOS
 
-    #include <OpenGLES/ES2/gl.h>
-    #include <OpenGLES/ES2/glext.h>
+	#include <OpenGLES/ES2/gl.h>
+	#include <OpenGLES/ES2/glext.h>
 
 #elif PLATFORM == PLATFORM_WINDOWS
 
@@ -79,63 +79,63 @@ namespace Polycode {
 		~OpenGLGraphicsInterface();
 
 		// implementation
-        
-        void createTexture(Texture *texture);
-        void destroyTexture(Texture *texture);
-        
-        void setViewport(unsigned int x,unsigned  int y,unsigned  int width, unsigned height);
-        void clearBuffers(const Color &clearColor, bool colorBuffer, bool depthBuffer, bool stencilBuffer);
-        void setParamInShader(Shader *shader, ProgramParam *param, LocalShaderParam *localParam);
-        void setAttributeInShader(Shader *shader, ProgramAttribute *attribute, AttributeBinding *attributeBinding);
-        void disableAttribute(Shader *shader, const ProgramAttribute &attribute);
-        void useShader(Shader *shader);
-        
-        void createProgram(ShaderProgram *program);
-        void destroyProgram(ShaderProgram *program);
-        
-        void createShader(Shader *shader);
-        void destroyShader(Shader *shader);
-        
-        void beginDrawCall();
-        void endDrawCall();
-        void setBlendingMode(unsigned int blendingMode);
-        
-        void createRenderBuffer(RenderBuffer *renderBuffer);
-        void destroyRenderBuffer(RenderBuffer *renderBuffer);
-        void bindRenderBuffer(RenderBuffer *renderBuffer);
-        
-        void createSubmeshBuffers(MeshGeometry *submesh);
-        void destroySubmeshBufferData(void *platformData);
-        void drawSubmeshBuffers(MeshGeometry *submesh, Shader *shader);
-        
-        void drawIndices(int type, IndexDataArray *indexArray);
-        void drawArrays(int type, unsigned int vertexCount);
-        
-        void enableDepthTest(bool val);
-        void enableDepthWrite(bool val);
-        void enableBackfaceCulling(bool val);
-        void setLineSize(Number lineSize);
-        
-        void setWireframeMode(bool val);
-        
-        void enableScissor(bool val);
-        void setScissorBox(const Polycode::Rectangle &box);
-        
-        bool lineSmooth;
-        
+		
+		void createTexture(Texture *texture);
+		void destroyTexture(Texture *texture);
+		
+		void setViewport(unsigned int x,unsigned  int y,unsigned  int width, unsigned height);
+		void clearBuffers(const Color &clearColor, bool colorBuffer, bool depthBuffer, bool stencilBuffer);
+		void setParamInShader(Shader *shader, ProgramParam *param, LocalShaderParam *localParam);
+		void setAttributeInShader(Shader *shader, ProgramAttribute *attribute, AttributeBinding *attributeBinding);
+		void disableAttribute(Shader *shader, const ProgramAttribute &attribute);
+		void useShader(Shader *shader);
+		
+		void createProgram(ShaderProgram *program);
+		void destroyProgram(ShaderProgram *program);
+		
+		void createShader(Shader *shader);
+		void destroyShader(Shader *shader);
+		
+		void beginDrawCall();
+		void endDrawCall();
+		void setBlendingMode(unsigned int blendingMode);
+		
+		void createRenderBuffer(RenderBuffer *renderBuffer);
+		void destroyRenderBuffer(RenderBuffer *renderBuffer);
+		void bindRenderBuffer(RenderBuffer *renderBuffer);
+		
+		void createSubmeshBuffers(MeshGeometry *submesh);
+		void destroySubmeshBufferData(void *platformData);
+		void drawSubmeshBuffers(MeshGeometry *submesh, Shader *shader);
+		
+		void drawIndices(int type, IndexDataArray *indexArray);
+		void drawArrays(int type, unsigned int vertexCount);
+		
+		void enableDepthTest(bool val);
+		void enableDepthWrite(bool val);
+		void enableBackfaceCulling(bool val);
+		void setLineSize(Number lineSize);
+		
+		void setWireframeMode(bool val);
+		
+		void enableScissor(bool val);
+		void setScissorBox(const Polycode::Rectangle &box);
+		
+		bool lineSmooth;
+		
 	protected:
 		
-        GLuint currentShaderID;
-        int textureIndex;
-        
-        static int mapNameToArrayType(const String &name);
-        static GLenum getGLDrawMode(int polycodeMode);
-        static int getPolycodeParamType(int glType);
-        static int getAttributeSize(int glType);
-        void setUniformMatrix(GLint paramLocation, const Polycode::Matrix4& matrix);
-        void createVertexBuffer(VertexDataArray *array);
-        void createIndexBuffer(IndexDataArray *array);
-        void destroyBuffer(RenderDataArray *array);
+		GLuint currentShaderID;
+		int textureIndex;
+		
+		static int mapNameToArrayType(const String &name);
+		static GLenum getGLDrawMode(int polycodeMode);
+		static int getPolycodeParamType(int glType);
+		static int getAttributeSize(int glType);
+		void setUniformMatrix(GLint paramLocation, const Polycode::Matrix4& matrix);
+		void createVertexBuffer(VertexDataArray *array);
+		void createIndexBuffer(IndexDataArray *array);
+		void destroyBuffer(RenderDataArray *array);
 	};
 }
 

+ 19 - 19
include/polycode/core/PolyPAAudioInterface.h

@@ -1,4 +1,4 @@
-    
+	
 /*
 Copyright (C) 2015 by Ivan Safrin
 
@@ -29,22 +29,22 @@ THE SOFTWARE.
 
 
 namespace Polycode {
-    
-    class PAAudioInterface : public Polycode::AudioInterface {
-        public:
-            PAAudioInterface();
-            ~PAAudioInterface();
-        
-            static int paCallback(const void *inputBuffer, void *outputBuffer,
-                                  unsigned long framesPerBuffer,
-                                  const PaStreamCallbackTimeInfo* timeInfo,
-                                  PaStreamCallbackFlags statusFlags,
-                                   void *userData);
-        
-        private:
-        
-        
-            PaStream *stream;
-    };
-    
+	
+	class PAAudioInterface : public Polycode::AudioInterface {
+		public:
+			PAAudioInterface();
+			~PAAudioInterface();
+		
+			static int paCallback(const void *inputBuffer, void *outputBuffer,
+								  unsigned long framesPerBuffer,
+								  const PaStreamCallbackTimeInfo* timeInfo,
+								  PaStreamCallbackFlags statusFlags,
+								   void *userData);
+		
+		private:
+		
+		
+			PaStream *stream;
+	};
+	
 }

+ 151 - 151
include/polycode/core/PolyParticleEmitter.h

@@ -28,156 +28,156 @@ THE SOFTWARE.
 #include "polycode/core/PolyBezierCurve.h"
 
 namespace Polycode {
-    
-    class SceneParticle {
-        public:
-            Number lifetime;
-            Vector3 position;
-            Vector3 velocity;
-            Vector3 perlinPos;
-            Vector3 rotation;
-            Number brightnessDeviation;
-            Number scale;
-            Color color;
-            int varianceIndex;
-    };
-    
-    class SceneParticleEmitter : public SceneMesh {
-        public:
-            SceneParticleEmitter(unsigned int particleCount, Number lifetime, Number speed);
-            virtual ~SceneParticleEmitter();
-        
-            void setParticleCount(unsigned int newParticleCount);
-            unsigned int getParticleCount() const;
-        
-            void setParticleLifetime(Number lifetime);
-            Number getParticleLifetime() const;
-        
-            void setDirectionDeviation(const Vector3 &newDeviation);
-            Vector3 getDirectionDeviation() const;
-        
-            void setEmitterSize(const Vector3 &newSize);
-            Vector3 getEmitterSize() const;
-        
-            void setGravity(const Vector3 &newGravity);
-            Vector3 getGravity() const;
-        
-            void fixedUpdate();
-            void Render(GPUDrawBuffer *buffer);
-            void updateParticles();
-            void rebuildParticles(GPUDrawBuffer *buffer);
-        
-            void triggerParticles(bool allAtOnce);
-        
-            void enableParticleSystem(bool val);
-        
-            void setUseFloorPlane(bool val);
-            void setFloorPlaneOffset(Number floorPlaneOffset);
-            void setFloorDamping(Number floorDamping);
-        
-            void setParticlesInWorldSpace(bool val);
-            bool getParticlesInWorldSpace() const;
-        
-            void setPerlinEnabled(bool val);
-            bool getPerlinEnabled() const;
-        
-            Number getParticleSpeed() const;
-            void setParticleSpeed(Number speed);
-        
-            void setPerlinValue(const Vector3 &perlinValue);
-            Vector3 getPerlinValue() const;
-        
-            void setParticleType(unsigned int particleType);
-            unsigned int getParticleType() const;
-        
-            void setParticleSize(Number particleSize);
-            Number getParticleSize() const;
-        
-            void setParticleRotationSpeed(const Vector3 &rotationSpeed);
-            Vector3 getParticleRotationSpeed() const;
-        
-            void setParticleDirection(const Vector3 &direction);
-            Vector3 getParticleDirection() const;
-        
-            void setLoopParticles(bool val);
-            bool getLoopParticles() const;
-        
-            static const int PARTICLE_TYPE_POINT = 0;
-            static const int PARTICLE_TYPE_QUAD = 1;
-            static const int PARTICLE_TYPE_MESH = 2;
-        
-            bool useScaleCurve;
-        
-            /**
-             * Bezier curve that controls the scale of the particles.
-             */
-            BezierCurve scaleCurve;
-        
-            bool useColorCurves;
+	
+	class SceneParticle {
+		public:
+			Number lifetime;
+			Vector3 position;
+			Vector3 velocity;
+			Vector3 perlinPos;
+			Vector3 rotation;
+			Number brightnessDeviation;
+			Number scale;
+			Color color;
+			int varianceIndex;
+	};
+	
+	class SceneParticleEmitter : public SceneMesh {
+		public:
+			SceneParticleEmitter(unsigned int particleCount, Number lifetime, Number speed);
+			virtual ~SceneParticleEmitter();
+		
+			void setParticleCount(unsigned int newParticleCount);
+			unsigned int getParticleCount() const;
+		
+			void setParticleLifetime(Number lifetime);
+			Number getParticleLifetime() const;
+		
+			void setDirectionDeviation(const Vector3 &newDeviation);
+			Vector3 getDirectionDeviation() const;
+		
+			void setEmitterSize(const Vector3 &newSize);
+			Vector3 getEmitterSize() const;
+		
+			void setGravity(const Vector3 &newGravity);
+			Vector3 getGravity() const;
+		
+			void fixedUpdate();
+			void Render(GPUDrawBuffer *buffer);
+			void updateParticles();
+			void rebuildParticles(GPUDrawBuffer *buffer);
+		
+			void triggerParticles(bool allAtOnce);
+		
+			void enableParticleSystem(bool val);
+		
+			void setUseFloorPlane(bool val);
+			void setFloorPlaneOffset(Number floorPlaneOffset);
+			void setFloorDamping(Number floorDamping);
+		
+			void setParticlesInWorldSpace(bool val);
+			bool getParticlesInWorldSpace() const;
+		
+			void setPerlinEnabled(bool val);
+			bool getPerlinEnabled() const;
+		
+			Number getParticleSpeed() const;
+			void setParticleSpeed(Number speed);
+		
+			void setPerlinValue(const Vector3 &perlinValue);
+			Vector3 getPerlinValue() const;
+		
+			void setParticleType(unsigned int particleType);
+			unsigned int getParticleType() const;
+		
+			void setParticleSize(Number particleSize);
+			Number getParticleSize() const;
+		
+			void setParticleRotationSpeed(const Vector3 &rotationSpeed);
+			Vector3 getParticleRotationSpeed() const;
+		
+			void setParticleDirection(const Vector3 &direction);
+			Vector3 getParticleDirection() const;
+		
+			void setLoopParticles(bool val);
+			bool getLoopParticles() const;
+		
+			static const int PARTICLE_TYPE_POINT = 0;
+			static const int PARTICLE_TYPE_QUAD = 1;
+			static const int PARTICLE_TYPE_MESH = 2;
+		
+			bool useScaleCurve;
+		
+			/**
+			 * Bezier curve that controls the scale of the particles.
+			 */
+			BezierCurve scaleCurve;
+		
+			bool useColorCurves;
 
-            /**
-             * Bezier curve that controls the red component of particles' color.
-             */
-            BezierCurve colorCurveR;
-            /**
-             * Bezier curve that controls the green component of particles' color.
-             */
-            BezierCurve colorCurveG;
-            /**
-             * Bezier curve that controls the blue component of particles' color.
-             */
-            BezierCurve colorCurveB;
-            /**
-             * Bezier curve that controls the alpha component of particles' color.
-             */
-            BezierCurve colorCurveA;
-        
-        
-            Color colorDeviation;
-        
-            void addSourceMesh(Mesh *mesh);
-            int getNumSourceMeshes();
-            Mesh *getSourcesMeshAtIndex(int index);
-            void removeSourceMeshAtIndex(int index);
-        
-            void positionParticle(unsigned int index);
-        
-            virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
-            virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
-        
-        protected:
-        
-            std::vector<Mesh*> sourceMeshes;
-            void resetParticle(unsigned int index);
-        
-            bool systemEnabled;
-            Core *core;
-            unsigned int particleCount;
-            std::vector<SceneParticle> particles;
-            Number particleSpeed;
-            Number lifetime;
-        
-            Vector3 directionVector;
-            Vector3 directionDeviation;
-            Vector3 emitterSize;
-            Vector3 gravity;
-        
-            Matrix4 systemTrasnformMatrix;
-            bool useFloorPlane;
-            bool particlesInWorldSpace;
-            bool perlinEnabled;
-            Vector3 perlinValue;
-            Perlin *motionPerlin;
-            Number particleSize;
-            Vector3 particleRotationSpeed;
-        
-            Number floorPlaneOffset;
-            Number floorDamping;
-        
-            bool loopParticles;
-        
-            unsigned int particleType;
-            Quaternion q;
-    };
-    
+			/**
+			 * Bezier curve that controls the red component of particles' color.
+			 */
+			BezierCurve colorCurveR;
+			/**
+			 * Bezier curve that controls the green component of particles' color.
+			 */
+			BezierCurve colorCurveG;
+			/**
+			 * Bezier curve that controls the blue component of particles' color.
+			 */
+			BezierCurve colorCurveB;
+			/**
+			 * Bezier curve that controls the alpha component of particles' color.
+			 */
+			BezierCurve colorCurveA;
+		
+		
+			Color colorDeviation;
+		
+			void addSourceMesh(Mesh *mesh);
+			int getNumSourceMeshes();
+			Mesh *getSourcesMeshAtIndex(int index);
+			void removeSourceMeshAtIndex(int index);
+		
+			void positionParticle(unsigned int index);
+		
+			virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
+			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
+		
+		protected:
+		
+			std::vector<Mesh*> sourceMeshes;
+			void resetParticle(unsigned int index);
+		
+			bool systemEnabled;
+			Core *core;
+			unsigned int particleCount;
+			std::vector<SceneParticle> particles;
+			Number particleSpeed;
+			Number lifetime;
+		
+			Vector3 directionVector;
+			Vector3 directionDeviation;
+			Vector3 emitterSize;
+			Vector3 gravity;
+		
+			Matrix4 systemTrasnformMatrix;
+			bool useFloorPlane;
+			bool particlesInWorldSpace;
+			bool perlinEnabled;
+			Vector3 perlinValue;
+			Perlin *motionPerlin;
+			Number particleSize;
+			Vector3 particleRotationSpeed;
+		
+			Number floorPlaneOffset;
+			Number floorDamping;
+		
+			bool loopParticles;
+		
+			unsigned int particleType;
+			Quaternion q;
+	};
+	
 }

+ 2 - 2
include/polycode/core/PolyPeer.h

@@ -90,8 +90,8 @@ namespace Polycode {
 			* port and accept incoming packets.
 			*
 			* @param port The UDP port to listen for packets. Can not be omitted,
-			*             this will be the actual port this peer will use to send
-			*             and receive packets.
+			*			  this will be the actual port this peer will use to send
+			*			  and receive packets.
 			*/
 			Peer(unsigned int port);
 			~Peer();

+ 21 - 21
include/polycode/core/PolyPerlin.h

@@ -52,7 +52,7 @@ public:
 	/**
 	* Returns noise value at the specified coordinate.
 	* @param x Horizontal coordinate.
-	* @param y Vertical coordinate.	
+	* @param y Vertical coordinate. 
 	*/ 
 
 	Number Get(Number x,Number y) {
@@ -76,27 +76,27 @@ public:
 
 
 protected:
-  void init_perlin(int n,Number p);
-  Number perlin_noise_2D(Number vec[2]);
-  Number perlin_noise_3D(Number vec[2]);
+	void init_perlin(int n,Number p);
+	Number perlin_noise_2D(Number vec[2]);
+	Number perlin_noise_3D(Number vec[2]);
   
-  Number noise1(Number arg);
-  Number noise2(Number vec[2]);
-  Number noise3(Number vec[3]);
-  void normalize2(Number v[2]);
-  void normalize3(Number v[3]);
-  void init(void);
-
-  int   mOctaves;
-  Number mFrequency;
-  Number mAmplitude;
-  int   mSeed;
-
-  int p[SAMPLE_SIZE + SAMPLE_SIZE + 2];
-  Number g3[SAMPLE_SIZE + SAMPLE_SIZE + 2][3];
-  Number g2[SAMPLE_SIZE + SAMPLE_SIZE + 2][2];
-  Number g1[SAMPLE_SIZE + SAMPLE_SIZE + 2];
-  bool  mStart;
+	Number noise1(Number arg);
+	Number noise2(Number vec[2]);
+	Number noise3(Number vec[3]);
+	void normalize2(Number v[2]);
+	void normalize3(Number v[3]);
+	void init(void);
+
+	int	mOctaves;
+	Number mFrequency;
+	Number mAmplitude;
+	int	mSeed;
+
+	int p[SAMPLE_SIZE + SAMPLE_SIZE + 2];
+	Number g3[SAMPLE_SIZE + SAMPLE_SIZE + 2][3];
+	Number g2[SAMPLE_SIZE + SAMPLE_SIZE + 2][2];
+	Number g1[SAMPLE_SIZE + SAMPLE_SIZE + 2];
+	bool	mStart;
 
 };
 

+ 24 - 24
include/polycode/core/PolyPhysFSFileProvider.h

@@ -27,29 +27,29 @@
 
 namespace Polycode {
 
-    class _PolyExport PhysFSFile : public CoreFile {
-    public:
-        
-        long read( void * ptr, size_t size, size_t count);
-        long write( const void * ptr, size_t size, size_t count);
-        int seek(long int offset, int origin);
-        long tell();
-        
-        PHYSFS_File *physFSFile;
-    };
+	class _PolyExport PhysFSFile : public CoreFile {
+	public:
+		
+		long read( void * ptr, size_t size, size_t count);
+		long write( const void * ptr, size_t size, size_t count);
+		int seek(long int offset, int origin);
+		long tell();
+		
+		PHYSFS_File *physFSFile;
+	};
 
-    class _PolyExport PhysFSFileProvider : public CoreFileProvider {
-        public:
-            PhysFSFileProvider();
-            ~PhysFSFileProvider();
-        
-            Polycode::CoreFile *openFile(const String &fileName, const String &opts);
-            void closeFile(Polycode::CoreFile *file);
-        
-            bool parseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector);
-        
-            void addSource(const String &source);
-            void removeSource(const String &source);
-    };
-    
+	class _PolyExport PhysFSFileProvider : public CoreFileProvider {
+		public:
+			PhysFSFileProvider();
+			~PhysFSFileProvider();
+		
+			Polycode::CoreFile *openFile(const String &fileName, const String &opts);
+			void closeFile(Polycode::CoreFile *file);
+		
+			bool parseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector);
+		
+			void addSource(const String &source);
+			void removeSource(const String &source);
+	};
+	
 }

+ 6 - 6
include/polycode/core/PolyQuaternion.h

@@ -46,7 +46,7 @@ namespace Polycode {
 			
 			/**
 			* Default constructor.
-			*/ 			
+			*/			
 			Quaternion();
 			~Quaternion();
 			
@@ -95,7 +95,7 @@ namespace Polycode {
 			Quaternion Log () const;
 			Quaternion Exp () const;	
 			Number Norm () const;
-			Number Normalize();	
+			Number Normalize(); 
 			Quaternion operator+ (const Quaternion& rkQ) const;
 			Quaternion operator* (const Quaternion& rkQ) const;
 			Quaternion operator* (Number fScalar) const;
@@ -118,8 +118,8 @@ namespace Polycode {
 			}
 			
 			void createFromMatrix(const Matrix4& matrix) {
-				Number  tr, s, q[4];
-				int    i, j, k;
+				Number	tr, s, q[4];
+				int	   i, j, k;
 				
 				static const int nxt[3] = {1, 2, 0};			
 				
@@ -240,14 +240,14 @@ namespace Polycode {
 			}
 
 			Vector3 toEulerAngles () const {
-                return Vector3(atan2( 2 * ( w * x + y * z), 1 - 2 * (x * x + y * y)), asin(2 * ( w * y - z * x)), atan2( 2 * ( w * z + x * y), 1 - 2 * (y * y + z * z) ));
+				return Vector3(atan2( 2 * ( w * x + y * z), 1 - 2 * (x * x + y * y)), asin(2 * ( w * y - z * x)), atan2( 2 * ( w * z + x * y), 1 - 2 * (y * y + z * z) ));
 			}
 
 			//-----------------------------------------------------------------------
 			void toAngleAxis (Number& rfAngle, Vector3& rkAxis) 
 			{
 				// The quaternion representing the rotation is
-				//   q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
+				//	 q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
 
 				Number fSqrLength = x*x+y*y+z*z;
 				if ( fSqrLength > 0.0 )

+ 1 - 1
include/polycode/core/PolyQuaternionCurve.h

@@ -34,7 +34,7 @@ namespace Polycode {
 		Quaternion q1;
 		Quaternion q2;
 		Quaternion q3;
-        Number time;
+		Number time;
 	};	
 
 	class _PolyExport QuaternionCurve : public PolyBase {

+ 107 - 107
include/polycode/core/PolyRenderDataArray.h

@@ -26,118 +26,118 @@
 #include <vector>
 
 namespace Polycode {
-    
-    class RenderDataArray : public PolyBase {
-    public:
-        
-        RenderDataArray(unsigned int type);
-        RenderDataArray(const RenderDataArray &other);
-        virtual RenderDataArray &operator=(const RenderDataArray &other);
-        
-        unsigned int type;
-        virtual void *getArrayData() const;
-        virtual unsigned int getDataSize() const;
-        
-        String customArrayName;
-        void *platformData;
-        
-        /**
-         * Vertex position array.
-         */
-        static const int VERTEX_DATA_ARRAY = 0;
-        
-        /**
-         * Vertex color array.
-         */
-        static const int COLOR_DATA_ARRAY = 1;
-        
-        /**
-         * Vertex normal array.
-         */
-        static const int NORMAL_DATA_ARRAY = 2;
-        
-        /**
-         * Vertex texture coordinate array.
-         */
-        static const int TEXCOORD_DATA_ARRAY = 3;
-        
-        /**
-         * Tangent array.
-         */
-        static const int TANGENT_DATA_ARRAY = 4;
-        
-        /**
-         * Bone weight array.
-         */
-        static const int BONE_WEIGHT_DATA_ARRAY = 5;
-        
-        /**
-         * Bone weight array.
-         */
-        static const int BONE_INDEX_DATA_ARRAY = 6;
-        
-        /**
-         * Index data array.
-         */
-        static const int INDEX_DATA_ARRAY = 7;
-        
-        /**
-         * Secondary texture coordinate array.
-         */
-        static const int TEXCOORD2_DATA_ARRAY = 8;
-        
-        /**
-         * Custom data array.
-         */
-        static const int CUSTOM_DATA_ARRAY1 = 9;
-        
-        /**
-         * Custom data array.
-         */
-        static const int CUSTOM_DATA_ARRAY2 = 10;
+	
+	class RenderDataArray : public PolyBase {
+	public:
+		
+		RenderDataArray(unsigned int type);
+		RenderDataArray(const RenderDataArray &other);
+		virtual RenderDataArray &operator=(const RenderDataArray &other);
+		
+		unsigned int type;
+		virtual void *getArrayData() const;
+		virtual unsigned int getDataSize() const;
+		
+		String customArrayName;
+		void *platformData;
+		
+		/**
+		 * Vertex position array.
+		 */
+		static const int VERTEX_DATA_ARRAY = 0;
+		
+		/**
+		 * Vertex color array.
+		 */
+		static const int COLOR_DATA_ARRAY = 1;
+		
+		/**
+		 * Vertex normal array.
+		 */
+		static const int NORMAL_DATA_ARRAY = 2;
+		
+		/**
+		 * Vertex texture coordinate array.
+		 */
+		static const int TEXCOORD_DATA_ARRAY = 3;
+		
+		/**
+		 * Tangent array.
+		 */
+		static const int TANGENT_DATA_ARRAY = 4;
+		
+		/**
+		 * Bone weight array.
+		 */
+		static const int BONE_WEIGHT_DATA_ARRAY = 5;
+		
+		/**
+		 * Bone weight array.
+		 */
+		static const int BONE_INDEX_DATA_ARRAY = 6;
+		
+		/**
+		 * Index data array.
+		 */
+		static const int INDEX_DATA_ARRAY = 7;
+		
+		/**
+		 * Secondary texture coordinate array.
+		 */
+		static const int TEXCOORD2_DATA_ARRAY = 8;
+		
+		/**
+		 * Custom data array.
+		 */
+		static const int CUSTOM_DATA_ARRAY1 = 9;
+		
+		/**
+		 * Custom data array.
+		 */
+		static const int CUSTOM_DATA_ARRAY2 = 10;
 
-        /**
-         * Custom data array.
-         */
-        static const int CUSTOM_DATA_ARRAY3 = 11;
+		/**
+		 * Custom data array.
+		 */
+		static const int CUSTOM_DATA_ARRAY3 = 11;
 
-        /**
-         * Custom data array.
-         */
-        static const int CUSTOM_DATA_ARRAY4 = 12;        
-        
-        /**
-         * Unknown data array.
-         */
-        static const int UNKNOWN_DATA_ARRAY = 13;
-    };
+		/**
+		 * Custom data array.
+		 */
+		static const int CUSTOM_DATA_ARRAY4 = 12;		 
+		
+		/**
+		 * Unknown data array.
+		 */
+		static const int UNKNOWN_DATA_ARRAY = 13;
+	};
 
-    class VertexDataArray : public RenderDataArray {
-    public:
-        VertexDataArray(unsigned char countPerVertex, unsigned int type) : RenderDataArray(type), countPerVertex(countPerVertex) {
-        }
-        VertexDataArray(const VertexDataArray &other);
-        VertexDataArray &operator=(const VertexDataArray &other);
+	class VertexDataArray : public RenderDataArray {
+	public:
+		VertexDataArray(unsigned char countPerVertex, unsigned int type) : RenderDataArray(type), countPerVertex(countPerVertex) {
+		}
+		VertexDataArray(const VertexDataArray &other);
+		VertexDataArray &operator=(const VertexDataArray &other);
 
-        
-        unsigned char getCountPerVertex() const;
-        unsigned char countPerVertex;
-        std::vector<PolyRendererVertexType> data;
-        virtual void *getArrayData() const;
-        virtual unsigned int getDataSize() const;
-    };
+		
+		unsigned char getCountPerVertex() const;
+		unsigned char countPerVertex;
+		std::vector<PolyRendererVertexType> data;
+		virtual void *getArrayData() const;
+		virtual unsigned int getDataSize() const;
+	};
 
-    class IndexDataArray : public RenderDataArray {
-    public:
-        IndexDataArray(unsigned int type) : RenderDataArray(type) {
-        }
-        IndexDataArray(const IndexDataArray &other);
-        IndexDataArray &operator=(const IndexDataArray &other);
+	class IndexDataArray : public RenderDataArray {
+	public:
+		IndexDataArray(unsigned int type) : RenderDataArray(type) {
+		}
+		IndexDataArray(const IndexDataArray &other);
+		IndexDataArray &operator=(const IndexDataArray &other);
 
-        
-        std::vector<PolyRendererIndexType> data;
-        virtual void *getArrayData() const;
-        virtual unsigned int getDataSize() const;
-    };
+		
+		std::vector<PolyRendererIndexType> data;
+		virtual void *getArrayData() const;
+		virtual unsigned int getDataSize() const;
+	};
 
 }

+ 207 - 207
include/polycode/core/PolyRenderer.h

@@ -41,224 +41,224 @@ THE SOFTWARE.
 #define MAX_QUEUED_FRAMES 2
 
 namespace Polycode {
-    
-    class Texture;
-    class RenderBuffer;
-    
-    class _PolyExport GraphicsInterface : public PolyBase {
-        public:
-            GraphicsInterface();
-            virtual void setParamInShader(Shader *shader, ProgramParam *param, LocalShaderParam *localParam) = 0;
-            virtual void setAttributeInShader(Shader *shader, ProgramAttribute *attribute, AttributeBinding *attributeBinding) = 0;
-            virtual void disableAttribute(Shader *shader, const ProgramAttribute &attribute) = 0;
-            virtual void createTexture(Texture *texture) = 0;
-            virtual void destroyTexture(Texture *texture) = 0;
-        
-            virtual void setViewport(unsigned int x,unsigned  int y,unsigned  int width, unsigned height) = 0;
-            virtual void clearBuffers(const Color &clearColor, bool colorBuffer, bool depthBuffer, bool stencilBuffer) = 0;
-            virtual void createProgram(ShaderProgram *program) = 0;
-            virtual void destroyProgram(ShaderProgram *program) = 0;
+	
+	class Texture;
+	class RenderBuffer;
+	
+	class _PolyExport GraphicsInterface : public PolyBase {
+		public:
+			GraphicsInterface();
+			virtual void setParamInShader(Shader *shader, ProgramParam *param, LocalShaderParam *localParam) = 0;
+			virtual void setAttributeInShader(Shader *shader, ProgramAttribute *attribute, AttributeBinding *attributeBinding) = 0;
+			virtual void disableAttribute(Shader *shader, const ProgramAttribute &attribute) = 0;
+			virtual void createTexture(Texture *texture) = 0;
+			virtual void destroyTexture(Texture *texture) = 0;
+		
+			virtual void setViewport(unsigned int x,unsigned  int y,unsigned  int width, unsigned height) = 0;
+			virtual void clearBuffers(const Color &clearColor, bool colorBuffer, bool depthBuffer, bool stencilBuffer) = 0;
+			virtual void createProgram(ShaderProgram *program) = 0;
+			virtual void destroyProgram(ShaderProgram *program) = 0;
 
-            virtual void destroyShader(Shader *shader) = 0;
-            virtual void createShader(Shader *shader) = 0;
-            virtual void useShader(Shader *shader) = 0;
+			virtual void destroyShader(Shader *shader) = 0;
+			virtual void createShader(Shader *shader) = 0;
+			virtual void useShader(Shader *shader) = 0;
 
-            virtual void createSubmeshBuffers(MeshGeometry *submesh) = 0;
-            virtual void destroySubmeshBufferData(void *platformData) = 0;
-            virtual void drawSubmeshBuffers(MeshGeometry *submesh, Shader *shader) = 0;
-        
-            virtual void enableDepthTest(bool val) = 0;
-            virtual void enableDepthWrite(bool val) = 0;
-            virtual void setBlendingMode(unsigned int blendingMode) = 0;
-            virtual void enableBackfaceCulling(bool val) = 0;
-            virtual void setLineSize(Number lineSize) = 0;
-        
-            virtual void enableScissor(bool val) = 0;
-            virtual void setScissorBox(const Polycode::Rectangle &box) = 0;
-        
-            virtual void setWireframeMode(bool val) = 0;
-        
-            virtual void createRenderBuffer(RenderBuffer *renderBuffer) = 0;
-            virtual void destroyRenderBuffer(RenderBuffer *renderBuffer) = 0;
-            virtual void bindRenderBuffer(RenderBuffer *buffer) = 0;
-        
-            virtual void beginDrawCall() = 0;
-            virtual void endDrawCall() = 0;
-    };
-    
-    class _PolyExport RendererThreadJob {
-        public:
-            int jobType;
-            void *data;
-            void *data2;
-    };
-    
-    class RenderThreadDebugInfo {
-        public:
-            unsigned int buffersProcessed;
-            unsigned int drawCallsProcessed;
-            unsigned int timeTaken;
-    };
+			virtual void createSubmeshBuffers(MeshGeometry *submesh) = 0;
+			virtual void destroySubmeshBufferData(void *platformData) = 0;
+			virtual void drawSubmeshBuffers(MeshGeometry *submesh, Shader *shader) = 0;
+		
+			virtual void enableDepthTest(bool val) = 0;
+			virtual void enableDepthWrite(bool val) = 0;
+			virtual void setBlendingMode(unsigned int blendingMode) = 0;
+			virtual void enableBackfaceCulling(bool val) = 0;
+			virtual void setLineSize(Number lineSize) = 0;
+		
+			virtual void enableScissor(bool val) = 0;
+			virtual void setScissorBox(const Polycode::Rectangle &box) = 0;
+		
+			virtual void setWireframeMode(bool val) = 0;
+		
+			virtual void createRenderBuffer(RenderBuffer *renderBuffer) = 0;
+			virtual void destroyRenderBuffer(RenderBuffer *renderBuffer) = 0;
+			virtual void bindRenderBuffer(RenderBuffer *buffer) = 0;
+		
+			virtual void beginDrawCall() = 0;
+			virtual void endDrawCall() = 0;
+	};
+	
+	class _PolyExport RendererThreadJob {
+		public:
+			int jobType;
+			void *data;
+			void *data2;
+	};
+	
+	class RenderThreadDebugInfo {
+		public:
+			unsigned int buffersProcessed;
+			unsigned int drawCallsProcessed;
+			unsigned int timeTaken;
+	};
 
-    class LightInfoBinding {
-        public:
-            LocalShaderParam *position;
-            LocalShaderParam *direction;
-            LocalShaderParam *specular;
-            LocalShaderParam *diffuse;
-            LocalShaderParam *spotExponent;
-            LocalShaderParam *spotCosCutoff;
-            LocalShaderParam *constantAttenuation;
-            LocalShaderParam *linearAttenuation;
-            LocalShaderParam *quadraticAttenuation;
-            LocalShaderParam *shadowEnabled;
-    };
-    
-    class LightShadowInfoBinding {
-    public:
-        LocalShaderParam *shadowMatrix;
-        LocalShaderParam *shadowBuffer;
-    };
-    
-    class _PolyExport RenderFrame : public PolyBase {
-    public:
-        std::queue<RendererThreadJob> jobQueue;
-    };
-    
-    class _PolyExport RenderThread : public Threaded {
-        public:
-            RenderThread();
-             void setGraphicsInterface(Core *core, GraphicsInterface *graphicsInterface);
-            virtual void runThread();
-	    void updateRenderThread();   
-            void enqueueFrame(RenderFrame *frame);
-        
-            void enqueueJob(int jobType, void *data, void *data2=NULL);
-            void processJob(const RendererThreadJob &job);
-        
-            ShaderBinding *getShaderBinding();
-        
-            void processDrawBufferLights(GPUDrawBuffer *buffer);
-            void processDrawBuffer(GPUDrawBuffer *buffer);
-            RenderThreadDebugInfo getFrameInfo();
-        
-            void clearFrameQueue();
-        
-            void initGlobals();
-        
-            void lockRenderMutex();
-            void unlockRenderMutex();
-        
-            static const int JOB_REQUEST_CONTEXT_CHANGE = 0;
-            static const int JOB_CREATE_TEXTURE = 1;
-            static const int JOB_PROCESS_DRAW_BUFFER = 2;
-            static const int JOB_END_FRAME = 3;
-            static const int JOB_CREATE_PROGRAM = 4;
-            static const int JOB_CREATE_SHADER = 5;
-            static const int JOB_BEGIN_FRAME = 6;
-            static const int JOB_DESTROY_TEXTURE = 8;
-            static const int JOB_DESTROY_SHADER = 9;
-            static const int JOB_DESTROY_PROGRAM = 10;
-            static const int JOB_DESTROY_SUBMESH_BUFFER = 11;
-            static const int JOB_CREATE_RENDER_BUFFER = 12;
-            static const int JOB_DESTROY_RENDER_BUFFER = 13;
-            static const int JOB_SET_TEXTURE_PARAM = 14;
-            static const int JOB_DESTROY_SHADER_BINDING = 16;
-            static const int JOB_DESTROY_SHADER_PARAM = 17;
-        
-        protected:
-        
-            unsigned int frameStart;
-            RenderThreadDebugInfo lastFrameDebugInfo;
-            RenderThreadDebugInfo currentDebugFrameInfo;
-        
-            Core *core;
-            CoreMutex *jobQueueMutex;
-            CoreMutex *renderMutex;
-        
-            std::queue<RendererThreadJob> jobQueue;
-            std::queue<RenderFrame*> frameQueue;
-            GraphicsInterface *graphicsInterface;
-        
-            ShaderBinding *rendererShaderBinding;
-            LocalShaderParam *projectionMatrixParam;
-            LocalShaderParam *viewMatrixParam;
-            LocalShaderParam *modelMatrixParam;
-        
-            LightInfoBinding lights[RENDERER_MAX_LIGHTS];
-            LightShadowInfoBinding lightShadows[RENDERER_MAX_LIGHT_SHADOWS];
-    };
+	class LightInfoBinding {
+		public:
+			LocalShaderParam *position;
+			LocalShaderParam *direction;
+			LocalShaderParam *specular;
+			LocalShaderParam *diffuse;
+			LocalShaderParam *spotExponent;
+			LocalShaderParam *spotCosCutoff;
+			LocalShaderParam *constantAttenuation;
+			LocalShaderParam *linearAttenuation;
+			LocalShaderParam *quadraticAttenuation;
+			LocalShaderParam *shadowEnabled;
+	};
+	
+	class LightShadowInfoBinding {
+	public:
+		LocalShaderParam *shadowMatrix;
+		LocalShaderParam *shadowBuffer;
+	};
+	
+	class _PolyExport RenderFrame : public PolyBase {
+	public:
+		std::queue<RendererThreadJob> jobQueue;
+	};
+	
+	class _PolyExport RenderThread : public Threaded {
+		public:
+			RenderThread();
+			 void setGraphicsInterface(Core *core, GraphicsInterface *graphicsInterface);
+			virtual void runThread();
+		void updateRenderThread();	 
+			void enqueueFrame(RenderFrame *frame);
+		
+			void enqueueJob(int jobType, void *data, void *data2=NULL);
+			void processJob(const RendererThreadJob &job);
+		
+			ShaderBinding *getShaderBinding();
+		
+			void processDrawBufferLights(GPUDrawBuffer *buffer);
+			void processDrawBuffer(GPUDrawBuffer *buffer);
+			RenderThreadDebugInfo getFrameInfo();
+		
+			void clearFrameQueue();
+		
+			void initGlobals();
+		
+			void lockRenderMutex();
+			void unlockRenderMutex();
+		
+			static const int JOB_REQUEST_CONTEXT_CHANGE = 0;
+			static const int JOB_CREATE_TEXTURE = 1;
+			static const int JOB_PROCESS_DRAW_BUFFER = 2;
+			static const int JOB_END_FRAME = 3;
+			static const int JOB_CREATE_PROGRAM = 4;
+			static const int JOB_CREATE_SHADER = 5;
+			static const int JOB_BEGIN_FRAME = 6;
+			static const int JOB_DESTROY_TEXTURE = 8;
+			static const int JOB_DESTROY_SHADER = 9;
+			static const int JOB_DESTROY_PROGRAM = 10;
+			static const int JOB_DESTROY_SUBMESH_BUFFER = 11;
+			static const int JOB_CREATE_RENDER_BUFFER = 12;
+			static const int JOB_DESTROY_RENDER_BUFFER = 13;
+			static const int JOB_SET_TEXTURE_PARAM = 14;
+			static const int JOB_DESTROY_SHADER_BINDING = 16;
+			static const int JOB_DESTROY_SHADER_PARAM = 17;
+		
+		protected:
+		
+			unsigned int frameStart;
+			RenderThreadDebugInfo lastFrameDebugInfo;
+			RenderThreadDebugInfo currentDebugFrameInfo;
+		
+			Core *core;
+			CoreMutex *jobQueueMutex;
+			CoreMutex *renderMutex;
+		
+			std::queue<RendererThreadJob> jobQueue;
+			std::queue<RenderFrame*> frameQueue;
+			GraphicsInterface *graphicsInterface;
+		
+			ShaderBinding *rendererShaderBinding;
+			LocalShaderParam *projectionMatrixParam;
+			LocalShaderParam *viewMatrixParam;
+			LocalShaderParam *modelMatrixParam;
+		
+			LightInfoBinding lights[RENDERER_MAX_LIGHTS];
+			LightShadowInfoBinding lightShadows[RENDERER_MAX_LIGHT_SHADOWS];
+	};
 
-    class _PolyExport Renderer : public PolyBase {
+	class _PolyExport Renderer : public PolyBase {
 	public:
-        
+		
 	Renderer(RenderThread *customThread=NULL);
 	virtual ~Renderer();
-        void setGraphicsInterface(Core *core, GraphicsInterface *graphicsInterface);
-        
-        RenderThread *getRenderThread();
+		void setGraphicsInterface(Core *core, GraphicsInterface *graphicsInterface);
+		
+		RenderThread *getRenderThread();
 
-        Cubemap *createCubemap(Texture *t0, Texture *t1, Texture *t2, Texture *t3, Texture *t4, Texture *t5);
-        Texture *createTexture(unsigned int width, unsigned int height, char *textureData, bool clamp, bool createMipmaps, int type, unsigned int filteringMode, unsigned int anisotropy, bool framebufferTexture);
-        
-        RenderBuffer *createRenderBuffer(unsigned int width, unsigned int height, bool attachDepthBuffer, bool floatingPoint);
-        void destroyRenderBuffer(RenderBuffer *buffer);
-        
-        void destroyTexture(Texture *texture);
+		Cubemap *createCubemap(Texture *t0, Texture *t1, Texture *t2, Texture *t3, Texture *t4, Texture *t5);
+		Texture *createTexture(unsigned int width, unsigned int height, char *textureData, bool clamp, bool createMipmaps, int type, unsigned int filteringMode, unsigned int anisotropy, bool framebufferTexture);
+		
+		RenderBuffer *createRenderBuffer(unsigned int width, unsigned int height, bool attachDepthBuffer, bool floatingPoint);
+		void destroyRenderBuffer(RenderBuffer *buffer);
+		
+		void destroyTexture(Texture *texture);
 
-        void processDrawBuffer(GPUDrawBuffer *buffer);
-        
-        void setBackingResolutionScale(Number xScale, Number yScale);
-        Number getBackingResolutionScaleX();
-        Number getBackingResolutionScaleY();
-        ShaderProgram *createProgram(const String &fileName);
-        Shader *createShader(ShaderProgram *vertexProgram, ShaderProgram *fragmentProgram);
-        
-        void enqueueFrameJob(int jobType, void *data);
-        
-        void destroyProgram(ShaderProgram *program);
-        void destroyShader(Shader *shader);
-        void destroySubmeshPlatformData(void *platformData);
-        
-        void destroyShaderBinding(ShaderBinding *binding);
-        void destroyShaderParam(LocalShaderParam *param);
-        
-        void setTextureParam(LocalShaderParam *param, Texture *texture);
-        
-        void setAnisotropyAmount(Number amount);
-        Number getAnisotropyAmount();
-        
-        static Vector3 unProject(const Vector3 &position, const Matrix4 &modelMatrix, const Matrix4 &projectionMatrix, const Polycode::Rectangle &viewport);
-        static Vector3 project(const Vector3 &position, const Matrix4 &modelMatrix, const Matrix4 &projectionMatrix, const Polycode::Rectangle &viewport);
-        
-        
-        void beginFrame();
-        void endFrame();
-        
-        static const int BLEND_MODE_NONE = 0;
-        static const int BLEND_MODE_NORMAL = 1;
-        static const int BLEND_MODE_LIGHTEN = 2;
-        static const int BLEND_MODE_COLOR = 3;
-        static const int BLEND_MODE_PREMULTIPLIED = 4;
-        static const int BLEND_MODE_MULTIPLY = 5;
-        static const int BLEND_MODE_MATERIAL = 6;
-        
-        static const int DEPTH_FUNCTION_GREATER = 0;
-        static const int DEPTH_FUNCTION_LEQUAL = 1;
-        
-        
+		void processDrawBuffer(GPUDrawBuffer *buffer);
+		
+		void setBackingResolutionScale(Number xScale, Number yScale);
+		Number getBackingResolutionScaleX();
+		Number getBackingResolutionScaleY();
+		ShaderProgram *createProgram(const String &fileName);
+		Shader *createShader(ShaderProgram *vertexProgram, ShaderProgram *fragmentProgram);
+		
+		void enqueueFrameJob(int jobType, void *data);
+		
+		void destroyProgram(ShaderProgram *program);
+		void destroyShader(Shader *shader);
+		void destroySubmeshPlatformData(void *platformData);
+		
+		void destroyShaderBinding(ShaderBinding *binding);
+		void destroyShaderParam(LocalShaderParam *param);
+		
+		void setTextureParam(LocalShaderParam *param, Texture *texture);
+		
+		void setAnisotropyAmount(Number amount);
+		Number getAnisotropyAmount();
+		
+		static Vector3 unProject(const Vector3 &position, const Matrix4 &modelMatrix, const Matrix4 &projectionMatrix, const Polycode::Rectangle &viewport);
+		static Vector3 project(const Vector3 &position, const Matrix4 &modelMatrix, const Matrix4 &projectionMatrix, const Polycode::Rectangle &viewport);
+		
+		
+		void beginFrame();
+		void endFrame();
+		
+		static const int BLEND_MODE_NONE = 0;
+		static const int BLEND_MODE_NORMAL = 1;
+		static const int BLEND_MODE_LIGHTEN = 2;
+		static const int BLEND_MODE_COLOR = 3;
+		static const int BLEND_MODE_PREMULTIPLIED = 4;
+		static const int BLEND_MODE_MULTIPLY = 5;
+		static const int BLEND_MODE_MATERIAL = 6;
+		
+		static const int DEPTH_FUNCTION_GREATER = 0;
+		static const int DEPTH_FUNCTION_LEQUAL = 1;
+		
+		
 	protected:
-      
-        RenderFrame *currentFrame;
-        
-        Number backingResolutionScaleX;
-        Number backingResolutionScaleY;
-        
+	  
+		RenderFrame *currentFrame;
+		
+		Number backingResolutionScaleX;
+		Number backingResolutionScaleY;
+		
 		Number anisotropy;
-        
-        int cpuBufferIndex;
-        int gpuBufferIndex;
-        RenderThread *renderThread;
+		
+		int cpuBufferIndex;
+		int gpuBufferIndex;
+		RenderThread *renderThread;
 
 	};
 }

+ 8 - 8
include/polycode/core/PolyResource.h

@@ -59,19 +59,19 @@ namespace Polycode {
 			static const int RESOURCE_CUBEMAP = 6;
 			static const int RESOURCE_SPRITE = 7;
 			static const int RESOURCE_ENTITY_INSTANCE = 8;
-            static const int RESOURCE_FONT = 9;
-            static const int RESOURCE_SCRIPT = 10;
-        
+			static const int RESOURCE_FONT = 9;
+			static const int RESOURCE_SCRIPT = 10;
+		
 			bool reloadOnFileModify;
-        
-            static bool defaultReloadOnFileModify;
-        
+		
+			static bool defaultReloadOnFileModify;
+		
 			size_t resourceFileTime;
 						
 			//@}
 			
-            void *platformData;
-        
+			void *platformData;
+		
 		protected:
 
 			

+ 127 - 127
include/polycode/core/PolyResourceManager.h

@@ -33,131 +33,131 @@ THE SOFTWARE.
 
 extern "C" {
 #ifndef NO_LUA
-    #include "lua.h"
-    #include "lualib.h"
-    #include "lauxlib.h"
-#endif   
-    #include "duktape.h"
+	#include "lua.h"
+	#include "lualib.h"
+	#include "lauxlib.h"
+#endif	 
+	#include "duktape.h"
 }
 
-#define RESOURCE_CHECK_INTERVAL	2000
+#define RESOURCE_CHECK_INTERVAL 2000
 
 namespace Polycode {
 
 	class Resource;
 	class PolycodeShaderModule;
 	class String;
-    class ResourceLoader;
-    
-    class _PolyExport ResourcePool : public EventDispatcher {
-        public:
-            ResourcePool(const String &name, ResourcePool *fallbackPool);
-            ~ResourcePool();
-        
-            void setFallbackPool(ResourcePool *pool);
-        
+	class ResourceLoader;
+	
+	class _PolyExport ResourcePool : public EventDispatcher {
+		public:
+			ResourcePool(const String &name, ResourcePool *fallbackPool);
+			~ResourcePool();
+		
+			void setFallbackPool(ResourcePool *pool);
+		
 			void addResource(Resource *resource);
 			void removeResource(Resource *resource);
-            bool hasResource(Resource *resource);
-        
-            void loadResourcesFromFolder(const String &folder, bool recursive);
-        
-            Resource *loadResource(const String &path);
-            Resource *loadResourceWithName(const String &path, const String &name);
-        
+			bool hasResource(Resource *resource);
+		
+			void loadResourcesFromFolder(const String &folder, bool recursive);
+		
+			Resource *loadResource(const String &path);
+			Resource *loadResourceWithName(const String &path, const String &name);
+		
 			Resource *getResource(int resourceType, const String& resourceName) const;
-            String getName();
-            void setName(const String &name);
-        
-            Resource *getResourceByPath(const String& resourcePath) const;
+			String getName();
+			void setName(const String &name);
+		
+			Resource *getResourceByPath(const String& resourcePath) const;
 			void Update(int elapsed);
-        
+		
 			std::vector<Resource *> getResources(int resourceType);
-        
+		
 			void checkForChangedFiles();
-        
+		
 			bool reloadResourcesOnModify;
-            bool dispatchChangeEvents;
-        
-            int resourceSubscribers;
-            bool deleteOnUnsubscribe;
-        
-            static bool defaultReloadResourcesOnModify;
-        
-        private:
-        
-            void loadResourcesFromFolderWithLoader(const String &folder, bool recursive, ResourceLoader *loader, const String &containingFolder);
-        
-            ResourcePool *fallbackPool;
-            String name;
+			bool dispatchChangeEvents;
+		
+			int resourceSubscribers;
+			bool deleteOnUnsubscribe;
+		
+			static bool defaultReloadResourcesOnModify;
+		
+		private:
+		
+			void loadResourcesFromFolderWithLoader(const String &folder, bool recursive, ResourceLoader *loader, const String &containingFolder);
+		
+			ResourcePool *fallbackPool;
+			String name;
 			int ticksSinceCheck;
-            std::vector <Resource*> resources;
-        
-    };
-    
-    class _PolyExport ResourceLoader {
-        public:
-            virtual ~ResourceLoader() {}
-            bool canHandleExtension(const String &extension);
-            virtual Resource *loadResource(const String &path, ResourcePool *targetPool) = 0;
-            std::vector<String> extensions;
-    };
-    
-    class _PolyExport TextureResourceLoader : public ResourceLoader {
-        public:
-            TextureResourceLoader();
-            Resource *loadResource(const String &path, ResourcePool *targetPool);
-    };
-    
-    class _PolyExport ProgramResourceLoader : public ResourceLoader {
-    public:
-        ProgramResourceLoader();
-        Resource *loadResource(const String &path, ResourcePool *targetPool);
-    };
+			std::vector <Resource*> resources;
+		
+	};
+	
+	class _PolyExport ResourceLoader {
+		public:
+			virtual ~ResourceLoader() {}
+			bool canHandleExtension(const String &extension);
+			virtual Resource *loadResource(const String &path, ResourcePool *targetPool) = 0;
+			std::vector<String> extensions;
+	};
+	
+	class _PolyExport TextureResourceLoader : public ResourceLoader {
+		public:
+			TextureResourceLoader();
+			Resource *loadResource(const String &path, ResourcePool *targetPool);
+	};
+	
+	class _PolyExport ProgramResourceLoader : public ResourceLoader {
+	public:
+		ProgramResourceLoader();
+		Resource *loadResource(const String &path, ResourcePool *targetPool);
+	};
 
-    class _PolyExport MaterialResourceLoader : public ResourceLoader {
-    public:
-            MaterialResourceLoader();
-            Resource *loadResource(const String &path, ResourcePool *targetPool);
-    };
-    
-    class _PolyExport FontResourceLoader : public ResourceLoader {
-    public:
-        FontResourceLoader();
-        ~FontResourceLoader();
-        Resource *loadResource(const String &path, ResourcePool *targetPool);
-    private:
-        FT_Library FTLibrary;
-    };
-    
-    class DebugBackTraceEntry {
-    public:
-        String fileName;
-        unsigned int lineNumber;
-    };
-    
-    class _PolyExport ScriptResourceLoader : public ResourceLoader {
-    public:
-        ScriptResourceLoader();
-        ~ScriptResourceLoader();
-        Resource *loadResource(const String &path, ResourcePool *targetPool);
-    private:
-        
-        void initJavascript();
-        duk_context *duktapeContext;
-        
+	class _PolyExport MaterialResourceLoader : public ResourceLoader {
+	public:
+			MaterialResourceLoader();
+			Resource *loadResource(const String &path, ResourcePool *targetPool);
+	};
+	
+	class _PolyExport FontResourceLoader : public ResourceLoader {
+	public:
+		FontResourceLoader();
+		~FontResourceLoader();
+		Resource *loadResource(const String &path, ResourcePool *targetPool);
+	private:
+		FT_Library FTLibrary;
+	};
+	
+	class DebugBackTraceEntry {
+	public:
+		String fileName;
+		unsigned int lineNumber;
+	};
+	
+	class _PolyExport ScriptResourceLoader : public ResourceLoader {
+	public:
+		ScriptResourceLoader();
+		~ScriptResourceLoader();
+		Resource *loadResource(const String &path, ResourcePool *targetPool);
+	private:
+		
+		void initJavascript();
+		duk_context *duktapeContext;
+		
 #ifndef NO_LUA
-        void initLua();
-        lua_State *luaState;
+		void initLua();
+		lua_State *luaState;
 #endif
-    };
-    
-    class _PolyExport MeshResourceLoader : public ResourceLoader {
-    public:
-        MeshResourceLoader();
-        Resource *loadResource(const String &path, ResourcePool *targetPool);
-    };
-    
+	};
+	
+	class _PolyExport MeshResourceLoader : public ResourceLoader {
+	public:
+		MeshResourceLoader();
+		Resource *loadResource(const String &path, ResourcePool *targetPool);
+	};
+	
 	/**
 	* Manages loading and unloading of resources from directories and archives. Should only be accessed via the CoreServices singleton.
 	*/ 
@@ -165,34 +165,34 @@ namespace Polycode {
 		public:
 			ResourceManager();
 			~ResourceManager();
-        
-            ResourcePool *getGlobalPool();
-            ResourcePool *getResourcePoolByName(const String &name);
-		      
-            void addResourceLoader(ResourceLoader *loader);
-            ResourceLoader *getResourceLoaderForExtension(const String &extension);
-            void removeResourceLoader(ResourceLoader *loader);
+		
+			ResourcePool *getGlobalPool();
+			ResourcePool *getResourcePoolByName(const String &name);
+			  
+			void addResourceLoader(ResourceLoader *loader);
+			ResourceLoader *getResourceLoaderForExtension(const String &extension);
+			void removeResourceLoader(ResourceLoader *loader);
 
-            unsigned int getNumResourceLoaders();
-            ResourceLoader *getResourceLoaderAtIndex(unsigned int index);
-        
-            void addResourcePool(ResourcePool *pool);
-            void removeResourcePool(ResourcePool *pool);
-        
+			unsigned int getNumResourceLoaders();
+			ResourceLoader *getResourceLoaderAtIndex(unsigned int index);
+		
+			void addResourcePool(ResourcePool *pool);
+			void removeResourcePool(ResourcePool *pool);
+		
 			std::vector<Resource*> getResources(int resourceType);
-        
+		
 			void removeResource(Resource *resource);
-        
-            void subscribeToResourcePool(ResourcePool *pool);
-            void unsubscibeFromResourcePool(ResourcePool *pool);
-        
+		
+			void subscribeToResourcePool(ResourcePool *pool);
+			void unsubscibeFromResourcePool(ResourcePool *pool);
+		
 			void Update(int elapsed);
 			void handleEvent(Event *event);
 		
 		private:
 		
-            std::vector<ResourceLoader*> resourceLoaders;
-            ResourcePool *globalPool;
-            std::vector <ResourcePool*> pools;
+			std::vector<ResourceLoader*> resourceLoaders;
+			ResourcePool *globalPool;
+			std::vector <ResourcePool*> pools;
 	};
 }

+ 1 - 1
include/polycode/core/PolySDLCore.h

@@ -78,7 +78,7 @@ namespace Polycode {
 		void removeDiskItem(const String& itemPath);
 		String openFolderPicker();
 		std::vector<String> openFilePicker(std::vector<CoreFileExtension> extensions, bool allowMultiple);
-                String saveFilePicker(std::vector<CoreFileExtension> extensions);
+				String saveFilePicker(std::vector<CoreFileExtension> extensions);
 		void resizeTo(int xRes, int yRes);
 
 		String executeExternalCommand(String command, String args, String inDirectory="");

+ 18 - 18
include/polycode/core/PolyScene.h

@@ -111,8 +111,8 @@ namespace Polycode {
 		* @param endDepth Ending depth of the fog.							
 		*/				
 		void setFogProperties(int fogMode, Color color, Number density, Number startDepth, Number endDepth);
-        
-        void setSceneType(int newType);
+		
+		void setSceneType(int newType);
 
 		virtual void fixedUpdate();
 		virtual void Update();
@@ -123,8 +123,8 @@ namespace Polycode {
 		void setEnabled(bool enabled);
 		
 		void Render(Camera *targetCamera, RenderBuffer *targetFramebuffer, Material *overrideMaterial, bool sendLights);
-        
-        void setOverrideMaterial(Material *material);
+		
+		void setOverrideMaterial(Material *material);
 		
 		void handleEvent(Event *event);
 		
@@ -188,22 +188,22 @@ namespace Polycode {
 						
 		Entity rootEntity;
 		
-        Polycode::Rectangle sceneMouseRect;
-        bool remapMouse;
-        
-        bool constrainPickingToViewport;
-        
-        void doVisibilityChecking(bool val);
-        bool doesVisibilityChecking();
-		      
+		Polycode::Rectangle sceneMouseRect;
+		bool remapMouse;
+		
+		bool constrainPickingToViewport;
+		
+		void doVisibilityChecking(bool val);
+		bool doesVisibilityChecking();
+			  
 	protected:
 		
 		void initScene(int sceneType, bool virtualScene);
-        void setEntityVisibility(Entity *entity, Camera *camera);
-        void setEntityVisibilityBool(Entity *entity, bool val);
-        
+		void setEntityVisibility(Entity *entity, Camera *camera);
+		void setEntityVisibilityBool(Entity *entity, bool val);
+		
 		bool hasLightmaps;
-        bool _doVisibilityChecking;
+		bool _doVisibilityChecking;
 		
 		Renderer *renderer;
 		std::vector <SceneLight*> lights;		
@@ -212,8 +212,8 @@ namespace Polycode {
 		Camera *defaultCamera;
 		Camera *activeCamera;
 		
-        Material *overrideMaterial;
-        
+		Material *overrideMaterial;
+		
 		Core *core;
 		
 		bool fogEnabled;

+ 38 - 38
include/polycode/core/PolySceneEntityInstance.h

@@ -37,12 +37,12 @@ THE SOFTWARE.
 namespace Polycode {
 
 class SceneEntityInstanceResourceEntry;
-    class SceneEntityInstanceLayer;
-    
+	class SceneEntityInstanceLayer;
+	
 class SceneEntityInstance : public Entity {
 	public:
-    
-        SceneEntityInstance(Scene *parentScene, const String& fileName);
+	
+		SceneEntityInstance(Scene *parentScene, const String& fileName);
 		explicit SceneEntityInstance(Scene *parentScene);
 		
 		static SceneEntityInstance *BlankSceneEntityInstance(Scene *parentScene);
@@ -59,25 +59,25 @@ class SceneEntityInstance : public Entity {
 		void parseObjectIntoCurve(ObjectEntry *entry, BezierCurve *curve);
 		Entity *loadObjectEntryIntoEntity(ObjectEntry *entry, Entity *targetEntity = NULL, int entityFileVersion = 1);
 		bool loadFromFile(const String& fileName);
-        void applySceneMesh(ObjectEntry *entry, SceneMesh *sceneMesh);
+		void applySceneMesh(ObjectEntry *entry, SceneMesh *sceneMesh);
 		
-        void linkResourcePool(ResourcePool *pool);
-        unsigned int getNumLinkedResourePools();
-        ResourcePool *getLinkedResourcePoolAtIndex(unsigned int index);
-    
-        void unlinkResourcePool(ResourcePool *pool);
-    
+		void linkResourcePool(ResourcePool *pool);
+		unsigned int getNumLinkedResourePools();
+		ResourcePool *getLinkedResourcePoolAtIndex(unsigned int index);
+	
+		void unlinkResourcePool(ResourcePool *pool);
+	
 		SceneEntityInstanceResourceEntry *getResourceEntry();
-    
-        ResourcePool *getTopLevelResourcePool();
-
-        bool hasLayerID(unsigned char layerID) const;
-        unsigned int getNumLayers() const;
-        SceneEntityInstanceLayer *getLayerAtIndex(unsigned int index) const;
-        void removeLayer(SceneEntityInstanceLayer *layer);
-    
-    
-        SceneEntityInstanceLayer *createNewLayer(String name);
+	
+		ResourcePool *getTopLevelResourcePool();
+
+		bool hasLayerID(unsigned char layerID) const;
+		unsigned int getNumLayers() const;
+		SceneEntityInstanceLayer *getLayerAtIndex(unsigned int index) const;
+		void removeLayer(SceneEntityInstanceLayer *layer);
+	
+	
+		SceneEntityInstanceLayer *createNewLayer(String name);
 		
 		String getFileName() const;
 		bool cloneUsingReload;
@@ -86,27 +86,27 @@ class SceneEntityInstance : public Entity {
 		
 	protected:
 		
-        std::vector<SceneEntityInstanceLayer*> layers;
-    
-        void rebuildResourceLinks();
-    
-        ResourcePool *topLevelResourcePool;
-        std::vector<ResourcePool*> resourcePools;
-        Scene *parentScene;
+		std::vector<SceneEntityInstanceLayer*> layers;
+	
+		void rebuildResourceLinks();
+	
+		ResourcePool *topLevelResourcePool;
+		std::vector<ResourcePool*> resourcePools;
+		Scene *parentScene;
 		SceneEntityInstanceResourceEntry *resourceEntry;
 		
 };
-    
+	
 class SceneEntityInstanceLayer {
-    public:
-        SceneEntityInstanceLayer(SceneEntityInstance *instance,String name);
-    
-        void setLayerVisibility(bool val);
-    
-        String name;
-        unsigned char layerID;
-        bool visible;
-        SceneEntityInstance *instance;
+	public:
+		SceneEntityInstanceLayer(SceneEntityInstance *instance,String name);
+	
+		void setLayerVisibility(bool val);
+	
+		String name;
+		unsigned char layerID;
+		bool visible;
+		SceneEntityInstance *instance;
 };
 
 

+ 1 - 1
include/polycode/core/PolySceneImage.h

@@ -83,7 +83,7 @@ namespace Polycode {
 
 		/**
 		* Returns the image height.
-		*/ 		
+		*/		
 		Number getImageHeight() const;
 
 		protected:

+ 11 - 11
include/polycode/core/PolySceneLabel.h

@@ -42,14 +42,14 @@ namespace Polycode {
 			SceneLabel(const String& text, int size, const String& fontName = "sans", int amode = 0, Number actualHeight = 0.0, bool premultiplyAlpha = false, const Color &backgroundColor = Color(0.0, 0.0, 0.0, 0.0), const Color &foregroundColor = Color(1.0, 1.0, 1.0, 1.0));
 			
 			String getText();
-        
-            void setLabelActualHeight(Number actualHeight);
-            Number getLabelActualHeight();
+		
+			void setLabelActualHeight(Number actualHeight);
+			Number getLabelActualHeight();
 			
 			void Render(GPUDrawBuffer *buffer);
 
-            int getTextWidthForString(String text);
-        
+			int getTextWidthForString(String text);
+		
 			virtual ~SceneLabel();
 		
 			/**
@@ -57,12 +57,12 @@ namespace Polycode {
 			* @param newText New text to display.
 			*/ 
 			void setText(const String& newText);
-        
-            virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
-            virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
+		
+			virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
+			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
 			
 			void updateFromLabel();
-        
+		
 			Label *getLabel();
 			
 			bool positionAtBaseline;
@@ -74,9 +74,9 @@ namespace Polycode {
 						
 		protected:
 			
-			     
+				 
 			Number actualHeight;
-            Number labelScale;
+			Number labelScale;
 			Label *label;
 	};
 }

+ 44 - 44
include/polycode/core/PolySceneLight.h

@@ -44,8 +44,8 @@ namespace Polycode {
 			* @param type Type of light to create. Can be SceneLight::POINT_LIGHT or SceneLight::SPOT_LIGHT
 			* @param parentScene Scene to light.
 			* @param intensity Light color intensity
-			* @param constantAttenuation Constant falloff attenuation value	
-			* @param linearAttenuation Linear falloff attenuation value	
+			* @param constantAttenuation Constant falloff attenuation value 
+			* @param linearAttenuation Linear falloff attenuation value 
 			* @param quadraticAttenuation Quadratic falloff attenuation value				
 			*/ 
 			SceneLight(int type, Scene *parentScene, Number intensity, Number constantAttenuation=1, Number linearAttenuation=1, Number quadraticAttenuation=1);
@@ -64,16 +64,16 @@ namespace Polycode {
 						
 			/**
 			* Sets the attenuation values for the light.
-			* @param constantAttenuation Constant falloff attenuation value	
-			* @param linearAttenuation Linear falloff attenuation value	
+			* @param constantAttenuation Constant falloff attenuation value 
+			* @param linearAttenuation Linear falloff attenuation value 
 			* @param quadraticAttenuation Quadratic falloff attenuation value
 			* 
 			*/
 			void setAttenuation(Number constantAttenuation, Number linearAttenuation, Number quadraticAttenuation);			
 						
-            Number getConstantAttenuation() const;
-            Number getLinearAttenuation() const;
-            Number getQuadraticAttenuation() const;
+			Number getConstantAttenuation() const;
+			Number getLinearAttenuation() const;
+			Number getQuadraticAttenuation() const;
 									
 			/*
 			* Returns the light's type.
@@ -106,16 +106,16 @@ namespace Polycode {
 			*/	
 			void setDiffuseLightColor(Number r, Number g, Number b, Number a=1.0) { lightInfo.diffuseColor.r = r; lightInfo.diffuseColor.g = g; lightInfo.diffuseColor.b = b; lightInfo.diffuseColor.a = a; }
 			
-        
-        	void setDiffuseLightColor(const Color &color) {
-                lightInfo.diffuseColor = color;
-            }
+		
+			void setDiffuseLightColor(const Color &color) {
+				lightInfo.diffuseColor = color;
+			}
 
-            void setSpecularLightColor(const Color &color) {
-                lightInfo.specularColor = color;
-            }
-        
-        
+			void setSpecularLightColor(const Color &color) {
+				lightInfo.specularColor = color;
+			}
+		
+		
 			/**
 			* Sets both the specular and diffust light colors. Use setDiffuseLightColor and setSpecularLightColor to set the individual light colors.
 			* @param r Red value 0-1.
@@ -136,10 +136,10 @@ namespace Polycode {
 			* @param spotlightExponent Spotlight exponent size
 			* @param spotlightCutoff Spotlight furstrum cutoff.
 			*/
-            void setSpotlightProperties(Number spotlightCutoff, Number spotlightExponent);
+			void setSpotlightProperties(Number spotlightCutoff, Number spotlightExponent);
 			
-            Number getSpotlightCutoff() const;
-            Number getSpotlightExponent() const;
+			Number getSpotlightCutoff() const;
+			Number getSpotlightExponent() const;
 			
 			/**
 			* If this is called with 'true', the light will generate a shadow map.
@@ -154,13 +154,13 @@ namespace Polycode {
 			*/
 			void setShadowMapFOV(Number fov);
 		
-            /**
-             * Returns the light's shadow map field of view.
-             */
-            Number getShadowMapFOV() const;
-        
-            unsigned int getShadowMapResolution() const;
-        
+			/**
+			 * Returns the light's shadow map field of view.
+			 */
+			Number getShadowMapFOV() const;
+		
+			unsigned int getShadowMapResolution() const;
+		
 			/**
 			* Returns true if shadows are enabled.
 			*/
@@ -169,29 +169,29 @@ namespace Polycode {
 			/**
 			* Returns the light type.
 			*/
-            int getLightType() const;
+			int getLightType() const;
 			
 			void setLightImportance(int newImportance);
 			int getLightImportance() const;
-        
-            void setLightType(int lightType);
-		
-            virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
-            virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
-        
-            Scene *getParentScene() const;
-            void setParentScene(Scene *scene);
-        
-            Camera *getSpotlightCamera();
-        
-            LightInfo getLightInfo() const;
-        
+		
+			void setLightType(int lightType);
+		
+			virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
+			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
+		
+			Scene *getParentScene() const;
+			void setParentScene(Scene *scene);
+		
+			Camera *getSpotlightCamera();
+		
+			LightInfo getLightInfo() const;
+		
 		protected:
-        
-            LightInfo lightInfo;
+		
+			LightInfo lightInfo;
 
-            RenderBuffer *shadowMapRenderBuffer;
-            Material *unlitMaterial;
+			RenderBuffer *shadowMapRenderBuffer;
+			Material *unlitMaterial;
 			Camera *spotCamera;
 			Scene *parentScene;
 		

+ 63 - 63
include/polycode/core/PolySceneLine.h

@@ -31,64 +31,64 @@ THE SOFTWARE.
 namespace Polycode {
 
 	/**
-     * BezierCurve scene rendering/placement class. You can use this class to place a bezier curve in scene space for use as animation tracks or rendering.
-     */
-    class _PolyExport SceneCurve : public SceneMesh {
-        public:
-        
-            /*
-             * Create empty scene curve.
-             */
-            SceneCurve();
-        
-            /*
-             * Create scene curve with an existing curve.
-             * @param curve Existing curve to use.
-             */
-            SceneCurve(BezierCurve *curve);
+	 * BezierCurve scene rendering/placement class. You can use this class to place a bezier curve in scene space for use as animation tracks or rendering.
+	 */
+	class _PolyExport SceneCurve : public SceneMesh {
+		public:
+		
+			/*
+			 * Create empty scene curve.
+			 */
+			SceneCurve();
+		
+			/*
+			 * Create scene curve with an existing curve.
+			 * @param curve Existing curve to use.
+			 */
+			SceneCurve(BezierCurve *curve);
 
-            /*
-             * Create scene curve with an existing curve.
-             * @param curve Existing curve to use.
-             */
-            static SceneCurve *SceneCurveWithCurve(BezierCurve *curve);
-        
-            /*
-             * Return a point along the curve in world space.
-             * @param t Number value from 0.0 to 1.0 along the curve
-             * @return A Vector3 point along the curve in world space.
-             */
-            Vector3 getWorldPointAt(Number t);
+			/*
+			 * Create scene curve with an existing curve.
+			 * @param curve Existing curve to use.
+			 */
+			static SceneCurve *SceneCurveWithCurve(BezierCurve *curve);
+		
+			/*
+			 * Return a point along the curve in world space.
+			 * @param t Number value from 0.0 to 1.0 along the curve
+			 * @return A Vector3 point along the curve in world space.
+			 */
+			Vector3 getWorldPointAt(Number t);
 
-        
-            virtual ~SceneCurve();
-            void Update();
-        
-        
-            virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
-            virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
+		
+			virtual ~SceneCurve();
+			void Update();
+		
+		
+			virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
+			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
  
-            /*
-             * Return the actual bezier curve class.
-             * @return The bezier curve used in this scene curve.
-             */
-            BezierCurve *getCurve();
-        
-            /*
-             * If set to true, renders the curve on every frame (defaults to true).
-             */
-            bool renderCurve;
-        
-            /*
-             * Number of vertices to use in rendering the curve.
-             */
-            int curveResolution;
-        
-        protected:
-        
-            BezierCurve *curve;
-    };
-    
+			/*
+			 * Return the actual bezier curve class.
+			 * @return The bezier curve used in this scene curve.
+			 */
+			BezierCurve *getCurve();
+		
+			/*
+			 * If set to true, renders the curve on every frame (defaults to true).
+			 */
+			bool renderCurve;
+		
+			/*
+			 * Number of vertices to use in rendering the curve.
+			 */
+			int curveResolution;
+		
+		protected:
+		
+			BezierCurve *curve;
+	};
+	
 	/**
 	* 3D line class. Can connect two SceneEntity classes with a line.
 	*/ 
@@ -96,14 +96,14 @@ namespace Polycode {
 		public:
 		
 		
-            /**
-             * Constructs the line with two taraget entities.
-             * @param ent1 Starting entity.
-             * @param ent2 Ending entity.
-             */
-            SceneLine(Entity *ent1, Entity *ent2);
-        
-        
+			/**
+			 * Constructs the line with two taraget entities.
+			 * @param ent1 Starting entity.
+			 * @param ent2 Ending entity.
+			 */
+			SceneLine(Entity *ent1, Entity *ent2);
+		
+		
 			/**
 			* Constructs the line with two taraget positions.
 			* @param start Starting position.

+ 10 - 10
include/polycode/core/PolySceneManager.h

@@ -33,24 +33,24 @@ namespace Polycode {
 	class Renderer;
 	
 	/**
-     * This class manages all rendered scenes in Polycode.
-     */
+	 * This class manages all rendered scenes in Polycode.
+	 */
 	class _PolyExport SceneManager : public PolyBase {
 		public:
 		SceneManager();
 		~SceneManager();
 		
-        /**
-         * Adds a scene to the render loop. Scenes automatically add themselves to the manager on creation, so there's no need to call this manually unless you remove a scene yourself.
-         */
+		/**
+		 * Adds a scene to the render loop. Scenes automatically add themselves to the manager on creation, so there's no need to call this manually unless you remove a scene yourself.
+		 */
 		void addScene(Scene *newScene);
 
-        /**
-         * Removes scene from the render loop (does not delete the scene).
-         */
+		/**
+		 * Removes scene from the render loop (does not delete the scene).
+		 */
 		void removeScene(Scene *scene);
-        
-        // Polycode internal
+		
+		// Polycode internal
 		void Update();
 		void fixedUpdate();
 		void Render(const Polycode::Rectangle &viewport);

+ 72 - 72
include/polycode/core/PolySceneMesh.h

@@ -34,7 +34,7 @@ namespace Polycode {
 	class Texture;
 	class Skeleton;
 	class Image;
-    class ResourcePool;
+	class ResourcePool;
 	
 	/**
 	* 3D polygonal mesh instance. The SceneMesh is the base for all polygonal 3d geometry. It can have simple textures or complex materials applied to it.
@@ -52,8 +52,8 @@ namespace Polycode {
 			* Construct scene mesh from an existing Mesh instance.
 			*/
 			explicit SceneMesh(Mesh *mesh);
-        
-            SceneMesh();
+		
+			SceneMesh();
 			
 			/**
 			* Construct scene mesh from an existing Mesh instance.
@@ -66,10 +66,10 @@ namespace Polycode {
 			
 
 			ShaderPass getShaderPass(unsigned int index);
-            unsigned int getNumShaderPasses();
-            void addShaderPass(ShaderPass pass);
-            void removeShaderPass(int shaderIndex);
-        
+			unsigned int getNumShaderPasses();
+			void addShaderPass(ShaderPass pass);
+			void removeShaderPass(int shaderIndex);
+		
 			/**
 			* Returns the Mesh instance of the actual mesh.
 			*/
@@ -122,39 +122,39 @@ namespace Polycode {
 		
 			void applySkeletonLocally();
 			
-            /**
-             * Sets the line width for line-based meshes.
-             */
+			/**
+			 * Sets the line width for line-based meshes.
+			 */
 			void setLineWidth(Number newWidth);
 
-            /**
-             * If this mesh was loaded form file, returns the filename of the loaded mesh.
-             */
-            String getFilename();
-        
-            /**
-             * Sets the filename path of the mesh.
-             */
-            void setFilename(String fileName);
-        
-            /**
-             * Loads mesh from file. Deletes current mesh if ownsMesh is set to true.
-             */
-            void loadFromFile(String fileName);
-        
-            /**
-             * Line width for line-based meshes.
-             */
+			/**
+			 * If this mesh was loaded form file, returns the filename of the loaded mesh.
+			 */
+			String getFilename();
+		
+			/**
+			 * Sets the filename path of the mesh.
+			 */
+			void setFilename(String fileName);
+		
+			/**
+			 * Loads mesh from file. Deletes current mesh if ownsMesh is set to true.
+			 */
+			void loadFromFile(String fileName);
+		
+			/**
+			 * Line width for line-based meshes.
+			 */
 			Number lineWidth;
-        
-            /**
-             * If set to true, will antialias the lines in a line-based mesh. Defaults to false.
-             */
+		
+			/**
+			 * If set to true, will antialias the lines in a line-based mesh. Defaults to false.
+			 */
 			bool lineSmooth;
 			
-            /**
-             * If setto true, will antialias points in a point-based mesh. Defaults to false.
-             */
+			/**
+			 * If setto true, will antialias points in a point-based mesh. Defaults to false.
+			 */
 			bool pointSmooth;
 			
 			/**
@@ -164,53 +164,53 @@ namespace Polycode {
 
 			/**
 			* If true, will delete its Skeleton upon destruction. (defaults to true)
-			*/ 			
+			*/			
 			bool ownsSkeleton;
 			
-            /**
-             * If set to true, will check against actual geometry polygons on ray hit detection. Defaults to false.
-             */
+			/**
+			 * If set to true, will check against actual geometry polygons on ray hit detection. Defaults to false.
+			 */
 			bool useGeometryHitDetection;
 			
 			bool customHitDetection(const Ray &ray);
-        
-            /**
-             * The Renderer has an ability to set an override material that is set for all rendered entities. If forceMaterial is set to true, this entity will always use its assigned material, even if an override material is set.
-             */
-            void setForceMaterial(bool forceMaterial);
-            bool getForceMaterial();
-        
-            virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
-            virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;        
-            
-            /**
-             * Normally, translucent textures do not affect the depth buffer, but if this flag is set to true, this entity's alpha channel is written to the depth buffer at a preset threshold. This flag is set to false by default.
-             */
-            bool alphaTest;
-            
-            /**
-             * If this flag is set to false, backface culling is disabled when rendering this entity, rendering both sides of each face. Set to true by default.
-             */
-            bool backfaceCulled;
-            bool sendBoneMatricesToMaterial;
+		
+			/**
+			 * The Renderer has an ability to set an override material that is set for all rendered entities. If forceMaterial is set to true, this entity will always use its assigned material, even if an override material is set.
+			 */
+			void setForceMaterial(bool forceMaterial);
+			bool getForceMaterial();
+		
+			virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
+			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;		
+			
+			/**
+			 * Normally, translucent textures do not affect the depth buffer, but if this flag is set to true, this entity's alpha channel is written to the depth buffer at a preset threshold. This flag is set to false by default.
+			 */
+			bool alphaTest;
+			
+			/**
+			 * If this flag is set to false, backface culling is disabled when rendering this entity, rendering both sides of each face. Set to true by default.
+			 */
+			bool backfaceCulled;
+			bool sendBoneMatricesToMaterial;
 			
 		protected:
-        
+		
 			bool useVertexBuffer;
 			Mesh *mesh;
 			Material *material;
 			Skeleton *skeleton;
-        
-            std::vector<ShaderPass> shaderPasses;
-        
-            String fileName;
-            std::vector<Matrix4> materialBoneMatrices;
-                    
-        
-            VertexDataArray skeletalVertexPositions;
-            VertexDataArray skeletalVertexNormals;
-        
-        
-        
+		
+			std::vector<ShaderPass> shaderPasses;
+		
+			String fileName;
+			std::vector<Matrix4> materialBoneMatrices;
+					
+		
+			VertexDataArray skeletalVertexPositions;
+			VertexDataArray skeletalVertexNormals;
+		
+		
+		
 	};
 }

+ 64 - 64
include/polycode/core/PolyScenePrimitive.h

@@ -67,14 +67,14 @@ namespace Polycode {
 			*/			
 			static const int TYPE_PLANE = 1;			
 
-            /**
-             * A vertical plane.
-             * v1 - X size
-             * v2 - Y size
+			/**
+			 * A vertical plane.
+			 * v1 - X size
+			 * v2 - Y size
 			 * v3 - # of tiles
-             */
-            static const int TYPE_VPLANE = 2;
-        
+			 */
+			static const int TYPE_VPLANE = 2;
+		
 			/**
 			* A cylinder.
 			* v1 - Cylinder length			
@@ -84,23 +84,23 @@ namespace Polycode {
 			*/			
 			static const int TYPE_CYLINDER = 3;
 
-            /**
-             * A cylinder.
-             * v1 - Cylinder length
-             * v2 - Cylinder radius
-             * v3 - Number of segments.
+			/**
+			 * A cylinder.
+			 * v1 - Cylinder length
+			 * v2 - Cylinder radius
+			 * v3 - Number of segments.
 			 * v4 - # of tiles
-             */
-            static const int TYPE_UNCAPPED_CYLINDER = 4;
-
-            /**
-             * A sphere.
-             * v1 - Sphere radius
-             * v2 - Lat segments
-             * v3 - Long segments
+			 */
+			static const int TYPE_UNCAPPED_CYLINDER = 4;
+
+			/**
+			 * A sphere.
+			 * v1 - Sphere radius
+			 * v2 - Lat segments
+			 * v3 - Long segments
 			 * v4 - # of tiles
-             */
-            static const int TYPE_SPHERE = 5;
+			 */
+			static const int TYPE_SPHERE = 5;
 
 			/**
 			* A torus.
@@ -111,15 +111,15 @@ namespace Polycode {
 			* v5 - # of tiles
 			*/			
 			static const int TYPE_TORUS = 6;	
-			     
-            /**
-             * A cone.
-             * v1 - Cone length.
-             * v2 - Cone raidus.
-             * v3 - Number of segments.
+				 
+			/**
+			 * A cone.
+			 * v1 - Cone length.
+			 * v2 - Cone raidus.
+			 * v3 - Number of segments.
 			 * v4 - # of tiles
-             */
-            static const int TYPE_CONE = 7;
+			 */
+			static const int TYPE_CONE = 7;
 
 			/**
 			* A 2D circle.
@@ -129,41 +129,41 @@ namespace Polycode {
 			* v4 - # of tiles
 			*/			
 			static const int TYPE_CIRCLE = 8;			
-        
-            /**
-             * An ico sphere.
-             * v1 - Sphere radius
-             * v2 - number of subdivisions
-             */
-            static const int TYPE_ICOSPHERE = 9;
-        
-            /**
-             * An ico sphere.
-             * v1 - Sphere radius
-             * v2 - number of subdivisions
-             */
-            static const int TYPE_OCTOSPHERE = 10;
-        
-            /**
-             * A 2D line circle.
-             * v1 - X size
-             * v2 - Y size
-             * v3 - Number of segments
+		
+			/**
+			 * An ico sphere.
+			 * v1 - Sphere radius
+			 * v2 - number of subdivisions
+			 */
+			static const int TYPE_ICOSPHERE = 9;
+		
+			/**
+			 * An ico sphere.
+			 * v1 - Sphere radius
+			 * v2 - number of subdivisions
+			 */
+			static const int TYPE_OCTOSPHERE = 10;
+		
+			/**
+			 * A 2D line circle.
+			 * v1 - X size
+			 * v2 - Y size
+			 * v3 - Number of segments
 			 * v4 - # of tiles
-             */
-            static const int TYPE_LINE_CIRCLE = 11;
-
-
-            int getPrimitiveType() const;
-        
-            Number getPrimitiveParameter1() const;
-            Number getPrimitiveParameter2() const;
-            Number getPrimitiveParameter3() const;
-            Number getPrimitiveParameter4() const;
-            Number getPrimitiveParameter5() const;
-        
-            virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
-            virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
+			 */
+			static const int TYPE_LINE_CIRCLE = 11;
+
+
+			int getPrimitiveType() const;
+		
+			Number getPrimitiveParameter1() const;
+			Number getPrimitiveParameter2() const;
+			Number getPrimitiveParameter3() const;
+			Number getPrimitiveParameter4() const;
+			Number getPrimitiveParameter5() const;
+		
+			virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
+			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
 		
 		protected:
 

+ 14 - 14
include/polycode/core/PolySceneRenderTexture.h

@@ -29,9 +29,9 @@ namespace Polycode {
 	class Scene;
 	class Camera;
 	class Texture;
-    class Renderer;
-    class RenderBuffer;
-    class Image;
+	class Renderer;
+	class RenderBuffer;
+	class Image;
 	
 	/**
 	* Renders scenes to texture. This class automatically renders a scene to a texture every frame that you can use to texture anything else. You can set a scene to virtual (see Scene for details) to only render a scene to a texture if you need to. This class automatically adds itself to the render cycle, so you do not need to do anything manual every frame.
@@ -46,7 +46,7 @@ namespace Polycode {
 			* @param renderHeight Vertical size of the render texture.
 			* @param floatingPoint Pass true if you want fp16 target renders			
 			*/
-            SceneRenderTexture(Scene *targetScene, Camera *targetCamera, int renderWidth,int renderHeight, bool floatingPoint);
+			SceneRenderTexture(Scene *targetScene, Camera *targetCamera, int renderWidth,int renderHeight, bool floatingPoint);
 			virtual ~SceneRenderTexture();
 						
 			/**
@@ -56,10 +56,10 @@ namespace Polycode {
 			
 			Texture *getFilterColorBufferTexture();
 			Texture *getFilterZBufferTexture();
-        
-            void Render();
-        
-            Image *saveToImage();
+		
+			void Render();
+		
+			Image *saveToImage();
 
 			void resizeRenderTexture(int newWidth, int newHeight);
 			/**
@@ -75,12 +75,12 @@ namespace Polycode {
 			bool enabled;
 			
 		protected:
-        
-            bool floatingPoint;
-        
-            Renderer *renderer;
-            RenderBuffer *targetFramebuffer;
-        
+		
+			bool floatingPoint;
+		
+			Renderer *renderer;
+			RenderBuffer *targetFramebuffer;
+		
 			Scene *targetScene;
 			Camera *targetCamera;
 	};

+ 11 - 11
include/polycode/core/PolySceneSound.h

@@ -30,7 +30,7 @@ namespace Polycode {
 
 	/**
 	* Creates a positional 3D sound listener. There can be only one listener active at any one time.
- 	*/	
+	*/	
 	class _PolyExport SceneSoundListener : public Entity {
 		public:
 			SceneSoundListener();
@@ -47,24 +47,24 @@ namespace Polycode {
 			SceneSound(const String& fileName, Number referenceDistance, Number maxDistance, bool directionalSound = false);
 			virtual ~SceneSound();			
 			void Update();
-        
-            virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
-            virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
+		
+			virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
+			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
 			
-            bool isDirectionalSound() const;
-            void setDirectionalSound(bool val);
-        
+			bool isDirectionalSound() const;
+			void setDirectionalSound(bool val);
+		
 			/**
 			* Returns the sound object associated with this positional sound.
 			*/
 			Sound *getSound();
-        
-            void setLoopOnLoad(bool val);
-            bool getLoopOnLoad();
+		
+			void setLoopOnLoad(bool val);
+			bool getLoopOnLoad();
 			
 		protected:
 		
-            bool loopOnLoad;
+			bool loopOnLoad;
 			bool directionalSound;
 			Sound *sound;
 	};

+ 183 - 183
include/polycode/core/PolySceneSprite.h

@@ -29,188 +29,188 @@ THE SOFTWARE.
 
 namespace Polycode {
 
-    
-    class SpriteFrame {
-    public:
-        Polycode::Rectangle coordinates;
-        Vector2 anchorPoint;
-        unsigned int frameID;
-    };
-    
-    class SpriteSet;
-    
-    class SpriteState {
-    public:
-        SpriteState(SpriteSet *spriteSet, String name);
-        
-        void setName(String name);
-        String getName() const;
-        
-        void POLYIGNORE appendFrames(std::vector<unsigned int> newFrameIDs);
-        
-        unsigned int getNumFrameIDs();
-        unsigned int getFrameIDAtIndex(unsigned int index);
-        
-        Mesh *getMeshForFrameIndex(unsigned int index);
-        
-        void insertFrame(unsigned int index, unsigned int frameID);
-        
-        void POLYIGNORE setNewFrameIDs(std::vector<unsigned int> newIDs);
-        
-        void removeFrameByIndex(unsigned int frameIndex);
-        void POLYIGNORE removeFrameIndices(std::vector<unsigned int> indices);
-        void clearFrames();
-        
-        void setPixelsPerUnit(Number ppu);
-        Number getPixelsPerUnit();
-        
-        void rebuildStateMeshes();
-        
-        void setStateFPS(Number fps);
-        Number getStateFPS();
-        
-        Vector3 getLargestFrameBoundingBox() const;
-        
-        void setBoundingBox(Vector2 boundingBox);
-        Vector2 getBoundingBox();
-        
-        Vector2 getSpriteOffset();
-        void setSpriteOffset(const Vector2 &offset);
-        
-    protected:
-        
-        Vector3 largestFrameBoundingBox;
-        Vector2 boundingBox;
-        Vector2 spriteOffset;
-        Number pixelsPerUnit;
-        Number stateFPS;
-        SpriteSet *spriteSet;
-        String name;
-        std::vector<unsigned int> frameIDs;
-        std::vector<Mesh*> frameMeshes;
-    };
-    
-    class SpriteSet;
-    
-    class Sprite : public Resource {
-    public:
-        Sprite(String name);
-        ~Sprite();
-        
-        String getName();
-        void setName(String name);
-        
-        void addSpriteState(SpriteState *state);
-        void removeSpriteState(SpriteState *state);
-        
-        unsigned int getNumStates();
-        SpriteState *getState(unsigned int index);
-        SpriteState *getStateByName(const String &name);
-        
-        void setParentSpritSet(SpriteSet *spriteSet);
-        SpriteSet *getParentSpriteSet();
-        
-        
-    protected:
-        String name;
-        SpriteSet *parentSpriteSet;
-        std::vector<SpriteState*> states;
-    };
-    
-    class SpriteSet : public ResourcePool {
-    public:
-        SpriteSet(const String &fileName, ResourcePool *parentPool = CoreServices::getInstance()->getResourceManager()->getGlobalPool());
-        ~SpriteSet();
-        
-        void setTexture(Texture *texture);
-        Texture *getTexture();
-        Texture *loadTexture(String imageFileName);
-        
-        void addSpriteEntry(Sprite *newEntry);
-        unsigned int getNumSpriteEntries() const;
-        Sprite *getSpriteEntry(unsigned int index) const;
-        void removeSprite(Sprite *sprite);
-        
-        void loadSpriteSet(String fileName);
-        
-        // frame manipulation
-        void addSpriteFrame(const SpriteFrame &frame, bool assignID = true);
-        unsigned int getNumFrames() const;
-        SpriteFrame getSpriteFrame(unsigned int index) const;
-        
-        SpriteFrame getSpriteFrameByID(unsigned int frameID) const;
-        void removeFrameByID(unsigned int frameID);
-        
-        void setSpriteFrame(const SpriteFrame &frame);
-        
-        void clearFrames();
-        
-        // automatic frame generation
-        void createGridFrames(unsigned int xCount, unsigned int yCount, const Vector2 &defaultAnchor);
-        void createFramesFromIslands(unsigned int minDistance, const Vector2 &defaultAnchor);
-        
-        Sprite *getSpriteByName(String spriteName);
-        
-    protected:
-        
-        unsigned int nextFrameIDIndex;
-        Texture *spriteTexture;
-        std::vector<SpriteFrame> frames;
-        std::vector<Sprite*> sprites;
-    };
-    
-    class SceneSprite : public SceneMesh {
-    public:
-        SceneSprite(SpriteSet *spriteSet);
-        ~SceneSprite();
-        
-        Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
-        void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
-        
-        SpriteSet *getSpriteSet();
-        Sprite *getCurrentSprite();
-        
-        void handleEvent(Event *event);
-        
-        void setSpriteSet(SpriteSet *spriteSet);
-        void setSpriteByName(String spriteName);
-        
-        void setCurrentFrame(unsigned int frameIndex);
-        unsigned int getCurrentFrame();
-        void Update();
-        void Render(GPUDrawBuffer *buffer);
-        
-        Vector3 getSpriteBoundingBox() const;
-        
-        void setPaused(bool val);
-        bool isPaused();
-        
-        void setSprite(Sprite *spriteEntry);
-        
-        void setSpriteState(SpriteState *spriteState, unsigned int startingFrame, bool playOnce);
-        
-        void setSpriteStateByName(String name, unsigned int startingFrame, bool playOnce);
-        
-        SpriteState *getCurrentSpriteState();
-        
+	
+	class SpriteFrame {
+	public:
+		Polycode::Rectangle coordinates;
+		Vector2 anchorPoint;
+		unsigned int frameID;
+	};
+	
+	class SpriteSet;
+	
+	class SpriteState {
+	public:
+		SpriteState(SpriteSet *spriteSet, String name);
+		
+		void setName(String name);
+		String getName() const;
+		
+		void POLYIGNORE appendFrames(std::vector<unsigned int> newFrameIDs);
+		
+		unsigned int getNumFrameIDs();
+		unsigned int getFrameIDAtIndex(unsigned int index);
+		
+		Mesh *getMeshForFrameIndex(unsigned int index);
+		
+		void insertFrame(unsigned int index, unsigned int frameID);
+		
+		void POLYIGNORE setNewFrameIDs(std::vector<unsigned int> newIDs);
+		
+		void removeFrameByIndex(unsigned int frameIndex);
+		void POLYIGNORE removeFrameIndices(std::vector<unsigned int> indices);
+		void clearFrames();
+		
+		void setPixelsPerUnit(Number ppu);
+		Number getPixelsPerUnit();
+		
+		void rebuildStateMeshes();
+		
+		void setStateFPS(Number fps);
+		Number getStateFPS();
+		
+		Vector3 getLargestFrameBoundingBox() const;
+		
+		void setBoundingBox(Vector2 boundingBox);
+		Vector2 getBoundingBox();
+		
+		Vector2 getSpriteOffset();
+		void setSpriteOffset(const Vector2 &offset);
+		
+	protected:
+		
+		Vector3 largestFrameBoundingBox;
+		Vector2 boundingBox;
+		Vector2 spriteOffset;
+		Number pixelsPerUnit;
+		Number stateFPS;
+		SpriteSet *spriteSet;
+		String name;
+		std::vector<unsigned int> frameIDs;
+		std::vector<Mesh*> frameMeshes;
+	};
+	
+	class SpriteSet;
+	
+	class Sprite : public Resource {
+	public:
+		Sprite(String name);
+		~Sprite();
+		
+		String getName();
+		void setName(String name);
+		
+		void addSpriteState(SpriteState *state);
+		void removeSpriteState(SpriteState *state);
+		
+		unsigned int getNumStates();
+		SpriteState *getState(unsigned int index);
+		SpriteState *getStateByName(const String &name);
+		
+		void setParentSpritSet(SpriteSet *spriteSet);
+		SpriteSet *getParentSpriteSet();
+		
+		
+	protected:
+		String name;
+		SpriteSet *parentSpriteSet;
+		std::vector<SpriteState*> states;
+	};
+	
+	class SpriteSet : public ResourcePool {
+	public:
+		SpriteSet(const String &fileName, ResourcePool *parentPool = CoreServices::getInstance()->getResourceManager()->getGlobalPool());
+		~SpriteSet();
+		
+		void setTexture(Texture *texture);
+		Texture *getTexture();
+		Texture *loadTexture(String imageFileName);
+		
+		void addSpriteEntry(Sprite *newEntry);
+		unsigned int getNumSpriteEntries() const;
+		Sprite *getSpriteEntry(unsigned int index) const;
+		void removeSprite(Sprite *sprite);
+		
+		void loadSpriteSet(String fileName);
+		
+		// frame manipulation
+		void addSpriteFrame(const SpriteFrame &frame, bool assignID = true);
+		unsigned int getNumFrames() const;
+		SpriteFrame getSpriteFrame(unsigned int index) const;
+		
+		SpriteFrame getSpriteFrameByID(unsigned int frameID) const;
+		void removeFrameByID(unsigned int frameID);
+		
+		void setSpriteFrame(const SpriteFrame &frame);
+		
+		void clearFrames();
+		
+		// automatic frame generation
+		void createGridFrames(unsigned int xCount, unsigned int yCount, const Vector2 &defaultAnchor);
+		void createFramesFromIslands(unsigned int minDistance, const Vector2 &defaultAnchor);
+		
+		Sprite *getSpriteByName(String spriteName);
+		
+	protected:
+		
+		unsigned int nextFrameIDIndex;
+		Texture *spriteTexture;
+		std::vector<SpriteFrame> frames;
+		std::vector<Sprite*> sprites;
+	};
+	
+	class SceneSprite : public SceneMesh {
+	public:
+		SceneSprite(SpriteSet *spriteSet);
+		~SceneSprite();
+		
+		Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
+		void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
+		
+		SpriteSet *getSpriteSet();
+		Sprite *getCurrentSprite();
+		
+		void handleEvent(Event *event);
+		
+		void setSpriteSet(SpriteSet *spriteSet);
+		void setSpriteByName(String spriteName);
+		
+		void setCurrentFrame(unsigned int frameIndex);
+		unsigned int getCurrentFrame();
+		void Update();
+		void Render(GPUDrawBuffer *buffer);
+		
+		Vector3 getSpriteBoundingBox() const;
+		
+		void setPaused(bool val);
+		bool isPaused();
+		
+		void setSprite(Sprite *spriteEntry);
+		
+		void setSpriteState(SpriteState *spriteState, unsigned int startingFrame, bool playOnce);
+		
+		void setSpriteStateByName(String name, unsigned int startingFrame, bool playOnce);
+		
+		SpriteState *getCurrentSpriteState();
+		
 
-        bool getStartOnRandomFrame();
-        void setStartOnRandomFrame(bool val);
-        
-    protected:
-        
-        Vector3 spriteBoundingBox;
-        bool startOnRandomFrame;
-        bool playOnce;
-        bool paused;
-        Core *core;
-        unsigned int currentFrame;
-        Mesh *defaultMesh;
-        Sprite *currentSprite;
-        SpriteState *currentSpriteState;
-        SpriteSet *spriteSet;
-        Number spriteTimer;
-        Number spriteTimerVal;
-        
-    };
+		bool getStartOnRandomFrame();
+		void setStartOnRandomFrame(bool val);
+		
+	protected:
+		
+		Vector3 spriteBoundingBox;
+		bool startOnRandomFrame;
+		bool playOnce;
+		bool paused;
+		Core *core;
+		unsigned int currentFrame;
+		Mesh *defaultMesh;
+		Sprite *currentSprite;
+		SpriteState *currentSpriteState;
+		SpriteSet *spriteSet;
+		Number spriteTimer;
+		Number spriteTimerVal;
+		
+	};
 }

+ 53 - 53
include/polycode/core/PolyScript.h

@@ -27,66 +27,66 @@
 
 extern "C" {
 #ifndef NO_LUA
-    #include "lua.h"
-    #include "lualib.h"
-    #include "lauxlib.h"
+	#include "lua.h"
+	#include "lualib.h"
+	#include "lauxlib.h"
 #endif
-    #include "duktape.h"
+	#include "duktape.h"
 }
 
 namespace Polycode {
 
-    class Entity;
-    class Script;
-    
-    class ScriptInstance {
-        public:
-            Script *script;
-    };
-    
-    class Script : public Resource {
-        public:
-            Script(const String &path);
-        
-            virtual ScriptInstance *callInit(Entity *entity) = 0;
-            virtual void callUpdate(ScriptInstance *instance, Entity *entity, Number elapsed) = 0;
-    };
-    
+	class Entity;
+	class Script;
+	
+	class ScriptInstance {
+		public:
+			Script *script;
+	};
+	
+	class Script : public Resource {
+		public:
+			Script(const String &path);
+		
+			virtual ScriptInstance *callInit(Entity *entity) = 0;
+			virtual void callUpdate(ScriptInstance *instance, Entity *entity, Number elapsed) = 0;
+	};
+	
 #ifndef NO_LUA
-    class LuaScriptInstance : public ScriptInstance {
-        public:
-            int tableRef;
-    };
-    
-    class LuaScript : public Script {
-        public:
-            LuaScript(lua_State *state, const String &path);
-        
-            ScriptInstance *callInit(Entity *entity);
-            void callUpdate(ScriptInstance *instance, Entity *entity, Number elapsed);
-        
-        private:
-            lua_State *state;
-            int tableRef;
-            int errH;
-    };
+	class LuaScriptInstance : public ScriptInstance {
+		public:
+			int tableRef;
+	};
+	
+	class LuaScript : public Script {
+		public:
+			LuaScript(lua_State *state, const String &path);
+		
+			ScriptInstance *callInit(Entity *entity);
+			void callUpdate(ScriptInstance *instance, Entity *entity, Number elapsed);
+		
+		private:
+			lua_State *state;
+			int tableRef;
+			int errH;
+	};
 #endif
 
-    class JSScriptInstance : public ScriptInstance {
-    public:
-        void *objectRef;
-    };
-    
-    class JSScript : public Script {
-    public:
-        JSScript(duk_context *context, const String &path);
-        
-        ScriptInstance *callInit(Entity *entity);
-        void callUpdate(ScriptInstance *instance, Entity *entity, Number elapsed);
-        
-    private:
-        void *mainObjectRef;
-        duk_context *context;
-    };
+	class JSScriptInstance : public ScriptInstance {
+	public:
+		void *objectRef;
+	};
+	
+	class JSScript : public Script {
+	public:
+		JSScript(duk_context *context, const String &path);
+		
+		ScriptInstance *callInit(Entity *entity);
+		void callUpdate(ScriptInstance *instance, Entity *entity, Number elapsed);
+		
+	private:
+		void *mainObjectRef;
+		duk_context *context;
+	};
 
 }

+ 4 - 4
include/polycode/core/PolyServer.h

@@ -56,9 +56,9 @@ namespace Polycode {
 		
 		ServerClientEvent *handlePacket(Packet *packet);
 		
-		unsigned int    clientID;
+		unsigned int	clientID;
 		PeerConnection *connection;
-        bool clientReady;
+		bool clientReady;
 	};
 		
 	class _PolyExport ServerEvent : public Event {
@@ -99,14 +99,14 @@ namespace Polycode {
 			~Server();
 		
 			void handlePacket(Packet *packet, PeerConnection *connection);
-			void handleEvent(Event *event);	
+			void handleEvent(Event *event); 
 			void handlePeerConnection(PeerConnection *connection);
 			void DisconnectClient(ServerClient *client);
 
 			/**
 			* Get a connected client from its associated peer connection, if any.
 			* @param connection The PeerConnection through which we're communicating 
-			*                   with the client to obtain.
+			*					with the client to obtain.
 			* @return The connected client or NULL if doesn't exist.
 			*/
 			ServerClient *getConnectedClient(PeerConnection *connection);

+ 95 - 95
include/polycode/core/PolyShader.h

@@ -35,48 +35,48 @@ namespace Polycode {
 	class Cubemap;
 	class ShaderBinding;
 	class Texture;
-    class VertexDataArray;
-    class LocalShaderParam;
-    class RenderBuffer;
-    class CoreMutex;
-    
+	class VertexDataArray;
+	class LocalShaderParam;
+	class RenderBuffer;
+	class CoreMutex;
+	
 	class _PolyExport ProgramParam {
 		public:
 	
-        ProgramParam();
-        
-        String name;
-        int type;
-        void *platformData;
-        LocalShaderParam *globalParam;
+		ProgramParam();
+		
+		String name;
+		int type;
+		void *platformData;
+		LocalShaderParam *globalParam;
 
-        static void *createParamData(int type);
-        
-        static const int PARAM_UNKNOWN = 0;	
-        static const int PARAM_NUMBER = 1;
-        static const int PARAM_VECTOR2 = 2;		
-        static const int PARAM_VECTOR3 = 3;
-        static const int PARAM_COLOR = 4;
-        static const int PARAM_MATRIX = 5;
-        static const int PARAM_TEXTURE = 6;
-        static const int PARAM_CUBEMAP = 7;
+		static void *createParamData(int type);
+		
+		static const int PARAM_UNKNOWN = 0; 
+		static const int PARAM_NUMBER = 1;
+		static const int PARAM_VECTOR2 = 2;		
+		static const int PARAM_VECTOR3 = 3;
+		static const int PARAM_COLOR = 4;
+		static const int PARAM_MATRIX = 5;
+		static const int PARAM_TEXTURE = 6;
+		static const int PARAM_CUBEMAP = 7;
+	};
+	
+	class _PolyExport ProgramAttribute {
+		public:
+			ProgramAttribute();
+		
+			int size;
+			String name;
+			int arrayType;
+			void *platformData;
 	};
 	
-    class _PolyExport ProgramAttribute {
-        public:
-            ProgramAttribute();
-        
-            int size;
-            String name;
-            int arrayType;
-            void *platformData;
-    };
-    
 	typedef struct {
 		Texture *texture;
 		String name;
 	} TextureBinding;
-    
+	
 	typedef struct {
 		Cubemap *cubemap;
 		String name;
@@ -103,9 +103,9 @@ namespace Polycode {
 			void setName(const String& name);
 			const String& getName() const;
 			
-            ProgramParam *getParamPointer(const String &name);
-            ProgramAttribute *getAttribPointer(const String &name);
-        
+			ProgramParam *getParamPointer(const String &name);
+			ProgramAttribute *getAttribPointer(const String &name);
+		
 			virtual void reload() {}
 			
 			int getExpectedParamType(String name);
@@ -148,47 +148,47 @@ namespace Polycode {
 	
 	class LocalShaderParam : public PolyBase {
 		public:
-        
-            LocalShaderParam();
-            ~LocalShaderParam();
-            LocalShaderParam *Copy();
-        
+		
+			LocalShaderParam();
+			~LocalShaderParam();
+			LocalShaderParam *Copy();
+		
 			String name;
 			void *data;
 			int type;
-            bool ownsPointer;
-            unsigned int arraySize;
-            ProgramParam *param;
-        
-            // Convenience getters/setters for Lua users
-            Number getNumber();
-            Vector2 getVector2();
-            Vector3 getVector3();
-            Matrix4 getMatrix4();
-            Color getColor();
-            void setNumber(Number x);
-            void setVector2(Vector2 x);
-            void setVector3(Vector3 x);
-            void setMatrix4(Matrix4 x);
-            void setColor(Color x);
-        
-            void setTexture(Texture *texture);
-            Texture *getTexture();
-        
-            void setCubemap(Cubemap *cubemap);
-            Cubemap *getCubemap();
-        
-            void setParamValueFromString(int type, String pvalue);
+			bool ownsPointer;
+			unsigned int arraySize;
+			ProgramParam *param;
+		
+			// Convenience getters/setters for Lua users
+			Number getNumber();
+			Vector2 getVector2();
+			Vector3 getVector3();
+			Matrix4 getMatrix4();
+			Color getColor();
+			void setNumber(Number x);
+			void setVector2(Vector2 x);
+			void setVector3(Vector3 x);
+			void setMatrix4(Matrix4 x);
+			void setColor(Color x);
+		
+			void setTexture(Texture *texture);
+			Texture *getTexture();
+		
+			void setCubemap(Cubemap *cubemap);
+			Cubemap *getCubemap();
+		
+			void setParamValueFromString(int type, String pvalue);
+	};
+	
+	class AttributeBinding : public PolyBase {
+		public:
+			AttributeBinding();
+			String name;
+			VertexDataArray *vertexData;
+			ProgramAttribute *attribute;
+			bool enabled;
 	};
-    
-    class AttributeBinding : public PolyBase {
-        public:
-            AttributeBinding();
-            String name;
-            VertexDataArray *vertexData;
-            ProgramAttribute *attribute;
-            bool enabled;
-    };
 	
 	class RenderTargetBinding : public PolyBase {
 		public:
@@ -206,26 +206,26 @@ namespace Polycode {
 		public:
 			ShaderBinding();
 			virtual ~ShaderBinding();
-        
-            void copyTo(ShaderBinding *targetBinding);
-        
+		
+			void copyTo(ShaderBinding *targetBinding);
+		
 			LocalShaderParam *addParam(int type, const String& name);
-			LocalShaderParam *addParamPointer(int type, const String& name, void *ptr);        
+			LocalShaderParam *addParamPointer(int type, const String& name, void *ptr);		   
 			unsigned int getNumLocalParams();
 			LocalShaderParam *getLocalParam(unsigned int index);
 			LocalShaderParam *getLocalParamByName(const String& name);
-        
-            void removeParam(const String &name);
-        
-            Texture *loadTextureForParam(const String &paramName, const String &fileName);
-            void setTextureForParam(const String &paramName, Texture *texture);
-            void setCubemapForParam(const String &paramName, Cubemap *cubemap);
-        
-            unsigned int getNumAttributeBindings();
-            AttributeBinding *getAttributeBinding(unsigned int index);
-        
-            AttributeBinding *addAttributeBinding(const String &name, VertexDataArray *dataArray);
-            AttributeBinding *getAttributeBindingByName(const String &name);
+		
+			void removeParam(const String &name);
+		
+			Texture *loadTextureForParam(const String &paramName, const String &fileName);
+			void setTextureForParam(const String &paramName, Texture *texture);
+			void setCubemapForParam(const String &paramName, Cubemap *cubemap);
+		
+			unsigned int getNumAttributeBindings();
+			AttributeBinding *getAttributeBinding(unsigned int index);
+		
+			AttributeBinding *addAttributeBinding(const String &name, VertexDataArray *dataArray);
+			AttributeBinding *getAttributeBindingByName(const String &name);
 			
 			void addRenderTargetBinding(RenderTargetBinding *binding);
 			void removeRenderTargetBinding(RenderTargetBinding *binding);
@@ -244,20 +244,20 @@ namespace Polycode {
 
 			unsigned int getNumOutTargetBindings();
 			RenderTargetBinding *getOutTargetBinding(unsigned int index);
-        
+		
 			std::vector<LocalShaderParam*> localParams;
 			std::vector<AttributeBinding*> attributes;
-        
+		
 			std::vector<RenderTargetBinding*> renderTargetBindings;
 			std::vector<RenderTargetBinding*> inTargetBindings;
 			std::vector<RenderTargetBinding*> outTargetBindings;
 			std::vector<RenderTargetBinding*> colorTargetBindings;
 			std::vector<RenderTargetBinding*> depthTargetBindings;
-        
-            bool resetAttributes;
-            Shader *targetShader;
-        
-            CoreMutex *accessMutex;
+		
+			bool resetAttributes;
+			Shader *targetShader;
+		
+			CoreMutex *accessMutex;
 	};
 
 }

+ 40 - 40
include/polycode/core/PolySkeleton.h

@@ -42,11 +42,11 @@ namespace Polycode {
 		public:
 			BoneTrack(Bone *bone, Number length);
 			~BoneTrack();
-        
+		
 			void Play(bool once=false);
 			void Stop();
 			void Update(Number elapsed);
-            void Reset();
+			void Reset();
 		
 			void setSpeed(Number speed);
 			
@@ -62,20 +62,20 @@ namespace Polycode {
 			BezierCurve *LocZ;
 			
 			Vector3 position;
-            Vector3 scale;
+			Vector3 scale;
 			Quaternion boneQuat;
-            QuaternionCurve *quatCurve;
-        
-            Number weight;
+			QuaternionCurve *quatCurve;
+		
+			Number weight;
 			
 		protected:
 		
 			Number length;
-            Number speed;
-            bool paused;
-            Number time;
+			Number speed;
+			bool paused;
+			Number time;
 			Bone *targetBone;
-            bool playOnce;
+			bool playOnce;
 		
 	};
 
@@ -107,9 +107,9 @@ namespace Polycode {
 			* Stops the animation.
 			*/			
 			void Stop();
-        
-            void Reset();
-        
+		
+			void Reset();
+		
 			void Update();
 
 			/**
@@ -118,15 +118,15 @@ namespace Polycode {
 			*/					
 			void setSpeed(Number speed);
 			
-            void setWeight(Number newWeight);
-            Number getWeight() const;
-        
-            bool isPlaying() const;
-        
+			void setWeight(Number newWeight);
+			Number getWeight() const;
+		
+			bool isPlaying() const;
+		
 		protected:
 			
-            Number weight;
-            bool playing;
+			Number weight;
+			bool playing;
 			String name;
 			Number duration;
 			std::vector<BoneTrack*> boneTracks;
@@ -170,15 +170,15 @@ namespace Polycode {
 			void playAnimationByName(const String& animName, Number weight = 1.0, bool once = false, bool restartIfPlaying = false);
 			
 
-            void playAnimation(SkeletonAnimation *animation, Number weight = 1.0, bool once = false, bool restartIfPlaying = false);
-        
-            void setBaseAnimationByName(const String &animName);
-            void setBaseAnimation(SkeletonAnimation *animation);
-        
-            void stopAllAnimations();
-        
-            SkeletonAnimation *getBaseAnimation();
-        
+			void playAnimation(SkeletonAnimation *animation, Number weight = 1.0, bool once = false, bool restartIfPlaying = false);
+		
+			void setBaseAnimationByName(const String &animName);
+			void setBaseAnimation(SkeletonAnimation *animation);
+		
+			void stopAllAnimations();
+		
+			SkeletonAnimation *getBaseAnimation();
+		
 			/**
 			* Loads in a new animation from a file and adds it to the skeleton.
 			* @param name Name of the new animation.
@@ -192,10 +192,10 @@ namespace Polycode {
 			*/
 			SkeletonAnimation *getAnimation(const String& name) const;
 
-        
-            void stopAnimationByName(const String &name);
-            void stopAnimation(SkeletonAnimation *animation);
-        
+		
+			void stopAnimationByName(const String &name);
+			void stopAnimation(SkeletonAnimation *animation);
+		
 			void Update();
 			
 			/**
@@ -221,17 +221,17 @@ namespace Polycode {
 			*/
 			Bone *getBone(unsigned int index) const;
 		
-            void addBone(Bone *bone);
-            void removeBone(Bone *bone);
-        
-            unsigned int getBoneIndexByBone(Bone *bone);
-        
+			void addBone(Bone *bone);
+			void removeBone(Bone *bone);
+		
+			unsigned int getBoneIndexByBone(Bone *bone);
+		
 		protected:
 		
 			Entity *bonesEntity;
 		
-            SkeletonAnimation *baseAnimation;
-            std::vector<SkeletonAnimation*> playingAnimations;
+			SkeletonAnimation *baseAnimation;
+			std::vector<SkeletonAnimation*> playingAnimations;
 			std::vector<Bone*> bones;
 			std::vector<SkeletonAnimation*> animations;
 	};

+ 13 - 13
include/polycode/core/PolySocket.h

@@ -69,18 +69,18 @@ namespace Polycode {
 		/**
 		* Constructor.
 		* @param ipAsString An IP address represented as string,
-		*                   for example "127.0.0.1"
+		*					for example "127.0.0.1"
 		* @param port The UDP/TCP port of the address, given in
-		*             host byte order.
+		*			  host byte order.
 		*/
 		Address(String ipAsString, unsigned int port);
 
 		/**
 		* Constructor.
 		* @param ip An IP address given as integer in host byte
-		*           order.
+		*			order.
 		* @param port The UDP/TCP port of the address, given in
-		*             host byte order.
+		*			  host byte order.
 		*/
 		Address(unsigned int ip, unsigned int port);
 
@@ -103,33 +103,33 @@ namespace Polycode {
 		/**
 		* @return 1 if the address IP and port match, 0 otherwise.
 		*/
-		inline bool operator == ( const Address& add2)  {
+		inline bool operator == ( const Address& add2)	{
 			return (uintAddress == add2.uintAddress && port == add2.port);
 		}
 			
 		/**
 		* Update the address IP and port.
 		* @param ipAsString An IP address represented as string,
-		*                   for example "197.0.0.1"
+		*					for example "197.0.0.1"
 		* @param port The UDP/TCP port of the address, given in
-		*             host byte order.
+		*			  host byte order.
 		*/
 		void setAddress(String ipAsString, unsigned int port);
 
 		/**
 		* Update the address IP and port.
 		* @param ip An IP address given as integer in host byte
-		*           order.
+		*			order.
 		* @param port The UDP/TCP port of the address, given in
-		*             host byte order.
+		*			  host byte order.
 		*/
 		void setAddress(unsigned int ip, unsigned int port);
 		
 		// TODO: A way to get the IP/port without exposing internal members.
-		//       The problem here is that the IP internally is converted to
-		//       network byte order, but the API seems to work with host byte
-		//       order, so I'm unsure in which byte order the IP/port should
-		//       be returned.
+		//		 The problem here is that the IP internally is converted to
+		//		 network byte order, but the API seems to work with host byte
+		//		 order, so I'm unsure in which byte order the IP/port should
+		//		 be returned.
 
 		protected:
 		unsigned int uintAddress;

+ 52 - 52
include/polycode/core/PolySound.h

@@ -31,27 +31,27 @@
 
 namespace Polycode {
 
-    enum SoundFormat {SoundFormatUnsupported, SoundFormat8, SoundFormat16, SoundFormat32};
-    
+	enum SoundFormat {SoundFormatUnsupported, SoundFormat8, SoundFormat16, SoundFormat32};
+	
 	class String;
-    class Vector3;
-    class Quaternion;
-    
-    class  AudioStreamingSource {
-        public:
-            AudioStreamingSource(unsigned int channels, unsigned int freq);        
-            POLYIGNORE virtual unsigned int streamData(int16_t *buffer, unsigned int size);
-        
-            unsigned int getNumChannels();
-            unsigned int getFrequency();
-        
-        protected:
-        
-            unsigned int channels;
-            unsigned int freq;
-        
-    };
-    
+	class Vector3;
+	class Quaternion;
+	
+	class  AudioStreamingSource {
+		public:
+			AudioStreamingSource(unsigned int channels, unsigned int freq);		   
+			POLYIGNORE virtual unsigned int streamData(int16_t *buffer, unsigned int size);
+		
+			unsigned int getNumChannels();
+			unsigned int getFrequency();
+		
+		protected:
+		
+			unsigned int channels;
+			unsigned int freq;
+		
+	};
+	
 	/**
 	* Loads and plays a sound. This class can load and play an OGG or WAV sound file.
 	*/
@@ -64,10 +64,10 @@ namespace Polycode {
 		*/ 
 		Sound(const String& fileName);
 		Sound(int size, const char *data, int channels, unsigned int freq, SoundFormat format);
-        Sound(AudioStreamingSource *streamingSource);
-        
-        Number getSampleAsNumber(unsigned int offset, unsigned int channel, const Vector3 &position, const Quaternion &orientation);
-        
+		Sound(AudioStreamingSource *streamingSource);
+		
+		Number getSampleAsNumber(unsigned int offset, unsigned int channel, const Vector3 &position, const Quaternion &orientation);
+		
 		virtual ~Sound();
 		
 		void loadFile(String fileName);
@@ -105,8 +105,8 @@ namespace Polycode {
 		*/
 		bool isPlaying();
 		
-        bool isLooped();
-        
+		bool isLooped();
+		
 		void setIsPositional(bool isPositional);
 		
 		void setSoundPosition(const Vector3 &position);
@@ -131,15 +131,15 @@ namespace Polycode {
 		* @return The sample offset if it is known, -1 otherwise.
 		*/
 		int getOffset();
-        
+		
 		/**
 		* Returns the number of samples in the sound.
 		* @return The sample length if it is known, -1 otherwise.
 		*/
 		int getSampleLength();
 		
-        unsigned int getFrequency();
-        
+		unsigned int getFrequency();
+		
 		void setPositionalProperties(Number referenceDistance, Number maxDistance);
 		
 		void setReferenceDistance(Number referenceDistance);
@@ -147,51 +147,51 @@ namespace Polycode {
 		
 		Number getReferenceDistance();
 		Number getMaxDistance();
-        
+		
 
 		bool loadBytes(const char *data, int size, int channels, unsigned int freq, SoundFormat format);
 		bool loadWAV(const String& fileName);
 		bool loadOGG(const String& fileName);
-        
+		
 		void soundCheck(bool result, const String& err);
 		static unsigned long readByte32(const unsigned char buffer[4]);		
 		static unsigned short readByte16(const unsigned char buffer[2]);
 		
-        void updateStream(unsigned int streamCount);
+		void updateStream(unsigned int streamCount);
 
 	protected:
-        
-        Number modulateSampleForListener(Number sample, unsigned int channel, const Vector3 &position, const Quaternion &orientation);
-        
-        Vector3 position;
-        Vector3 velocity;
-        Vector3 direction;
-        
+		
+		Number modulateSampleForListener(Number sample, unsigned int channel, const Vector3 &position, const Quaternion &orientation);
+		
+		Vector3 position;
+		Vector3 velocity;
+		Vector3 direction;
+		
 		Number referenceDistance;
 		Number maxDistance;
-        
-        bool streamingSound;
-        AudioStreamingSource *streamingSource;
-        
+		
+		bool streamingSound;
+		AudioStreamingSource *streamingSource;
+		
 		Number pitch;
 		Number frequencyAdjust;
-        
+		
 		Number volume;
 	
 		String fileName;
 		
 		bool soundLoaded;
 	
-        bool playing;
-        bool looped;
-        
+		bool playing;
+		bool looped;
+		
 		bool isPositional;
 		unsigned int numSamples;
-        unsigned int numChannels;
-        unsigned int playbackOffset;
-        unsigned int frequency;
-    
-        int16_t *soundBuffer;
+		unsigned int numChannels;
+		unsigned int playbackOffset;
+		unsigned int frequency;
+	
+		int16_t *soundBuffer;
 
 	};
 }

+ 41 - 41
include/polycode/core/PolySoundManager.h

@@ -33,36 +33,36 @@
 #define POLY_MIX_BUFFER_SIZE (POLY_FRAMES_PER_BUFFER*POLY_CIRCULAR_BUFFER_SIZE)
 
 namespace Polycode {
-    
-    class _PolyExport AudioMixer {
-        public:
+	
+	class _PolyExport AudioMixer {
+		public:
 
 			AudioMixer();
 			~AudioMixer();
 
-            void mixIntoBuffer(int16_t *buffer, unsigned int numSamples);
-            std::vector<Sound*> sounds;
-            Number globalVolume;
-            Vector3 listenerPosition;
-            Quaternion listenerOrientation;
+			void mixIntoBuffer(int16_t *buffer, unsigned int numSamples);
+			std::vector<Sound*> sounds;
+			Number globalVolume;
+			Vector3 listenerPosition;
+			Quaternion listenerOrientation;
 			CoreMutex *mixerMutex;
-    };
+	};
+	
+	class _PolyExport AudioInterface {
+		public:
+			AudioInterface();
+			void addToBuffer(int16_t *data, unsigned int count);
+			virtual void setMixer(AudioMixer *mixer);
+			AudioMixer *getMixer();		   
+		protected:
+			AudioMixer *mixer;
+	};
+	
 	
-    class _PolyExport AudioInterface {
-        public:
-            AudioInterface();
-            void addToBuffer(int16_t *data, unsigned int count);
-            virtual void setMixer(AudioMixer *mixer);
-            AudioMixer *getMixer();        
-        protected:
-            AudioMixer *mixer;
-    };
-    
-    
 	/**
 	* Controls global sound settings.
 	*/
-    
+	
 	class _PolyExport SoundManager : public PolyBase{
 	public:
 		SoundManager();
@@ -70,33 +70,33 @@ namespace Polycode {
 		 
 		void setListenerPosition(const Vector3 &position);
 		void setListenerOrientation(const Quaternion &orientation);
-        
-        bool recordSound(unsigned int rate, unsigned int sampleSize);
-        Sound *stopRecording(bool generateFloatBuffer = false);
-        void setAudioInterface(AudioInterface *audioInterface);
-        
-        void Update();
+		
+		bool recordSound(unsigned int rate, unsigned int sampleSize);
+		Sound *stopRecording(bool generateFloatBuffer = false);
+		void setAudioInterface(AudioInterface *audioInterface);
+		
+		void Update();
 		
 		/**
 		* Sets the global sound volume.
 		*/ 
 		void setGlobalVolume(Number globalVolume);
-        
-        void registerSound(Sound *sound);
-        void unregisterSound(Sound *sound);
+		
+		void registerSound(Sound *sound);
+		void unregisterSound(Sound *sound);
 		
 	protected:
 		
-        AudioMixer *mixer;
-        AudioInterface *audioInterface;
-        
-        int16_t mixBuffer[POLY_MIX_BUFFER_SIZE*POLY_NUM_CHANNELS];
-        
-        Number testVal;
-        Number leftOver;
-        
-       
-        int recordingBufferSize;
-        int recordingBufferRate;
+		AudioMixer *mixer;
+		AudioInterface *audioInterface;
+		
+		int16_t mixBuffer[POLY_MIX_BUFFER_SIZE*POLY_NUM_CHANNELS];
+		
+		Number testVal;
+		Number leftOver;
+		
+	   
+		int recordingBufferSize;
+		int recordingBufferRate;
 	};
 }

+ 7 - 7
include/polycode/core/PolyString.h

@@ -137,9 +137,9 @@ namespace Polycode {
 			inline String operator + (const char *str) const { return String(contents + String(str).contents); }		
 			inline String operator + (const String &str) const { return String(contents + str.contents); }		
 			String operator += (const String &str) { contents = contents + str.contents; return *this; }		
-			String operator = (const String &str) {  contents = str.contents; return *this;}
-			inline bool operator == (const String &str) const {  return (str.contents == contents); }		
-			inline bool operator != (const String &str) const {  return (str.contents != contents); }		
+			String operator = (const String &str) {	 contents = str.contents; return *this;}
+			inline bool operator == (const String &str) const {	 return (str.contents == contents); }		
+			inline bool operator != (const String &str) const {	 return (str.contents != contents); }		
 			inline wchar_t operator [] ( const size_t i ) const { return contents[i]; }
 
 			/**
@@ -175,10 +175,10 @@ namespace Polycode {
 			* @return A string converted from the Number.
 			*/																										
 			static String NumberToString(Number value, int precision = 2);
-        
-        
-            Number toNumber();
-            int toInteger();
+		
+		
+			Number toNumber();
+			int toInteger();
 
 			/**
 			* Convert an integer to a String.

+ 31 - 31
include/polycode/core/PolyTexture.h

@@ -30,7 +30,7 @@ namespace Polycode {
 
 	class _PolyExport Texture : public Resource {
 		public:
-            Texture(unsigned int width, unsigned int height, char *textureData,bool clamp, bool createMipmaps, int type=Image::IMAGE_RGBA, bool framebufferTexture=false);
+			Texture(unsigned int width, unsigned int height, char *textureData,bool clamp, bool createMipmaps, int type=Image::IMAGE_RGBA, bool framebufferTexture=false);
 			Texture(Image *image);
 			virtual ~Texture();
 			
@@ -47,42 +47,42 @@ namespace Polycode {
 		
 			bool clamp;
 			char *textureData;
-            int type;
-            int filteringMode;
-            bool createMipmaps;
-            unsigned int anisotropy;
-            bool framebufferTexture;
-            bool depthTexture;
-        
-            static const int FILTERING_NEAREST = 0;
-            static const int FILTERING_LINEAR = 1;
-        
+			int type;
+			int filteringMode;
+			bool createMipmaps;
+			unsigned int anisotropy;
+			bool framebufferTexture;
+			bool depthTexture;
+		
+			static const int FILTERING_NEAREST = 0;
+			static const int FILTERING_LINEAR = 1;
+		
 		protected:
 
 			int pixelSize;
 			int width;
 			int height;
 	};
-    
-    class _PolyExport RenderBuffer {
-        public:
-            RenderBuffer(unsigned int width, unsigned int height, bool attachDepthBuffer, bool floatingPoint);
+	
+	class _PolyExport RenderBuffer {
+		public:
+			RenderBuffer(unsigned int width, unsigned int height, bool attachDepthBuffer, bool floatingPoint);
 
-            unsigned int getWidth();
-            unsigned int getHeight();
-        
-            Texture *colorTexture;
-            Texture *depthTexture;
+			unsigned int getWidth();
+			unsigned int getHeight();
+		
+			Texture *colorTexture;
+			Texture *depthTexture;
 
-            void *platformData;
-            void *depthBufferPlatformData;
-    
-        private:
-        
-            bool floatingPoint;
-        
-            unsigned int width;
-            unsigned int height;
-    };
-    
+			void *platformData;
+			void *depthBufferPlatformData;
+	
+		private:
+		
+			bool floatingPoint;
+		
+			unsigned int width;
+			unsigned int height;
+	};
+	
 }

+ 3 - 3
include/polycode/core/PolyTween.h

@@ -54,8 +54,8 @@ namespace Polycode {
 		Number interpolateTween();
 		virtual void updateCustomTween() {}
 		void doOnComplete();
-        
-        Number *getTarget();
+		
+		Number *getTarget();
 		
 		/**
 		* Pauses and resumes the tween.
@@ -155,7 +155,7 @@ namespace Polycode {
 		protected:
 			Number pathValue;
 			Tween *pathTween;
-			QuaternionCurve	*quatCurve;
+			QuaternionCurve *quatCurve;
 			Quaternion *target;			
 	};
 	

+ 1 - 1
include/polycode/core/PolyTweenManager.h

@@ -36,7 +36,7 @@ namespace Polycode {
 			void addTween(Tween *tween);
 			void Update(Number elapsed);
 			void removeTween(Tween *tween);
-            void removeTweensForTarget(Number *target);
+			void removeTweensForTarget(Number *target);
 		
 		private:
 					

+ 8 - 8
include/polycode/core/PolyVector2.h

@@ -76,17 +76,17 @@ namespace Polycode {
 			inline Vector2 operator * (const Number val) const {
 				return Vector2(x * val, y * val);
 			}
-        
-            inline Vector2 operator * (const Vector2 &v2) const {
-                return Vector2(x * v2.x, y * v2.y);
-            }
+		
+			inline Vector2 operator * (const Vector2 &v2) const {
+				return Vector2(x * v2.x, y * v2.y);
+			}
 
 			inline Vector2 operator / (const Number val) const {
 				assert( val != 0.0 );
 				return operator*(1/val);
 			}
 
-			inline Vector2& operator = ( const Vector2& v2)  {
+			inline Vector2& operator = ( const Vector2& v2)	 {
 				x = v2.x;
 				y = v2.y;
 				return *this;
@@ -108,9 +108,9 @@ namespace Polycode {
 				return Vector2(x + v2.x, y + v2.y);
 			}		
 
-            inline Vector2 operator - () {
-                return Vector2(-x, -y);
-            }
+			inline Vector2 operator - () {
+				return Vector2(-x, -y);
+			}
 
 			inline bool operator == ( const Vector2& v2)  {
 				return (v2.x == x && v2.y == y);

+ 5 - 5
include/polycode/core/PolyVector3.h

@@ -99,7 +99,7 @@ namespace Polycode {
 				return operator*(1/val);
 			}
 
-			inline Vector3& operator = ( const Vector3& v2)  {
+			inline Vector3& operator = ( const Vector3& v2)	 {
 				x = v2.x;
 				y = v2.y;
 				z = v2.z;
@@ -123,10 +123,10 @@ namespace Polycode {
 			inline Vector3 operator + ( const Vector3& v2 ) const {
 				return Vector3(x + v2.x, y + v2.y, z + v2.z);
 			}
-        
-            inline Vector3 operator - () {
-                return Vector3(-x, -y, -z);
-            }
+		
+			inline Vector3 operator - () {
+				return Vector3(-x, -y, -z);
+			}
 
 			inline bool operator == ( const Vector3& v2)  {
 				return (v2.x == x && v2.y == y && v2.z == z);

+ 13 - 13
include/polycode/core/PolyVector4.h

@@ -45,9 +45,9 @@ namespace Polycode {
 			* @param w W coordinate.
 			*/					
 			Vector4(Number x,Number y,Number z, Number w);
-        
-        
-            Vector4(const Vector3 &v3);
+		
+		
+			Vector4(const Vector3 &v3);
 
 			/**
 			* Create from single value for all coordinates
@@ -66,7 +66,7 @@ namespace Polycode {
 			* @param x X coordinate.
 			* @param y Y coordinate.			
 			* @param z Z coordinate.
-            * @param w W coordinate
+			* @param w W coordinate
 			*/
 			void set(Number x, Number y, Number z, Number w);
 
@@ -96,7 +96,7 @@ namespace Polycode {
 				return operator*(1/val);
 			}
 
-			inline Vector4& operator = ( const Vector4& v2)  {
+			inline Vector4& operator = ( const Vector4& v2)	 {
 				x = v2.x;
 				y = v2.y;
 				z = v2.z;
@@ -123,10 +123,10 @@ namespace Polycode {
 			inline Vector4 operator + ( const Vector4& v2 ) const {
 				return Vector4(x + v2.x, y + v2.y, z + v2.z, w + v2.w);
 			}
-        
-            inline Vector4 operator - () {
-                return Vector4(-x, -y, -z, -w);
-            }
+		
+			inline Vector4 operator - () {
+				return Vector4(-x, -y, -z, -w);
+			}
 
 			inline bool operator == ( const Vector4& v2)  {
 				return (v2.x == x && v2.y == y && v2.z == z && v2.w == w);
@@ -163,10 +163,10 @@ namespace Polycode {
 			*/			
 			Number z;			
 
-            /**
-             * W coordinate.
-             */
-            Number w;
+			/**
+			 * W coordinate.
+			 */
+			Number w;
 
 	};
 }

+ 4 - 4
include/polycode/core/PolyWinCore.h

@@ -89,11 +89,11 @@
 #define VK_PERIOD	0xBE
 #define VK_SLASH	0xBF
 #define VK_GRAVE	0xC0
-#define VK_LBRACKET	0xDB
+#define VK_LBRACKET 0xDB
 #define VK_BACKSLASH	0xDC
-#define VK_RBRACKET	0xDD
+#define VK_RBRACKET 0xDD
 #define VK_APOSTROPHE	0xDE
-#define VK_BACKTICK	0xDF
+#define VK_BACKTICK 0xDF
 #define VK_OEM_102	0xE2
 
 #define EXTENDED_KEYMASK	(1<<24)
@@ -186,7 +186,7 @@ public:
 		
 	public:
 		
-		Win32Core(PolycodeViewBase *view, int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate,  int monitorIndex = -1, bool retinaSupport = false);
+		Win32Core(PolycodeViewBase *view, int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate,	 int monitorIndex = -1, bool retinaSupport = false);
 		~Win32Core();
 
 		void enableMouse(bool newval);

+ 8 - 8
include/polycode/core/PolyXAudio2AudioInterface.h

@@ -1,4 +1,4 @@
-    
+	
 /*
 Copyright (C) 2015 by Ivan Safrin
 
@@ -34,7 +34,7 @@ THE SOFTWARE.
 #define MAX_XAUDIO_BUFFER_COUNT 4
 
 #ifndef SAFE_RELEASE
-#define SAFE_RELEASE(p)      { if(p) { (p)->Release(); (p)=nullptr; } }
+#define SAFE_RELEASE(p)		 { if(p) { (p)->Release(); (p)=nullptr; } }
 #endif
 
 
@@ -105,15 +105,15 @@ namespace Polycode {
 
 	};
 
-    class XAudio2AudioInterface : public Polycode::AudioInterface {
-        public:
+	class XAudio2AudioInterface : public Polycode::AudioInterface {
+		public:
 			XAudio2AudioInterface();
-            ~XAudio2AudioInterface();
+			~XAudio2AudioInterface();
 			void setMixer(AudioMixer *mixer);
 
-        private:
+		private:
 			
 			XAudio2Stream *xAudioStream;
-    };
-    
+	};
+	
 }

+ 47 - 47
include/polycode/ide/EditorGrid.h

@@ -37,61 +37,61 @@ class EditorGrid : public Entity {
 		EditorGrid();
 		~EditorGrid();
 		
-        void setGridMode(int mode);
-    
-        Number getGridSize();
-        int getGridLen();
-    
-        void setGridSize(Number size);
-        void setGridLen(int len);
-    
-        bool isXAxisEnabled();
-        bool isYAxisEnabled();
-        bool isZAxisEnabled();
+		void setGridMode(int mode);
+	
+		Number getGridSize();
+		int getGridLen();
+	
+		void setGridSize(Number size);
+		void setGridLen(int len);
+	
+		bool isXAxisEnabled();
+		bool isYAxisEnabled();
+		bool isZAxisEnabled();
 
-        void enableXAxis(bool val);
-        void enableYAxis(bool val);
-        void enableZAxis(bool val);
-    
-        void rebuildGrid();
+		void enableXAxis(bool val);
+		void enableYAxis(bool val);
+		void enableZAxis(bool val);
+	
+		void rebuildGrid();
 		
-        static const int GRID_MODE_3D = 0;
-        static const int GRID_MODE_2D_X = 1;
-        static const int GRID_MODE_2D_Y = 2;
-        static const int GRID_MODE_2D_Z = 3;
-    
+		static const int GRID_MODE_3D = 0;
+		static const int GRID_MODE_2D_X = 1;
+		static const int GRID_MODE_2D_Y = 2;
+		static const int GRID_MODE_2D_Z = 3;
+	
 	private:
-        int gridMode;
+		int gridMode;
 		SceneMesh *grid;
-    
-        SceneLine *yLine;
-        SceneLine *xLine;
-        SceneLine *zLine;
-    
-        Number gridSize;
-        int gridLen;
-    
-        bool threeDeeGrid;
+	
+		SceneLine *yLine;
+		SceneLine *xLine;
+		SceneLine *zLine;
+	
+		Number gridSize;
+		int gridLen;
+	
+		bool threeDeeGrid;
 };
 
 
 class EditorGridSettingsWindow : public UIWindow {
 public:
-    EditorGridSettingsWindow(EditorGrid *grid);
-    ~EditorGridSettingsWindow();
-    
-    void handleEvent(Event *event);
-    
+	EditorGridSettingsWindow(EditorGrid *grid);
+	~EditorGridSettingsWindow();
+	
+	void handleEvent(Event *event);
+	
 protected:
-    
-    EditorGrid *grid;
-    
-    UICheckBox *visibleCheck;
-    
-    UITextInput *sizeInput;
-    UITextInput *countInput;
-    
-    UICheckBox *xAxisBox;
-    UICheckBox *yAxisBox;
-    UICheckBox *zAxisBox;
+	
+	EditorGrid *grid;
+	
+	UICheckBox *visibleCheck;
+	
+	UITextInput *sizeInput;
+	UITextInput *countInput;
+	
+	UICheckBox *xAxisBox;
+	UICheckBox *yAxisBox;
+	UICheckBox *zAxisBox;
 };

+ 32 - 32
include/polycode/ide/EntityEditorPropertyView.h

@@ -30,37 +30,37 @@ using namespace Polycode;
 
 
 class EntityEditorPropertyView : public UIElement {
-    public:
-    
-        EntityEditorPropertyView();
-        ~EntityEditorPropertyView();
-    
-        void setEntityInstance(SceneEntityInstance *instance);
-        void setEntity(Entity *entity, bool rootEntityMode = false);
-        void handleEvent(Event *event);
-        void updateShaderOptions();
-    
-        PropList *getEntityProps();
-        void Resize(Number width, Number height);
-    
-    protected:
-    
-        Entity *targetEntity;
-        PropList *entityProps;
-    
-        TransformSheet *transformSheet;    
-        EntitySheet *entitySheet;
-        MaterialPropSheet *materialSheet;
-        ScenePrimitiveSheet *primitiveSheet;
-        SceneLightSheet *lightSheet;
-        ParticleEmitterSheet *particleSheet;
-        SceneLabelSheet *labelSheet;
-        SceneSpriteSheet *spriteSheet;
-        SoundSheet *soundSheet;
-        SceneCurveSheet *curveSheet;
-        CameraSheet *cameraSheet;
-        EntityPropSheet *propSheet;
-        SceneMeshSheet *sceneMeshSheet;    
-        ShaderOptionsSheet *shaderOptionsSheet;
+	public:
+	
+		EntityEditorPropertyView();
+		~EntityEditorPropertyView();
+	
+		void setEntityInstance(SceneEntityInstance *instance);
+		void setEntity(Entity *entity, bool rootEntityMode = false);
+		void handleEvent(Event *event);
+		void updateShaderOptions();
+	
+		PropList *getEntityProps();
+		void Resize(Number width, Number height);
+	
+	protected:
+	
+		Entity *targetEntity;
+		PropList *entityProps;
+	
+		TransformSheet *transformSheet;	   
+		EntitySheet *entitySheet;
+		MaterialPropSheet *materialSheet;
+		ScenePrimitiveSheet *primitiveSheet;
+		SceneLightSheet *lightSheet;
+		ParticleEmitterSheet *particleSheet;
+		SceneLabelSheet *labelSheet;
+		SceneSpriteSheet *spriteSheet;
+		SoundSheet *soundSheet;
+		SceneCurveSheet *curveSheet;
+		CameraSheet *cameraSheet;
+		EntityPropSheet *propSheet;
+		SceneMeshSheet *sceneMeshSheet;	   
+		ShaderOptionsSheet *shaderOptionsSheet;
 };
 

+ 9 - 9
include/polycode/ide/EntityEditorSettingsView.h

@@ -31,14 +31,14 @@ using namespace Polycode;
 
 class EntityEditorSettingsView : public UIElement {
 public:
-    EntityEditorSettingsView();
-    ~EntityEditorSettingsView();
-    
-    void setEntityInstance(SceneEntityInstance *instance);
-    
-    void Resize(Number width, Number height);
-    
+	EntityEditorSettingsView();
+	~EntityEditorSettingsView();
+	
+	void setEntityInstance(SceneEntityInstance *instance);
+	
+	void Resize(Number width, Number height);
+	
 private:
-    PropList *entityProps;
-    LinkedMaterialsSheet *materialsSheet;
+	PropList *entityProps;
+	LinkedMaterialsSheet *materialsSheet;
 };

+ 31 - 31
include/polycode/ide/EntityEditorTreeView.h

@@ -29,41 +29,41 @@
 using namespace Polycode;
 
 class EntityEditorTreeSheet : public PropSheet {
-    public:
-        EntityEditorTreeSheet();
-        ~EntityEditorTreeSheet();
-    
-        void refreshTree();
-        void syncNodeToEntity(UITree *node, Entity *entity);
-        void handleEvent(Event *event);
-        void setSelectedEntity(Entity *entity);
-        Entity *getSelectedEntity();
-        void Resize(Number width, Number height);
-        void setRootEntity(Entity *entity);
-    
-    private:
+	public:
+		EntityEditorTreeSheet();
+		~EntityEditorTreeSheet();
+	
+		void refreshTree();
+		void syncNodeToEntity(UITree *node, Entity *entity);
+		void handleEvent(Event *event);
+		void setSelectedEntity(Entity *entity);
+		Entity *getSelectedEntity();
+		void Resize(Number width, Number height);
+		void setRootEntity(Entity *entity);
+	
+	private:
 
-        Entity *selectedEntity;
-        bool dontSendSelectionEvent;
-        UITreeContainer *treeContainer;
-        Entity *rootEntity;
-    
+		Entity *selectedEntity;
+		bool dontSendSelectionEvent;
+		UITreeContainer *treeContainer;
+		Entity *rootEntity;
+	
 };
 
 class EntityEditorTreeView : public UIElement {
-    public:
-        EntityEditorTreeView();
+	public:
+		EntityEditorTreeView();
 
-        void setEntityInstance(SceneEntityInstance *instance);
-        EntityEditorTreeSheet *getTreeSheet();
-        void Resize(Number width, Number height);
-    
-    private:
-    
-    
-        PropList *entityProps;
-        EntityEditorTreeSheet *treeSheet;
-        LayerSheet *layerSheet;
-    
+		void setEntityInstance(SceneEntityInstance *instance);
+		EntityEditorTreeSheet *getTreeSheet();
+		void Resize(Number width, Number height);
+	
+	private:
+	
+	
+		PropList *entityProps;
+		EntityEditorTreeSheet *treeSheet;
+		LayerSheet *layerSheet;
+	
 
 };

+ 2 - 2
include/polycode/ide/NewFileWindow.h

@@ -29,7 +29,7 @@
 
 using namespace Polycode;
 
-class FileTemplateUserData  {
+class FileTemplateUserData	{
 public:
 	String templatePath;
 	int type;
@@ -57,6 +57,6 @@ class NewFileWindow : public UIWindow {
 		
 		String templatePath;
 			
-		UITreeContainer *templateContainer;	
+		UITreeContainer *templateContainer; 
 		UITree *defaultTemplateTree;
 };

+ 2 - 2
include/polycode/ide/NewProjectWindow.h

@@ -28,7 +28,7 @@
 
 using namespace Polycode;
 
-class TemplateUserData  {
+class TemplateUserData	{
 public:
 	String templateFolder;
 	int type;
@@ -57,7 +57,7 @@ class NewProjectWindow : public UIWindow {
 	
 		UIButton *cancelButton;
 		UIButton *okButton;
-		UIButton *locationSelectButton;	
+		UIButton *locationSelectButton; 
 		UITreeContainer *templateContainer;
 	
 		String templateFolder;

+ 2 - 2
include/polycode/ide/PolycodeClipboard.h

@@ -40,8 +40,8 @@ class PolycodeClipboard {
 		void setData(void *data, String type, ClipboardProvider *provider);
 		void *getData();
 		String getType();
-        ClipboardProvider *getCurrentProvider();
-        void setCurrentProvider(ClipboardProvider *provider);
+		ClipboardProvider *getCurrentProvider();
+		void setCurrentProvider(ClipboardProvider *provider);
 
 	protected:
 

+ 12 - 12
include/polycode/ide/PolycodeConsole.h

@@ -92,25 +92,25 @@ class ConsoleWindow : public UIElement {
 		ConsoleWindow();
 		
 		void Resize(Number width, Number height);
-    
-        void clearBuffer();
-        void printToBuffer(String msg);
+	
+		void clearBuffer();
+		void printToBuffer(String msg);
 		
-        void Update();
-    
+		void Update();
+	
 		UITextInput *consoleTextInput;
 		
 		UIImageButton *clearButton;
 		UIImageButton *hideConsoleButton;
 		
 		UIRect *labelBg;
-    
-        bool consoleDirty;
-        Number consoleTimer;
-        Number consoleRefreshInterval;
-    
-        int consoleBufferMaxSize;
-        std::vector<String> consoleBuffer;
+	
+		bool consoleDirty;
+		Number consoleTimer;
+		Number consoleRefreshInterval;
+	
+		int consoleBufferMaxSize;
+		std::vector<String> consoleBuffer;
 		UITextInput *debugTextInput;
 };
 

+ 7 - 7
include/polycode/ide/PolycodeEditor.h

@@ -27,7 +27,7 @@
 #include "polycode/ide/PolycodeProject.h"
 #include "polycode/ide/PolycodeClipboard.h"
 
-#define MAX_EDITOR_UNDO_ACTIONS	40
+#define MAX_EDITOR_UNDO_ACTIONS 40
 
 using namespace Polycode;
 
@@ -39,12 +39,12 @@ class PolycodeEditorActionData {
 		virtual ~PolycodeEditorActionData() {}
 };
 
-class PolycodeEditorAction  {
+class PolycodeEditorAction	{
 	public:
 		PolycodeEditorAction(){
-            beforeData = NULL;
-            afterData = NULL;
-        }
+			beforeData = NULL;
+			afterData = NULL;
+		}
 		~PolycodeEditorAction() {}
 		
 		void deleteData() {
@@ -69,7 +69,7 @@ public:
 	virtual void handleEvent(Event *event);
 
 	virtual void Activate() {};
-   	virtual void Deactivate() {};
+	virtual void Deactivate() {};
 	virtual void saveFile(){};
 	
 	void didAction(String actionName, PolycodeEditorActionData *beforeData, PolycodeEditorActionData *afterData, bool setFileChanged = true);
@@ -78,7 +78,7 @@ public:
 	virtual String Copy(void **data) { return ""; }
 	virtual void Paste(void *data, String clipboardType) {}
 	virtual void selectAll() {}
-    
+	
 	virtual void handleDroppedFile(OSFileEntry file, Number x, Number y) {};
 	
 	virtual ObjectEntry *getEditorConfig() { return NULL; }

+ 290 - 290
include/polycode/ide/PolycodeEntityEditor.h

@@ -39,179 +39,179 @@ using namespace Polycode;
 
 class EntityEditorClipboardData {
 public:
-    EntityEditorClipboardData(){}
-    std::vector<Entity*> entities;
+	EntityEditorClipboardData(){}
+	std::vector<Entity*> entities;
 };
 
 class PolycodeSceneEditorActionDataEntry {
 public:
-    PolycodeSceneEditorActionDataEntry(){
-        entity = NULL;
-        parentEntity = NULL;
-    }
-    
-    PolycodeSceneEditorActionDataEntry(Vector3 vec3, Number number);
-    PolycodeSceneEditorActionDataEntry(Quaternion quat);
-    PolycodeSceneEditorActionDataEntry(Vector3 vec3);
-    PolycodeSceneEditorActionDataEntry(Vector3 vec3, Vector3 vec3Secondary);
-    PolycodeSceneEditorActionDataEntry(Quaternion quat, Vector3 vec3);
-    PolycodeSceneEditorActionDataEntry(Number number);
-    PolycodeSceneEditorActionDataEntry(Entity *entity);
-    Vector3 vec3;
-    Vector3 vec3Secondary;
-    Quaternion quat;
-    Number number;
-    Entity *entity;
-    Entity *parentEntity;
+	PolycodeSceneEditorActionDataEntry(){
+		entity = NULL;
+		parentEntity = NULL;
+	}
+	
+	PolycodeSceneEditorActionDataEntry(Vector3 vec3, Number number);
+	PolycodeSceneEditorActionDataEntry(Quaternion quat);
+	PolycodeSceneEditorActionDataEntry(Vector3 vec3);
+	PolycodeSceneEditorActionDataEntry(Vector3 vec3, Vector3 vec3Secondary);
+	PolycodeSceneEditorActionDataEntry(Quaternion quat, Vector3 vec3);
+	PolycodeSceneEditorActionDataEntry(Number number);
+	PolycodeSceneEditorActionDataEntry(Entity *entity);
+	Vector3 vec3;
+	Vector3 vec3Secondary;
+	Quaternion quat;
+	Number number;
+	Entity *entity;
+	Entity *parentEntity;
 };
 
 
 class PolycodeSceneEditorActionData : public PolycodeEditorActionData {
-    public:
-        PolycodeSceneEditorActionData() {
-            reverse = true;
-            deleteEntitiesInDestructor = false;
-        }
-    
-        ~PolycodeSceneEditorActionData() {
-            if(deleteEntitiesInDestructor) {
-                for(int i=0; i < entries.size(); i++) {
-                    if(!entries[i].entity->getParentEntity()) {
-                        delete entries[i].entity;
-                    }
-                }
-            }
-        }
-    
-        std::vector<PolycodeSceneEditorActionDataEntry> entries;
-        bool deleteEntitiesInDestructor;
-        bool reverse;
+	public:
+		PolycodeSceneEditorActionData() {
+			reverse = true;
+			deleteEntitiesInDestructor = false;
+		}
+	
+		~PolycodeSceneEditorActionData() {
+			if(deleteEntitiesInDestructor) {
+				for(int i=0; i < entries.size(); i++) {
+					if(!entries[i].entity->getParentEntity()) {
+						delete entries[i].entity;
+					}
+				}
+			}
+		}
+	
+		std::vector<PolycodeSceneEditorActionDataEntry> entries;
+		bool deleteEntitiesInDestructor;
+		bool reverse;
 };
 
 
 class DummyTargetEntity : public Entity {
-    public:
-        DummyTargetEntity();
-        ~DummyTargetEntity();
-    
-        Vector3 getSelectedPoint() const;
-        void selectPoint(Vector3 point, Number distance);
-        virtual void setDummyTransform(Entity *dummy) {}
-    
-        virtual void handleDelete() {}
-        virtual void handleDeselect() {}
-        virtual void handleSelect() {}
-    
-        Entity *getPropertyEntity();
-    
-    protected:
-    
-        Vector3 selectedPoint;
-        Entity *propertyEntity;
+	public:
+		DummyTargetEntity();
+		~DummyTargetEntity();
+	
+		Vector3 getSelectedPoint() const;
+		void selectPoint(Vector3 point, Number distance);
+		virtual void setDummyTransform(Entity *dummy) {}
+	
+		virtual void handleDelete() {}
+		virtual void handleDeselect() {}
+		virtual void handleSelect() {}
+	
+		Entity *getPropertyEntity();
+	
+	protected:
+	
+		Vector3 selectedPoint;
+		Entity *propertyEntity;
 };
 
 class CurveDisplay : public DummyTargetEntity {
-    public:
-        CurveDisplay(Scene *parentScene, SceneCurve *curve);
-        ~CurveDisplay();
-    
-        void setDummyTransform(Entity *dummy);
-        void handleDelete();
-        void handleDeselect();
-        void handleSelect();
-    
-        void Update();
-        void handleEvent(Event *event);
+	public:
+		CurveDisplay(Scene *parentScene, SceneCurve *curve);
+		~CurveDisplay();
+	
+		void setDummyTransform(Entity *dummy);
+		void handleDelete();
+		void handleDeselect();
+		void handleSelect();
+	
+		void Update();
+		void handleEvent(Event *event);
 
-        static const int SELECT_MODE_P1 = 0;
-        static const int SELECT_MODE_P2 = 1;
-        static const int SELECT_MODE_P3 = 2;
-    
-        bool renderControlPoints;
-    
-    private:
-    
-        int selectMode;
-    
-        BezierPoint *targetPoint;
-    
-        CoreInput *coreInput;
-        SceneCurve *curve;
-        SceneMesh *mainPoints;
-        SceneMesh *controlPoints;
-        SceneMesh *controlPointLines;
-        Scene *parentScene;
+		static const int SELECT_MODE_P1 = 0;
+		static const int SELECT_MODE_P2 = 1;
+		static const int SELECT_MODE_P3 = 2;
+	
+		bool renderControlPoints;
+	
+	private:
+	
+		int selectMode;
+	
+		BezierPoint *targetPoint;
+	
+		CoreInput *coreInput;
+		SceneCurve *curve;
+		SceneMesh *mainPoints;
+		SceneMesh *controlPoints;
+		SceneMesh *controlPointLines;
+		Scene *parentScene;
 };
 
 class LightDisplay : public Entity {
 public:
-    LightDisplay(SceneLight *light);
-    ~LightDisplay();
-    void Update();
-    
+	LightDisplay(SceneLight *light);
+	~LightDisplay();
+	void Update();
+	
 private:
-    ScenePrimitive *spotSpot;
-    SceneMesh *fovSceneMesh;    
-    Mesh *fovMesh;
-    
-    SceneLight *light;
+	ScenePrimitive *spotSpot;
+	SceneMesh *fovSceneMesh;	
+	Mesh *fovMesh;
+	
+	SceneLight *light;
 };
 
 class CameraDisplay : public Entity {
-    public:
-        CameraDisplay(Camera *camera);
-        ~CameraDisplay();
-        void Update();
-    
-    
-    private:
-        SceneMesh *fovSceneMesh;
-        Mesh *fovMesh;
-        Camera *camera;
+	public:
+		CameraDisplay(Camera *camera);
+		~CameraDisplay();
+		void Update();
+	
+	
+	private:
+		SceneMesh *fovSceneMesh;
+		Mesh *fovMesh;
+		Camera *camera;
 };
 
 class CameraPreviewWindow : public UIElement {
-    public:
-        CameraPreviewWindow();
-        ~CameraPreviewWindow();
-    
-        void handleEvent(Event *event);
-        void Resize(Number width, Number height);
-    
-        void setCamera(Scene *scene, Camera *camera);
-    
-        bool isPinned();
-    
-    private:
-    
-        SceneRenderTexture *renderTexture;
-        Camera *camera;
-        Scene *scene;
-        UIRect *bgRect;
-        UIRect *previewRect;
-        bool pinned;
-        bool cameraSelected;
-    
-        UIComboBox *aspectCombo;
-        UIButton *pinButton;
+	public:
+		CameraPreviewWindow();
+		~CameraPreviewWindow();
+	
+		void handleEvent(Event *event);
+		void Resize(Number width, Number height);
+	
+		void setCamera(Scene *scene, Camera *camera);
+	
+		bool isPinned();
+	
+	private:
+	
+		SceneRenderTexture *renderTexture;
+		Camera *camera;
+		Scene *scene;
+		UIRect *bgRect;
+		UIRect *previewRect;
+		bool pinned;
+		bool cameraSelected;
+	
+		UIComboBox *aspectCombo;
+		UIButton *pinButton;
 };
 
 class SceneMeshSettings {
-    public:
-        Material *material;
-        bool backfaceCulled;
-        ShaderBinding *shaderBinding;
+	public:
+		Material *material;
+		bool backfaceCulled;
+		ShaderBinding *shaderBinding;
 };
 
 class MultiselectorEntry {
-    public:
-        Entity *entity;
-        Number distance;
+	public:
+		Entity *entity;
+		Number distance;
 };
 
 class EntityDistanceSorter : public PolyBase {
-    public:
-    bool operator() (MultiselectorEntry i,MultiselectorEntry j);
+	public:
+	bool operator() (MultiselectorEntry i,MultiselectorEntry j);
 };
 
 class EntityEditorMainView : public UIElement {
@@ -219,154 +219,154 @@ class EntityEditorMainView : public UIElement {
 			EntityEditorMainView(PolycodeEditor *editor);
 			~EntityEditorMainView();
 			
-            void createIcon(Entity *entity, String iconFile);
-            void setEditorProps(Entity *entity);
-    
-            void selectEntity(Entity *targetEntity, bool addToSelection = false, bool doAction = true);
-    
+			void createIcon(Entity *entity, String iconFile);
+			void setEditorProps(Entity *entity);
+	
+			void selectEntity(Entity *targetEntity, bool addToSelection = false, bool doAction = true);
+	
 			void handleEvent(Event *event);
 			void Resize(Number width, Number height);
 			void fixedUpdate();
-            void addEntityFromMenu(String command);
-    
-            void doEntityDeselect(Entity *targetEntity);
-            void doEntitySelect(Entity *targetEntity);
-            void setEditorMode(int newMode);
-            Entity *getSelectedEntity();
-            std::vector<Entity*> getSelectedEntities();
-    
-            void setOverlayWireframeRecursive(Entity *targetEntity, bool val);
-            void setLinkedEntityPropsRecursive(SceneEntityInstance *parentInstance, Entity *entity);
-    
-            void Paste(EntityEditorClipboardData *data);
-    
-            void moveSelectedUp();
-            void moveSelectedDown();
-            void moveSelectedTop();
-            void moveSelectedBottom();
-    
-            void disableLighting(bool disable);
-            void selectNone(bool doAction);
-            void selectAll(bool doAction);
-    
-            SceneRenderTexture *getRenderTexture();
-    
-            void onGainFocus();
-            void onLoseFocus();
-            void deleteSelected(bool doAction);
-    
-            void doAction(String actionName, PolycodeEditorActionData *data);
-    
-            void didPlaceEntity(Entity *entity);
-    
-            void setBBox(Entity *targetEntity = NULL);
-    
-            Entity *getObjectRoot();
-            void setObjectRoot(SceneEntityInstance *entity);
-    
-            Scene *getMainScene();
-    
-            void setEditorPropsRecursive(Entity *entity);
-    
-            static const int EDITOR_MODE_2D = 0;
-            static const int EDITOR_MODE_3D_X = 1;
-            static const int EDITOR_MODE_3D_Y = 2;
-            static const int EDITOR_MODE_3D_Z = 3;
-            static const int EDITOR_MODE_3D = 4;
+			void addEntityFromMenu(String command);
+	
+			void doEntityDeselect(Entity *targetEntity);
+			void doEntitySelect(Entity *targetEntity);
+			void setEditorMode(int newMode);
+			Entity *getSelectedEntity();
+			std::vector<Entity*> getSelectedEntities();
+	
+			void setOverlayWireframeRecursive(Entity *targetEntity, bool val);
+			void setLinkedEntityPropsRecursive(SceneEntityInstance *parentInstance, Entity *entity);
+	
+			void Paste(EntityEditorClipboardData *data);
+	
+			void moveSelectedUp();
+			void moveSelectedDown();
+			void moveSelectedTop();
+			void moveSelectedBottom();
+	
+			void disableLighting(bool disable);
+			void selectNone(bool doAction);
+			void selectAll(bool doAction);
+	
+			SceneRenderTexture *getRenderTexture();
+	
+			void onGainFocus();
+			void onLoseFocus();
+			void deleteSelected(bool doAction);
+	
+			void doAction(String actionName, PolycodeEditorActionData *data);
+	
+			void didPlaceEntity(Entity *entity);
+	
+			void setBBox(Entity *targetEntity = NULL);
+	
+			Entity *getObjectRoot();
+			void setObjectRoot(SceneEntityInstance *entity);
+	
+			Scene *getMainScene();
+	
+			void setEditorPropsRecursive(Entity *entity);
+	
+			static const int EDITOR_MODE_2D = 0;
+			static const int EDITOR_MODE_3D_X = 1;
+			static const int EDITOR_MODE_3D_Y = 2;
+			static const int EDITOR_MODE_3D_Z = 3;
+			static const int EDITOR_MODE_3D = 4;
 		protected:
-    
-            bool selectingNewEntities();
-    
-            CoreInput *input;
-            PolycodeSceneEditorActionData *beforeData;
+	
+			bool selectingNewEntities();
+	
+			CoreInput *input;
+			PolycodeSceneEditorActionData *beforeData;
 			
-            bool lightsDisabled;
-            int editorMode;
+			bool lightsDisabled;
+			int editorMode;
 			Entity *topBar;
 			Entity *bottomBar;
 			UIRect *headerBg;
 			UIRect *footerBg;
-    
-            PolycodeEditor *editor;
+	
+			PolycodeEditor *editor;
 				
-            unsigned int multiselectIndex;
+			unsigned int multiselectIndex;
 			std::vector<Entity*> selectedEntities;
-            std::vector<MultiselectorEntry> entitiesToSelect;
-            std::vector<MultiselectorEntry> lastEntitiesToSelect;
-    
-            EntityDistanceSorter distanceSorter;
-    
-            Entity *dummyEntity;
-            DummyTargetEntity *dummyTargetEntity;
-            Vector3 lastSelectedDummyPoint;
-    
+			std::vector<MultiselectorEntry> entitiesToSelect;
+			std::vector<MultiselectorEntry> lastEntitiesToSelect;
+	
+			EntityDistanceSorter distanceSorter;
+	
+			Entity *dummyEntity;
+			DummyTargetEntity *dummyTargetEntity;
+			Vector3 lastSelectedDummyPoint;
+	
 			Scene *mainScene;
-            Entity *sceneObjectRoot;
-    
-            SceneLight *customLight1;
-            SceneLight *customLight2;
-    
-        	ScenePrimitive *bBoxVis;
-    
-            Entity *objectRootBase;
-            Entity *iconBase;
-            SceneEntityInstance *objectRootInstance;
-    
+			Entity *sceneObjectRoot;
+	
+			SceneLight *customLight1;
+			SceneLight *customLight2;
+	
+			ScenePrimitive *bBoxVis;
+	
+			Entity *objectRootBase;
+			Entity *iconBase;
+			SceneEntityInstance *objectRootInstance;
+	
 			SceneRenderTexture *renderTexture;
-			UIRect *renderTextureShape;	
+			UIRect *renderTextureShape; 
 
 			TransformGizmo *transformGizmo;
 			TransformGizmoMenu *transformGizmoMenu;
 			TrackballCamera *trackballCamera;
 			EditorGrid *grid;
-    
-            UIImageButton *addEntityButton;
-    
-            UIIconSelector *viewModeSelector;
-    
-    
-            UIMenu *addEntityMenu;
-    
-            UIIconSelector *shadeModeSelector;
-            UIIconSelector *lightingModeSelector;
+	
+			UIImageButton *addEntityButton;
+	
+			UIIconSelector *viewModeSelector;
+	
+	
+			UIMenu *addEntityMenu;
+	
+			UIIconSelector *shadeModeSelector;
+			UIIconSelector *lightingModeSelector;
 
-            UIIconSelector *iconVisibilitySelector;
-    
-            UIImageButton *moveUpButton;
-            UIImageButton *moveTopButton;
-            UIImageButton *moveDownButton;
-            UIImageButton *moveBottomButton;    
-    
-            UIImageButton *gridSettingsButton;
-            EditorGridSettingsWindow *gridSettings;
-            UIIconSelector *snapSelector;
-    
-            CameraPreviewWindow *cameraPreview;
-    
-            std::vector<ScenePrimitive*> icons;
-    
-            Vector3 cursorPosition;
-            String assetSelectType;
-    
+			UIIconSelector *iconVisibilitySelector;
+	
+			UIImageButton *moveUpButton;
+			UIImageButton *moveTopButton;
+			UIImageButton *moveDownButton;
+			UIImageButton *moveBottomButton;	
+	
+			UIImageButton *gridSettingsButton;
+			EditorGridSettingsWindow *gridSettings;
+			UIIconSelector *snapSelector;
+	
+			CameraPreviewWindow *cameraPreview;
+	
+			std::vector<ScenePrimitive*> icons;
+	
+			Vector3 cursorPosition;
+			String assetSelectType;
+	
 };
 
 class EntityEditorPropertyContainer : public UIElement {
-    public:
-        EntityEditorPropertyContainer(PolycodeEditor *editor);
-        ~EntityEditorPropertyContainer();
-        void Resize(Number width, Number height);
-    
-        void handleEvent(Event *event);
-    
-        UIElement *currentView;
-        EntityEditorPropertyView *propertyView;
-        EntityEditorTreeView *treeView;
-        EntityEditorSettingsView *settingsView;
-        UIIconSelector *propIconSelector;
-    
-    private:
-    
-        PolycodeEditor *editor;
+	public:
+		EntityEditorPropertyContainer(PolycodeEditor *editor);
+		~EntityEditorPropertyContainer();
+		void Resize(Number width, Number height);
+	
+		void handleEvent(Event *event);
+	
+		UIElement *currentView;
+		EntityEditorPropertyView *propertyView;
+		EntityEditorTreeView *treeView;
+		EntityEditorSettingsView *settingsView;
+		UIIconSelector *propIconSelector;
+	
+	private:
+	
+		PolycodeEditor *editor;
 };
 
 class PolycodeEntityEditor : public PolycodeEditor {
@@ -376,37 +376,37 @@ class PolycodeEntityEditor : public PolycodeEditor {
 		
 		bool openFile(OSFileEntry filePath);
 		void Resize(int x, int y);
-    
-        void Activate();
-        void Deactivate();
-    
-        void saveFile();
-        void saveCurveToObject(ObjectEntry *entry, BezierCurve *curve);
-        void saveShaderOptionsToEntry(ObjectEntry *entry, Material *material, ShaderBinding *binding);
-    
-        void saveEntityToObjectEntry(Entity *entity, ObjectEntry *entry);
-        void doAction(String actionName, PolycodeEditorActionData *data);
-    
-        String Copy(void **data);
-        void Paste(void *data, String clipboardType);
-        void selectAll();
-        void destroyClipboardData(void *data, String type);
-    
-        void handleEvent(Event *event);
-    
+	
+		void Activate();
+		void Deactivate();
+	
+		void saveFile();
+		void saveCurveToObject(ObjectEntry *entry, BezierCurve *curve);
+		void saveShaderOptionsToEntry(ObjectEntry *entry, Material *material, ShaderBinding *binding);
+	
+		void saveEntityToObjectEntry(Entity *entity, ObjectEntry *entry);
+		void doAction(String actionName, PolycodeEditorActionData *data);
+	
+		String Copy(void **data);
+		void Paste(void *data, String clipboardType);
+		void selectAll();
+		void destroyClipboardData(void *data, String type);
+	
+		void handleEvent(Event *event);
+	
 	protected:
 	
-        EntityEditorPropertyContainer *propertyContainer;
-    
+		EntityEditorPropertyContainer *propertyContainer;
+	
 		EntityEditorMainView *mainView;
-        EntityEditorPropertyView *propertyView;
-        EntityEditorTreeView *treeView;
-        EntityEditorSettingsView *settingsView;
-    
-        SceneEntityInstance *loadedInstance;
+		EntityEditorPropertyView *propertyView;
+		EntityEditorTreeView *treeView;
+		EntityEditorSettingsView *settingsView;
+	
+		SceneEntityInstance *loadedInstance;
 		UIHSizer *mainSizer;
-    
-    
+	
+	
 };
 
 class PolycodeEntityEditorFactory : public PolycodeEditorFactory {

+ 10 - 10
include/polycode/ide/PolycodeFrame.h

@@ -123,7 +123,7 @@ class CurveEditor : public UIWindow {
 		UIImageButton *addButton;
 		UIImageButton *removeButton;
 				
-		UIImage	*selectorImage;
+		UIImage *selectorImage;
 		
 		static const int MODE_SELECT = 0;		
 		static const int MODE_ADD = 1;
@@ -146,8 +146,8 @@ class EditorHolder : public UIElement {
 		ObjectEntry *getEditorHolderConfig();
 		void applyConfig(ObjectEntry *entry);
 		
-        void activateEditor(bool val);
-    
+		void activateEditor(bool val);
+	
 		void handleEvent(Event *event);
 		void Resize(Number width, Number height);		
 		
@@ -311,11 +311,11 @@ public:
 	
 	void showFileBrowser(String baseDir, bool foldersOnly, std::vector<String> extensions, bool allowMultiple);
 
-	void handleEvent(Event *event);	
+	void handleEvent(Event *event); 
 	void showAssetBrowser(std::vector<String> extensions);
 
 	void showAssetBrowserForPools(std::vector<ResourcePool*> pools, int resourceType);
-    
+	
 	PolycodeProjectBrowser *getCurrentProjectBrowser();
 	PolycodeProjectFrame *getActiveProjectFrame();	
 	PolycodeProjectFrame *getProjectFrame(PolycodeProject *project);
@@ -337,16 +337,16 @@ public:
 	
 	void showCurveEditor();
 	
-	NewProjectWindow *newProjectWindow;	
+	NewProjectWindow *newProjectWindow; 
 	ExampleBrowserWindow *exampleBrowserWindow;
 	NewFileWindow *newFileWindow;
 	ExportProjectWindow *exportProjectWindow;
-	SettingsWindow *settingsWindow;	
+	SettingsWindow *settingsWindow; 
 	AssetBrowser *assetBrowser;
 	
 	TextInputPopup *textInputPopup;
 	YesNoPopup *yesNoPopup;
-    MessagePopup *messagePopup;
+	MessagePopup *messagePopup;
 	YesNoCancelPopup *yesNoCancelPopup;
 	
 	Entity *welcomeEntity;	
@@ -380,7 +380,7 @@ private:
 				
 	UIVSizer *consoleSizer;
 	
-	bool willHideModal;	
+	bool willHideModal; 
 	bool showingConsole;
 
 	UIRect *fileDialogBlocker;
@@ -394,7 +394,7 @@ private:
 	UILabel *dragLabel;
 	bool isDragging;
 	
-	UIComboBox *currentProjectSelector;	
+	UIComboBox *currentProjectSelector; 
 	UIImage *welcomeImage;	
 	
 	UIRect *modalBlocker;

+ 2 - 2
include/polycode/ide/PolycodeIDEApp.h

@@ -61,7 +61,7 @@ public:
 #endif
 	~PolycodeIDEApp();
 	
-	void handleEvent(Event *event);	
+	void handleEvent(Event *event); 
 	bool Update();
 	
 	void saveConfigFile();
@@ -136,7 +136,7 @@ protected:
 	PolycodeFrame *frame;
 	
 	PolycodeEditorManager *editorManager;
-	PolycodeProjectManager *projectManager;	
+	PolycodeProjectManager *projectManager; 
 	PolycodeRemoteDebugger *debugger;
 
 	UIMenuBar *menuBar;

+ 1 - 1
include/polycode/ide/PolycodeImageEditor.h

@@ -45,6 +45,6 @@ class PolycodeImageEditor : public PolycodeEditor {
 
 class PolycodeImageEditorFactory : public PolycodeEditorFactory {
 	public:
-        PolycodeImageEditorFactory() : PolycodeEditorFactory() { extensions.push_back("png"); extensions.push_back("hdr");  extensions.push_back("jpg");  extensions.push_back("tga");  extensions.push_back("psd");}
+		PolycodeImageEditorFactory() : PolycodeEditorFactory() { extensions.push_back("png"); extensions.push_back("hdr");	extensions.push_back("jpg");  extensions.push_back("tga");	extensions.push_back("psd");}
 		PolycodeEditor *createEditor() { return new PolycodeImageEditor(); }
 };

+ 22 - 22
include/polycode/ide/PolycodeMaterialEditor.h

@@ -126,7 +126,7 @@ class MaterialBrowser : public UIElement {
 		
 		MaterialBrowserData *selectedData;
 
-		UIImageButton *newShaderButton;	
+		UIImageButton *newShaderButton; 
 		UIImageButton *newMaterialButton;
 		UIImageButton *newCubemapButton;
 		UIImageButton *newPostButton;
@@ -143,7 +143,7 @@ class MaterialBrowser : public UIElement {
 		UITree *cubemapsNode;
 		UITree *postEffectsNode;
 			
-		UITreeContainer *treeContainer;	
+		UITreeContainer *treeContainer; 
 };
 
 class CubemapEditorPane : public UIElement {
@@ -155,9 +155,9 @@ class CubemapEditorPane : public UIElement {
 		void handleEvent(Event *event);
 		Cubemap *currentCubemap;		
 		
-        void Activate();
-        void Deactivate();
-    
+		void Activate();
+		void Deactivate();
+	
 	protected:
 	
 		PropList *propList;
@@ -184,9 +184,9 @@ class PostEditorPane : public UIElement {
 		void handleEvent(Event *event);
 		Material *currentMaterial;	
 		
-        void Activate();
-        void Deactivate();
-    
+		void Activate();
+		void Deactivate();
+	
 		void adjustPreview();
 		
 		protected:
@@ -230,7 +230,7 @@ class ShaderEditorPane : public UIElement {
 			
 	protected:
 	
-        ResourcePool *resourcePool;
+		ResourcePool *resourcePool;
 		bool changingShader;
 
 		bool choosingVertexProgram;
@@ -254,10 +254,10 @@ class MaterialEditorPane : public UIElement {
 	public:
 		MaterialEditorPane();
 		~MaterialEditorPane();
-    
-        void Activate();
-        void Deactivate();
-    
+	
+		void Activate();
+		void Deactivate();
+	
 		
 		void setMaterial(Material *material);
 		void handleEvent(Event *event);
@@ -279,7 +279,7 @@ class MaterialEditorPane : public UIElement {
 		ComboProp *blendModeProp;
 		ComboProp *shaderProp;
 		
-		ShaderOptionsSheet *shaderOptionsSheet;	
+		ShaderOptionsSheet *shaderOptionsSheet; 
 };
 
 class MaterialMainWindow : public UIElement {
@@ -287,14 +287,14 @@ class MaterialMainWindow : public UIElement {
 	MaterialMainWindow(ResourcePool *resourcePool);
 	~MaterialMainWindow();
 	
-    void Activate();
-    void Deactivate();
-    
+	void Activate();
+	void Deactivate();
+	
 	void Resize(Number width, Number height);
 	
 	MaterialEditorPane *materialPane;
 	ShaderEditorPane *shaderPane;	
-	CubemapEditorPane *cubemapPane;	
+	CubemapEditorPane *cubemapPane; 
 	PostEditorPane *postPane;	
 		
 	UIColorPicker *colorPicker;
@@ -308,8 +308,8 @@ class PolycodeMaterialEditor : public PolycodeEditor {
 	bool openFile(OSFileEntry filePath);
 	void Resize(int x, int y);
 	
-    void Activate();
-    void Deactivate();
+	void Activate();
+	void Deactivate();
 	
 	void handleEvent(Event *event);
 	void saveFile();
@@ -318,8 +318,8 @@ class PolycodeMaterialEditor : public PolycodeEditor {
 	static String createStringValue(unsigned int type, void *value);
 	
 	protected:
-    
-        ResourcePool *resourcePool;
+	
+		ResourcePool *resourcePool;
 		
 		MaterialBrowser *materialBrowser;
 		UIHSizer *mainSizer;

+ 2 - 2
include/polycode/ide/PolycodeMeshEditor.h

@@ -37,8 +37,8 @@ class PolycodeMeshEditor : public PolycodeEditor {
 		virtual ~PolycodeMeshEditor();
 	
 		void handleEvent(Event *event);
-        void Activate();
-        void Deactivate();
+		void Activate();
+		void Deactivate();
 	
 		bool openFile(OSFileEntry filePath);
 		void Resize(int x, int y);

+ 4 - 4
include/polycode/ide/PolycodeProject.h

@@ -43,7 +43,7 @@ class ProjectData {
 		String entryPoint;
 		int defaultWidth;
 		int defaultHeight;
-		bool vSync;	
+		bool vSync; 
 		unsigned int anisotropy;	
 		unsigned int aaLevel;
 		unsigned int frameRate;
@@ -60,13 +60,13 @@ class ProjectData {
 class PolycodeProject {
 	public:
 		PolycodeProject(String name, String path, String file);
-		~PolycodeProject();	
+		~PolycodeProject(); 
 		
-		bool loadProjectFromFile();	
+		bool loadProjectFromFile(); 
 		bool saveFile();
 	
 		String getProjectName() { return projectName; }
-		String getProjectFile() { return projectFile; }	
+		String getProjectFile() { return projectFile; } 
 		String getRootFolder() { return projectFolder; }	
 	
 		ProjectData data;

+ 3 - 3
include/polycode/ide/PolycodeProjectBrowser.h

@@ -61,8 +61,8 @@ class PolycodeProjectBrowser : public UIElement {
 		UITree *nodeHasName(UITree *node, String name);
 		bool listHasFileEntry(vector<OSFileEntry> files, OSFileEntry fileEntry);
 		
-        static String getIconForExtension(String extension);
-    
+		static String getIconForExtension(String extension);
+	
 		void Refresh();
 		
 		void handleEvent(Event *event);
@@ -81,4 +81,4 @@ protected:
 		UIRect *headerBg;	
 		UIMenu *contextMenu;	
 		BrowserUserData *selectedData;
-};	
+};

+ 1 - 1
include/polycode/ide/PolycodeProjectEditor.h

@@ -101,5 +101,5 @@ class PolycodeProjectEditorFactory : public PolycodeEditorFactory {
 		PolycodeEditor *createEditor();
 		
 	protected:
-		PolycodeProjectManager *projectManager;	
+		PolycodeProjectManager *projectManager; 
 };

+ 331 - 331
include/polycode/ide/PolycodeProps.h

@@ -41,9 +41,9 @@ class PropProp : public UIElement {
 		virtual void setPropData(PolycodeEditorPropActionData* data) {}
 		
 		virtual void setPropWidth(Number width) {}
-        virtual void updateFocusVisibility() {}
-        void setPropName(String newName);
-    
+		virtual void updateFocusVisibility() {}
+		void setPropName(String newName);
+	
 		String propType;
 		UILabel *label;
 		UIElement *propContents;
@@ -53,28 +53,28 @@ class PropProp : public UIElement {
 };
 
 class Vector3Prop : public PropProp {
-    public:
-        Vector3Prop(String caption, UIElement *focusParent);
-        ~Vector3Prop();
-        void handleEvent(Event *event);
-        void set(const Vector3 &position);
-
-        Vector3 get() const;
-        void setPropData(PolycodeEditorPropActionData* data);
-        
-        void setPropWidth(Number width);
-        
-        UITextInput *xInput;
-        UITextInput *yInput;
-        UITextInput *zInput;
-        
-        UILabel *labelX;
-        UILabel *labelY;
-        UILabel *labelZ;
-    
-        Vector3 lastData;
-        Vector3 currentData;
-    
+	public:
+		Vector3Prop(String caption, UIElement *focusParent);
+		~Vector3Prop();
+		void handleEvent(Event *event);
+		void set(const Vector3 &position);
+
+		Vector3 get() const;
+		void setPropData(PolycodeEditorPropActionData* data);
+		
+		void setPropWidth(Number width);
+		
+		UITextInput *xInput;
+		UITextInput *yInput;
+		UITextInput *zInput;
+		
+		UILabel *labelX;
+		UILabel *labelY;
+		UILabel *labelZ;
+	
+		Vector3 lastData;
+		Vector3 currentData;
+	
 };
 
 
@@ -91,7 +91,7 @@ class Vector2Prop : public PropProp {
 		void setPropWidth(Number width);		
 				
 		UITextInput *positionX;
-		UITextInput *positionY;	
+		UITextInput *positionY; 
 		
 		Vector2 lastData;
 		Vector2 currentData;	
@@ -119,15 +119,15 @@ class SliderProp : public PropProp {
 };
 
 class ButtonProp : public PropProp {
-    public:
-        ButtonProp(const String &caption, UIElement *focusParent);
-        ~ButtonProp();
-        void setPropWidth(Number width);
-        UIButton *getButton();
-    
-    private:
-    
-        UIButton *button;
+	public:
+		ButtonProp(const String &caption, UIElement *focusParent);
+		~ButtonProp();
+		void setPropWidth(Number width);
+		UIButton *getButton();
+	
+	private:
+	
+		UIButton *button;
 };
 
 
@@ -138,10 +138,10 @@ class NumberProp : public PropProp {
 		void handleEvent(Event *event);
 		void set(Number number);
 		Number get();
-    
+	
 		void setPropWidth(Number width);
-        void updateFocusVisibility();
-    
+		void updateFocusVisibility();
+	
 		void setPropData(PolycodeEditorPropActionData* data);
 				
 		UITextInput *numberEntry;
@@ -156,7 +156,7 @@ class TargetBindingProp : public PropProp {
 		TargetBindingProp(Shader *shader, Material *material, ShaderBinding *binding, RenderTargetBinding *targetBinding);
 		~TargetBindingProp();
 
-		void handleEvent(Event *event);	
+		void handleEvent(Event *event); 
 		void setPropWidth(Number width);
 						
 		RenderTargetBinding *targetBinding;
@@ -176,7 +176,7 @@ class RenderTargetProp : public PropProp {
 		RenderTargetProp(ShaderRenderTarget *renderTarget, Material *material);
 		~RenderTargetProp();
 
-		void handleEvent(Event *event);	
+		void handleEvent(Event *event); 
 		void setPropWidth(Number width);
 		
 		void recreateRenderTarget();
@@ -196,7 +196,7 @@ class ShaderPassProp : public PropProp {
 		ShaderPassProp(Material *material, int shaderIndex);
 		~ShaderPassProp();
 		
-		void handleEvent(Event *event);	
+		void handleEvent(Event *event); 
 		void setPropWidth(Number width);
 		
 		Material *material;
@@ -211,42 +211,42 @@ class ShaderPassProp : public PropProp {
 
 class RemovableStringProp : public PropProp {
 public:
-    RemovableStringProp(const String &caption);
-    ~RemovableStringProp();
-    void handleEvent(Event *event);
-    
-    String getCaption();
-    
-    UILabel *label;
-    UIImageButton *removeButton;
+	RemovableStringProp(const String &caption);
+	~RemovableStringProp();
+	void handleEvent(Event *event);
+	
+	String getCaption();
+	
+	UILabel *label;
+	UIImageButton *removeButton;
 };
 
 
 class LayerProp : public PropProp {
-    public:
-        LayerProp(SceneEntityInstance *instance, SceneEntityInstanceLayer *layer);
-        ~LayerProp();
-        void handleEvent(Event *event);
-        void setPropWidth(Number width);
-    
-        void setInstance(SceneEntityInstance *instance);
-    
-    private:
-    
-        SceneEntityInstance *instance;
-        SceneEntityInstanceLayer *layer;
-        UILabel *layerName;
-        UIImageButton *hideLayerButton;
-        UIImageButton *showLayerButton;
-        UIImageButton *moreButton;
-    
-        UIMenu *menu;
-    
-        UIImageButton *removeLayerButton;
-    
+	public:
+		LayerProp(SceneEntityInstance *instance, SceneEntityInstanceLayer *layer);
+		~LayerProp();
+		void handleEvent(Event *event);
+		void setPropWidth(Number width);
+	
+		void setInstance(SceneEntityInstance *instance);
+	
+	private:
+	
+		SceneEntityInstance *instance;
+		SceneEntityInstanceLayer *layer;
+		UILabel *layerName;
+		UIImageButton *hideLayerButton;
+		UIImageButton *showLayerButton;
+		UIImageButton *moreButton;
+	
+		UIMenu *menu;
+	
+		UIImageButton *removeLayerButton;
+	
 		unsigned char layerID;
-    
-        UIRect *bgRect;
+	
+		UIRect *bgRect;
 };
 
 class CustomProp : public PropProp {
@@ -255,7 +255,7 @@ class CustomProp : public PropProp {
 		~CustomProp();
 		void handleEvent(Event *event);
 		void set(String key, String val);
-		void setPropWidth(Number width);    
+		void setPropWidth(Number width);	
 		String getValue();
 		String getKey();
 				
@@ -360,7 +360,7 @@ class BezierRGBACurveProp : public PropProp {
 		BezierRGBACurveProp(String caption);
 		~BezierRGBACurveProp();
 
-		void handleEvent(Event *event);	
+		void handleEvent(Event *event); 
 		
 		BezierCurve *curveR;
 		BezierCurve *curveG;
@@ -374,7 +374,7 @@ class BezierCurveProp : public PropProp {
 		BezierCurveProp(String caption, String curveName);
 		~BezierCurveProp();
 
-		void handleEvent(Event *event);	
+		void handleEvent(Event *event); 
 		
 		String curveName;
 		BezierCurve *curve;
@@ -382,38 +382,38 @@ class BezierCurveProp : public PropProp {
 };
 
 class MaterialProp : public PropProp {
-    public:
-        MaterialProp(const String &caption);
-        ~MaterialProp();
-    
-        void setEntityInstance(SceneEntityInstance *instance);
-        void set(Material *material);
-        Material *get();
+	public:
+		MaterialProp(const String &caption);
+		~MaterialProp();
+	
+		void setEntityInstance(SceneEntityInstance *instance);
+		void set(Material *material);
+		Material *get();
 		void setPropWidth(Number width);
-        void handleEvent(Event *event);
-    
-    private:
-    
-        Scene *previewScene;
-        SceneLight *mainLight;
-        SceneLight *secondLight;
-        SceneRenderTexture *renderTexture;
-        ScenePrimitive *previewPrimitive;
-    
-    
-        SceneEntityInstance *entityInstance;
-        UIRect *previewShape;
-        UIButton *changeButton;
-        UILabel *materialLabel;
-    
-        Material *currentMaterial;
+		void handleEvent(Event *event);
+	
+	private:
+	
+		Scene *previewScene;
+		SceneLight *mainLight;
+		SceneLight *secondLight;
+		SceneRenderTexture *renderTexture;
+		ScenePrimitive *previewPrimitive;
+	
+	
+		SceneEntityInstance *entityInstance;
+		UIRect *previewShape;
+		UIButton *changeButton;
+		UILabel *materialLabel;
+	
+		Material *currentMaterial;
 };
 
 class TextureProp : public PropProp {
 	public:
 		TextureProp(String caption);
 		~TextureProp();
-		void handleEvent(Event *event);	
+		void handleEvent(Event *event); 
 		void setPropWidth(Number width);
 				
 		void set(Texture *texture);
@@ -437,19 +437,19 @@ class SceneSpriteProp : public PropProp {
 		
 		void setPropData(PolycodeEditorPropActionData* data);
 		
-        void setEntityInstance(SceneEntityInstance *instance);
-    
+		void setEntityInstance(SceneEntityInstance *instance);
+	
 		void set(Sprite *sprite);
 		Sprite *get();
 				
-        SceneEntityInstance *entityInstance;
-    
-        Sprite *sprite;
+		SceneEntityInstance *entityInstance;
+	
+		Sprite *sprite;
 		SceneSprite *previewSprite;
 		UIButton *changeButton;
-        UILabel *spriteName;
-    
-        Sprite *lastData;
+		UILabel *spriteName;
+	
+		Sprite *lastData;
 		Sprite *currentData;
 };
 
@@ -480,8 +480,8 @@ class PropSheet : public UIElement {
 		
 		virtual void applyPropActionData(PolycodeEditorPropActionData *data);
 		void handleEvent(Event *event);
-    
-        void layoutProps();
+	
+		void layoutProps();
 		
 		void setCollapsed(bool val);
 		
@@ -529,20 +529,20 @@ class ShaderOptionsSheet : public PropSheet {
 class EntitySheet : public PropSheet {
 	public:
 		EntitySheet();
-		~EntitySheet();	
+		~EntitySheet(); 
 	
 		void handleEvent(Event *event);
-        void setEntity(Entity *entity);
-    
-        void refreshLayers();
-    
-        void setEntityInstance(SceneEntityInstance *instance);
+		void setEntity(Entity *entity);
+	
+		void refreshLayers();
+	
+		void setEntityInstance(SceneEntityInstance *instance);
 
-    protected:
+	protected:
 		Entity *entity;
 		
-        SceneEntityInstance *instance;
-        ComboProp *layersProp;
+		SceneEntityInstance *instance;
+		ComboProp *layersProp;
 		StringProp *idProp;
 		StringProp *tagProp;
 		ColorProp *colorProp;
@@ -566,8 +566,8 @@ class ShaderPassesSheet : public PropSheet {
 
 		ShaderPassProp *selectedProp;
 
-        ResourcePool *resourcePool;
-    
+		ResourcePool *resourcePool;
+	
 		ButtonProp *addButton;
 		int removeIndex;		
 };
@@ -614,149 +614,149 @@ class RenderTargetsSheet : public PropSheet {
 };
 
 class TransformSheet : public PropSheet {
-    public:
-        TransformSheet();
-        ~TransformSheet();
-    
-        void Update();
-    
-        void setEntity(Entity *entity);
-        void handleEvent(Event *event);
-    
-    protected:
-        Entity *entity;
-    
-        Vector3Prop *positionProp;
-        Vector3Prop *scaleProp;
-        Vector3Prop *rotationProp;
-    
-        Vector3 lastPosition;
-        Vector3 lastScale;
-        Vector3 lastRotation;
+	public:
+		TransformSheet();
+		~TransformSheet();
+	
+		void Update();
+	
+		void setEntity(Entity *entity);
+		void handleEvent(Event *event);
+	
+	protected:
+		Entity *entity;
+	
+		Vector3Prop *positionProp;
+		Vector3Prop *scaleProp;
+		Vector3Prop *rotationProp;
+	
+		Vector3 lastPosition;
+		Vector3 lastScale;
+		Vector3 lastRotation;
 };
 
 class ParticleEmitterSheet : public PropSheet {
-    public:
-        ParticleEmitterSheet();
-        ~ParticleEmitterSheet();
-    
-        void handleEvent(Event *event);
-        void setParticleEmitter(SceneParticleEmitter *emitter);
-    
-    protected:
-        SceneParticleEmitter *emitter;
-    
-        ComboProp *typeProp;
-        NumberProp *countProp;
-        NumberProp *lifetimeProp;
-        NumberProp *particleSizeProp;
-        NumberProp *particleSpeedProp;
-
-        BoolProp *worldParticlesProp;
-        BoolProp *loopingProp;
-
-        Vector3Prop *particleRotaionProp;
-    
-        Vector3Prop *gravityProp;
-        Vector3Prop *directionProp;
-        Vector3Prop *sizeProp;
-        Vector3Prop *deviationProp;
-    
-        BoolProp *perlinProp;
-        Vector3Prop *perlinSizeProp;
-    
-        BoolProp *useColorCurvesProp;
-        BezierRGBACurveProp *colorCurveProp;
-
-        BoolProp *useScaleCurvesProp;
-        BezierCurveProp *scaleCurveProp;
+	public:
+		ParticleEmitterSheet();
+		~ParticleEmitterSheet();
+	
+		void handleEvent(Event *event);
+		void setParticleEmitter(SceneParticleEmitter *emitter);
+	
+	protected:
+		SceneParticleEmitter *emitter;
+	
+		ComboProp *typeProp;
+		NumberProp *countProp;
+		NumberProp *lifetimeProp;
+		NumberProp *particleSizeProp;
+		NumberProp *particleSpeedProp;
+
+		BoolProp *worldParticlesProp;
+		BoolProp *loopingProp;
+
+		Vector3Prop *particleRotaionProp;
+	
+		Vector3Prop *gravityProp;
+		Vector3Prop *directionProp;
+		Vector3Prop *sizeProp;
+		Vector3Prop *deviationProp;
+	
+		BoolProp *perlinProp;
+		Vector3Prop *perlinSizeProp;
+	
+		BoolProp *useColorCurvesProp;
+		BezierRGBACurveProp *colorCurveProp;
+
+		BoolProp *useScaleCurvesProp;
+		BezierCurveProp *scaleCurveProp;
 
 };
 
 class SceneLightSheet : public PropSheet {
-    public:
-        SceneLightSheet();
-        ~SceneLightSheet();
-    
-        void updateOptionVisibility();
-    
-        void setSceneLight(SceneLight *light);
-        void handleEvent(Event *event);
-    
-    protected:
-    
-        SceneLight *light;
-    
-        ComboProp *typeProp;
-        NumberProp *importanceProp;
-        ColorProp *lightColorProp;
-        ColorProp *specularColorProp;
-        NumberProp *intensityProp;
-        SliderProp *constantAttenuationProp;
-        SliderProp *linearAttenuationProp;
-        SliderProp *quadraticAttenuationProp;
-    
-        SliderProp *spotlightCutoffProp;
-        SliderProp *spotlightExponentProp;
-    
-        BoolProp *castShadowsProp;
-        SliderProp *shadowMapFOVProp;
-        NumberProp *shadowResolutionProp;
+	public:
+		SceneLightSheet();
+		~SceneLightSheet();
+	
+		void updateOptionVisibility();
+	
+		void setSceneLight(SceneLight *light);
+		void handleEvent(Event *event);
+	
+	protected:
+	
+		SceneLight *light;
+	
+		ComboProp *typeProp;
+		NumberProp *importanceProp;
+		ColorProp *lightColorProp;
+		ColorProp *specularColorProp;
+		NumberProp *intensityProp;
+		SliderProp *constantAttenuationProp;
+		SliderProp *linearAttenuationProp;
+		SliderProp *quadraticAttenuationProp;
+	
+		SliderProp *spotlightCutoffProp;
+		SliderProp *spotlightExponentProp;
+	
+		BoolProp *castShadowsProp;
+		SliderProp *shadowMapFOVProp;
+		NumberProp *shadowResolutionProp;
 };
 
 class SceneMeshSheet : public PropSheet {
-    public:
-        SceneMeshSheet();
-        ~SceneMeshSheet();
-    
-        void setSceneMesh(SceneMesh *mesh);
-        void handleEvent(Event *event);
-    
-    private:
-    
-        BoolProp *gpuSkinningProp;
-        BoolProp *backfaceCullProp;
-        BoolProp *alphaTestProp;
-    
-        SceneMesh *sceneMesh;
+	public:
+		SceneMeshSheet();
+		~SceneMeshSheet();
+	
+		void setSceneMesh(SceneMesh *mesh);
+		void handleEvent(Event *event);
+	
+	private:
+	
+		BoolProp *gpuSkinningProp;
+		BoolProp *backfaceCullProp;
+		BoolProp *alphaTestProp;
+	
+		SceneMesh *sceneMesh;
 };
 
 
 class ScenePrimitiveSheet : public PropSheet {
 public:
-    ScenePrimitiveSheet();
-    ~ScenePrimitiveSheet();
-    
-    void setScenePrimitive(ScenePrimitive *primitive);
-    void handleEvent(Event *event);
-    
+	ScenePrimitiveSheet();
+	~ScenePrimitiveSheet();
+	
+	void setScenePrimitive(ScenePrimitive *primitive);
+	void handleEvent(Event *event);
+	
 protected:
-    
-    void updatePrimitiveLabels();
-    
-    ScenePrimitive *primitive;
-    ComboProp *typeProp;
-    
-    NumberProp *option1Prop;
-    NumberProp *option2Prop;
-    NumberProp *option3Prop;
-    NumberProp *option4Prop;
-    NumberProp *option5Prop;
+	
+	void updatePrimitiveLabels();
+	
+	ScenePrimitive *primitive;
+	ComboProp *typeProp;
+	
+	NumberProp *option1Prop;
+	NumberProp *option2Prop;
+	NumberProp *option3Prop;
+	NumberProp *option4Prop;
+	NumberProp *option5Prop;
 };
 
 class MaterialPropSheet : public PropSheet {
-    public:
-        MaterialPropSheet();
-        ~MaterialPropSheet();
-    
-        void setEntityInstance(SceneEntityInstance *instance);
-        void handleEvent(Event *event);
-        void setSceneMesh(SceneMesh *sceneMesh);
-    
-    protected:
-    
-        MaterialProp *materialProp;
-        SceneMesh *sceneMesh;
+	public:
+		MaterialPropSheet();
+		~MaterialPropSheet();
+	
+		void setEntityInstance(SceneEntityInstance *instance);
+		void handleEvent(Event *event);
+		void setSceneMesh(SceneMesh *sceneMesh);
+	
+	protected:
+	
+		MaterialProp *materialProp;
+		SceneMesh *sceneMesh;
 };
 
 class EntityPropSheet : public PropSheet {
@@ -766,12 +766,12 @@ class EntityPropSheet : public PropSheet {
 		void Update();
 		void refreshProps();
 		void applyPropActionData(PolycodeEditorPropActionData *data);
-        void setEntity(Entity *entity);
+		void setEntity(Entity *entity);
 
-        ButtonProp *addButtonProp;
+		ButtonProp *addButtonProp;
 		
 		Entity *entity;
-    
+	
 		int lastNumProps;		
 		int removeIndex;
 };
@@ -783,33 +783,33 @@ class SceneLabelSheet : public PropSheet {
 		
 		void refreshFonts();
 		void handleEvent(Event *event);
-    
-        void setSceneLabel(SceneLabel *label);
+	
+		void setSceneLabel(SceneLabel *label);
 		
-    
-    private:
+	
+	private:
 		SceneLabel *label;
 				
 		StringProp *caption;
 		NumberProp *size;
-        NumberProp *actualHeight;
+		NumberProp *actualHeight;
 		ComboProp *font;
 		BoolProp *enableAA;
 };
 
 class SceneCurveSheet : public PropSheet {
-    public:
-        SceneCurveSheet();
-        ~SceneCurveSheet();
-    
-        void handleEvent(Event *event);
-        void setCurve(SceneCurve *curve);
-    
-        SceneCurve *curve;
-        ButtonProp *addPointProp;
-        BoolProp *renderProp;
-        NumberProp *numPointsProp;
-    
+	public:
+		SceneCurveSheet();
+		~SceneCurveSheet();
+	
+		void handleEvent(Event *event);
+		void setCurve(SceneCurve *curve);
+	
+		SceneCurve *curve;
+		ButtonProp *addPointProp;
+		BoolProp *renderProp;
+		NumberProp *numPointsProp;
+	
 };
 
 class SceneSpriteSheet : public PropSheet {
@@ -818,40 +818,40 @@ class SceneSpriteSheet : public PropSheet {
 		~SceneSpriteSheet();
 		
 		void handleEvent(Event *event);
-        void setSprite(SceneSprite *sprite);
-    
-        void setEntityInstance(SceneEntityInstance *instance);
+		void setSprite(SceneSprite *sprite);
+	
+		void setEntityInstance(SceneEntityInstance *instance);
 				
 		SceneSprite *sprite;
-    
-        SceneSpriteProp *spriteProp;
-        BoolProp *randomFrameProp;
-        ComboProp *defaultStateProp;
+	
+		SceneSpriteProp *spriteProp;
+		BoolProp *randomFrameProp;
+		ComboProp *defaultStateProp;
 };
 
 
 class CameraSheet : public PropSheet {
-    public:
-        CameraSheet();
-        ~CameraSheet();
-    
-        void handleEvent(Event *event);
-        void setCamera(Camera *camera);
-    
-        void updateOptionVisibility();
-    
-        NumberProp *exposureProp;
-    
-        BoolProp *orthoProp;
-        NumberProp *fovProp;
-        ComboProp *orthoSizeTypeProp;
-        NumberProp *orthoWidthProp;
-        NumberProp *orthoHeightProp;
-    
-        NumberProp *nearClipPlane;
-        NumberProp *farClipPlane;
-    
-        Camera *camera;
+	public:
+		CameraSheet();
+		~CameraSheet();
+	
+		void handleEvent(Event *event);
+		void setCamera(Camera *camera);
+	
+		void updateOptionVisibility();
+	
+		NumberProp *exposureProp;
+	
+		BoolProp *orthoProp;
+		NumberProp *fovProp;
+		ComboProp *orthoSizeTypeProp;
+		NumberProp *orthoWidthProp;
+		NumberProp *orthoHeightProp;
+	
+		NumberProp *nearClipPlane;
+		NumberProp *farClipPlane;
+	
+		Camera *camera;
 };
 
 
@@ -873,55 +873,55 @@ class SoundSheet : public PropSheet {
 		~SoundSheet();
 		
 		void handleEvent(Event *event);
-        void setSound(SceneSound *sound);
+		void setSound(SceneSound *sound);
 				
 		SceneSound *sound;
 
 		SoundProp *soundProp;		
 		NumberProp *referenceDistance;
-        BoolProp *loopOnLoad;
+		BoolProp *loopOnLoad;
 		NumberProp *maxDistance;
 		SliderProp *volume;
 		SliderProp *pitch;
 };
 
 class LayerSheet : public PropSheet {
-    public:
-        LayerSheet();
-        ~LayerSheet();
-        
-        void handleEvent(Event *event);
-        void setEntityInstance(SceneEntityInstance *instance);
-    
-        void setFromEntity();
-    
-        void Update();
-
-    private:
-        ButtonProp *addLayerProp;
-        SceneEntityInstance *instance;
-        int layerRemoveIndex;
+	public:
+		LayerSheet();
+		~LayerSheet();
+		
+		void handleEvent(Event *event);
+		void setEntityInstance(SceneEntityInstance *instance);
+	
+		void setFromEntity();
+	
+		void Update();
+
+	private:
+		ButtonProp *addLayerProp;
+		SceneEntityInstance *instance;
+		int layerRemoveIndex;
 };
 
 class LinkedMaterialsSheet : public PropSheet {
-    public:
-        LinkedMaterialsSheet();
-        ~LinkedMaterialsSheet();
-    
-        void handleEvent(Event *event);
-        void setEntityInstance(SceneEntityInstance *instance);
-    
-        void Update();
-    
-        void updateMaterials();
-    
-    
-    private:
-        SceneEntityInstance *instance;
-        ButtonProp *addMaterialProp;
-    
-        int poolRemoveIndex;
-    
+	public:
+		LinkedMaterialsSheet();
+		~LinkedMaterialsSheet();
+	
+		void handleEvent(Event *event);
+		void setEntityInstance(SceneEntityInstance *instance);
+	
+		void Update();
+	
+		void updateMaterials();
+	
+	
+	private:
+		SceneEntityInstance *instance;
+		ButtonProp *addMaterialProp;
+	
+		int poolRemoveIndex;
+	
 };
 
 class PropList : public UIElement {
@@ -931,8 +931,8 @@ class PropList : public UIElement {
 		
 		void updateProps();
 		void updateSize();
-    
-        void setCaption(const String &newCaption);
+	
+		void setCaption(const String &newCaption);
 		void addPropSheet(PropSheet *sheet);
 		void handleEvent(Event *event);
 		void Resize(Number width, Number height);
@@ -941,7 +941,7 @@ class PropList : public UIElement {
 	protected:
 	
 		UIElement *propContents;
-        UILabel *label;
+		UILabel *label;
 		std::vector<PropSheet*> props;	
 		UIRect *bg;
 		UIRect *bg2;				

+ 5 - 5
include/polycode/ide/PolycodeRemoteDebugger.h

@@ -30,9 +30,9 @@ using namespace Polycode;
 
 typedef struct {
 	unsigned int lineNumber;
-	char errorMessage[256];	
+	char errorMessage[256]; 
 	char fileName[256];
-	unsigned int backTraceSize;	
+	unsigned int backTraceSize; 
 } RemoteErrorData;
 
 typedef struct {
@@ -53,7 +53,7 @@ class PolycodeRemoteDebugger : EventHandler {
 		void injectCode(String code);
 		
 		void handleEvent(Event *event);
-        void resetDebugger();
+		void resetDebugger();
 			
 		bool isConnected();
 		
@@ -71,8 +71,8 @@ class PolycodeRemoteDebugger : EventHandler {
 	protected:
 		
 		bool hasErred;
-    
-        std::vector<RemoteBacktraceData> receivedBacktraceData;
+	
+		std::vector<RemoteBacktraceData> receivedBacktraceData;
 		
 		PolycodeProjectManager *projectManager;
 		

+ 299 - 299
include/polycode/ide/PolycodeSpriteEditor.h

@@ -31,315 +31,315 @@ using namespace Polycode;
 
 class PolycodeSpriteEditorActionData : public PolycodeEditorActionData {
 public:
-    PolycodeSpriteEditorActionData() {
-        reverse = true;
-        sprite = NULL;
-        state = NULL;
-    }
-    
-    ~PolycodeSpriteEditorActionData() {
-        
-    }
+	PolycodeSpriteEditorActionData() {
+		reverse = true;
+		sprite = NULL;
+		state = NULL;
+	}
+	
+	~PolycodeSpriteEditorActionData() {
+		
+	}
 
-    Sprite *sprite;
-    SpriteState *state;
-    String name;
-    
-    Number stateFPS;
-    Number stateScale;
-    Vector2 stateBBox;
-    Vector2 stateOffset;
-    
-    std::vector<unsigned int> frameIDs;
-    std::vector<SpriteFrame> spriteFrames;
-    bool reverse;
+	Sprite *sprite;
+	SpriteState *state;
+	String name;
+	
+	Number stateFPS;
+	Number stateScale;
+	Vector2 stateBBox;
+	Vector2 stateOffset;
+	
+	std::vector<unsigned int> frameIDs;
+	std::vector<SpriteFrame> spriteFrames;
+	bool reverse;
 };
 
 class SpritePreview : public UIElement {
-    public:
-        SpritePreview(SpriteSet *spriteSet);
-        ~SpritePreview();
-    
-        void Update();
-    
-        void handleEvent(Event *event);
-    
-        SceneSprite *getSceneSprite();
-        void Resize(Number width, Number height);
-    
-    protected:
-        UIRect *headerBg;    
-        UIImage *previewBg;
-        SceneSprite *sprite;
-    
-        UIIconSelector *bgSelector;
-    
-        SceneMesh *boundingBoxPreview;
-    
+	public:
+		SpritePreview(SpriteSet *spriteSet);
+		~SpritePreview();
+	
+		void Update();
+	
+		void handleEvent(Event *event);
+	
+		SceneSprite *getSceneSprite();
+		void Resize(Number width, Number height);
+	
+	protected:
+		UIRect *headerBg;	 
+		UIImage *previewBg;
+		SceneSprite *sprite;
+	
+		UIIconSelector *bgSelector;
+	
+		SceneMesh *boundingBoxPreview;
+	
 };
 
 class SpriteSheetEditor : public UIElement {
-    public:
-        SpriteSheetEditor(SpriteSet *sprite);
-        ~SpriteSheetEditor();
-    
-        void handleEvent(Event *event);
-    
-        void Update();
-    
-        void Render();
-    
-        void deleteSelectedFrames();
-    
-        void selectAll();
-        void clearSelected();
-        bool hasSelectedID(unsigned int frameID);
-        std::vector<unsigned int> getSelectedFrameIDs();
-    
-        void Resize(Number width, Number height);
-    
-        PolycodeEditor *editor;
-    
-        SpriteSet *sprite;
-        UIRect *previewImage;
-    
-    protected:
-    
-        UIRect *headerBg;
-    
-        UIIconSelector *bgSelector;
-    
-        bool creatingFrame;
-        bool willCreateFrame;
-    
-        Number zoomScale;
-        Vector2 panOffset;
-    
-        TransformGrips *transformGrips;
-    
-        SpriteFrame frameToAdd;
+	public:
+		SpriteSheetEditor(SpriteSet *sprite);
+		~SpriteSheetEditor();
+	
+		void handleEvent(Event *event);
+	
+		void Update();
+	
+		void Render();
+	
+		void deleteSelectedFrames();
+	
+		void selectAll();
+		void clearSelected();
+		bool hasSelectedID(unsigned int frameID);
+		std::vector<unsigned int> getSelectedFrameIDs();
+	
+		void Resize(Number width, Number height);
+	
+		PolycodeEditor *editor;
+	
+		SpriteSet *sprite;
+		UIRect *previewImage;
+	
+	protected:
+	
+		UIRect *headerBg;
+	
+		UIIconSelector *bgSelector;
+	
+		bool creatingFrame;
+		bool willCreateFrame;
+	
+		Number zoomScale;
+		Vector2 panOffset;
+	
+		TransformGrips *transformGrips;
+	
+		SpriteFrame frameToAdd;
 
-        Vector2 clickBaseCoord;
-    
-        Vector2 panMouseBase;
-        bool panning;
-    
-    
-        std::vector<Vector2> defaultAnchors;
-    
-        UIImage *previewBg;
-    
-        SceneMesh *frameVisualizerMesh;
-        SceneMesh *frameVisualizerMeshSelected;
-    
-        Entity *bottomMenu;
-        UIRect *bottomMenuRect;
-        UIButton *changeImageButton;
-        UIButton *generateFramesButton;
-        UIButton *clearFramesButton;
-    
-        UIButton *generateOptionsButton;
-    
-        UIElement *uniformOptions;
-        UIElement *detectOptions;
-    
-        UIComboBox *defaultAnchorCombo;
-    
-        UIWindow *optionsWindow;
-    
-        UITextInput *uniformGridWidthInput;
-        UITextInput *uniformGridHeightInput;
-    
-        UITextInput *minimumDistanceInput;
-    
-        std::vector<unsigned int> selectedIDs;
-    
-        UIComboBox *generateTypeDropdown;
+		Vector2 clickBaseCoord;
+	
+		Vector2 panMouseBase;
+		bool panning;
+	
+	
+		std::vector<Vector2> defaultAnchors;
+	
+		UIImage *previewBg;
+	
+		SceneMesh *frameVisualizerMesh;
+		SceneMesh *frameVisualizerMeshSelected;
+	
+		Entity *bottomMenu;
+		UIRect *bottomMenuRect;
+		UIButton *changeImageButton;
+		UIButton *generateFramesButton;
+		UIButton *clearFramesButton;
+	
+		UIButton *generateOptionsButton;
+	
+		UIElement *uniformOptions;
+		UIElement *detectOptions;
+	
+		UIComboBox *defaultAnchorCombo;
+	
+		UIWindow *optionsWindow;
+	
+		UITextInput *uniformGridWidthInput;
+		UITextInput *uniformGridHeightInput;
+	
+		UITextInput *minimumDistanceInput;
+	
+		std::vector<unsigned int> selectedIDs;
+	
+		UIComboBox *generateTypeDropdown;
 };
 
 class SpriteBrowser : public UIElement {
-    public:
-        SpriteBrowser(SpriteSet *spriteSet);
-        ~SpriteBrowser();
-    
-        void Resize(Number width, Number height);
+	public:
+		SpriteBrowser(SpriteSet *spriteSet);
+		~SpriteBrowser();
+	
+		void Resize(Number width, Number height);
 		void handleEvent(Event *event);
-        void refreshSprites();
-    
-        Sprite *getSelectedSpriteEntry();
-    
-        PolycodeEditor *editor;
-    protected:
-    
-    
-        UIRect *headerBg;
-        SpriteSet *spriteSet;
-    
-        Sprite *selectedEntry;
-    
-        UITreeContainer *spriteTreeView;
-        UIImageButton *newSpriteButton;
-        UIImageButton *removeSpriteButton;
-        UIImageButton *moreButton;
-    
-        UIMenu *spriteMoreMenu;
+		void refreshSprites();
+	
+		Sprite *getSelectedSpriteEntry();
+	
+		PolycodeEditor *editor;
+	protected:
+	
+	
+		UIRect *headerBg;
+		SpriteSet *spriteSet;
+	
+		Sprite *selectedEntry;
+	
+		UITreeContainer *spriteTreeView;
+		UIImageButton *newSpriteButton;
+		UIImageButton *removeSpriteButton;
+		UIImageButton *moreButton;
+	
+		UIMenu *spriteMoreMenu;
 };
 
 
 class SpriteStateEditBar : public UIElement {
-    public:
-        SpriteStateEditBar(SpriteSet *spriteSet);
-        ~SpriteStateEditBar();
-    
-        void Resize(Number width, Number height);
-        void clearBar();
-        void refreshBar();
-    
-        void handleEvent(Event *event);
-    
-        void moveSelectedLeft();
-        void moveSelectedRight();
-    
-        void doSelectFrame(unsigned int selectedFrameIndex);
-    
-        bool isFrameSelected(unsigned int frameID);
-        void deleteSelectedFrames();
-    
-        void Update();
-    
-        void setSceneSprite(SceneSprite *sprite);
-        void setSpriteState(SpriteState *state);
-    
-        PolycodeEditor *editor;
-    
-    protected:
-    
-        Vector2 clickBaseCoord;
-        Vector2 frameMoveBase;
-    
-        bool draggingFrames;
-        bool extendingFrame;
-        unsigned int extendingID;
-        unsigned int extendingIndex;
-    
-        Number zoomScale;
-        SpriteState *spriteState;
-        SpriteSet *spriteSet;
-        SceneSprite *sceneSprite;
-    
-        Number defaultFrameWidth;
-    
-        SceneMesh *barMesh;
-        SceneMesh *barMeshBg;
-        SceneMesh *frameTicksMesh;
-        SceneMesh *frameGripsMesh;
-    
-        UIElement *barBase;
-        UIScrollContainer *scroller;
-    
-        std::vector<unsigned int> selectedFrames;
+	public:
+		SpriteStateEditBar(SpriteSet *spriteSet);
+		~SpriteStateEditBar();
+	
+		void Resize(Number width, Number height);
+		void clearBar();
+		void refreshBar();
+	
+		void handleEvent(Event *event);
+	
+		void moveSelectedLeft();
+		void moveSelectedRight();
+	
+		void doSelectFrame(unsigned int selectedFrameIndex);
+	
+		bool isFrameSelected(unsigned int frameID);
+		void deleteSelectedFrames();
+	
+		void Update();
+	
+		void setSceneSprite(SceneSprite *sprite);
+		void setSpriteState(SpriteState *state);
+	
+		PolycodeEditor *editor;
+	
+	protected:
+	
+		Vector2 clickBaseCoord;
+		Vector2 frameMoveBase;
+	
+		bool draggingFrames;
+		bool extendingFrame;
+		unsigned int extendingID;
+		unsigned int extendingIndex;
+	
+		Number zoomScale;
+		SpriteState *spriteState;
+		SpriteSet *spriteSet;
+		SceneSprite *sceneSprite;
+	
+		Number defaultFrameWidth;
+	
+		SceneMesh *barMesh;
+		SceneMesh *barMeshBg;
+		SceneMesh *frameTicksMesh;
+		SceneMesh *frameGripsMesh;
+	
+		UIElement *barBase;
+		UIScrollContainer *scroller;
+	
+		std::vector<unsigned int> selectedFrames;
 };
 
 class SpriteStateBrowser : public UIElement {
-    public:
-        SpriteStateBrowser();
-        ~SpriteStateBrowser();
-    
-        void Resize(Number width, Number height);
-    
-        UITreeContainer *stateTreeView;
-        UIRect *headerBg;
-    
-        UIImageButton *newStateButton;
-        UIImageButton *removeStateButton;
-        UIImageButton *moreButton;
-        PolycodeEditor *editor;
-    
+	public:
+		SpriteStateBrowser();
+		~SpriteStateBrowser();
+	
+		void Resize(Number width, Number height);
+	
+		UITreeContainer *stateTreeView;
+		UIRect *headerBg;
+	
+		UIImageButton *newStateButton;
+		UIImageButton *removeStateButton;
+		UIImageButton *moreButton;
+		PolycodeEditor *editor;
+	
 };
 
 class SpriteStateEditorDetails : public UIElement {
-    public:
-        SpriteStateEditorDetails(SpriteSet *spriteSet);
-        ~SpriteStateEditorDetails();
-    
-        void Resize(Number width, Number height);
-        void handleEvent(Event *event);
-    
-        void Update();
-    
-        void setSpriteState(SpriteState *state);
-        SpriteState *getSpriteState();
-    
-        void setSceneSprite(SceneSprite *spritePreview);
+	public:
+		SpriteStateEditorDetails(SpriteSet *spriteSet);
+		~SpriteStateEditorDetails();
+	
+		void Resize(Number width, Number height);
+		void handleEvent(Event *event);
+	
+		void Update();
+	
+		void setSpriteState(SpriteState *state);
+		SpriteState *getSpriteState();
+	
+		void setSceneSprite(SceneSprite *spritePreview);
 
-        PolycodeSpriteEditorActionData *makeStateData();
-    
-        void refreshState();
-    
-        UIButton *getAppendFramesButton();
-        SpriteStateEditBar *getEditBar();
-    
-        PolycodeEditor *editor;
-    
-    protected:
-    
-        UIRect *headerBg;
-    
-        SpriteState *spriteState;
-        SpriteSet *spriteSet;
-        SceneSprite *sceneSprite;
-    
-        UITextInput *fpsInput;
-        UITextInput *scaleInput;
-        UITextInput *bBoxWidthInput;
-        UITextInput *bBoxHeightInput;
+		PolycodeSpriteEditorActionData *makeStateData();
+	
+		void refreshState();
+	
+		UIButton *getAppendFramesButton();
+		SpriteStateEditBar *getEditBar();
+	
+		PolycodeEditor *editor;
+	
+	protected:
+	
+		UIRect *headerBg;
+	
+		SpriteState *spriteState;
+		SpriteSet *spriteSet;
+		SceneSprite *sceneSprite;
+	
+		UITextInput *fpsInput;
+		UITextInput *scaleInput;
+		UITextInput *bBoxWidthInput;
+		UITextInput *bBoxHeightInput;
 
-        UITextInput *offsetXInput;
-        UITextInput *offsetYInput;
-    
-        UIButton *appendFramesButton;
-        UIButton *removeFramesButton;
-        UIButton *clearFramesButton;
-    
-        UIImageButton *playButton;
-        UIImageButton *pauseButton;
-        SpriteStateEditBar *editBar;
-    
+		UITextInput *offsetXInput;
+		UITextInput *offsetYInput;
+	
+		UIButton *appendFramesButton;
+		UIButton *removeFramesButton;
+		UIButton *clearFramesButton;
+	
+		UIImageButton *playButton;
+		UIImageButton *pauseButton;
+		SpriteStateEditBar *editBar;
+	
 };
 
 class SpriteStateEditor : public UIElement {
-    public:
-        SpriteStateEditor(SpriteSet *spriteSet);
-        ~SpriteStateEditor();
-    
-        void setSpriteEntry(Sprite *entry);
-        void refreshStates();
-        void handleEvent(Event *event);
-    
-        void Resize(Number width, Number height);
-    
-        SpriteStateEditorDetails *getDetailsEditor();
-        SpriteStateBrowser *getStateBrowser();
-        SpriteState *getSelectedState();
-        PolycodeEditor *editor;
-    
-    protected:
-        UITreeContainer *stateTreeView;
-        SpriteSet *spriteSet;
-        SpriteState *selectedState;
-    
-        UIMenu *stateMoreMenu;
-    
-        SpriteStateBrowser *stateBrowser;
-    
-        Sprite *spriteSetEntry;
-    
-        UIImageButton *newStateButton;
-    
-        UIHSizer *stateSizer;
+	public:
+		SpriteStateEditor(SpriteSet *spriteSet);
+		~SpriteStateEditor();
+	
+		void setSpriteEntry(Sprite *entry);
+		void refreshStates();
+		void handleEvent(Event *event);
+	
+		void Resize(Number width, Number height);
+	
+		SpriteStateEditorDetails *getDetailsEditor();
+		SpriteStateBrowser *getStateBrowser();
+		SpriteState *getSelectedState();
+		PolycodeEditor *editor;
+	
+	protected:
+		UITreeContainer *stateTreeView;
+		SpriteSet *spriteSet;
+		SpriteState *selectedState;
+	
+		UIMenu *stateMoreMenu;
+	
+		SpriteStateBrowser *stateBrowser;
+	
+		Sprite *spriteSetEntry;
+	
+		UIImageButton *newStateButton;
+	
+		UIHSizer *stateSizer;
 
-    
-        SpriteStateEditorDetails *stateDetails;
+	
+		SpriteStateEditorDetails *stateDetails;
 };
 
 class PolycodeSpriteEditor : public PolycodeEditor {
@@ -352,27 +352,27 @@ class PolycodeSpriteEditor : public PolycodeEditor {
 		bool openFile(OSFileEntry filePath);
 		void Resize(int x, int y);
 		void saveFile();
-    
-        void doAction(String actionName, PolycodeEditorActionData *data);
-        void selectAll();
+	
+		void doAction(String actionName, PolycodeEditorActionData *data);
+		void selectAll();
 				
 	protected:
 	
-        SpriteSet *sprite;
-        UIVSizer *mainSizer;
-        UIHSizer *topSizer;
-    
-        UIHSizer *bottomSizer;
-    
-        PolycodeSpriteEditorActionData *beforeData;
-    
-        SpriteSheetEditor *spriteSheetEditor;
-        SpriteBrowser *spriteBrowser;
-        SpriteStateEditor *stateEditor;
-        SpritePreview *spritePreview;
-    
-        UIButton *addFramesButton;
-    
+		SpriteSet *sprite;
+		UIVSizer *mainSizer;
+		UIHSizer *topSizer;
+	
+		UIHSizer *bottomSizer;
+	
+		PolycodeSpriteEditorActionData *beforeData;
+	
+		SpriteSheetEditor *spriteSheetEditor;
+		SpriteBrowser *spriteBrowser;
+		SpriteStateEditor *stateEditor;
+		SpritePreview *spritePreview;
+	
+		UIButton *addFramesButton;
+	
 };
 
 class PolycodeSpriteEditorFactory : public PolycodeEditorFactory {

+ 22 - 22
include/polycode/ide/TextureBrowser.h

@@ -41,11 +41,11 @@ class AssetEntry : public UIElement {
 		~AssetEntry();
 		
 		UIRect *imageShape;
-        SceneSprite *spritePreview;
+		SceneSprite *spritePreview;
 		UILabel *nameLabel;
 		
 		String assetPath;
-        Resource *resource;
+		Resource *resource;
 		UIRect *selectShape;
 };
 
@@ -57,21 +57,21 @@ class AssetList : public UIElement {
 		void handleEvent(Event *event);
 		
 		bool hasExtension(String extension);
-    
-        void clearList();
+	
+		void clearList();
 		
 		void showFolder(String folderPath);
-        void showResourcePool(ResourcePool *pool, int resourceFilter);
-    
-        Resource *getSelectedResource();
-    
+		void showResourcePool(ResourcePool *pool, int resourceFilter);
+	
+		Resource *getSelectedResource();
+	
 		String selectedPath;
 		
 		void setExtensions(std::vector<String> extensions);
 		
 	protected:
 	
-        Resource *selectedResource;
+		Resource *selectedResource;
 		UIImageButton *reloadButton;
 	
 		String currentFolderPath;
@@ -98,17 +98,17 @@ class AssetBrowser : public UIWindow {
 		void setExtensions(std::vector<String> extensions);
 		
 		void setProject(PolycodeProject *project);
-    
-        void setBrowseMode(unsigned int newBrowseMode);
+	
+		void setBrowseMode(unsigned int newBrowseMode);
 
-        void setResourcePools(std::vector<ResourcePool*> pools, int resourceFilter);
-        void setResourceFilter(int resourceType);
+		void setResourcePools(std::vector<ResourcePool*> pools, int resourceFilter);
+		void setResourceFilter(int resourceType);
 		void handleEvent(Event *event);
-    
-        Resource *getSelectedResource();
-    
-        static const int BROWSE_MODE_FILES = 0;
-        static const int BROWSE_MODE_RESOURCES = 1;
+	
+		Resource *getSelectedResource();
+	
+		static const int BROWSE_MODE_FILES = 0;
+		static const int BROWSE_MODE_RESOURCES = 1;
 	
 	protected:
 	
@@ -117,14 +117,14 @@ class AssetBrowser : public UIWindow {
 	
 		PolycodeProject *currentProject;
 	
-        unsigned int browseMode;
-        int resourceFilter;
-    
+		unsigned int browseMode;
+		int resourceFilter;
+	
 		UIButton *cancelButton;
 		UIButton *okButton;
 		
 		String templatePath;
 			
-		UITreeContainer *templateContainer;	
+		UITreeContainer *templateContainer; 
 		UITree *defaultTemplateTree;
 };

+ 37 - 37
include/polycode/ide/ToolWindows.h

@@ -38,8 +38,8 @@ class TextInputPopup : public UIWindow {
 		String getValue();
 		void handleEvent(Event *event);
 		
-        virtual void onGainFocus();
-    
+		virtual void onGainFocus();
+	
 		String action;
 				
 	protected:
@@ -47,23 +47,23 @@ class TextInputPopup : public UIWindow {
 		UITextInput *textInput;
 	
 		UIButton *cancelButton;
-		UIButton *okButton;	
+		UIButton *okButton; 
 };
 
 class MessagePopup : public UIWindow {
-    public:
-    MessagePopup();
-    ~MessagePopup();
-    
-    void setCaption(String caption);
-    void handleEvent(Event *event);
-    
-    virtual void onGainFocus();
-    
-        String action;
-        UILabel *captionLabel;
-        UIButton *okButton;
-    
+	public:
+	MessagePopup();
+	~MessagePopup();
+	
+	void setCaption(String caption);
+	void handleEvent(Event *event);
+	
+	virtual void onGainFocus();
+	
+		String action;
+		UILabel *captionLabel;
+		UIButton *okButton;
+	
 };
 
 class YesNoPopup : public UIWindow {
@@ -74,15 +74,15 @@ class YesNoPopup : public UIWindow {
 		void setCaption(String caption);
 		void handleEvent(Event *event);
 		
-        virtual void onGainFocus();
-    
+		virtual void onGainFocus();
+	
 		String action;
 	
 		UILabel *captionLabel;
 	
 		UIElement *buttonAnchor;
 		UIButton *cancelButton;
-		UIButton *okButton;	
+		UIButton *okButton; 
 };
 
 
@@ -94,8 +94,8 @@ class YesNoCancelPopup : public UIWindow {
 		void setCaption(String caption);
 		void handleEvent(Event *event);
 		
-        virtual void onGainFocus();
-    
+		virtual void onGainFocus();
+	
 		String action;
 	
 		UILabel *captionLabel;
@@ -117,17 +117,17 @@ class AssetImporterWindow : public UIWindow {
 		
 		void setSourceFileAndTargetFolder(String file, String folder, String projectRelativeFolder);
 		void refreshPreview();
-    
-        virtual void onGainFocus();
+	
+		virtual void onGainFocus();
 			
-		void handleEvent(Event *event);	
+		void handleEvent(Event *event); 
 			
 	protected:
 
 		String file;
 		String folder;
 		String projectRelativeFolder;
-    
+	
 		UIButton *cancelButton;
 		UIButton *okButton;
 		std::vector<UILabel*> fileLabels;
@@ -139,18 +139,18 @@ class AssetImporterWindow : public UIWindow {
 		UICheckBox *generateNormalsCheckbox;
 		UICheckBox *swapZYAxisCheckbox;
 
-        UICheckBox *exportNormals;
-        UICheckBox *exportTangents;
-        UICheckBox *exportColors;
-        UICheckBox *exportBoneWeights;
-        UICheckBox *exportUVs;
-        UICheckBox *exportSecondaryUVs;
-        UICheckBox *exportScene;
-    
-        UICheckBox *generateMatFile;
-        UICheckBox *overrideMaterial;
-        UITextInput *overrideMaterialInput;
-    
+		UICheckBox *exportNormals;
+		UICheckBox *exportTangents;
+		UICheckBox *exportColors;
+		UICheckBox *exportBoneWeights;
+		UICheckBox *exportUVs;
+		UICheckBox *exportSecondaryUVs;
+		UICheckBox *exportScene;
+	
+		UICheckBox *generateMatFile;
+		UICheckBox *overrideMaterial;
+		UITextInput *overrideMaterialInput;
+	
 		UIElement *filesAnchor;
 		UIScrollContainer *filesScroller;
 

+ 11 - 11
include/polycode/ide/TrackballCamera.h

@@ -35,21 +35,21 @@ class TrackballCamera : public EventDispatcher {
 		void setOrbitingCenter(const Vector3 &newCenter);
 		void setCameraDistance(Number cameraDistance);
 		Camera *getTargetCamera();
-    
-    
-        void setCameraPosition(Vector3 cameraPosition);
-    
+	
+	
+		void setCameraPosition(Vector3 cameraPosition);
+	
 		bool isNavKeyDown();
 
-        void disableRotation(bool val);
-    
+		void disableRotation(bool val);
+	
 		static const int MOUSE_MODE_IDLE = 0;
 		static const int MOUSE_MODE_ORBITING = 1;
 		static const int MOUSE_MODE_PANNING = 2;
 		static const int MOUSE_MODE_ZOOMING = 3;
-    
-        Number getCameraDistance();
-        Vector3 getOribitingCenter();
+	
+		Number getCameraDistance();
+		Vector3 getOribitingCenter();
 		
 		Number trackballPanSpeed;
 		Number trackballZoomSpeed;	
@@ -64,8 +64,8 @@ class TrackballCamera : public EventDispatcher {
 		
 		Camera *targetCamera;
 		Entity *trackballShape;
-    
-        bool rotationDisabled;
+	
+		bool rotationDisabled;
 		
 		Vector2 trackBallMouseStart;
 		Vector2 trackBallMouseEnd;			

+ 116 - 116
include/polycode/ide/TransformGizmo.h

@@ -34,49 +34,49 @@ using namespace Polycode;
 
 class TransformGrips : public UIElement {
 public:
-    TransformGrips();
-    ~TransformGrips();
-    
-    void setGripRectangle(Polycode::Rectangle rectangle, Vector2 offset);
-    
-    void handleEvent(Event *event);
-    Polycode::Rectangle getGripRectangle();
-    
-    Vector2 getAnchorPoint();
-    
+	TransformGrips();
+	~TransformGrips();
+	
+	void setGripRectangle(Polycode::Rectangle rectangle, Vector2 offset);
+	
+	void handleEvent(Event *event);
+	Polycode::Rectangle getGripRectangle();
+	
+	Vector2 getAnchorPoint();
+	
 private:
-    
-    bool transforming;
-    UIImage *movingTransform;
-    
-    Polycode::Rectangle gripRectangle;
-    Vector2 anchorPoint;
-    
-    Vector2 mouseBase;
-    
-    UIRect *mainRect;
-    UIImage *transformTL;
-    UIImage *transformT;
-    UIImage *transformTR;
-    UIImage *transformR;
-    UIImage *transformL;
-    UIImage *transformBL;
-    UIImage *transformB;
-    UIImage *transformBR;
-    UIImage *transformOffset;
-    std::vector<UIElement*> grips;
-    
+	
+	bool transforming;
+	UIImage *movingTransform;
+	
+	Polycode::Rectangle gripRectangle;
+	Vector2 anchorPoint;
+	
+	Vector2 mouseBase;
+	
+	UIRect *mainRect;
+	UIImage *transformTL;
+	UIImage *transformT;
+	UIImage *transformTR;
+	UIImage *transformR;
+	UIImage *transformL;
+	UIImage *transformBL;
+	UIImage *transformB;
+	UIImage *transformBR;
+	UIImage *transformOffset;
+	std::vector<UIElement*> grips;
+	
 };
 
 class TrasnformGizmoEvent : public Event {
-    public:
-        TrasnformGizmoEvent(int mode);
-    
-        static const int EVENT_TRANSLATE = 0;
-        static const int EVENT_SCALE = 1;
-        static const int EVENT_ROTATE = 2;
-    
-        int mode;
+	public:
+		TrasnformGizmoEvent(int mode);
+	
+		static const int EVENT_TRANSLATE = 0;
+		static const int EVENT_SCALE = 1;
+		static const int EVENT_ROTATE = 2;
+	
+		int mode;
 };
 
 class TransformGizmo : public Entity {
@@ -86,13 +86,13 @@ class TransformGizmo : public Entity {
 		
 		void handleEvent(Event *event);
 		void setTransformMode(int newMode);
-        void setGizmoMode(int newMode);
-    
+		void setGizmoMode(int newMode);
+	
 		void fixedUpdate();
-    
-        void enableSnap(bool val);
-        void setSnapSize(Number snapSize);
-    
+	
+		void enableSnap(bool val);
+		void setSnapSize(Number snapSize);
+	
 		void setTransformSelection(std::vector<Entity*> selectedEntities);
 		
 		void transformSelectedEntities(const Vector3 &move, const Vector3 &scale, Number rotate);
@@ -105,16 +105,16 @@ class TransformGizmo : public Entity {
 		Vector2 getCorrectedMousePosition();
 
 		void resetTransform();
-    
-        void setTransformOrientation(int orientation);
-    
-        void updateOrientationForEntity(Entity *entity);
-    
-        void setTransformPlane(Number x, Number y, Number z, bool forceGlobal = false);
+	
+		void setTransformOrientation(int orientation);
+	
+		void updateOrientationForEntity(Entity *entity);
+	
+		void setTransformPlane(Number x, Number y, Number z, bool forceGlobal = false);
 		void setTransformPlane(bool useX, bool useY, bool useZ);
-        void setTransformPlaneFromView();
-    
-        void setCenterMode(int centerMode);
+		void setTransformPlaneFromView();
+	
+		void setCenterMode(int centerMode);
 
 		void toggleOrientation();
 		
@@ -124,33 +124,33 @@ class TransformGizmo : public Entity {
 		static const int TRANSFORM_SCALE_VIEW = 3;
 		static const int TRANSFORM_ROTATE_VIEW = 4;
 		static const int TRANSFORM_MOVE_VIEW = 5;
-    
-        static const int GIZMO_MODE_3D = 0;
+	
+		static const int GIZMO_MODE_3D = 0;
 		static const int GIZMO_MODE_2D_X = 1;
 		static const int GIZMO_MODE_2D_Y = 2;
 		static const int GIZMO_MODE_2D_Z = 3;
-    
-        static const int ORIENTATION_GLOBAL = 0;
-        static const int ORIENTATION_LOCAL = 1;
-
-        static const int CENTER_MODE_MEDIAN = 0;
-        static const int CENTER_MODE_INDIVIDUAL = 1;
-    
-        bool enableGizmo;
-    
+	
+		static const int ORIENTATION_GLOBAL = 0;
+		static const int ORIENTATION_LOCAL = 1;
+
+		static const int CENTER_MODE_MEDIAN = 0;
+		static const int CENTER_MODE_INDIVIDUAL = 1;
+	
+		bool enableGizmo;
+	
 	private:
-    
-        bool snapEnabled;
-        Number snapSize;
-    
-        void dispatchEndEvent();
-    
-        int transformMode;
-        int gizmoMode;
-        int orientation;
+	
+		bool snapEnabled;
+		Number snapSize;
+	
+		void dispatchEndEvent();
+	
+		int transformMode;
+		int gizmoMode;
+		int orientation;
 		int startingOrientation;
-    
-        int centerMode;
+	
+		int centerMode;
 	
 		std::vector<Entity*> selectedEntities;
 		std::vector<Vector3> entityPositions;
@@ -158,33 +158,33 @@ class TransformGizmo : public Entity {
 		std::vector<Vector3> oldPosition;
 		std::vector<Vector3> oldScale;
 		std::vector<Quaternion> oldRotation;
-    
+	
 		Scene *targetScene;
 		Camera *targetCamera;
-    
-        bool firstMove;
-    
+	
+		bool firstMove;
+	
 	
 		CoreInput *coreInput;
 		int mode;
-        int previousMode;
+		int previousMode;
 		bool transforming;
 		
 		Vector3 transformConstraint;
 		Vector3 transformPlane;
-        Vector3 localTransformPlane;
-    
-        Number transformPlaneDistance;
-    
-        Matrix4 planeMatrix;
+		Vector3 localTransformPlane;
+	
+		Number transformPlaneDistance;
+	
+		Matrix4 planeMatrix;
 				
-        Vector3 gizmoPoint;
+		Vector3 gizmoPoint;
 		Vector3 startingPoint;
 		Number startingAngle;
 
 		Vector2 mouseStart2d;
-    
-        Number scaleAmount;
+	
+		Number scaleAmount;
 				
 		Entity *trasnformDecorators;
 		Entity *scaleDecorators;
@@ -193,34 +193,34 @@ class TransformGizmo : public Entity {
 							
 		Entity *xTransformGrip;
 		Entity *yTransformGrip;
-		Entity *zTransformGrip;	
+		Entity *zTransformGrip; 
 		
 		ScenePrimitive *pitchGrip;
 		ScenePrimitive *rollGrip;
 		ScenePrimitive *yawGrip;
 
-        ScenePrimitive *viewportRotateGrip;
-        Entity *viewportRotateGripBase;
-    
-        SceneMesh *xLine;
-        SceneMesh *yLine;
-        SceneMesh *zLine;
-    
-        ScenePrimitive *xArrow;
-        ScenePrimitive *yArrow;
-        ScenePrimitive *zArrow;
-    
-        ScenePrimitive *xBox;
-        ScenePrimitive *yBox;
-        ScenePrimitive *zBox;
-    
-        ScenePrimitive *outerCircle;
-        ScenePrimitive *bgCircle;
-    
-        ScenePrimitive *pitchCircle;
-        ScenePrimitive *yawCircle;
-        ScenePrimitive *rollCircle;
-    
+		ScenePrimitive *viewportRotateGrip;
+		Entity *viewportRotateGripBase;
+	
+		SceneMesh *xLine;
+		SceneMesh *yLine;
+		SceneMesh *zLine;
+	
+		ScenePrimitive *xArrow;
+		ScenePrimitive *yArrow;
+		ScenePrimitive *zArrow;
+	
+		ScenePrimitive *xBox;
+		ScenePrimitive *yBox;
+		ScenePrimitive *zBox;
+	
+		ScenePrimitive *outerCircle;
+		ScenePrimitive *bgCircle;
+	
+		ScenePrimitive *pitchCircle;
+		ScenePrimitive *yawCircle;
+		ScenePrimitive *rollCircle;
+	
 };
 
 class TransformGizmoMenu : public UIElement {
@@ -232,10 +232,10 @@ class TransformGizmoMenu : public UIElement {
 		
 	private:
 	
-        UIIconSelector *transformSelector;
-        UIComboBox *orientationCombo;
-        UIIconSelector *centerSelector;
-    
+		UIIconSelector *transformSelector;
+		UIComboBox *orientationCombo;
+		UIIconSelector *centerSelector;
+	
 		TransformGizmo *gizmo;
 };
 

+ 9 - 9
include/polycode/modules/TUIO/TuioClient.h

@@ -65,7 +65,7 @@ namespace TUIO {
 		/**
 		 * This constructor creates a TuioClient that listens to the provided port
 		 *
-		 * @param  port  the incoming TUIO UDP port number, defaults to 3333 if no argument is provided
+		 * @param  port	 the incoming TUIO UDP port number, defaults to 3333 if no argument is provided
 		 */
 		TuioClient(int port=3333);
 
@@ -78,7 +78,7 @@ namespace TUIO {
 		 * The TuioClient starts listening to TUIO messages on the configured UDP port
 		 * All received TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners
 		 *
-		 * @param  lock  running in the background if set to false (default)
+		 * @param  lock	 running in the background if set to false (default)
 		 */
 		void connect(bool lock=false);
 
@@ -96,35 +96,35 @@ namespace TUIO {
 		/**
 		 * Adds the provided TuioListener to the list of registered TUIO event listeners
 		 *
-		 * @param  listener  the TuioListener to add
+		 * @param  listener	 the TuioListener to add
 		 */
 		void addTuioListener(TuioListener *listener);
 
 		/**
 		 * Removes the provided TuioListener from the list of registered TUIO event listeners
 		 *
-		 * @param  listener  the TuioListener to remove
+		 * @param  listener	 the TuioListener to remove
 		 */
 		void removeTuioListener(TuioListener *listener);
 
 		/**
 		 * Removes all TuioListener from the list of registered TUIO event listeners
 		 */
-		void removeAllTuioListeners() {	
+		void removeAllTuioListeners() { 
 			listenerList.clear();
 		}
 
 		/**
 		 * Returns a List of all currently active TuioObjects
 		 *
-		 * @return  a List of all currently active TuioObjects
+		 * @return	a List of all currently active TuioObjects
 		 */
 		std::list<TuioObject*> getTuioObjects();
 		
 		/**
 		 * Returns a List of all currently active TuioCursors
 		 *
-		 * @return  a List of all currently active TuioCursors
+		 * @return	a List of all currently active TuioCursors
 		 */
 		std::list<TuioCursor*> getTuioCursors();
 
@@ -132,7 +132,7 @@ namespace TUIO {
 		 * Returns the TuioObject corresponding to the provided Session ID
 		 * or NULL if the Session ID does not refer to an active TuioObject
 		 *
-		 * @return  an active TuioObject corresponding to the provided Session ID or NULL
+		 * @return	an active TuioObject corresponding to the provided Session ID or NULL
 		 */
 		TuioObject* getTuioObject(long s_id);
 
@@ -140,7 +140,7 @@ namespace TUIO {
 		 * Returns the TuioCursor corresponding to the provided Session ID
 		 * or NULL if the Session ID does not refer to an active TuioCursor
 		 *
-		 * @return  an active TuioCursor corresponding to the provided Session ID or NULL
+		 * @return	an active TuioCursor corresponding to the provided Session ID or NULL
 		 */
 		TuioCursor* getTuioCursor(long s_id);
 

+ 1 - 1
include/polycode/modules/TUIO/TuioContainer.h

@@ -244,7 +244,7 @@ namespace TUIO {
 			TuioPoint::update(tcon);
 			x_speed = tcon->getXSpeed();
 			y_speed =  tcon->getYSpeed();
-			motion_speed =  tcon->getMotionSpeed();
+			motion_speed =	tcon->getMotionSpeed();
 			motion_accel = tcon->getMotionAccel();
 			
 			TuioPoint p(tcon->getTuioTime(),xpos,ypos);

+ 2 - 2
include/polycode/modules/TUIO/TuioCursor.h

@@ -47,7 +47,7 @@ namespace TUIO {
 		 * Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor.
 		 *
 		 * @param	ttime	the TuioTime to assign
-		 * @param	si	the Session ID  to assign
+		 * @param	si	the Session ID	to assign
 		 * @param	ci	the Cursor ID  to assign
 		 * @param	xp	the X coordinate to assign
 		 * @param	yp	the Y coordinate to assign
@@ -60,7 +60,7 @@ namespace TUIO {
 		 * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate 
 		 * and assigs these values to the newly created TuioCursor.
 		 *
-		 * @param	si	the Session ID  to assign
+		 * @param	si	the Session ID	to assign
 		 * @param	ci	the Cursor ID  to assign
 		 * @param	xp	the X coordinate to assign
 		 * @param	yp	the Y coordinate to assign

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません