Explorar o código

Updated some documentation

Ivan Safrin %!s(int64=13) %!d(string=hai) anos
pai
achega
9fce1e5c5b

+ 23 - 0
Core/Contents/Include/PolyCamera.h

@@ -64,10 +64,30 @@ namespace Polycode {
 			*/					
 			*/					
 			bool canSee(SceneEntity *entity);
 			bool canSee(SceneEntity *entity);
 			
 			
+			/**
+			* Toggles orthographic projection mode for camera.
+			* @param mode If true, sets the camera into orthographic projection mode.
+			* @param orthoSizeX Width of the orthographic frustum (defaults to 1.0)
+			* @param orthoSizeY Height of the orthographic frustum (defaults to 1.0)				
+			*/			
 			void setOrthoMode(bool mode, Number orthoSizeX = 1.0, Number orthoSizeY = 1.0);
 			void setOrthoMode(bool mode, Number orthoSizeX = 1.0, Number orthoSizeY = 1.0);
+			
+			/**
+			* Returns true if camera is in orthographic projection mode.
+			* @return True if camera is orthographic, false if otherwise.
+			*/
 			bool getOrthoMode();
 			bool getOrthoMode();
 			
 			
+			/**
+			* Returns the width of the camera's orthographic frustum.
+			* @return Width of the camera's orthographic frustum.
+			*/
 			Number getOrthoSizeX();
 			Number getOrthoSizeX();
+			
+			/**
+			* Returns the height of the camera's orthographic frustum.
+			* @return Height of the camera's orthographic frustum.
+			*/			
 			Number getOrthoSizeY();
 			Number getOrthoSizeY();
 						
 						
 			/**
 			/**
@@ -125,6 +145,9 @@ namespace Polycode {
 			*/			
 			*/			
 			Material *getScreenShaderMaterial() { return filterShaderMaterial; }
 			Material *getScreenShaderMaterial() { return filterShaderMaterial; }
 			
 			
+			/**
+			* Toggles the frustum culling of the camera. (Defaults to true).
+			*/
 			bool frustumCulling;
 			bool frustumCulling;
 			
 			
 		protected:
 		protected:

+ 32 - 0
Core/Contents/Include/PolyCoreInput.h

@@ -29,13 +29,31 @@ THE SOFTWARE.
 
 
 namespace Polycode {
 namespace Polycode {
 	
 	
+	/**
+	* Joystick info.
+	*/
 	class JoystickInfo {
 	class JoystickInfo {
 		public:
 		public:
 			JoystickInfo();
 			JoystickInfo();
 			
 			
+			/**
+			* State array of the joystick axis knobs.
+			*/
 			float joystickAxisState[32];
 			float joystickAxisState[32];
+			
+			/**
+			* State array of the joystick buttons.
+			*/			
 			bool joystickButtonState[64];
 			bool joystickButtonState[64];
+			
+			/**
+			* Internal device ID.
+			*/			
 			unsigned int deviceID;		
 			unsigned int deviceID;		
+			
+			/**
+			* Joystick index.
+			*/						
 			unsigned int deviceIndex;
 			unsigned int deviceIndex;
 	};
 	};
 	
 	
@@ -92,7 +110,18 @@ namespace Polycode {
 		*/								
 		*/								
 		bool getMouseButtonState(int mouseButton);		
 		bool getMouseButtonState(int mouseButton);		
 
 
+		/**
+		* Returns the current number of active joysticks.
+		* @return Number of active joysticks.
+		*/		
 		unsigned int getNumJoysticks();
 		unsigned int getNumJoysticks();
+		
+		/**
+		* Returns joystick info for specified joystick index.
+		* @param index Joystick index. Must be less than getNumJoysticks()
+		* @return Joystick info for specified joystick.
+		* @see JoystickInfo
+		*/
 		JoystickInfo *getJoystickInfoByIndex(unsigned int index);
 		JoystickInfo *getJoystickInfoByIndex(unsigned int index);
 
 
 		JoystickInfo *getJoystickInfoByID(unsigned int deviceID);
 		JoystickInfo *getJoystickInfoByID(unsigned int deviceID);
@@ -115,6 +144,9 @@ 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.
+		*/
 		bool simulateTouchWithMouse;
 		bool simulateTouchWithMouse;
 		
 		
 	protected:
 	protected:

+ 4 - 2
Core/Contents/Include/PolyCoreServices.h

@@ -146,8 +146,10 @@ namespace Polycode {
 			* @see Config
 			* @see Config
 			*/																													
 			*/																													
 			Config *getConfig();
 			Config *getConfig();
-		
-				
+			
+			/**
+			* If set to true, will draw Screens before Scenes (defaults to false).
+			*/	
 			bool drawScreensFirst;
 			bool drawScreensFirst;
 					
 					
 			~CoreServices();
 			~CoreServices();

+ 8 - 6
Core/Contents/Include/PolyEntity.h

@@ -538,10 +538,8 @@ namespace Polycode {
 			bool depthTest;
 			bool depthTest;
 			
 			
 			/**
 			/**
-			* Blending mode for rendering this entity. Possible blending modes are:
-			*	Renderer::BLEND_MODE_NORMAL - Draw entity normally 
-			*   Renderer::BLEND_MODE_LIGHTEN - Add the entity's color on top of the background color.
-			*   Renderer::BLEND_MODE_COLOR - Only change the color of the background.
+			* @param newBlendingMode New blending mode to set. Possible values are 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.
+			* @see Renderer
 			*/
 			*/
 			int blendingMode;	
 			int blendingMode;	
 			
 			
@@ -579,6 +577,11 @@ namespace Polycode {
 			*/			
 			*/			
 			void *getUserData();
 			void *getUserData();
 				
 				
+			/**
+			* Sets the entity's blending mode.
+			* @param newBlendingMode New blending mode to set. Possible values are 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.
+			* @see Renderer			
+			*/
 			void setBlendingMode(int newBlendingMode);
 			void setBlendingMode(int newBlendingMode);
 				
 				
 			Vector3 getChildCenter() const;
 			Vector3 getChildCenter() const;
@@ -589,8 +592,7 @@ namespace Polycode {
 			void doUpdates();				
 			void doUpdates();				
 			virtual Matrix4 buildPositionMatrix();
 			virtual Matrix4 buildPositionMatrix();
 			virtual void adjustMatrixForChildren(){}
 			virtual void adjustMatrixForChildren(){}
-			void setRenderer(Renderer *renderer);
-						
+			void setRenderer(Renderer *renderer);						
 			
 			
 			
 			
 			Vector3 bBox;			
 			Vector3 bBox;			

+ 9 - 1
Core/Contents/Include/PolyScreenSprite.h

@@ -59,6 +59,10 @@ class _PolyExport ScreenSprite : public ScreenShape
 		*/
 		*/
 		void addAnimation(const String& name, const String& frames, Number speed);
 		void addAnimation(const String& name, const String& frames, Number speed);
 		
 		
+		/**
+		* Shows a specific frame of the current animation.
+		* @param frameIndex Frame index of the frame to show.
+		*/
 		void showFrame(unsigned int frameIndex);
 		void showFrame(unsigned int frameIndex);
 		
 		
 		/**
 		/**
@@ -69,7 +73,11 @@ class _PolyExport ScreenSprite : public ScreenShape
 		*/
 		*/
 		void playAnimation(const String& name, int startFrame, bool once);
 		void playAnimation(const String& name, int startFrame, bool once);
 		void Update();
 		void Update();
-		
+	
+		/**
+		* Pauses or unpauses the current sprite animation.
+		* @param val If true, pauses the current animation, if false, resumes playing it.
+		*/ 
 		void Pause(bool val);
 		void Pause(bool val);
 		
 		
 		void updateSprite();
 		void updateSprite();