1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-31 00:07:39 +02:00

Fix obstacle rendering

This commit is contained in:
Ivan Savenko
2022-12-12 00:05:00 +02:00
parent c302efd315
commit 1558c28c0a
2 changed files with 8 additions and 7 deletions

View File

@@ -54,10 +54,11 @@ void BattleObstacleController::loadObstacleImage(const CObstacleInstance & oi)
{
if (oi.obstacleType == CObstacleInstance::ABSOLUTE_OBSTACLE)
{
// obstacle use single bitmap image for animations
// obstacle uses single bitmap image for animations
auto animation = std::make_shared<CAnimation>();
animation->setCustom(animationName, 0, 0);
animationsCache[animationName] = animation;
animation->preload();
}
else
{

View File

@@ -18,17 +18,17 @@ class JsonSerializeFormat;
struct DLL_LINKAGE CObstacleInstance
{
BattleHex pos; //position on battlefield, typically left bottom corner
ui8 obstacleType; //if true, then position is meaningless
si32 uniqueID;
si32 ID; //ID of obstacle (defines type of it)
enum EObstacleType
enum EObstacleType : ui8
{
//ABSOLUTE needs an underscore because it's a Win
USUAL, ABSOLUTE_OBSTACLE, SPELL_CREATED, MOAT
};
BattleHex pos; //position on battlefield, typically left bottom corner
EObstacleType obstacleType;
si32 uniqueID;
si32 ID; //ID of obstacle (defines type of it)
CObstacleInstance();
virtual ~CObstacleInstance();