seanpaultaylor 11 rokov pred
rodič
commit
4ed4ab6b51

+ 1 - 1
README.md

@@ -1,6 +1,6 @@
 ## GamePlay v3.0.0
 
-GamePlay is an open-source, cross-platform native C++ game framework making it easy to learn and write mobile and desktop games. 
+GamePlay is an open-source, cross-platform native C++ game framework for creating 2D/3D mobile and desktop games.
 
 <img align="right" src="https://raw.github.com/wiki/gameplay3d/GamePlay/img/logo.png" alt="gameplay3d" />
 

+ 34 - 34
api/header.html

@@ -1,34 +1,34 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<title>gameplay: Main Page</title>
-
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="custom.css" rel="stylesheet" type="text/css" />
-
-<link href="search/search.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="search/search.js"></script>
-<script type="text/javascript">
-  $(document).ready(function() { searchBox.OnSelectItem(0); });
-</script>
-
-</head>
-<body>
-<div id="top"><!-- do not remove this div! -->
-<table class="header" border="0">
-<tbody>
-<tr>
-<td id="logo"><a href="http://gameplay3d.org/"><img src="images/logo.png" alt="gameplay" border="0" height="64px"/></a></td>
-<td width="100%"/>
-<td><a href="http://gameplay3d.org/"><span class="button">overview</span></a></td><td width="12px"/>
-<td><a href="https://github.com/gameplay3d/GamePlay/wiki"><span class="button">wiki</span></a></td><td width="12px"/>
-<td><a href="http://gameplay3d.github.com/GamePlay/api/index.html"><span class="button">api&nbsp;reference</span></a></td><td width="12px"/>
-<td><a href="http://www.gameplay3d.org/forums"><span class="button">forums</span></a></td>
-<td><a href="https://github.com/gameplay3d/GamePlay"><span class="button">download</span></a></td>
-</tr>
-</tbody>
-</table>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<title>gameplay: Main Page</title>
+
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="custom.css" rel="stylesheet" type="text/css" />
+
+<link href="search/search.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="search/search.js"></script>
+<script type="text/javascript">
+  $(document).ready(function() { searchBox.OnSelectItem(0); });
+</script>
+
+</head>
+<body>
+<div id="top"><!-- do not remove this div! -->
+<table class="header" border="0">
+<tbody>
+<tr>
+<td id="logo"><a href="http://gameplay3d.org/"><img src="images/logo.png" alt="gameplay" border="0" height="64px"/></a></td>
+<td width="100%"/>
+<td><a href="http://gameplay3d.org/"><span class="button">overview</span></a></td><td width="12px"/>
+<td><a href="https://github.com/gameplay3d/GamePlay/wiki"><span class="button">wiki</span></a></td><td width="12px"/>
+<td><a href="http://gameplay3d.github.com/GamePlay/api/index.html"><span class="button">api&nbsp;reference</span></a></td><td width="12px"/>
+<td><a href="http://www.gameplay3d.org/forums"><span class="button">forums</span></a></td>
+<td><a href="https://github.com/gameplay3d/GamePlay"><span class="button">download</span></a></td>
+</tr>
+</tbody>
+</table>

+ 2 - 2
gameplay/src/Control.h

@@ -1348,10 +1348,10 @@ protected:
      *
      * @param s A string in the format of either 'N, N' or 'N%, N%' (where N is a number)
      * @param v1 Set to the value of the first number in the string
-     * @param v1 Set to the value of the second number in the string
+     * @param v2 Set to the value of the second number in the string
      * @param v1Percentage Set to true if the first number should be treated as a percentage
      * @param v2Percentage Set to true if the second number should be treated as a percentage
-     * @return True if the string was parsed
+     * @return true if the string was parsed
      */
     static bool parseCoordPair(const char* s, float* v1, float* v2, bool* v1Percentage, bool* v2Percentage);
 

+ 4 - 2
gameplay/src/Curve.h

@@ -339,8 +339,10 @@ public:
      * Sets the tangents for a point on the curve specified by the index.
      *
      * @param index The index of the point.
-     *
-     *
+     * @param type The interpolation type.
+     * @param type The curve interpolation type.
+     * @param inValue The tangent approaching the point.
+     * @param outValue The tangent leaving the point.
      */
     void setTangent(unsigned int index, InterpolationType type, float* inValue, float* outValue);
     

+ 5 - 2
gameplay/src/Drawable.h

@@ -12,10 +12,10 @@ class NodeCloneContext;
  */
 class Drawable
 {
-public:
-
     friend class Node;
 
+public:
+
     /**
      * Constructor.
      */
@@ -59,6 +59,9 @@ protected:
      */
     virtual void setNode(Node* node);
 
+    /**
+     * Node this drawable is attached to.
+     */
     Node* _node;
 };
 

+ 1 - 0
gameplay/src/JoystickControl.h

@@ -131,6 +131,7 @@ public:
     /**
      * Sets the radius of joystick motion
      *
+     * @param radius The radius to be set.
      * @param isPercentage If the radius value is a percentage value of the relative size of this control
      */
     void setRadius(float radius, bool isPercentage = false);

+ 25 - 5
gameplay/src/Node.h

@@ -416,18 +416,19 @@ public:
     /**
      * Gets the drawable object attached to this node.
      *
-     *
-     * @return The model attached to this node.
+     * @return The drawable component attached to this node.
      */
     Drawable* getDrawable() const;
 
     /**
-     * Set the drawable object to be attached to this node.
+     * Set the drawable object to be attached to this node
+     *
+     * This is typically a Model, ParticleEmiiter, Form, Terrrain, Sprite, TileSet or Text.
      *
      * This will increase the reference count of the new drawble and decrease
      * the reference count of the old drawable.
      *
-     * @param model The new model. May be NULL.
+     * @param drawable The new drawable component. May be NULL.
      */
     void setDrawable(Drawable* drawable);
 
@@ -680,25 +681,44 @@ private:
 
 protected:
 
+    /** The scene this node is attached to. */
     Scene* _scene;
+    /** The nodes id. */
     std::string _id;
+    /** The nodes first child. */
     Node* _firstChild;
+    /** The nodes next sibiling. */
     Node* _nextSibling;
+    /** The nodes previous sibiling. */
     Node* _prevSibling;
+    /** The nodes parent. */
     Node* _parent;
+    /** The number of child nodes. */
     unsigned int _childCount;
+    /** If this node is enabled. Maybe different if parent is enabled/disabled. */
     bool _enabled; 
+    /** Tags assigned to this node. */
     std::map<std::string, std::string>* _tags;
+    /** The drawble component attached to this node. */
     Drawable* _drawable;
+    /** The camera component attached to this node. */
     Camera* _camera;
+    /** The light component attached to this node. */
     Light* _light;
+    /** The audio source component attached to this node. */
     AudioSource* _audioSource;
+    /** The collision object component attached to this node. */
     PhysicsCollisionObject* _collisionObject;
+    /** The AI agent component attached to this node. */
     mutable AIAgent* _agent;
+    /** The user object component attached to this node. */
     Ref* _userObject;
+    /** The world matrix for this node. */
     mutable Matrix _world;
-    mutable int _dirtyBits;
+    /** The bounding sphere for this node. */
     mutable BoundingSphere _bounds;
+    /** The dirty bits used for optimization. */
+    mutable int _dirtyBits;
 };
 
 /**

+ 55 - 24
gameplay/src/ScriptTarget.h

@@ -122,14 +122,14 @@ public:
     public:
 
         /**
-         * Returns the name of this event.
+         * Gets the name of this event.
          *
          * @return The event name.
          */
         const char* getName() const;
 
         /**
-         * Returns the argument string for this event.
+         * Gets the argument string for this event.
          *
          * @return The argument string.
          */
@@ -144,7 +144,6 @@ public:
 
         /**
          * The event arguments.
-         *
          * @see ScriptController::executeFunction
          */
         std::string args;
@@ -164,7 +163,7 @@ public:
     public:
 
         /**
-         * Creates an empty event registry.
+         * Constructor.
          */
         EventRegistry();
 
@@ -180,7 +179,6 @@ public:
          * @param args The argument string for the event.
          *
          * @return The added event.
-         *
          * @see ScriptController::executeFunction
          */
         const Event* addEvent(const char* name, const char* args = NULL);
@@ -196,7 +194,6 @@ public:
          * Returns the event with the given index.
          *
          * @param index The index of the event to retrieve.
-         *
          * @return The event for the given index.
          */
         const Event* getEvent(unsigned int index) const;
@@ -205,7 +202,6 @@ public:
          * Returns the event that matches the given name.
          *
          * @param name The name of the event to search for.
-         *
          * @return The matching event, or NULL if no such event exists.
          */
         const Event* getEvent(const char* name) const;
@@ -216,8 +212,7 @@ public:
     };
 
     /**
-     * Implemented by child classes to return the type name identifier for
-     * the class that extends ScriptTarget.
+     * Gets the type name identifier for the class that extends ScriptTarget.
      *
      * @return A string describing the type name of the ScriptTarget child
      *      class, as it is defined in the lua bindings (i.e. "Node").
@@ -232,7 +227,6 @@ public:
      * variables with the same name to be used without colliding with other scripts.
      *
      * @param path Path to the script.
-     *
      * @return A pointer to the successfully loaded script, or NULL if unsuccessful.
      */
     Script* addScript(const char* path);
@@ -241,7 +235,6 @@ public:
      * Removes a previously attached script from this object.
      *
      * @param path The same path that was used to load the script being removed.
-     *
      * @return True if a script is successfully removed, false otherwise.
      */
     bool removeScript(const char* path);
@@ -279,7 +272,6 @@ public:
      * event (i.e. has a function callback defined for the given event).
      *
      * @param eventName The script event to check.
-     *
      * @return True if there is a listener for the specified event, false otherwise.
      */
     bool hasScriptListener(const char* eventName) const;
@@ -289,16 +281,14 @@ public:
      * event (i.e. has a function callback defined for the given event).
      *
      * @param event The script event to check.
-     *
      * @return True if there is a listener for the specified event, false otherwise.
      */
     bool hasScriptListener(const Event* event) const;
 
     /**
-     * Returns the event object for the given event name, if it exists.
+     * Gets the event object for the given event name, if it exists.
      *
      * @param eventName Name of the event.
-     *
      * @return The event object for the given name, or NULL if no such event exists.
      */
     const Event* getScriptEvent(const char* eventName) const;
@@ -326,10 +316,17 @@ protected:
      */
     struct RegistryEntry
     {
+        /** The event registry. */
         EventRegistry* registry;
+        /** The next entry in the registry. */
         RegistryEntry* next;
+        /** The previous entry in the registry. */
         RegistryEntry* prev;
 
+        /**
+         * Constructor.
+         * @param registry The event registry.
+         */
         RegistryEntry(EventRegistry* registry) : registry(registry), next(NULL), prev(NULL) { }
     };
 
@@ -338,9 +335,18 @@ protected:
      */
     struct ScriptEntry
     {
+        /** The script. */
         Script* script;
+        /** The next script entry. */
         ScriptEntry* next;
+        /** The previous script entry. */
         ScriptEntry* prev;
+
+        /**
+         * Constructor.
+         *
+         * @param script The script to create an entry for.
+         */
         ScriptEntry(Script* script) : script(script), next(NULL), prev(NULL) { }
     };
 
@@ -349,12 +355,16 @@ protected:
      */
     struct CallbackFunction
     {
-        // The script the callback belongs to (or NULL if the callback is a global function)
+        /** The script the callback belongs to (or NULL if the callback is a global function) */
         Script* script;
-
-        // The function within the script to call
+        /** The function within the script to call. */
         std::string function;
 
+        /**
+         * The callback function to registry script function to.
+         * @param script The script.
+         * @param function The script function.
+         */
         CallbackFunction(Script* script, const char* function) : script(script), function(function) { }
     };
 
@@ -370,8 +380,10 @@ protected:
 
     /**
      * Removes the specified script.
+     *
+     * @param entry The script entry to be removed.
      */
-    void removeScript(ScriptEntry* se);
+    void removeScript(ScriptEntry* entry);
 
     /**
      * Registers a set of supported script events and event arguments for this ScriptTarget. 
@@ -396,15 +408,34 @@ protected:
     std::map<const Event*, std::vector<CallbackFunction> >* _scriptCallbacks;
 };
 
-template<typename T> T ScriptTarget::fireScriptEvent(const Event* evt, ...)
+/**
+ * The fire script event template specialization.
+ *
+ * @param event The event fired.
+ * @param ... Optional list of arguments to pass to the script event.
+ */
+template<typename T> T ScriptTarget::fireScriptEvent(const Event* event, ...)
 {
     GP_ERROR("Unsupported return type for template function ScriptTarget::fireScriptEvent.");
 }
 
-/** Template specialization. */
-template<> void ScriptTarget::fireScriptEvent<void>(const Event* event, ...);
-/** Template specialization. */
-template<> bool ScriptTarget::fireScriptEvent<bool>(const Event* event, ...);
+/** 
+ * Template specialization. 
+ *
+ * @param evt The event fired.
+ * @param ... Optional list of arguments to pass to the script event (should match the
+ *      script event argument definition).
+ */
+template<> void ScriptTarget::fireScriptEvent<void>(const Event* evt, ...);
+
+/** 
+ * Template specialization.
+ *
+ * @param evt The event fired.
+ * @param ... Optional list of arguments to pass to the script event (should match the
+ *      script event argument definition).
+ */
+template<> bool ScriptTarget::fireScriptEvent<bool>(const Event* evt, ...);
 
 }
 

+ 14 - 9
gameplay/src/Sprite.h

@@ -124,6 +124,7 @@ public:
     /**
      * Creates a sprite from properties.
      *
+     * @param properties The properties object to create from.
      * @return The new Sprite.
      */
     static Sprite* create(Properties* properties);
@@ -193,13 +194,15 @@ public:
     /**
      * Sets the source region from the source image.
      *
-     * @param sourceClip The source clip region from the source image.
+     * @param frameIndex The frame index to specify the source region for.
+     * @param source The source clip region from the source image.
      */
     void setFrameSource(unsigned int frameIndex, const Rectangle& source);
     
     /**
      * Gets the source region from the source image.
      *
+     * @param frameIndex The frame index to get the source region from.
      * @return The source clip region from the source image.
      */
     const Rectangle& getFrameSource(unsigned int frameIndex) const;
@@ -244,7 +247,7 @@ public:
      *
      * @param index The current frame index to be rendered.
      */
-    void setFrameIndex(unsigned int frameIndex);
+    void setFrameIndex(unsigned int index);
     
     /**
      * Gets the current frame index to be rendered.
@@ -267,7 +270,7 @@ public:
      *
      * The range is from full transparent to opaque [0.0,1.0].
      *
-     * @preturn The opacity for the sprite.
+     * @return The opacity for the sprite.
      */
     float getOpacity() const;
     
@@ -302,11 +305,11 @@ public:
     BlendMode getBlendMode() const;
     
     /**
-     * Gets the texture sampler.
-     *
-     * This return texture sampler is used when sampling the texture in the
-     * effect. This can be modified for controlling sampler setting such as
+     * Gets the texture sampler used when sampling the texture.
+     * This can be modified for controlling sampler setting such as
      * filtering modes.
+     *
+     * @return The texture sampler used when sampling the texture.
      */
     Texture::Sampler* getSampler() const;
     
@@ -322,9 +325,9 @@ public:
     RenderState::StateBlock* getStateBlock() const;
     
     /**
-     * Gets the material used by this batch.
+     * Gets the material used by sprite batch.
      *
-     * @return The material.
+     * @return The material used by the sprite batch.
      */
     Material* getMaterial() const;
 
@@ -375,6 +378,8 @@ protected:
      */
     void setAnimationPropertyValue(int propertyId, AnimationValue* value, float blendWeight = 1.0f);
 
+private:
+
     float _width;
     float _height;
     Offset _offset;

+ 9 - 5
gameplay/src/SpriteBatch.h

@@ -267,14 +267,23 @@ public:
      */
     struct SpriteVertex
     {
+        /** Vertex position x */
         float x;
+        /** Vertex position y */
         float y;
+        /** Vertex position z */
         float z;
+        /** Vertex texture u */
         float u;
+        /** Vertex texture v */
         float v;
+        /** Vertex color red component */
         float r;
+        /** Vertex color green component */
         float g;
+        /** Vertex color blue component */
         float b;
+        /** Vertex color alpha component */
         float a;
     };
     
@@ -391,11 +400,6 @@ private:
      */
     void addSprite(float x, float y, float width, float height, float u1, float v1, float u2, float v2, const Vector4& color, const Rectangle& clip, SpriteBatch::SpriteVertex* vertices);
 
-    /**
-     * Clip position and size to fit within clip region.
-     *
-     * @return true if any part of sprite intersects with the clip region and therefore needs drawing, false otherwise.
-     */
     bool clipSprite(const Rectangle& clip, float& x, float& y, float& width, float& height, float& u1, float& v1, float& u2, float& v2);
 
     MeshBatch* _batch;

+ 5 - 2
gameplay/src/Text.h

@@ -133,6 +133,7 @@ public:
      * Sets if the text is rendered right-to-left.
      *
      * Default is false (left-to-right)
+     *
      * @return rightToLeft true if the text is rendered right-to-left, false if left-to-right.
      */
     bool getRightToLeft() const;
@@ -167,7 +168,7 @@ public:
      *
      * Default is Rectangle(0, 0, 0, 0) which means no clipping region is applied.
      *
-     * @param clip The clipping region for this text.
+     * @return clip The clipping region for this text.
      */
     const Rectangle& getClip() const;
     
@@ -185,7 +186,7 @@ public:
      *
      * The range is from full transparent to opaque [0.0,1.0].
      *
-     * @preturn The opacity for the sprite.
+     * @return The opacity for the sprite.
      */
     float getOpacity() const;
     
@@ -250,6 +251,8 @@ protected:
      */
     void setAnimationPropertyValue(int propertyId, AnimationValue* value, float blendWeight = 1.0f);
     
+private:
+
     Font* _font;
     std::string _text;
     unsigned int _size;

+ 5 - 2
gameplay/src/TileSet.h

@@ -41,6 +41,7 @@ public:
      * @param tileHeight The height of each tile in the tile set.
      * @param rowCount The number of tile rows.
      * @param columnCount The number of tile columns.
+     *
      * @return The tile set created.
      */
     static TileSet* create(const char* imagePath, float tileWidth, float tileHeight,
@@ -129,7 +130,7 @@ public:
      *
      * The range is from full transparent to opaque [0.0,1.0].
      *
-     * @preturn The opacity for the sprite.
+     * @return The opacity for the sprite.
      */
     float getOpacity() const;
     
@@ -172,7 +173,9 @@ protected:
      * @see Drawable::clone
      */
     Drawable* clone(NodeCloneContext &context);
-    
+
+private:
+
     Vector2* _tiles;
     float _tileWidth;
     float _tileHeight;

+ 6 - 4
tools/encoder/README.md

@@ -1,6 +1,6 @@
 ## gameplay-encoder
 Command-line tool for encoding games assets like true-type fonts and 3D scene files
-into a simple binary-based bundle file format for the gameplay 3D game framework runtime. 
+into a simple binary-based bundle file format for the GamePlay game framework runtime. 
 The 'bin' folder contains pre-built 64-bit versions of the gameplay-encoder executables for 
 Windows, MacOS X and Linux Ubuntu with support built-in support for:
 
@@ -12,7 +12,8 @@ representation.
 
 ## FBX Scene
 Autodesk® FBX® asset exchange technology facilitates higher-fidelity data exchange between several Autodesk content creation packages
-Autodesk® Maya®, Autodesk® 3ds Max®, Autodesk® MotionBuilder®, Autodesk® Mudbox®, and Autodesk® Softimage®
+Autodesk® Maya®, Autodesk® 3ds Max®, Autodesk® MotionBuilder®, Autodesk® Mudbox®, Autodesk® Softimage®
+It is also supported on many other major 3D CAD software tools such as Blender, Sketchup, Daz, Lightwave, MODO, etc.
 For more information goto: "http://www.autodesk.com/fbx".
 
 ## Running gameplay-encoder
@@ -21,8 +22,9 @@ Simply execute the gameplay-encoder command-line executable:
 `Usage: gameplay-encoder [options] <file(s)>`
 
 ## Building gameplay-encoder
-
-See [Building gameplay-encoder](https://github.com/blackberry/GamePlay/wiki/Building-gameplay-encoder) on the wiki.
+The tools come pre-built and are part of the install.bat/install.sh script. 
+If you need to build them yourself:
+See [Building gameplay-encoder](https://github.com/gameplay3d/GamePlay/wiki/Building-gameplay-encoder) on the wiki.
 
 ## Bundle File Format
 The gameplay bundle file format is defined in the [tools/encoder/gameplay-bundle.txt](gameplay-bundle.txt) file.

+ 3 - 1
tools/luagen/README.md

@@ -1,7 +1,9 @@
 ## Usage
 Make sure that you have [doxygen](http://www.doxygen.org/) installed.
 
-To generate the Lua script bindings for gameplay, run the generate-doxygen-xml.bat (or .sh) script. Then, on Windows, open the gameplay-luagen Visual Studio solution and build and run the gameplay-luagen project. On Mac, open the gameplay-luagen XCode workspace and build and run the gameplay-luagen project.
+To generate the Lua script bindings for gameplay, run the generate-doxygen-xml.bat (or .sh) script. 
+Then, on Windows, open the gameplay-luagen Visual Studio solution and build and run the gameplay-luagen project. 
+On Mac, open the gameplay-luagen XCode workspace and build and run the gameplay-luagen project.
 
 There are also prebuilt binaries in the gameplay/bin folder.