From 39c8f41f9d46e3d2b890961814193363f0fa10c5 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Sun, 19 Mar 2006 21:31:03 +0000 Subject: [PATCH] Split game objects into separate .sprite files SVN-Revision: 3102 --- data/images/objects/bonus_block/bonusblock.sprite | 19 +++ data/images/objects/bonus_block/brick.sprite | 8 + data/images/objects/bonus_block/icedbrick.sprite | 8 + data/images/objects/bonus_block/infoblock.sprite | 6 + .../objects/bonus_block/invisibleblock.sprite | 5 + data/images/objects/coin/coin.sprite | 15 ++ data/images/objects/eat-me/eat-me.sprite | 6 + .../images/objects/flying_platform/platform.sprite | 45 +++++ data/images/objects/hatch/hatch.sprite | 17 ++ .../objects/lightmap_light/lightmap_light.sprite | 6 + .../objects/particles/rainsplash-vertical.sprite | 9 + data/images/objects/particles/rainsplash.sprite | 9 + data/images/objects/rock/rock.sprite | 5 + data/images/objects/skull_tile/skull_tile.sprite | 4 + .../objects/unstable_tile/unstable_tile.sprite | 4 + data/images/sprites.strf | 189 +-------------------- src/object/block.cpp | 6 +- src/object/coin.cpp | 4 +- src/object/gameobjs.cpp | 2 +- src/object/infoblock.cpp | 2 +- src/object/invisible_block.cpp | 2 +- src/object/light.cpp | 2 +- src/object/platform.cpp | 2 +- src/object/rainsplash.cpp | 4 +- src/object/rock.cpp | 2 +- src/object/skull_tile.cpp | 2 +- src/object/unstable_tile.cpp | 2 +- src/trigger/door.cpp | 2 +- src/trigger/hatch.cpp | 4 +- 29 files changed, 186 insertions(+), 205 deletions(-) create mode 100644 data/images/objects/bonus_block/bonusblock.sprite create mode 100644 data/images/objects/bonus_block/brick.sprite create mode 100644 data/images/objects/bonus_block/icedbrick.sprite create mode 100644 data/images/objects/bonus_block/infoblock.sprite create mode 100644 data/images/objects/bonus_block/invisibleblock.sprite create mode 100644 data/images/objects/coin/coin.sprite create mode 100644 data/images/objects/eat-me/eat-me.sprite create mode 100644 data/images/objects/flying_platform/platform.sprite create mode 100644 data/images/objects/hatch/hatch.sprite create mode 100644 data/images/objects/lightmap_light/lightmap_light.sprite create mode 100644 data/images/objects/particles/rainsplash-vertical.sprite create mode 100644 data/images/objects/particles/rainsplash.sprite create mode 100644 data/images/objects/rock/rock.sprite create mode 100644 data/images/objects/skull_tile/skull_tile.sprite create mode 100644 data/images/objects/unstable_tile/unstable_tile.sprite diff --git a/data/images/objects/bonus_block/bonusblock.sprite b/data/images/objects/bonus_block/bonusblock.sprite new file mode 100644 index 000000000..3f5924c29 --- /dev/null +++ b/data/images/objects/bonus_block/bonusblock.sprite @@ -0,0 +1,19 @@ +(supertux-sprite + (action + (fps 15) + (name "normal") + (images "full-0.png" + "full-1.png" + "full-2.png" + "full-3.png" + "full-4.png" + "full-2.png" + "full-1.png" + "full-0.png" + "full-0.png" + "full-0.png" + )) + (action + (name "empty") + (images "empty.png")) +) diff --git a/data/images/objects/bonus_block/brick.sprite b/data/images/objects/bonus_block/brick.sprite new file mode 100644 index 000000000..f60e4e901 --- /dev/null +++ b/data/images/objects/bonus_block/brick.sprite @@ -0,0 +1,8 @@ +(supertux-sprite + (action + (name "empty") + (images "empty.png")) + (action + (name "normal") + (images "../../tiles/blocks/brick0.png")) +) diff --git a/data/images/objects/bonus_block/icedbrick.sprite b/data/images/objects/bonus_block/icedbrick.sprite new file mode 100644 index 000000000..3e9697367 --- /dev/null +++ b/data/images/objects/bonus_block/icedbrick.sprite @@ -0,0 +1,8 @@ +(supertux-sprite + (action + (name "empty") + (images "empty.png")) + (action + (name "normal") + (images "../../tiles/blocks/brick1.png")) +) diff --git a/data/images/objects/bonus_block/infoblock.sprite b/data/images/objects/bonus_block/infoblock.sprite new file mode 100644 index 000000000..58ac97e90 --- /dev/null +++ b/data/images/objects/bonus_block/infoblock.sprite @@ -0,0 +1,6 @@ +(supertux-sprite + (action + (name "default") + (images "info_block.png") + ) +) diff --git a/data/images/objects/bonus_block/invisibleblock.sprite b/data/images/objects/bonus_block/invisibleblock.sprite new file mode 100644 index 000000000..4216e0cd2 --- /dev/null +++ b/data/images/objects/bonus_block/invisibleblock.sprite @@ -0,0 +1,5 @@ +(supertux-sprite + (action + (name "empty") + (images "empty.png")) +) diff --git a/data/images/objects/coin/coin.sprite b/data/images/objects/coin/coin.sprite new file mode 100644 index 000000000..979015eb9 --- /dev/null +++ b/data/images/objects/coin/coin.sprite @@ -0,0 +1,15 @@ +(supertux-sprite + (action + (name "normal") + (images "coin-0.png" + "coin-1.png" + "coin-2.png" + "coin-3.png" + "coin-4.png" + "coin-5.png" + "coin-6.png" + "coin-7.png")) + (action + (name "still") + (images "coin-0.png")) +) diff --git a/data/images/objects/eat-me/eat-me.sprite b/data/images/objects/eat-me/eat-me.sprite new file mode 100644 index 000000000..bdb9da177 --- /dev/null +++ b/data/images/objects/eat-me/eat-me.sprite @@ -0,0 +1,6 @@ +(supertux-sprite + (action + (name "default") + (images "../../tiles/doodads/platter.png") + ) +) diff --git a/data/images/objects/flying_platform/platform.sprite b/data/images/objects/flying_platform/platform.sprite new file mode 100644 index 000000000..de027b1fe --- /dev/null +++ b/data/images/objects/flying_platform/platform.sprite @@ -0,0 +1,45 @@ +(supertux-sprite + (action + (name "flying") + (x-offset 0) + (y-offset 0) + (images "flying_platform-0.png" + "flying_platform-1.png" + "flying_platform-2.png" + "flying_platform-3.png") + ) + (action + (name "block1") + (x-offset 0) + (y-offset 0) + (images "../../tiles/blocks/block1.png") + ) + (action + (name "block2") + (x-offset 0) + (y-offset 0) + (images "../../tiles/blocks/block2.png") + ) + (action + (name "block3") + (x-offset 0) + (y-offset 0) + (images "../../tiles/blocks/block3.png") + ) + (action + (name "block4") + (x-offset 0) + (y-offset 0) + (images "../../tiles/blocks/block4.png") + ) + (action + (name "firefly") + (x-offset 0) + (y-offset 0) + (images "../../tiles/firefly/firefly1.png" + "../../tiles/firefly/firefly2.png" + "../../tiles/firefly/firefly3.png" + "../../tiles/firefly/firefly2.png") + ) +) + diff --git a/data/images/objects/hatch/hatch.sprite b/data/images/objects/hatch/hatch.sprite new file mode 100644 index 000000000..e871d68ac --- /dev/null +++ b/data/images/objects/hatch/hatch.sprite @@ -0,0 +1,17 @@ +(supertux-sprite + (action + (name "normal") + (x-offset 0) + (y-offset 0) + (images "hatch-0.png")) + (action + (name "open") + (x-offset 0) + (y-offset 0) + (images "hatch-0.png" + "hatch-1.png" + "hatch-2.png" + "hatch-3.png" + "hatch-4.png" + "hatch-5.png")) +) diff --git a/data/images/objects/lightmap_light/lightmap_light.sprite b/data/images/objects/lightmap_light/lightmap_light.sprite new file mode 100644 index 000000000..52d98aa2d --- /dev/null +++ b/data/images/objects/lightmap_light/lightmap_light.sprite @@ -0,0 +1,6 @@ +(supertux-sprite + (action + (name "default") + (images "../../effects/light_red.png") + ) +) diff --git a/data/images/objects/particles/rainsplash-vertical.sprite b/data/images/objects/particles/rainsplash-vertical.sprite new file mode 100644 index 000000000..6e70d71d4 --- /dev/null +++ b/data/images/objects/particles/rainsplash-vertical.sprite @@ -0,0 +1,9 @@ +(supertux-sprite + (action + (fps 20) + (images "rainsplash-vertical-1.png" + "rainsplash-vertical-2.png" + "rainsplash-vertical-3.png" + "rainsplash-vertical-4.png") + ) +) diff --git a/data/images/objects/particles/rainsplash.sprite b/data/images/objects/particles/rainsplash.sprite new file mode 100644 index 000000000..3d07fd5b5 --- /dev/null +++ b/data/images/objects/particles/rainsplash.sprite @@ -0,0 +1,9 @@ +(supertux-sprite + (action + (fps 20) + (images "rainsplash-1.png" + "rainsplash-2.png" + "rainsplash-3.png" + "rainsplash-4.png") + ) +) diff --git a/data/images/objects/rock/rock.sprite b/data/images/objects/rock/rock.sprite new file mode 100644 index 000000000..66683d641 --- /dev/null +++ b/data/images/objects/rock/rock.sprite @@ -0,0 +1,5 @@ +(supertux-sprite + (action + (name "normal") + (images "../../tiles/blocks/block11.png")) +) diff --git a/data/images/objects/skull_tile/skull_tile.sprite b/data/images/objects/skull_tile/skull_tile.sprite new file mode 100644 index 000000000..524536e37 --- /dev/null +++ b/data/images/objects/skull_tile/skull_tile.sprite @@ -0,0 +1,4 @@ +(supertux-sprite + (action + (images "../skulls/skull.png")) +) diff --git a/data/images/objects/unstable_tile/unstable_tile.sprite b/data/images/objects/unstable_tile/unstable_tile.sprite new file mode 100644 index 000000000..2a0572ddd --- /dev/null +++ b/data/images/objects/unstable_tile/unstable_tile.sprite @@ -0,0 +1,4 @@ +(supertux-sprite + (action + (images "unstable_tile.png")) +) diff --git a/data/images/sprites.strf b/data/images/sprites.strf index fc824cd49..8aa48d8c2 100644 --- a/data/images/sprites.strf +++ b/data/images/sprites.strf @@ -1,193 +1,8 @@ ;; -*- mode: scheme; -*- (supertux-resources -;; Tux is now in seperate .sprite files +;; All sprites are in seperate .sprite files +(ignore-me) -;; Bad Guys are in separate .sprite files - -;; Game elements are in separate .sprite files - -;; Game Objects follow - - ; Flying platform - (sprite (name "platform") - (action - (name "flying") - (x-offset 0) - (y-offset 0) - (images "objects/flying_platform/flying_platform-0.png" - "objects/flying_platform/flying_platform-1.png" - "objects/flying_platform/flying_platform-2.png" - "objects/flying_platform/flying_platform-3.png") - ) - (action - (name "block1") - (x-offset 0) - (y-offset 0) - (images "tiles/blocks/block1.png") - ) - (action - (name "block2") - (x-offset 0) - (y-offset 0) - (images "tiles/blocks/block2.png") - ) - (action - (name "block3") - (x-offset 0) - (y-offset 0) - (images "tiles/blocks/block3.png") - ) - (action - (name "block4") - (x-offset 0) - (y-offset 0) - (images "tiles/blocks/block4.png") - ) - (action - (name "firefly") - (x-offset 0) - (y-offset 0) - (images "tiles/firefly/firefly1.png" - "tiles/firefly/firefly2.png" - "tiles/firefly/firefly3.png" - "tiles/firefly/firefly2.png") - ) - ) - - ; coin - (sprite (name "coin") - (action - (name "normal") - (images "objects/coin/coin-0.png" - "objects/coin/coin-1.png" - "objects/coin/coin-2.png" - "objects/coin/coin-3.png" - "objects/coin/coin-4.png" - "objects/coin/coin-5.png" - "objects/coin/coin-6.png" - "objects/coin/coin-7.png")) - (action - (name "still") - (images "objects/coin/coin-0.png")) - ) - - (sprite (name "bonusblock") - (action - (fps 15) - (name "normal") - (images "objects/bonus_block/full-0.png" - "objects/bonus_block/full-1.png" - "objects/bonus_block/full-2.png" - "objects/bonus_block/full-3.png" - "objects/bonus_block/full-4.png" - "objects/bonus_block/full-2.png" - "objects/bonus_block/full-1.png" - "objects/bonus_block/full-0.png" - "objects/bonus_block/full-0.png" - "objects/bonus_block/full-0.png" - )) - (action - (name "empty") - (images "objects/bonus_block/empty.png")) - ) - - (sprite (name "brick") - (action - (name "empty") - (images "objects/bonus_block/empty.png")) - (action - (name "normal") - (images "tiles/blocks/brick0.png")) - ) - - (sprite (name "icedbrick") - (action - (name "empty") - (images "objects/bonus_block/empty.png")) - (action - (name "normal") - (images "tiles/blocks/brick1.png")) - ) - - (sprite (name "infoblock") - (action - (name "default") - (images "objects/bonus_block/info_block.png") - ) - ) - - (sprite (name "rock") - (action - (name "normal") - (images "tiles/blocks/block11.png")) - ) - - (sprite (name "invisibleblock") - (action - (name "empty") - (images "objects/bonus_block/empty.png")) - ) - - (sprite (name "unstable_tile") - (action - (images "objects/unstable_tile/unstable_tile.png")) - ) - (sprite (name "skull_tile") - (action - (images "objects/skulls/skull.png")) - ) - (sprite (name "rainsplash") - (action - (fps 20) - (images "objects/particles/rainsplash-1.png" - "objects/particles/rainsplash-2.png" - "objects/particles/rainsplash-3.png" - "objects/particles/rainsplash-4.png") - ) - ) - (sprite (name "rainsplash-vertical") - (action - (fps 20) - (images "objects/particles/rainsplash-vertical-1.png" - "objects/particles/rainsplash-vertical-2.png" - "objects/particles/rainsplash-vertical-3.png" - "objects/particles/rainsplash-vertical-4.png") - ) - ) - - (sprite (name "hatch") - (action - (name "normal") - (x-offset 0) - (y-offset 0) - (images "objects/hatch/hatch-0.png")) - (action - (name "open") - (x-offset 0) - (y-offset 0) - (images "objects/hatch/hatch-0.png" - "objects/hatch/hatch-1.png" - "objects/hatch/hatch-2.png" - "objects/hatch/hatch-3.png" - "objects/hatch/hatch-4.png" - "objects/hatch/hatch-5.png")) - ) - - (sprite - (name "lightmap_light") - (action - (name "default") - (images "effects/light_red.png") - ) - ) - - (sprite - (name "eat-me") - (action - (name "default") - (images "tiles/doodads/platter.png") - ) - ) ) diff --git a/src/object/block.cpp b/src/object/block.cpp index ac5bc577c..63b02d9c7 100644 --- a/src/object/block.cpp +++ b/src/object/block.cpp @@ -122,7 +122,7 @@ Block::start_bounce() //--------------------------------------------------------------------------- BonusBlock::BonusBlock(const Vector& pos, int data) - : Block(sprite_manager->create("bonusblock")), object(0) + : Block(sprite_manager->create("images/objects/bonus_block/bonusblock.sprite")), object(0) { bbox.set_pos(pos); sprite->set_action("normal"); @@ -140,7 +140,7 @@ BonusBlock::BonusBlock(const Vector& pos, int data) } BonusBlock::BonusBlock(const lisp::Lisp& lisp) - : Block(sprite_manager->create("bonusblock")) + : Block(sprite_manager->create("images/objects/bonus_block/bonusblock.sprite")) { Vector pos; @@ -268,7 +268,7 @@ IMPLEMENT_FACTORY(BonusBlock, "bonusblock"); //--------------------------------------------------------------------------- Brick::Brick(const Vector& pos, int data) - : Block(sprite_manager->create("brick")), breakable(false), + : Block(sprite_manager->create("images/objects/bonus_block/brick.sprite")), breakable(false), coin_counter(0) { bbox.set_pos(pos); diff --git a/src/object/coin.cpp b/src/object/coin.cpp index d3eb1f5fd..8d969e1a9 100644 --- a/src/object/coin.cpp +++ b/src/object/coin.cpp @@ -34,7 +34,7 @@ Coin::Coin(const Vector& pos) { bbox.set_pos(pos); bbox.set_size(32, 32); - sprite = sprite_manager->create("coin"); + sprite = sprite_manager->create("images/objects/coin/coin.sprite"); set_group(COLGROUP_TOUCHABLE); } @@ -43,7 +43,7 @@ Coin::Coin(const lisp::Lisp& reader) reader.get("x", bbox.p1.x); reader.get("y", bbox.p1.y); bbox.set_size(32, 32); - sprite = sprite_manager->create("coin"); + sprite = sprite_manager->create("images/objects/coin/coin.sprite"); set_group(COLGROUP_TOUCHABLE); } diff --git a/src/object/gameobjs.cpp b/src/object/gameobjs.cpp index 3ea669e47..7e4a98372 100644 --- a/src/object/gameobjs.cpp +++ b/src/object/gameobjs.cpp @@ -41,7 +41,7 @@ BouncyCoin::BouncyCoin(const Vector& pos) : position(pos) { timer.start(.3); - sprite = sprite_manager->create("coin"); + sprite = sprite_manager->create("images/objects/coin/coin.sprite"); sprite->set_action("still"); } diff --git a/src/object/infoblock.cpp b/src/object/infoblock.cpp index 1008c0790..f6703ec59 100644 --- a/src/object/infoblock.cpp +++ b/src/object/infoblock.cpp @@ -29,7 +29,7 @@ #include "sector.hpp" InfoBlock::InfoBlock(const lisp::Lisp& lisp) - : Block(sprite_manager->create("infoblock")) + : Block(sprite_manager->create("images/objects/bonus_block/infoblock.sprite")) { Vector pos; lisp.get("x", pos.x); diff --git a/src/object/invisible_block.cpp b/src/object/invisible_block.cpp index 4d28d2683..38e294769 100644 --- a/src/object/invisible_block.cpp +++ b/src/object/invisible_block.cpp @@ -29,7 +29,7 @@ #include "object_factory.hpp" InvisibleBlock::InvisibleBlock(const Vector& pos) - : Block(sprite_manager->create("invisibleblock")), visible(false) + : Block(sprite_manager->create("images/objects/bonus_block/invisibleblock.sprite")), visible(false) { bbox.set_pos(pos); flags &= ~FLAG_SOLID; diff --git a/src/object/light.cpp b/src/object/light.cpp index ebd8146ac..42dcc2c09 100644 --- a/src/object/light.cpp +++ b/src/object/light.cpp @@ -10,7 +10,7 @@ Light::Light(const lisp::Lisp& ) { - sprite = sprite_manager->create("lightmap_light"); + sprite = sprite_manager->create("images/objects/lightmap_light/lightmap_light.sprite"); } Light::~Light() diff --git a/src/object/platform.cpp b/src/object/platform.cpp index c0a59a74a..374a4ee8b 100644 --- a/src/object/platform.cpp +++ b/src/object/platform.cpp @@ -38,7 +38,7 @@ Platform::Platform(const lisp::Lisp& reader) reader.get("y", bbox.p1.y); reader.get("type", type); reader.get("use_path", use_path); - sprite = sprite_manager->create("platform"); + sprite = sprite_manager->create("images/objects/flying_platform/platform.sprite"); sprite->set_action(type); bbox.set_size(sprite->get_width(), sprite->get_height()); diff --git a/src/object/rainsplash.cpp b/src/object/rainsplash.cpp index 2bd2cc9ab..d53e5314e 100644 --- a/src/object/rainsplash.cpp +++ b/src/object/rainsplash.cpp @@ -21,8 +21,8 @@ RainSplash::RainSplash(Vector pos, bool vertical) { frame = 0; position = pos; - if (vertical) sprite = sprite_manager->create("rainsplash-vertical"); - else sprite = sprite_manager->create("rainsplash"); + if (vertical) sprite = sprite_manager->create("images/objects/particles/rainsplash-vertical.sprite"); + else sprite = sprite_manager->create("images/objects/particles/rainsplash.sprite"); } RainSplash::~RainSplash() { diff --git a/src/object/rock.cpp b/src/object/rock.cpp index ea1ed64a3..5b022b5aa 100644 --- a/src/object/rock.cpp +++ b/src/object/rock.cpp @@ -32,7 +32,7 @@ Rock::Rock(const lisp::Lisp& reader) reader.get("x", bbox.p1.x); reader.get("y", bbox.p1.y); bbox.set_size(31.8, 31.8); - sprite = sprite_manager->create("rock"); + sprite = sprite_manager->create("images/objects/rock/rock.sprite"); grabbed = false; flags |= FLAG_SOLID | FLAG_PORTABLE; } diff --git a/src/object/skull_tile.cpp b/src/object/skull_tile.cpp index d49f40759..d73a6d129 100644 --- a/src/object/skull_tile.cpp +++ b/src/object/skull_tile.cpp @@ -37,7 +37,7 @@ SkullTile::SkullTile(const lisp::Lisp& lisp) lisp.get("x", bbox.p1.x); lisp.get("y", bbox.p1.y); bbox.set_size(32, 32); - sprite = sprite_manager->create("skull_tile"); + sprite = sprite_manager->create("images/objects/skull_tile/skull_tile.sprite"); flags |= FLAG_SOLID; set_group(COLGROUP_STATIC); diff --git a/src/object/unstable_tile.cpp b/src/object/unstable_tile.cpp index 4db794b6e..543568a6d 100644 --- a/src/object/unstable_tile.cpp +++ b/src/object/unstable_tile.cpp @@ -37,7 +37,7 @@ UnstableTile::UnstableTile(const lisp::Lisp& lisp) lisp.get("x", bbox.p1.x); lisp.get("y", bbox.p1.y); bbox.set_size(32, 32); - sprite = sprite_manager->create("unstable_tile"); + sprite = sprite_manager->create("images/objects/unstable_tile/unstable_tile.sprite"); flags |= FLAG_SOLID; set_group(COLGROUP_STATIC); } diff --git a/src/trigger/door.cpp b/src/trigger/door.cpp index a7eaf5598..5be83dabf 100644 --- a/src/trigger/door.cpp +++ b/src/trigger/door.cpp @@ -47,7 +47,7 @@ Door::Door(int x, int y, std::string sector, std::string spawnpoint) target_sector = sector; target_spawnpoint = spawnpoint; - sprite = sprite_manager->create("door"); + sprite = sprite_manager->create("images/objects/door/door.sprite"); } Door::~Door() diff --git a/src/trigger/hatch.cpp b/src/trigger/hatch.cpp index f2e11a3b2..440c2f129 100644 --- a/src/trigger/hatch.cpp +++ b/src/trigger/hatch.cpp @@ -37,7 +37,7 @@ Hatch::Hatch(const lisp::Lisp& reader) reader.get("sector", target_sector); reader.get("spawnpoint", target_spawnpoint); - sprite = sprite_manager->create("hatch"); + sprite = sprite_manager->create("images/objects/hatch/hatch.sprite"); } Hatch::Hatch(int x, int y, std::string sector, std::string spawnpoint) @@ -47,7 +47,7 @@ Hatch::Hatch(int x, int y, std::string sector, std::string spawnpoint) target_sector = sector; target_spawnpoint = spawnpoint; - sprite = sprite_manager->create("hatch"); + sprite = sprite_manager->create("images/objects/hatch/hatch.sprite"); } Hatch::~Hatch() -- 2.11.0