mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 02:46:49 +00:00
Fixes PSA converter to detect broken animations/skeletons.xml slightly better, based on patch by Markus. Fixes #1478
This was SVN commit r13498.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user