summaryrefslogtreecommitdiff
path: root/ZAPD/ZTexture.cpp
diff options
context:
space:
mode:
authorlouist103 <35883445+louist103@users.noreply.github.com>2021-04-01 17:24:47 -0400
committerGitHub <noreply@github.com>2021-04-01 17:24:47 -0400
commitca4458d0ca12134df8c8c92ebbcd22c0f7c21a71 (patch)
tree9a625ebb4049c64074eeb6ce67433b38e00da0f3 /ZAPD/ZTexture.cpp
parentc4773301a17a5a9f9c964a3e7ba6dfbf0730a94b (diff)
Add more warnings for textures (#104)
* started on basic type errors * Done. For now * remove libgfxd binary * added errors if Height or width is not spelled correctly * change the error message and fix reverted warning fixes
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");