Browse Source

Merge pull request #302 from blackberry-gaming/next-setaylor

Updated variables names for Bundle rename.
Sean Paul Taylor 13 years ago
parent
commit
d025ed2db2
3 changed files with 24 additions and 24 deletions
  1. 10 10
      gameplay/src/Bundle.cpp
  2. 6 6
      gameplay/src/Font.cpp
  3. 8 8
      gameplay/src/SceneLoader.cpp

+ 10 - 10
gameplay/src/Bundle.cpp

@@ -199,12 +199,12 @@ Bundle* Bundle::create(const char* path)
     }
 
     // Keep file open for faster reading later
-    Bundle* pkg = new Bundle(path);
-    pkg->_referenceCount = refCount;
-    pkg->_references = refs;
-    pkg->_file = fp;
+    Bundle* bundle = new Bundle(path);
+    bundle->_referenceCount = refCount;
+    bundle->_references = refs;
+    bundle->_file = fp;
 
-    return pkg;
+    return bundle;
 }
 
 Bundle::Reference* Bundle::find(const char* id) const
@@ -1163,19 +1163,19 @@ Bundle::MeshData* Bundle::readMeshData(const char* url)
     std::string id = urlstring.substr(pos + 1);
 
     // Load bundle
-    Bundle* pkg = Bundle::create(file.c_str());
-    if (pkg == NULL)
+    Bundle* bundle = Bundle::create(file.c_str());
+    if (bundle == NULL)
         return NULL;
 
     // Seek to mesh with specified ID in bundle
-    Reference* ref = pkg->seekTo(id.c_str(), BUNDLE_TYPE_MESH);
+    Reference* ref = bundle->seekTo(id.c_str(), BUNDLE_TYPE_MESH);
     if (ref == NULL)
         return NULL;
 
     // Read mesh data from current file position
-    MeshData* meshData = pkg->readMeshData();
+    MeshData* meshData = bundle->readMeshData();
 
-    SAFE_RELEASE(pkg);
+    SAFE_RELEASE(bundle);
 
     return meshData;
 }

+ 6 - 6
gameplay/src/Font.cpp

@@ -79,8 +79,8 @@ Font* Font::create(const char* path, const char* id)
     }
 
     // Load the bundle.
-    Bundle* pkg = Bundle::create(path);
-    if (pkg == NULL)
+    Bundle* bundle = Bundle::create(path);
+    if (bundle == NULL)
     {
         return NULL;
     }
@@ -91,18 +91,18 @@ Font* Font::create(const char* path, const char* id)
     {
         // Get the ID of the first/only object in the bundle (assume it's a Font).
         const char* id;
-        if (pkg->getObjectCount() != 1 || (id = pkg->getObjectID(0)) == NULL)
+        if (bundle->getObjectCount() != 1 || (id = bundle->getObjectID(0)) == NULL)
         {
             return NULL;
         }
 
         // Load the font using the ID of the first object in the bundle.
-        font = pkg->loadFont(pkg->getObjectID(0));
+        font = bundle->loadFont(bundle->getObjectID(0));
     }
     else
     {
         // Load the font with the given ID.
-        font = pkg->loadFont(id);
+        font = bundle->loadFont(id);
     }
 
     if (font)
@@ -111,7 +111,7 @@ Font* Font::create(const char* path, const char* id)
         __fontCache.push_back(font);
     }
 
-    SAFE_RELEASE(pkg);
+    SAFE_RELEASE(bundle);
 
     return font;
 }

+ 8 - 8
gameplay/src/SceneLoader.cpp

@@ -439,14 +439,14 @@ void SceneLoader::applyNodeUrls(Scene* scene)
                 // An external file was referenced, so load the node from file and then insert it into the scene with the new ID.
 
                 // TODO: Revisit this to determine if we should cache Bundle objects for the duration of the scene
-                // load to prevent constantly creating/destroying the same externally referenced packages each time
+                // load to prevent constantly creating/destroying the same externally referenced bundles each time
                 // a url with a file is encountered.
-                Bundle* tmpPackage = Bundle::create(snp._file.c_str());
-                if (tmpPackage)
+                Bundle* tmpBundle = Bundle::create(snp._file.c_str());
+                if (tmpBundle)
                 {
                     if (sceneNode._exactMatch)
                     {
-                        Node* node = tmpPackage->loadNode(snp._id.c_str());
+                        Node* node = tmpBundle->loadNode(snp._id.c_str());
                         if (node)
                         {
                             node->setId(sceneNode._nodeID);
@@ -462,16 +462,16 @@ void SceneLoader::applyNodeUrls(Scene* scene)
                     {
                         // Search for nodes in the bundle using a partial match
                         std::string partialMatch = snp._id;
-                        unsigned int objectCount = tmpPackage->getObjectCount();
+                        unsigned int objectCount = tmpBundle->getObjectCount();
                         unsigned int matchCount = 0;
                         for (unsigned int k = 0; k < objectCount; ++k)
                         {
-                            const char* objid = tmpPackage->getObjectID(k);
+                            const char* objid = tmpBundle->getObjectID(k);
                             if (strstr(objid, snp._id.c_str()) == objid)
                             {
                                 // This object ID matches (starts with).
                                 // Try to load this object as a Node.
-                                Node* node = tmpPackage->loadNode(objid);
+                                Node* node = tmpBundle->loadNode(objid);
                                 if (node)
                                 {
                                     // Construct a new node ID using _nodeID plus the remainder of the partial match.
@@ -490,7 +490,7 @@ void SceneLoader::applyNodeUrls(Scene* scene)
                         }
                     }
 
-                    SAFE_RELEASE(tmpPackage);
+                    SAFE_RELEASE(tmpBundle);
                 }
                 else
                 {