Răsfoiți Sursa

Updated doxygen documentation in multiple classes, removed a few deprecated and unused methods and parameters, SceneMesh now deletes mesh if ownsMesh upon loading from file

Ivan Safrin 11 ani în urmă
părinte
comite
049a820d3d

+ 23 - 6
Core/Contents/Include/PolyBezierCurve.h

@@ -157,26 +157,43 @@ namespace Polycode {
 		*/																				
 		*/																				
 		Vector3 getPointBetween(Number a, BezierPoint *bp1, BezierPoint *bp2);
 		Vector3 getPointBetween(Number a, BezierPoint *bp1, BezierPoint *bp2);
 
 
+        /**
+         * Removes all curve control points.
+         */
 		void clearControlPoints();
 		void clearControlPoints();
         
         
+        /**
+         * Returns the Y-axis value of the curve at specified X-axis value.
+         */
         Number getYValueAtX(Number x);
         Number getYValueAtX(Number x);
+
+        /**
+         * Returns the normalized curve position value at specified X-axis value.
+         */
 		Number getTValueAtX(Number x);
 		Number getTValueAtX(Number x);
 		
 		
 		/**
 		/**
-		* Removes (and deletes!) a given point by pointer
+		* Removes (and deletes!) a given point by pointer.
 		*/
 		*/
 		void removePoint(BezierPoint *point);
 		void removePoint(BezierPoint *point);
         
         
+        /**
+        * 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;
 		BezierPoint *insertPoint;
-
-		std::vector<BezierPoint*> controlPoints;
-		std::vector<Number> distances;
-		
-		void recalculateDistances();
 		
 		
+        /**
+         * 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;
         Number evaluationAccuracy;
+        
+        void recalculateDistances();        
 		
 		
 		protected:
 		protected:
+        
+            std::vector<BezierPoint*> controlPoints;
+            std::vector<Number> distances;
 		
 		
             Number minX;
             Number minX;
             Number maxX;
             Number maxX;

+ 93 - 6
Core/Contents/Include/PolyCamera.h

@@ -58,7 +58,7 @@ namespace Polycode {
 			/** ProjectionMode: Perspective projection, with bounds set by edges of frustum. */
 			/** ProjectionMode: Perspective projection, with bounds set by edges of frustum. */
 			static const int PERSPECTIVE_FRUSTUM = 5;
 			static const int PERSPECTIVE_FRUSTUM = 5;
         
         
-            /** ProjectionMode: Manual matrix projection. */
+            /** ProjectionMode: Manual matrix projection. Use setProjectionMatrix to set the matrix. */
             static const int MANUAL_MATRIX = 6;
             static const int MANUAL_MATRIX = 6;
         
         
 
 
@@ -69,6 +69,9 @@ namespace Polycode {
 			Camera(Scene *parentScene);
 			Camera(Scene *parentScene);
 			virtual ~Camera();
 			virtual ~Camera();
 			
 			
+            /**
+             * Builds the frustum clipping planes for this camera using the current render modelview and the camera's projection matrices.
+             */
 			void buildFrustumPlanes();
 			void buildFrustumPlanes();
 			
 			
 			/**
 			/**
@@ -80,6 +83,11 @@ namespace Polycode {
 			*/								
 			*/								
 			bool isSphereInFrustum(const Vector3 &pos, Number fRadius);
 			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);
             bool isAABBInFrustum(const AABB &aabb);
 			
 			
 			/**
 			/**
@@ -90,6 +98,11 @@ namespace Polycode {
 			*/			
 			*/			
 			void setOrthoMode(bool mode);
 			void setOrthoMode(bool mode);
 
 
+            /**
+             * Sets the orthographic size of the camera.
+             * @param orthoSizeX Orthographic width
+             * @param orthoSizeY Orthographic height
+             */
 			void setOrthoSize(Number orthoSizeX, Number orthoSizeY);
 			void setOrthoSize(Number orthoSizeX, Number orthoSizeY);
 			
 			
 			/** Switches into frustum mode and sets up the planes. */
 			/** Switches into frustum mode and sets up the planes. */
@@ -132,23 +145,55 @@ namespace Polycode {
 				return fov;
 				return fov;
 			}
 			}
 			
 			
+            /**
+             * Sets the clipping planes for the camera.
+             * @param nearClipPlane Near clipping plane.
+             * @param farClipPlane Far clipping plane.
+             */
 			void setClippingPlanes(Number nearClipPlane, Number farClipPlane);
 			void setClippingPlanes(Number nearClipPlane, Number farClipPlane);
         
         
-        
+            /**
+             * Returns the near clipping plane of the camera.
+             * @return Near clipping plane of the camera.
+             */
 			Number getNearClippingPlane();
 			Number getNearClippingPlane();
+        
+            /**
+             * Returns the far clipping plane of the camera.
+             * @return Far clipping plane of the camera.
+             */
 			Number getFarClippingPlane();
 			Number getFarClippingPlane();
         
         
+            /**
+             * Sets the parent scene of the camera.
+             * @param parentScene New parent scene.
+             */
 			void setParentScene(Scene *parentScene);
 			void setParentScene(Scene *parentScene);
+        
+            /**
+             * Returns the camera's parent scene.
+             * @return The camera's parent scene.
+             */
             Scene *getParentScene() const;
             Scene *getParentScene() const;
 			
 			
+            /**
+             * Sets the renderer viewport and projection/modelview matrices based on the camera's setting and transform.
+             */
 			void doCameraTransform();
 			void doCameraTransform();
-			void setLightDepthTexture(Texture *texture);			
 
 
+            /**
+             * Check if camera has a post filter material applied
+             * @return True if the camera has a filter material applied.
+             */
 			bool hasFilterShader();
 			bool hasFilterShader();
+        
+            /**
+             * Binds target buffers and renders the scene in multiple passes based on the post filter material.
+             */
 			void drawFilter(Texture *targetTexture = NULL, Number targetTextureWidth = 0.0, Number targetTextureHeight = 0.0, Texture *targetColorTexture = NULL, Texture *targetZTexture = NULL);
 			void drawFilter(Texture *targetTexture = NULL, Number targetTextureWidth = 0.0, Number targetTextureHeight = 0.0, Texture *targetColorTexture = NULL, Texture *targetZTexture = NULL);
 			
 			
 			/**
 			/**
-			* Sets the exposure for the camera. The exposure value can be passed to a shader for HDR rendering.
+			* Sets the exposure for the camera. The exposure value is passed automatically to  post material shaders using an "exposure" uniform.
 			* @param level The new exposure value.
 			* @param level The new exposure value.
 			*/						
 			*/						
 			void setExposureLevel(Number level) {
 			void setExposureLevel(Number level) {
@@ -185,21 +230,50 @@ namespace Polycode {
 			*/
 			*/
 			std::vector<ShaderBinding*> getLocalShaderOptions() { return localShaderOptions; }
 			std::vector<ShaderBinding*> getLocalShaderOptions() { return localShaderOptions; }
 			
 			
+            /**
+             * Returns the number of local material shader options.
+             * @return Number of local material shader options.
+             */
             unsigned int getNumLocalShaderOptions() const;
             unsigned int getNumLocalShaderOptions() const;
+        
+            /**
+             * Returns the shader option binding at the specified shader index.
+             * @param Specified shader index.
+             * @return Shader binding at specified shader index or NULL if index is out of bounds.
+             */
             ShaderBinding* getLocalShaderOption(unsigned int index) const;
             ShaderBinding* getLocalShaderOption(unsigned int index) const;
         
         
 			/**
 			/**
 			* Returns the shader material applied to the camera.
 			* Returns the shader material applied to the camera.
 			*/			
 			*/			
 			Material *getScreenShaderMaterial() { return filterShaderMaterial; }	
 			Material *getScreenShaderMaterial() { return filterShaderMaterial; }	
-			
-        
+
+            /**
+             * Clones the camera.
+             */
             virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
             virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
+
+            /**
+             * Applies clone parameters to the camera.
+             */
             virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
             virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
 			
 			
+            /**
+             * Returns the camera's projection matrix.
+             * @return Projection matrix.
+             */
 			Matrix4 getProjectionMatrix();
 			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 setProjectionMatrix(Matrix4 matrix);
             void setProjectionMatrix(Matrix4 matrix);
 			
 			
+            /**
+             * Return's the camera's pixel viewport based on the last render pass.
+             */
 			Polycode::Rectangle getViewport();
 			Polycode::Rectangle getViewport();
 			
 			
 			/**
 			/**
@@ -207,6 +281,9 @@ namespace Polycode {
 			*/
 			*/
 			bool frustumCulling;
 			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.
+             */ 
 			bool topLeftOrtho;
 			bool topLeftOrtho;
 		
 		
             /**
             /**
@@ -219,7 +296,17 @@ namespace Polycode {
 			/** @deprecated use getProjectionMode() */
 			/** @deprecated use getProjectionMode() */
 			int getOrthoSizeMode() const { return projectionMode; }
 			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.
+             */
 			void setProjectionMode(int mode);
 			void setProjectionMode(int mode);
+        
+            /**
+             * Returns the current projection mode.
+             * @return Current projection mode.
+             */
 			int getProjectionMode() const { return projectionMode; }
 			int getProjectionMode() const { return projectionMode; }
 
 
 
 

+ 1 - 1
Core/Contents/Include/PolyColor.h

@@ -196,7 +196,7 @@ namespace Polycode {
 			/**
 			/**
 			* Returns a new color after blending the second color with specified blending mode. 
 			* Returns a new color after blending the second color with specified blending mode. 
 			* @param c2 Color to blend with
 			* @param c2 Color to blend with
-			* @param mode Blending mode to use. Currently possible values are Color::BLEND_NORMAL, Color::BLEND_COLOR
+			* @param mode Blending mode to use. Currently possible values are Color::BLEND_NORMAL, Color::BLEND_REPLACE_COLOR and Color::BLEND_ADDITIVE
 			* @param amount Amount to blend.
 			* @param amount Amount to blend.
 			*/
 			*/
 			Color blendColor(Color c2, int mode, Number amount, Color c3 = Color());
 			Color blendColor(Color c2, int mode, Number amount, Color c3 = Color());

+ 20 - 3
Core/Contents/Include/PolyCoreInput.h

@@ -134,12 +134,18 @@ namespace Polycode {
 		
 		
 		/**
 		/**
 		* Returns joystick info for specified joystick index.
 		* Returns joystick info for specified joystick index.
-		* @param index Joystick index. Must be less than getNumJoysticks()
+		* @param index Joystick index. Returns NULL if index is invalid.
 		* @return Joystick info for specified joystick.
 		* @return Joystick info for specified joystick.
 		* @see JoystickInfo
 		* @see JoystickInfo
 		*/
 		*/
 		JoystickInfo *getJoystickInfoByIndex(unsigned int index);
 		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
+         */
 		JoystickInfo *getJoystickInfoByID(unsigned int deviceID);
 		JoystickInfo *getJoystickInfoByID(unsigned int deviceID);
 		void addJoystick(unsigned int deviceID);
 		void addJoystick(unsigned int deviceID);
 		void removeJoystick(unsigned int deviceID);
 		void removeJoystick(unsigned int deviceID);
@@ -161,14 +167,25 @@ namespace Polycode {
 		static InputEvent *createEvent(Event *event){ return (InputEvent*)event; }
 		static InputEvent *createEvent(Event *event){ return (InputEvent*)event; }
 		
 		
 		/**
 		/**
-		* If set to true, will fire touch events on mouse input.
+		* If set to true, will fire touch events on mouse input. Defaults to false.
 		*/
 		*/
 		bool simulateTouchWithMouse;
 		bool simulateTouchWithMouse;
-		bool simulateMouseWithTouch;		
+
+        /**
+         * 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.
+         */
 		bool ignoreOffScreenTouch;	
 		bool ignoreOffScreenTouch;	
 		
 		
 		void clearInput();
 		void clearInput();
 		
 		
+        /**
+        * If set to false, will ignore repeat system keypress events if a key is already pressed-down. Defaults to true.
+        */
         bool keyRepeat;
         bool keyRepeat;
 		
 		
 		std::vector<JoystickInfo> joysticks;
 		std::vector<JoystickInfo> joysticks;

+ 223 - 52
Core/Contents/Include/PolyEntity.h

@@ -147,8 +147,16 @@ namespace Polycode {
 			*/
 			*/
 			Matrix4 getConcatenatedMatrix();
 			Matrix4 getConcatenatedMatrix();
 			
 			
+            /**
+             * 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);
 			Matrix4 getConcatenatedMatrixRelativeTo(Entity *relativeEntity);
 			
 			
+            /**
+             * Returns the concatenated matrix, multiplied by the entity's anchor adjustment.
+             * @see setAnchorPoint
+             */
 			Matrix4 getAnchorAdjustedMatrix();
 			Matrix4 getAnchorAdjustedMatrix();
 			
 			
 			/** 
 			/** 
@@ -192,9 +200,24 @@ namespace Polycode {
 			*/
 			*/
 			virtual void removeChild(Entity *entityToRemove);
 			virtual void removeChild(Entity *entityToRemove);
 
 
+            /**
+             * Moves the specified child one position up the render list.
+             */
 			void moveChildUp(Entity *child);
 			void moveChildUp(Entity *child);
+        
+            /**
+             * Moves the specified child one position down the render list.
+             */
 			void moveChildDown(Entity *child);
 			void moveChildDown(Entity *child);
+        
+            /**
+             * Moves the specified child up to the top of the render list.
+             */
 			void moveChildTop(Entity *child);
 			void moveChildTop(Entity *child);
+        
+            /**
+             * Moves the specified child up to the bottom of the render list.
+             */
 			void moveChildBottom(Entity *child);
 			void moveChildBottom(Entity *child);
 
 
 			/**
 			/**
@@ -227,7 +250,10 @@ namespace Polycode {
 			*/ 
 			*/ 
 			bool ownsChildren;										
 			bool ownsChildren;										
 			
 			
-				
+			/**
+             * Sets the ownsChildren flag for this entity and recursively for all its child entities.
+             * @see ownsChildren
+             */
 			void setOwnsChildrenRecursive(bool val);
 			void setOwnsChildrenRecursive(bool val);
 			//@}
 			//@}
 			// ----------------------------------------------------------------------------------------------------------------
 			// ----------------------------------------------------------------------------------------------------------------
@@ -244,6 +270,9 @@ namespace Polycode {
 			*/			
 			*/			
 			Vector3 getPosition() const;
 			Vector3 getPosition() const;
 			
 			
+            /**
+             * Returns the entity's position as a Vector2
+             */
 			Vector2 getPosition2D() const;
 			Vector2 getPosition2D() const;
 			
 			
 			/**
 			/**
@@ -447,29 +476,51 @@ namespace Polycode {
 			* @return Current roll value.
 			* @return Current roll value.
 			*/																										
 			*/																										
 			Number getRoll() const;
 			Number getRoll() const;
-			
+			     
+            /**
+             * Returns the bounding box X value.
+             */
 			Number getWidth() const;
 			Number getWidth() const;
 
 
+            /**
+             * Returns the bounding box Y value.
+             */
 			Number getHeight() const;
 			Number getHeight() const;
 
 
+            /**
+             * Returns the bounding box Z value.
+             */
 			Number getDepth() const;
 			Number getDepth() const;
 			
 			
+            /**
+             * Sets the bounding box X value.
+             */
 			void setWidth(Number width);
 			void setWidth(Number width);
+        
+            /**
+             * Sets the bounding box Y value.
+             */
 			void setHeight(Number height);
 			void setHeight(Number height);
+        
+            /**
+             * Sets the bounding box Z value.
+             */
 			void setDepth(Number depth);
 			void setDepth(Number depth);
 			
 			
 			/**
 			/**
 			* Sets the rotation with quaternion value.
 			* Sets the rotation with quaternion value.
-			* @param Current yaw value.
-			*/																									
+			*/
 			void setRotationQuat(Number w, Number x, Number y, Number z);
 			void setRotationQuat(Number w, Number x, Number y, Number z);
-			
+
+            /*
+            * Sets the rotation with quaternion value.
+            */
 			void setRotationByQuaternion(const Quaternion &quaternion);
 			void setRotationByQuaternion(const Quaternion &quaternion);
 			
 			
 			/**
 			/**
 			* Returns the current rotation as a quaternion.
 			* Returns the current rotation as a quaternion.
 			* @return Current rotation value.
 			* @return Current rotation value.
-			*/																												
+			*/
 			Quaternion getRotationQuat() const;
 			Quaternion getRotationQuat() const;
 			
 			
 			/**
 			/**
@@ -481,7 +532,7 @@ namespace Polycode {
 			
 			
 			/**
 			/**
 			* Orients the entity towards another entity with the provided up vector. The up vector determines which side of the entity will be pointing in that direction.
 			* Orients the entity towards another entity 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.
+			* @param entity Entity to look at.
 			* @param upVector The up vector.
 			* @param upVector The up vector.
 			* @see lookAt()
 			* @see lookAt()
 			*/																																		
 			*/																																		
@@ -518,16 +569,25 @@ namespace Polycode {
 			void setColor(Color color);
 			void setColor(Color color);
 
 
 			//@}
 			//@}
-			// ----------------------------------------------------------------------------------------------------------------
-	
-			/** @name Bounding box operations.
-			*  These methods modify the bounding box of the entity. The bounding box is used for culling and collision detection.
-			*/
-			//@{			
-	
+
 			
 			
+            /**
+             * 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);
 			void setAnchorPoint(const Vector3 &anchorPoint);
-			void setAnchorPoint(Number x, Number y, Number z);			
+        
+            /**
+             * 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.
+             */
 			Vector3 getAnchorPoint() const;
 			Vector3 getAnchorPoint() const;
 			
 			
 			virtual MouseEventResult onMouseDown(const Ray &ray, int mouseButton, int timestamp);
 			virtual MouseEventResult onMouseDown(const Ray &ray, int mouseButton, int timestamp);
@@ -536,19 +596,11 @@ namespace Polycode {
 			virtual MouseEventResult onMouseWheelUp(const Ray &ray, int timestamp);
 			virtual MouseEventResult onMouseWheelUp(const Ray &ray, int timestamp);
 			virtual MouseEventResult onMouseWheelDown(const Ray &ray, int timestamp);
 			virtual MouseEventResult onMouseWheelDown(const Ray &ray, int timestamp);
 
 
-			//@}			
-			// ----------------------------------------------------------------------------------------------------------------
 		
 		
 			/** @name Rendering properties
 			/** @name Rendering properties
 			*  Methods and properties affecting the way the entity is rendered.
 			*  Methods and properties affecting the way the entity is rendered.
 			*/
 			*/
-			//@{			
-		
-		
-			/**
-			* You can set a custom string identifier for user purposes.
-			*/									
-			String custEntityType;
+			//@{
 								
 								
 			/**
 			/**
 			* If this flag is true, the entity will always face the camera. False by default.
 			* If this flag is true, the entity will always face the camera. False by default.
@@ -566,8 +618,6 @@ namespace Polycode {
 			*/
 			*/
 			bool billboardIgnoreScale;
 			bool billboardIgnoreScale;
 
 
-
-
 			/**
 			/**
 			* The entity's color.
 			* The entity's color.
 			*/					
 			*/					
@@ -595,6 +645,7 @@ namespace Polycode {
 			
 			
 			/**
 			/**
 			* Entity blending mode. Possible values are Renderer::BLEND_MODE_NONE, Renderer::BLEND_MODE_NORMAL, Renderer::BLEND_MODE_LIGHTEN, Renderer::BLEND_MODE_COLOR, Renderer::BLEND_MODE_PREMULTIPLIED, Renderer::BLEND_MODE_MULTIPLY. See the Renderer class for details on individual blending modes.
 			* Entity blending mode. Possible values are Renderer::BLEND_MODE_NONE, Renderer::BLEND_MODE_NORMAL, Renderer::BLEND_MODE_LIGHTEN, Renderer::BLEND_MODE_COLOR, Renderer::BLEND_MODE_PREMULTIPLIED, Renderer::BLEND_MODE_MULTIPLY. See the Renderer class for details on individual blending modes.
+                This blending mode is overridden by the material.
 			*/
 			*/
 			int blendingMode;	
 			int blendingMode;	
 			
 			
@@ -607,7 +658,6 @@ namespace Polycode {
 			* If set to false, the children will be rendered even if the entity is invisible.
 			* 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.
 			* 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.
@@ -639,90 +689,211 @@ namespace Polycode {
 			*/
 			*/
 			void setBlendingMode(int newBlendingMode);
 			void setBlendingMode(int newBlendingMode);
 			
 			
+            /**
+             * 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;
 			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.
+             */
 			std::vector<Entity*> getEntitiesByTag(String tag, bool recursive) const;
 			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;
             std::vector<Entity*> getEntitiesByLayerID(unsigned char layerID, bool recursive) const;
         
         
-        
-			std::vector <EntityProp> entityProps;
+            /** 
+             * 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);
 			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.
+             */
 			void setEntityProp(const String& propName, const String& propValue);
 			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.
+             */
 			void setInverseY(bool val);
 			void setInverseY(bool val);
+        
+            /**
+             * Returns true if the entity is set to use an inverse Y-coordinate system.
+             */
 			bool getInverseY();
 			bool getInverseY();
 			
 			
 			void doUpdates();				
 			void doUpdates();				
 			virtual Matrix4 buildPositionMatrix();
 			virtual Matrix4 buildPositionMatrix();
 			void setRenderer(Renderer *renderer);
 			void setRenderer(Renderer *renderer);
 			
 			
+            /**
+             * 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; }			
 			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.
+             */
 			bool ignoreParentMatrix;
 			bool ignoreParentMatrix;
 						
 						
-			bool enableScissor;	
+            /**
+             * 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
+             */
 			Polycode::Rectangle scissorBox;			
 			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.
+             */
 			bool editorOnly;
 			bool editorOnly;
-	
-			/** @name Class and ID strings
-			*  These properties can be used to set and retrieve string-based ids and
-			* tags
-			*/
-			//@{			
 
 
+            /**
+             * String ID of the entity. Can be used to retrieve specific entities by their ID.
+             */
 			String id;
 			String id;
 
 
+            /**
+             * Returns the number of tags this entity has.
+             */
 			unsigned int getNumTags() const;
 			unsigned int getNumTags() const;
+        
+            /**
+             * Returns the tag at specified index or an empty string if index is invalid.
+             */
 			String getTagAtIndex(unsigned int index) const;
 			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.
+             */
 			bool hasTag(String tag) const;
 			bool hasTag(String tag) const;
 			
 			
+            /**
+             * Removes all tags from this entity.
+             */
 			void clearTags();
 			void clearTags();
-			void addTag(String tag); 
-
-			//@}
         
         
-			/**
-			* If set to true, will cast shadows (Defaults to true).
-			*/
-			bool castShadows;
+            /**
+             * Adds a string tag to the entity.
+             * @param tag Tag to add.
+             */
+			void addTag(String tag);
 			
 			
-			int collisionShapeType;	
-			bool processInputEvents;			
+            /**
+             * 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!
+             */
+			bool processInputEvents;
+        
+            /**
+             * If set to true, will block input events for entities below itself in the parent's entiy list.
+             */
 			bool blockMouseInput;
 			bool blockMouseInput;
-																					
-			void setHitbox(Number width, Number height) {}
+						
+		
+            /** 
+             * 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);
             Vector2 getScreenPosition(const Matrix4 &projectionMatrix, const Matrix4 &cameraMatrix, const Polycode::Rectangle &viewport);
+        
+            /**
+             * Returns the screen pixel position of the entity using the last projection matrix, camera matrix and viewport that were set in the renderer.
+             * @return Pixel position of the entity on the screen.
+             */
 			Vector2 getScreenPositionForMainCamera();
 			Vector2 getScreenPositionForMainCamera();
 
 
-			bool hitTest(Number x, Number y) const { return false; }
-			bool hitTest(Vector2 v) const { return false; }
 
 
-			bool snapToPixels;			
+            /**
+             * 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;
 			bool mouseOver;
         
         
+            /**
+             * Sets the default blending mode for all created entities.
+             */
             static int defaultBlendingMode;
             static int defaultBlendingMode;
         
         
             void recalculateAABBAllChildren();
             void recalculateAABBAllChildren();
             void recalculateAABB();
             void recalculateAABB();
         
         
-            /*
+            /**
              Return axis-aligned bounding box in world space.
              Return axis-aligned bounding box in world space.
              */
              */
             AABB getWorldAABB();
             AABB getWorldAABB();
         
         
+            /**
+             * Returns the bounding box of the entity. This is used for hit-testing as well as visibility calculation.
+             */
             Vector3 getLocalBoundingBox();
             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);
             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);
             void setLocalBoundingBox(Number x, Number y, Number z);
+        
+            /**
+             * Sets the bounding box X-axis value of the entity.
+             */
             void setLocalBoundingBoxX(Number x);
             void setLocalBoundingBoxX(Number x);
+        
+            /**
+             * Sets the bounding box Y-axis value of the entity.
+             */
             void setLocalBoundingBoxY(Number y);
             void setLocalBoundingBoxY(Number y);
+
+            /**
+             * Sets the bounding box Z-axis value of the entity.
+             */
             void setLocalBoundingBoxZ(Number z);
             void setLocalBoundingBoxZ(Number z);
         
         
             bool rendererVis;
             bool rendererVis;
         
         
+            /**
+            * Layer ID. Used by entity instances to separate entities into groups.
+            */
             unsigned char layerID;
             unsigned char layerID;
 
 
+            std::vector <EntityProp> entityProps;
+        
 		protected:
 		protected:
+        
 		
 		
             AABB aabb;
             AABB aabb;
             Vector3 bBox;
             Vector3 bBox;

+ 10 - 0
Core/Contents/Include/PolyEventDispatcher.h

@@ -65,8 +65,18 @@ typedef struct {
 			*/						
 			*/						
 			void addEventListener(EventHandler *handler, int eventCode);
 			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.
+             */
 			void addEventListenerUnique(EventHandler *handler, int eventCode);
 			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);
             bool hasEventListener(EventHandler *handler, int eventCode);
         
         
 			/**
 			/**

+ 15 - 0
Core/Contents/Include/PolyFontManager.h

@@ -60,11 +60,26 @@ namespace Polycode {
 		*/		
 		*/		
 		Font *getFontByName(const String& fontName);
 		Font *getFontByName(const String& fontName);
 		
 		
+        /**
+         * Returns number of registered fonts.
+         */
 		unsigned int getNumFonts() const;
 		unsigned int getNumFonts() const;
+        
+        /**
+         * Returns the font entry by specified index or NULL if index is invalid.
+         */
 		FontEntry *getFontEntryByIndex(const unsigned int index);
 		FontEntry *getFontEntryByIndex(const unsigned int index);
 
 
+        /**
+         * Returns the font entry based on the font path or NULL if no fonts are registered with the specified path.
+         */
 		FontEntry *getFontEntryByFontPath(const String &fontPath);
 		FontEntry *getFontEntryByFontPath(const String &fontPath);
 		
 		
+        /**
+         * Removes the font entry from manager and optionally delets the associated Font.
+         * @param entry FontEntry to remove.
+
+         */
 		void removeFontEntry(FontEntry *entry, bool deleteFont);
 		void removeFontEntry(FontEntry *entry, bool deleteFont);
 		
 		
 	private:
 	private:

+ 3 - 12
Core/Contents/Include/PolyImage.h

@@ -198,18 +198,6 @@ namespace Polycode {
 			void fastBlurVert(int blurSize);
 			void fastBlurVert(int blurSize);
 			void fastBlurHor(int blurSize);
 			void fastBlurHor(int blurSize);
 			
 			
-			/**
-			* Blurs the image using gaussian blur
-			* @param radius Radius of the blur
-			* @param deviation Standard deviation of the gaussian distribution
-			*/															
-			void gaussianBlur(float radius, float deviation);
-			float* createKernel(float radius, float deviation);
-			
-			// What are these??? I wrote them way too long ago.
-			void darken(Number amt, bool color, bool alpha);
-			void lighten(Number amt, bool color, bool alpha);
-			void multiply(Number amt, bool color, bool alpha);
 						
 						
 			/**
 			/**
 			* Returns an area of the image buffer. The area can go outside of image bounds, in which case the pixels not within the image are zeroed out. This method allocates new memory for the returned buffer and you must free it manually.
 			* Returns an area of the image buffer. The area can go outside of image bounds, in which case the pixels not within the image are zeroed out. This method allocates new memory for the returned buffer and you must free it manually.
@@ -260,6 +248,9 @@ namespace Polycode {
 			*/						
 			*/						
 			char *getPixels();
 			char *getPixels();
 			
 			
+            /**
+             * Multiplies the RGB values by alpha for each pixel.
+             */
 			void premultiplyAlpha();
 			void premultiplyAlpha();
 		
 		
 			static const int IMAGE_RGB = 0;
 			static const int IMAGE_RGB = 0;

+ 100 - 11
Core/Contents/Include/PolyLabel.h

@@ -56,53 +56,142 @@ namespace Polycode {
 			unsigned int rangeEnd;			
 			unsigned int rangeEnd;			
 	};
 	};
 
 
+	/**
+     * 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 {
 	class _PolyExport Label : public Image {
 		public:
 		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
+             */
 			Label(Font *font, const String& text, int size, int antiAliasMode, bool premultiplyAlpha = false);
 			Label(Font *font, const String& text, int size, int antiAliasMode, bool premultiplyAlpha = false);
 			virtual ~Label();
 			virtual ~Label();
+        
+            /**
+             * Sets the text of the label.
+             * @param text Text to set.
+             */
 			void setText(const String& text);
 			void setText(const String& text);
+        
+            /**
+             * Returns the current text of the label.
+             * @return Current text.
+             */
 			const String& getText() const;
 			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.
+             */
 			int getTextWidthForString(const String& 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.
+             */
 			int getTextHeightForString(const String& text);
 			int getTextHeightForString(const String& text);
 
 
-			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, Color glyphColor);
-					
+            /**
+             * Returns the width of the current text.
+             * @return Width of the current text.
+             */
 			Number getTextWidth() const;
 			Number getTextWidth() const;
+        
+            /**
+             * Returns the height of the current text.
+             * @return Height of the current text.
+             */
 			Number getTextHeight() const;
 			Number getTextHeight() const;
 		
 		
-			void 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);
 			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.
+             */
 			Color getColorForIndex(unsigned int index);
 			Color getColorForIndex(unsigned int index);
         
         
+            /**
+             * Returns the premultiply alpha setting.
+             */
             bool getPremultiplyAlpha() const;
             bool getPremultiplyAlpha() const;
+        
+            /**
+             * If set to true, will premultiply alpha when text is set to the label.
+             */
             void setPremultiplyAlpha(bool val);
             void setPremultiplyAlpha(bool val);
 		
 		
+            /**
+             * Sets the Font used to render text in the label.
+             * @see Font
+             */
 			void setFont(Font *newFont);
 			void setFont(Font *newFont);
+        
+            /**
+             * Returns the Font currently used to render text in the label.
+             * @see Font
+             */
 			Font *getFont() const;
 			Font *getFont() const;
 			
 			
+            /**
+             * Sets the vertical pixel size of text rendered in the label.
+             */
 			void setSize(int newSize);
 			void setSize(int newSize);
+        
+            /**
+             * Return the current vertical pixel size of text rendered in the label.
+             */
 			unsigned int getSize() const;
 			unsigned int getSize() const;
 			
 			
-			int getAntialiasMode() const;			
+            /**
+             * 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.
+             */
 			void setAntialiasMode(int newMode);
 			void setAntialiasMode(int newMode);
-			
-			bool optionsChanged();
 					
 					
 			static const int ANTIALIAS_FULL = 0;
 			static const int ANTIALIAS_FULL = 0;
 			static const int ANTIALIAS_NONE = 1;
 			static const int ANTIALIAS_NONE = 1;
 			static const int ANTIALIAS_STRONG = 2;			
 			static const int ANTIALIAS_STRONG = 2;			
 			
 			
+            /**
+             * Returns the pixel distance from top of image to the baseline of the rendered text.
+             */
 			int getBaselineAdjust();
 			int getBaselineAdjust();
+        
+			bool optionsChanged();
 			
 			
 		protected:
 		protected:
+        
+            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, Color glyphColor);
 		
 		
 			bool _optionsChanged;
 			bool _optionsChanged;
 			GlyphData labelData;
 			GlyphData labelData;

+ 13 - 4
Core/Contents/Include/PolySceneManager.h

@@ -31,21 +31,30 @@ namespace Polycode {
 	class SceneRenderTexture;
 	class SceneRenderTexture;
 	class Renderer;
 	class Renderer;
 	
 	
+	/**
+     * This class manages all rendered scenes in Polycode.
+     */
 	class _PolyExport SceneManager : public PolyBase {
 	class _PolyExport SceneManager : public PolyBase {
 		public:
 		public:
 		SceneManager();
 		SceneManager();
 		~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.
+         */
 		void addScene(Scene *newScene);
 		void addScene(Scene *newScene);
+
+        /**
+         * Removes scene from the render loop (does not delete the scene).
+         */
+		void removeScene(Scene *scene);
+        
+        // Polycode internal
 		void Update();
 		void Update();
 		void Render();
 		void Render();
-		
 		void renderVirtual();
 		void renderVirtual();
-				
-		void removeScene(Scene *scene);	
 		void registerRenderTexture(SceneRenderTexture *renderTexture);
 		void registerRenderTexture(SceneRenderTexture *renderTexture);
 		void unregisterRenderTexture(SceneRenderTexture *renderTexture);
 		void unregisterRenderTexture(SceneRenderTexture *renderTexture);
-
 		void setRenderer(Renderer *renderer);
 		void setRenderer(Renderer *renderer);
 				
 				
 		private:
 		private:

+ 46 - 2
Core/Contents/Include/PolySceneMesh.h

@@ -72,6 +72,9 @@ namespace Polycode {
 			
 			
 			void Render();
 			void Render();
 			
 			
+            /**
+             * Returns the local material binding options for this mesh.
+             */
 			ShaderBinding *getLocalShaderOptions();
 			ShaderBinding *getLocalShaderOptions();
 			
 			
 			/**
 			/**
@@ -150,22 +153,49 @@ namespace Polycode {
 			* If this is set to true, the mesh will be cached to a hardware vertex buffer if those are available. This can dramatically speed up rendering.
 			* If this is set to true, the mesh will be cached to a hardware vertex buffer if those are available. This can dramatically speed up rendering.
 			*/
 			*/
 			void cacheToVertexBuffer(bool cache);
 			void cacheToVertexBuffer(bool cache);
-				
+			
+            /**
+             * Sets the line width for line-based meshes.
+             */
 			void setLineWidth(Number newWidth);
 			void setLineWidth(Number newWidth);
 
 
+            /**
+             * If this mesh was loaded form file, returns the filename of the loaded mesh.
+             */
             String getFilename();
             String getFilename();
+        
+            /**
+             * Sets the filename path of the mesh.
+             */
             void setFilename(String fileName);
             void setFilename(String fileName);
         
         
+            /**
+             * Loads mesh from file. Deletes current mesh if ownsMesh is set to true.
+             */
             void loadFromFile(String fileName);
             void loadFromFile(String fileName);
         
         
+            /**
+             * Line width for line-based meshes.
+             */
 			Number lineWidth;
 			Number lineWidth;
+        
+            /**
+             * If set to true, will antialias the lines in a line-based mesh. Defaults to false.
+             */
 			bool lineSmooth;
 			bool lineSmooth;
 			
 			
+            /**
+             * Point size for point-based meshes.
+             */
 			Number pointSize;
 			Number pointSize;
+        
+            /**
+             * If setto true, will antialias points in a point-based mesh. Defaults to false.
+             */
 			bool pointSmooth;
 			bool pointSmooth;
 			
 			
 			/**
 			/**
-			* If true, will delete its Mesh upon destruction. (defaults to true)
+			* If true, will delete its Mesh upon destruction or mesh loading. (defaults to true)
 			*/ 
 			*/ 
 			bool ownsMesh;
 			bool ownsMesh;
 
 
@@ -174,13 +204,27 @@ namespace Polycode {
 			*/ 			
 			*/ 			
 			bool ownsSkeleton;
 			bool ownsSkeleton;
 			
 			
+            /**
+             * If set to true, will render the mesh wireframe on top of the mesh using wireFrameColor.
+             * @see wireFrameColor
+             */
 			bool overlayWireframe;
 			bool overlayWireframe;
+        
+            /*
+             * If overlayWireframe is set to true, defines the color of the mesh wireframe.
+             */
 			Color wireFrameColor;	
 			Color wireFrameColor;	
 			
 			
+            /**
+             * If set to true, will check against actual geometry polygons on ray hit detection. Defaults to false.
+             */
 			bool useGeometryHitDetection;
 			bool useGeometryHitDetection;
 			
 			
 			bool customHitDetection(const Ray &ray);
 			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.
+             */
             bool forceMaterial;
             bool forceMaterial;
         
         
             virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
             virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;

+ 0 - 7
Core/Contents/Source/PolyCamera.cpp

@@ -356,13 +356,6 @@ bool Camera::hasFilterShader() {
 	return _hasFilterShader;
 	return _hasFilterShader;
 }
 }
 
 
-void Camera::setLightDepthTexture(Texture *texture) {
-	for(int i=0; i < localShaderOptions.size(); i++) {
-		localShaderOptions[i]->clearTexture("PolyLight0ZBuffer");
-		localShaderOptions[i]->addTexture("PolyLight0ZBuffer", texture);
-	}
-}
-
 void Camera::drawFilter(Texture *targetTexture, Number targetTextureWidth, Number targetTextureHeight, Texture *targetColorTexture, Texture *targetZTexture) {
 void Camera::drawFilter(Texture *targetTexture, Number targetTextureWidth, Number targetTextureHeight, Texture *targetColorTexture, Texture *targetZTexture) {
 
 
 	if(!filterShaderMaterial)
 	if(!filterShaderMaterial)

+ 3 - 0
Core/Contents/Source/PolyCoreInput.cpp

@@ -63,6 +63,9 @@ namespace Polycode {
 	}
 	}
 	
 	
 	JoystickInfo *CoreInput::getJoystickInfoByIndex(unsigned int index) {
 	JoystickInfo *CoreInput::getJoystickInfoByIndex(unsigned int index) {
+        if(index > joysticks.size()-1) {
+            return NULL;
+        }
 		return &joysticks[index];
 		return &joysticks[index];
 	}	
 	}	
 	
 	

+ 0 - 1
Core/Contents/Source/PolyEntity.cpp

@@ -109,7 +109,6 @@ void Entity::applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) co
 	clone->setRotationByQuaternion(rotationQuat);
 	clone->setRotationByQuaternion(rotationQuat);
 	clone->setScale(scale);
 	clone->setScale(scale);
 	clone->color = color;
 	clone->color = color;
-	clone->custEntityType = custEntityType;
 	clone->billboardMode = billboardMode;	
 	clone->billboardMode = billboardMode;	
 	clone->billboardRoll = billboardRoll;
 	clone->billboardRoll = billboardRoll;
 	clone->depthWrite = depthWrite;
 	clone->depthWrite = depthWrite;

+ 0 - 212
Core/Contents/Source/PolyImage.cpp

@@ -246,218 +246,6 @@ void Image::setPixel(int x, int y, Number r, Number g, Number b, Number a) {
 	imageData32[x+(y*width)] = color.getUint();
 	imageData32[x+(y*width)] = color.getUint();
 }
 }
 
 
-void Image::multiply(Number amt, bool color, bool alpha) {
-	int startIndex = 0;
-	int endIndex = 3;
-	if(!color)
-		startIndex = 3;
-	if(!alpha)
-		endIndex = 2;
-		
-	for (int i = 0; i < height*width*pixelSize; i+=pixelSize) {
-		for(int j = startIndex; j < endIndex+1;j++) {
-			if(((Number)imageData[i+j]) * amt< 0)
-				imageData[i+j] = 0;
-			else if(((Number)imageData[i+j]) * amt > 255)
-				imageData[i+j] = 255;
-			else
-				imageData[i+j] = (char)(((Number)imageData[i+j]) * amt);
-		}
-	}
-}
-
-void Image::darken(Number amt, bool color, bool alpha) {
-	char decAmt = 255.0f * amt;
-	int startIndex = 0;
-	int endIndex = 3;
-	if(!color)
-		startIndex = 3;
-	if(!alpha)
-		endIndex = 2;
-		
-	for (int i = 0; i < height*width*pixelSize; i+=pixelSize) {
-		for(int j = startIndex; j < endIndex+1;j++) {
-			if(imageData[i+j]-decAmt < 0)
-				imageData[i+j] = 0;
-			else
-				imageData[i+j] -= decAmt;
-		}
-	}
-}
-
-void Image::lighten(Number amt, bool color, bool alpha) {
-	char decAmt = 255.0f * amt;
-	int startIndex = 0;
-	int endIndex = 3;
-	if(!color)
-		startIndex = 3;
-	if(!alpha)
-		endIndex = 2;
-		
-	for (int i = 0; i < height*width*pixelSize; i+=pixelSize) {
-		for(int j = startIndex; j < endIndex+1;j++) {
-			if(imageData[i+j]+decAmt > 255)
-				imageData[i+j] = 255;
-			else
-				imageData[i+j] += decAmt;
-		}
-	}
-}
-
-float* Image::createKernel(float radius, float deviation) {
-	int size = 2 * (int)radius + 1;
-	float* kernel = (float*)malloc(sizeof(float) * (size+1));
-	float radiusf = fabs(radius) + 1.0f;
-
-	if(deviation == 0.0f) deviation = sqrtf(
-			-(radiusf * radiusf) / (2.0f * logf(1.0f / 255.0f))
-	);
-
-	kernel[0] = size;
-
-	float value = -radius;
-	float sum   = 0.0f;
-	int i;
-
-	for(i = 0; i < size; i++) {
-			kernel[1 + i] =
-					1.0f / (2.506628275f * deviation) *
-					expf(-((value * value) / (2.0f * (deviation * deviation))));
-
-			sum   += kernel[1 + i];
-			value += 1.0f;
-	}
-
-	for(i = 0; i < size; i++) {
-		kernel[1 + i] /= sum;
-	}
-	return kernel;
-}
-
-void Image::gaussianBlur(float radius, float deviation) {
-
-	char *newData = (char*)malloc(width*height*pixelSize);
-	
-	char *horzBlur;
-	char *vertBlur;
-
-	
-	horzBlur = (char*)malloc(sizeof(float)*pixelSize*width*height);
-	vertBlur = (char*)malloc(sizeof(float)*pixelSize*width*height);
-
-	float *kernel = createKernel(radius, deviation);
-	
-	int i, iY, iX;
-
-        // Horizontal pass.
-        for(iY = 0; iY < height; iY++) {
-                for(iX = 0; iX < width; iX++) {
-						float val[4];
-						memset(val, 0, sizeof(float) * 4);
-												
-                        int offset = ((int)kernel[0]) / -2;
-
-                        for(i = 0; i < ((int)kernel[0]); i++) {
-                                int x = iX + offset;
-
-                                if(x < 0 || x >= width) { offset++; continue; }
-
-                                float kernip1 = kernel[i + 1];
-								
-								if(imageType == IMAGE_FP16) {
-									float *dataPtr = (float*)&imageData[(width * pixelSize * iY) + (pixelSize * x)];
-									for(int c=0; c < 4; c++) {
-										val[c] += kernip1 * dataPtr[c];
-									}				
-									
-								} else {
-									char *dataPtr = &imageData[(width * pixelSize * iY) + (pixelSize * x)];
-									for(int c=0; c < pixelSize; c++) {
-										val[c] += kernip1 * ((float)dataPtr[c]);
-									}				
-								}
-								
-                                offset++;
-                        }										
-
-						if(imageType == IMAGE_FP16) {
-							int baseOffset = (width * 4 * iY) + (4 * iX);
-							for(int c=0; c < 4; c++) {
-								float *f_horzBlur = (float*)horzBlur;
-								f_horzBlur[baseOffset+c] = val[c];
-							}				
-						} else {
-							int baseOffset = (width * pixelSize * iY) + (pixelSize * iX);
-							for(int c=0; c < pixelSize; c++) {	
-								if(val[c] > 255.0) {
-									val[c] = 255.0;
-								}
-								horzBlur[baseOffset+c] = (char)val[c];
-							}				
-						}
-                }
-        }
-
-	// Vertical pass.
-        for(iY = 0; iY < height; iY++) {
-                for(iX = 0; iX < width; iX++) {
-						float val[4];	
-						memset(val, 0, sizeof(float) * 4);					
-                        int offset = ((int)kernel[0]) / -2;
-
-                        for(i = 0; i < ((int)kernel[0]); i++) {
-                                int y = iY + offset;
-
-                                if(y < 0 || y >= height) {
-                                        offset++;
-                                        continue;
-                                }
-
-                                float kernip1 = kernel[i + 1];
-								if(imageType == IMAGE_FP16) {
-									float *dataPtr = (float*)&horzBlur[(width * pixelSize * y) + (pixelSize * iX)];
-									for(int c=0; c < 4; c++) {
-										val[c] += kernip1 * dataPtr[c];
-									}				
-									
-								} else {
-									char *dataPtr = &horzBlur[(width * pixelSize * y) + (pixelSize * iX)];
-									for(int c=0; c < pixelSize; c++) {
-										val[c] += kernip1 * ((float)dataPtr[c]);
-									}				
-								}
-                                offset++;
-                        }
-						
-						if(imageType == IMAGE_FP16) {
-							int baseOffset = (width * 4 * iY) + (4 * iX);
-							for(int c=0; c < 4; c++) {
-								float *f_vertBlur = (float*)vertBlur;
-								f_vertBlur[baseOffset+c] = val[c];
-							}				
-						} else {
-							int baseOffset = (width * pixelSize * iY) + (pixelSize * iX);
-							for(int c=0; c < pixelSize; c++) {
-								if(val[c] > 255.0) {
-									val[c] = 255.0;
-								}							
-								vertBlur[baseOffset+c] = (char)val[c];
-							}				
-						}
-                }
-        }
-
-
-	memcpy(newData, vertBlur, height * width * pixelSize);
-
-	free(horzBlur);
-	free(vertBlur);
-	free(kernel);
-	
-	free(imageData);
-	imageData = newData;
-}
-
 void Image::fastBlurHor(int blurSize) {
 void Image::fastBlurHor(int blurSize) {
 	if(blurSize == 0)
 	if(blurSize == 0)
 		return;
 		return;

+ 0 - 1
Core/Contents/Source/PolySceneManager.cpp

@@ -42,7 +42,6 @@ SceneManager::~SceneManager() {
 }
 }
 
 
 void SceneManager::removeScene(Scene *scene) {
 void SceneManager::removeScene(Scene *scene) {
-	Logger::log("Removing scene\n");
 	for(int i=0;i<scenes.size();i++) {
 	for(int i=0;i<scenes.size();i++) {
 		if(scenes[i] == scene) {
 		if(scenes[i] == scene) {
 			scenes.erase(scenes.begin()+i);
 			scenes.erase(scenes.begin()+i);

+ 4 - 1
Core/Contents/Source/PolySceneMesh.cpp

@@ -43,7 +43,7 @@ SceneMesh *SceneMesh::SceneMeshWithType(int meshType) {
 	return new SceneMesh(meshType);
 	return new SceneMesh(meshType);
 }
 }
 
 
-SceneMesh::SceneMesh(const String& fileName) : Entity(), texture(NULL), material(NULL), skeleton(NULL), localShaderOptions(NULL) {
+SceneMesh::SceneMesh(const String& fileName) : Entity(), texture(NULL), material(NULL), skeleton(NULL), localShaderOptions(NULL), mesh(NULL) {
     loadFromFile(fileName);
     loadFromFile(fileName);
 	useVertexBuffer = false;
 	useVertexBuffer = false;
 	lineSmooth = false;
 	lineSmooth = false;
@@ -147,6 +147,9 @@ void SceneMesh::setFilename(String fileName) {
 }
 }
 
 
 void SceneMesh::loadFromFile(String fileName) {
 void SceneMesh::loadFromFile(String fileName) {
+    if(mesh && ownsMesh) {
+        delete mesh;
+    }
 	mesh = new Mesh(fileName);
 	mesh = new Mesh(fileName);
 	setLocalBoundingBox(mesh->calculateBBox());
 	setLocalBoundingBox(mesh->calculateBBox());
     this->fileName = fileName;
     this->fileName = fileName;

+ 2 - 2
IDE/Contents/Source/PolycodeEntityEditor.cpp

@@ -329,8 +329,8 @@ EntityEditorMainView::EntityEditorMainView(PolycodeEditor *editor) {
     this->editor = editor;
     this->editor = editor;
 	mainScene = new Scene(Scene::SCENE_3D, true);
 	mainScene = new Scene(Scene::SCENE_3D, true);
     
     
-    mainScene->getDefaultCamera()->frustumCulling = false;
-    mainScene->doVisibilityChecking(false);
+//    mainScene->getDefaultCamera()->frustumCulling = false;
+//    mainScene->doVisibilityChecking(false);
     
     
 	renderTexture = new SceneRenderTexture(mainScene, mainScene->getDefaultCamera(), 512, 512);
 	renderTexture = new SceneRenderTexture(mainScene, mainScene->getDefaultCamera(), 512, 512);
 	mainScene->clearColor.setColor(0.2, 0.2, 0.2, 1.0);	
 	mainScene->clearColor.setColor(0.2, 0.2, 0.2, 1.0);	

+ 1 - 1
Modules/Contents/UI/Source/PolyUIMenu.cpp

@@ -199,7 +199,7 @@ void UIMenu::handleEvent(Event *event) {
 		if((event->getEventCode() == InputEvent::EVENT_MOUSEDOWN || (event->getEventCode() == InputEvent::EVENT_MOUSEUP && initialMouse != inputEvent->getMousePosition())) && !ignoreMouse) {
 		if((event->getEventCode() == InputEvent::EVENT_MOUSEDOWN || (event->getEventCode() == InputEvent::EVENT_MOUSEUP && initialMouse != inputEvent->getMousePosition())) && !ignoreMouse) {
 			if(selectorBox->visible) {
 			if(selectorBox->visible) {
 				dispatchEvent(new UIEvent(), UIEvent::OK_EVENT);
 				dispatchEvent(new UIEvent(), UIEvent::OK_EVENT);
-			} else if(!dropDownBox->hitTest(inputEvent->getMousePosition())) {
+			} else {
 				dispatchEvent(new UIEvent(), UIEvent::CANCEL_EVENT);
 				dispatchEvent(new UIEvent(), UIEvent::CANCEL_EVENT);
 			}
 			}
 		}
 		}

+ 1 - 8
Modules/Contents/UI/Source/PolyUITextInput.cpp

@@ -185,7 +185,6 @@ UITextInput::UITextInput(bool multiLine, Number width, Number height) : UIElemen
 	focusable = true;
 	focusable = true;
 	setWidth(width);
 	setWidth(width);
 	setHeight(rectHeight);
 	setHeight(rectHeight);
-	setHitbox(width, rectHeight);
 	
 	
 	scrollContainer = NULL;
 	scrollContainer = NULL;
 	if(multiLine) {
 	if(multiLine) {
@@ -715,7 +714,6 @@ void UITextInput::Resize(Number width, Number height) {
 	matrixDirty = true;	
 	matrixDirty = true;	
 	
 	
 	if(multiLine) {
 	if(multiLine) {
-		inputRect->setHitbox(width - scrollContainer->getVScrollWidth(), height);		
 		neededBufferLines = (height / ( lineHeight+lineSpacing)) + 1;
 		neededBufferLines = (height / ( lineHeight+lineSpacing)) + 1;
 		checkBufferLines();
 		checkBufferLines();
 		renumberLines();
 		renumberLines();
@@ -861,12 +859,7 @@ void UITextInput::restructLines() {
 	
 	
 	if(scrollContainer) {
 	if(scrollContainer) {
 		scrollContainer->setContentSize(getWidth(),  (((wordWrapLines.size()+1) * ((lineHeight+lineSpacing)))) + padding);
 		scrollContainer->setContentSize(getWidth(),  (((wordWrapLines.size()+1) * ((lineHeight+lineSpacing)))) + padding);
-	}	
-	
-	if(multiLine) {
-		inputRect->setHitbox(getWidth() - scrollContainer->getVScrollWidth(), getHeight());
-	}	
-	
+	}
 }
 }
 
 
 void UITextInput::setCaretPosition(int position) {
 void UITextInput::setCaretPosition(int position) {

+ 0 - 4
Modules/Contents/UI/Source/PolyUITreeContainer.cpp

@@ -61,7 +61,6 @@ UITreeContainer::UITreeContainer(String icon, String text, Number treeWidth, Num
 	
 	
 	setWidth(treeWidth);
 	setWidth(treeWidth);
 	setHeight(treeHeight);
 	setHeight(treeHeight);
-	setHitbox(getWidth(), getHeight());
 	
 	
 	Resize(getWidth(), getHeight());
 	Resize(getWidth(), getHeight());
 
 
@@ -79,9 +78,6 @@ void UITreeContainer::Resize(Number width, Number height) {
 	mainContainer->setPositionY(0);
 	mainContainer->setPositionY(0);
 
 
 	rootNode->Resize(width);
 	rootNode->Resize(width);
-//	width = x;
-	//	height = y;
-	setHitbox(width, height);
 	setWidth(width);
 	setWidth(width);
 	setHeight(height);
 	setHeight(height);
 }
 }

+ 0 - 1
Modules/Contents/UI/Source/PolyUIWindow.cpp

@@ -99,7 +99,6 @@ UIWindow::UIWindow(String windowName, Number width, Number height) : UIElement()
 	
 	
 	setWidth(width);
 	setWidth(width);
 	setHeight(height);
 	setHeight(height);
-	setHitbox(width, height);
 	
 	
 	focusable = true;
 	focusable = true;
 	blockMouseInput = true;
 	blockMouseInput = true;