From a981890ab9d641e89bccfb7cb64fab00e5ca937e Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Sun, 23 Jun 2013 22:58:17 +0000 Subject: [PATCH] Fixes PSA converter to detect broken animations/skeletons.xml slightly better, based on patch by Markus. Fixes #1478 This was SVN commit r13498. --- source/collada/PSAConvert.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/collada/PSAConvert.cpp b/source/collada/PSAConvert.cpp index b90df0303d..ffa90751b8 100644 --- a/source/collada/PSAConvert.cpp +++ b/source/collada/PSAConvert.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2013 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -81,6 +81,8 @@ public: float timeStart = 0, timeEnd = 0; GetAnimationRange(converter.GetDocument(), skeleton, controllerInstance, timeStart, timeEnd); + // To catch broken animations / skeletons.xml: + REQUIRE(timeEnd > timeStart, "animation end frame must come after start frame"); // Count frames; don't include the last keyframe size_t frameCount = (size_t)((timeEnd - timeStart) / frameLength - 0.5f);