Browse Source

Updated ImageAsset.getExplicitCellIndex

The function ImageAsset.getExplicitCellIndex now returns a -1 if no such cell exisits.
Peter Robinson 3 years ago
parent
commit
ae746dcecf

+ 3 - 4
engine/source/2d/assets/ImageAsset.cc

@@ -625,7 +625,7 @@ S32 ImageAsset::getExplicitCellIndex(const char* regionName)
     {
         // No, so warn.
         Con::warnf( "ImageAsset() - Cannot perform explicit cell operation when not in explicit mode." );
-        return NULL;
+        return -1;
     }
     
     // Set up a frame counter
@@ -649,9 +649,8 @@ S32 ImageAsset::getExplicitCellIndex(const char* regionName)
         }
     }
     
-    // Didn't find it, so warn
-    Con::warnf( "ImageAsset::getExplicitCellIndex() - Cannot find %s cell.", regionName );
-    return NULL;
+    // Didn't find it, so return -1
+    return -1;
     
 }
 

+ 1 - 1
engine/source/2d/assets/ImageAsset_ScriptBinding.h

@@ -578,7 +578,7 @@ ConsoleMethodWithDocs(ImageAsset, getExplicitCellName, ConsoleString, 3, 3, (cel
 
 /*! Gets the CELL index number in Explicit Mode.
     @param cellName The cell name to use to find the specific index.
-    @return The specified CELL index number.
+    @return The specified CELL index number or -1 if no such cell exists.
 */
 ConsoleMethodWithDocs(ImageAsset, getExplicitCellIndex, ConsoleInt, 3, 3, (cellName))
 {