summaryrefslogtreecommitdiff
path: root/ZAPD/ZTexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ZAPD/ZTexture.cpp')
-rw-r--r--ZAPD/ZTexture.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/ZAPD/ZTexture.cpp b/ZAPD/ZTexture.cpp
index ab2ee55..b7fe82a 100644
--- a/ZAPD/ZTexture.cpp
+++ b/ZAPD/ZTexture.cpp
@@ -163,10 +163,23 @@ void ZTexture::ParseXML(XMLElement* reader)
ZResource::ParseXML(reader);
if (reader->Attribute("Width") != nullptr)
+ {
width = atoi(reader->Attribute("Width"));
+ }
+ else
+ {
+ throw std::runtime_error("Width == nullptr for asset " + (string)reader->Attribute("Name") );
+ }
if (reader->Attribute("Height") != nullptr)
+ {
height = atoi(reader->Attribute("Height"));
+ }
+ else
+ {
+ throw std::runtime_error("Height == nullptr for asset " +
+ (string)reader->Attribute("Name"));
+ }
string formatStr = reader->Attribute("Format");