Browse Source

Look specifically for a tileset/image node in the tsx file and throw an error if it's not found

Shaddock Heath 8 years ago
parent
commit
58fbdeb89d
1 changed files with 7 additions and 2 deletions
  1. 7 2
      Source/Atomic/Atomic2D/TmxFile2D.cpp

+ 7 - 2
Source/Atomic/Atomic2D/TmxFile2D.cpp

@@ -388,7 +388,10 @@ bool TmxFile2D::BeginLoad(Deserializer& source)
                     return false;
 
                 // ATOMIC BEGIN
-                if (tsxXMLFile->GetRoot("tileset").GetChild("tile"))
+
+                // Look for an image indicating that this is a spritesheet with multiple tiles instead
+                // of a series of individual images which are not supported
+                if (!tsxXMLFile->GetRoot("tileset").GetChild("image"))
                 {
                     ATOMIC_LOGERROR("Load TSX File failed: " + source + ". tsx files with individual images are not supported.");
                     return false;
@@ -586,7 +589,9 @@ bool TmxFile2D::LoadTileSet(const XMLElement& element)
                 return false;
 
             // ATOMIC BEGIN
-            if (tsxXMLFile->GetRoot("tileset").GetChild("tile"))
+            // Look for an image indicating that this is a spritesheet with multiple tiles instead
+            // of a series of individual images which are not supported
+            if (!tsxXMLFile->GetRoot("tileset").GetChild("image"))
             {
                 ATOMIC_LOGERROR("Load TSX File failed: " + source + ". tsx files with individual images are not supported.");
                 return false;