From 66f7df70fb03d487ae0c667adec3d5ad6e11721e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 23 Jul 2013 12:59:18 +0300 Subject: Add new sprite actions for water and sky. New actions: fly, swim, standsky, standwater, sitsky, sitwater, attacksky, attackwater, spawnsky, spawnwater, deadsky, deadwater For now attacksky and attackwater unused. --- src/resources/spritedef.cpp | 12 ++++++++++++ src/resources/spritedef.h | 39 ++++++++++++++++++++++++++------------- 2 files changed, 38 insertions(+), 13 deletions(-) (limited to 'src/resources') diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index cc47e34c0..16d120b0f 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -158,6 +158,18 @@ void SpriteDef::substituteActions() substituteAction(SpriteAction::HURT, SpriteAction::STAND); substituteAction(SpriteAction::DEAD, SpriteAction::HURT); substituteAction(SpriteAction::SPAWN, SpriteAction::STAND); + substituteAction(SpriteAction::FLY, SpriteAction::MOVE); + substituteAction(SpriteAction::SWIM, SpriteAction::MOVE); + substituteAction(SpriteAction::STANDSKY, SpriteAction::STAND); + substituteAction(SpriteAction::STANDWATER, SpriteAction::STAND); + substituteAction(SpriteAction::SITSKY, SpriteAction::SIT); + substituteAction(SpriteAction::SITWATER, SpriteAction::SIT); + substituteAction(SpriteAction::ATTACKSKY, SpriteAction::ATTACK); + substituteAction(SpriteAction::ATTACKWATER, SpriteAction::ATTACK); + substituteAction(SpriteAction::SPAWNSKY, SpriteAction::SPAWN); + substituteAction(SpriteAction::SPAWNWATER, SpriteAction::SPAWN); + substituteAction(SpriteAction::DEADSKY, SpriteAction::DEAD); + substituteAction(SpriteAction::DEADWATER, SpriteAction::DEAD); } void SpriteDef::loadSprite(const XmlNodePtr spriteNode, const int variant, diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 2a01bb9d7..26c768776 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -84,19 +84,32 @@ typedef std::vector::const_iterator SpriteRefs; */ namespace SpriteAction { - static const std::string DEFAULT = "stand"; - static const std::string STAND = "stand"; - static const std::string SIT = "sit"; - static const std::string SITTOP = "sittop"; - static const std::string SLEEP = "sleep"; - static const std::string DEAD = "dead"; - static const std::string MOVE = "walk"; - static const std::string ATTACK = "attack"; - static const std::string HURT = "hurt"; - static const std::string USE_SPECIAL = "special"; - static const std::string CAST_MAGIC = "magic"; - static const std::string USE_ITEM = "item"; - static const std::string SPAWN = "spawn"; + static const std::string DEFAULT("stand"); + static const std::string STAND("stand"); + static const std::string SIT("sit"); + static const std::string SITTOP("sittop"); + static const std::string SLEEP("sleep"); + static const std::string DEAD("dead"); + static const std::string MOVE("walk"); + static const std::string ATTACK("attack"); + static const std::string HURT("hurt"); + static const std::string USE_SPECIAL("special"); + static const std::string CAST_MAGIC("magic"); + static const std::string USE_ITEM("item"); + static const std::string SPAWN("spawn"); + static const std::string FLY("fly"); + static const std::string SWIM("swim"); + static const std::string STANDSKY("standsky"); + static const std::string STANDWATER("standwater"); + static const std::string SITSKY("sitsky"); + static const std::string SITWATER("sitwater"); + static const std::string ATTACKSKY("attacksky"); + static const std::string ATTACKWATER("attackwater"); + static const std::string SPAWNSKY("spawnsky"); + static const std::string SPAWNWATER("spawnwater"); + static const std::string DEADSKY("deadsky"); + static const std::string DEADWATER("deadwater"); + static const std::string INVALID(""); } // namespace SpriteAction -- cgit v1.2.3-70-g09d2