Add some more sound_manager->preloads into object constructors
authorWolfgang Becker <uafr@gmx.de>
Sun, 2 Jul 2006 20:50:13 +0000 (20:50 +0000)
committerWolfgang Becker <uafr@gmx.de>
Sun, 2 Jul 2006 20:50:13 +0000 (20:50 +0000)
SVN-Revision: 3843

13 files changed:
src/badguy/dart.cpp
src/badguy/darttrap.cpp
src/badguy/mriceblock.cpp
src/badguy/mrtree.cpp
src/badguy/snail.cpp
src/badguy/yeti.cpp
src/object/block.cpp
src/object/fireworks.cpp
src/object/flower.cpp
src/object/growup.cpp
src/object/invisible_block.cpp
src/object/player.cpp
src/object/powerup.cpp

index 7e2d5df..5e70e26 100644 (file)
@@ -33,6 +33,8 @@ Dart::Dart(const lisp::Lisp& reader)
 {
   physic.enable_gravity(false);
   countMe = false;
+  sound_manager->preload("sounds/darthit.wav");
+  sound_manager->preload("sounds/stomp.wav");
 }
 
 Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent = 0)
@@ -40,12 +42,16 @@ Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent = 0)
 {
   physic.enable_gravity(false);
   countMe = false;
+  sound_manager->preload("sounds/darthit.wav");
+  sound_manager->preload("sounds/stomp.wav");
 }
 
 Dart::Dart(const Dart& other)
        : BadGuy(other), set_direction(other.set_direction), initial_direction(other.initial_direction), parent(other.parent)
 {
   sound_source.reset(sound_manager->create_sound_source(SOUNDFILE));
+  sound_manager->preload("sounds/darthit.wav");
+  sound_manager->preload("sounds/stomp.wav");
 }
 
 Dart::~Dart()
index 130ecca..d86326b 100644 (file)
@@ -33,6 +33,7 @@ DartTrap::DartTrap(const lisp::Lisp& reader)
   reader.get("fire-delay", fire_delay);
   reader.get("ammo", ammo);
   countMe = false;
+  sound_manager->preload("sounds/dartfire.wav");
 }
 
 void
index 49ed170..efc1556 100644 (file)
@@ -32,6 +32,9 @@ MrIceBlock::MrIceBlock(const lisp::Lisp& reader)
   : BadGuy(reader, "images/creatures/mr_iceblock/mr_iceblock.sprite"), ice_state(ICESTATE_NORMAL), squishcount(0)
 {
   set_direction = false;
+  sound_manager->preload("sounds/iceblock_bump.wav");
+  sound_manager->preload("sounds/stomp.wav");
+  sound_manager->preload("sounds/kick.wav");
 }
 
 MrIceBlock::MrIceBlock(const Vector& pos, Direction d)
@@ -39,6 +42,9 @@ MrIceBlock::MrIceBlock(const Vector& pos, Direction d)
 {
   set_direction = true;
   initial_direction = d;
+  sound_manager->preload("sounds/iceblock_bump.wav");
+  sound_manager->preload("sounds/stomp.wav");
+  sound_manager->preload("sounds/kick.wav");
 }
 
 void
index 2f848ce..3f92211 100644 (file)
@@ -35,6 +35,8 @@ MrTree::MrTree(const lisp::Lisp& reader)
   : BadGuy(reader, "images/creatures/mr_tree/mr_tree.sprite"), mystate(STATE_BIG)
 {
   sprite->set_action(dir == LEFT ? "large-left" : "large-right");
+  sound_manager->preload("sounds/mr_tree.ogg");
+  sound_manager->preload("sounds/mr_treehit.ogg");
 }
 
 void
index c2da556..dea697b 100644 (file)
@@ -33,6 +33,9 @@ Snail::Snail(const lisp::Lisp& reader)
   : BadGuy(reader, "images/creatures/snail/snail.sprite"), state(STATE_NORMAL), squishcount(0)
 {
   set_direction = false;
+  sound_manager->preload("sounds/iceblock_bump.wav");
+  sound_manager->preload("sounds/stomp.wav");
+  sound_manager->preload("sounds/kick.wav");
 }
 
 Snail::Snail(const Vector& pos, Direction d)
@@ -40,6 +43,9 @@ Snail::Snail(const Vector& pos, Direction d)
 {
   set_direction = true;
   initial_direction = d;
+  sound_manager->preload("sounds/iceblock_bump.wav");
+  sound_manager->preload("sounds/stomp.wav");
+  sound_manager->preload("sounds/kick.wav");
 }
 
 void
index 9f69245..8528e82 100644 (file)
@@ -58,6 +58,8 @@ Yeti::Yeti(const lisp::Lisp& reader)
   hit_points = INITIAL_HITPOINTS;
   reader.get("dead-script", dead_script);
   countMe = false;
+  sound_manager->preload("sounds/yeti_gna.wav");
+  sound_manager->preload("sounds/yeti_roar.wav");
 }
 
 Yeti::~Yeti()
index 6d0c5f4..3ab0d1b 100644 (file)
@@ -54,6 +54,8 @@ Block::Block(Sprite* newsprite)
   bbox.set_size(32, 32.1);
   set_group(COLGROUP_STATIC);
   flags |= FLAG_SOLID;
+  sound_manager->preload("sounds/upgrade.wav");
+  sound_manager->preload("sounds/brick.wav");
 }
 
 Block::~Block()
index a6333c5..d218c06 100644 (file)
@@ -32,6 +32,7 @@
 Fireworks::Fireworks()
 {
   timer.start(.2);
+  sound_manager->preload("sounds/fireworks.wav");
 }
 
 Fireworks::~Fireworks()
index 5bfbfc4..4e4c878 100644 (file)
@@ -33,8 +33,10 @@ Flower::Flower(Type _type)
 {
   bbox.set_size(32, 32);
 
-  if(_type == FIREFLOWER)
+  if(_type == FIREFLOWER){
     sprite = sprite_manager->create("images/powerups/fireflower/fireflower.sprite");
+    sound_manager->preload("sounds/fire-flower.wav");
+  }
   else
     sprite = sprite_manager->create("images/powerups/iceflower/iceflower.sprite"); 
 
index bdcb894..32e3674 100644 (file)
@@ -32,6 +32,7 @@ GrowUp::GrowUp()
 {
   physic.enable_gravity(true);
   physic.set_velocity_x(100);
+  sound_manager->preload("sounds/grow.wav");
 }
 
 void
index c923c11..d914b2b 100644 (file)
@@ -33,6 +33,7 @@ InvisibleBlock::InvisibleBlock(const Vector& pos)
   bbox.set_pos(pos);
   flags &= ~FLAG_SOLID;
   set_group(COLGROUP_MOVING);
+  sound_manager->preload("sounds/brick.wav");
 }
 
 void
index ebed28a..3c23106 100644 (file)
@@ -118,6 +118,7 @@ Player::Player(PlayerStatus* _player_status)
   sound_manager->preload("sounds/hurt.wav");
   sound_manager->preload("sounds/skid.wav");
   sound_manager->preload("sounds/flip.wav");
+  sound_manager->preload("sounds/invincible.wav");
 
   init();
 }
index f274d48..ebced41 100644 (file)
@@ -37,6 +37,8 @@ PowerUp::PowerUp(const lisp::Lisp& lisp)
   no_physics = false;
   lisp.get("disable-physics", no_physics);
   physic.enable_gravity(true);
+  sound_manager->preload("sounds/grow.wav");
+  sound_manager->preload("sounds/fire-flower.wav");
 }
 
 HitResponse