[Supertux-Commit] r5468 - in trunk/supertux/src: . badguy object trigger

sik0fewl at millhouse.dreamhost.com sik0fewl at millhouse.dreamhost.com
Tue May 13 18:48:37 PDT 2008


Author: sik0fewl
Date: 2008-05-13 18:48:36 -0700 (Tue, 13 May 2008)
New Revision: 5468

Modified:
   trunk/supertux/src/badguy/ghosttree.cpp
   trunk/supertux/src/badguy/jumpy.cpp
   trunk/supertux/src/badguy/mole.cpp
   trunk/supertux/src/badguy/mole_rock.cpp
   trunk/supertux/src/badguy/stumpy.cpp
   trunk/supertux/src/object/ambient_sound.cpp
   trunk/supertux/src/object/flower.cpp
   trunk/supertux/src/object/invisible_block.cpp
   trunk/supertux/src/object/player.cpp
   trunk/supertux/src/sector.cpp
   trunk/supertux/src/trigger/door.cpp
Log:
Applied sound pre-loading patch from mathnerd314 (#331)

Modified: trunk/supertux/src/badguy/ghosttree.cpp
===================================================================
--- trunk/supertux/src/badguy/ghosttree.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/badguy/ghosttree.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -40,6 +40,8 @@
 {
   glow_sprite.reset(sprite_manager->create("images/creatures/ghosttree/ghosttree-glow.sprite"));
   set_colgroup_active(COLGROUP_TOUCHABLE);
+  sound_manager->preload("sounds/tree_howling.ogg");
+  sound_manager->preload("sounds/tree_suck.ogg");
 }
 
 GhostTree::~GhostTree()

Modified: trunk/supertux/src/badguy/jumpy.cpp
===================================================================
--- trunk/supertux/src/badguy/jumpy.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/badguy/jumpy.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -28,6 +28,8 @@
 Jumpy::Jumpy(const lisp::Lisp& reader)
     : BadGuy(reader, "images/creatures/snowjumpy/snowjumpy.sprite"), groundhit_pos_set(false)
 {
+  // TODO create a nice sound for this...
+  //sound_manager->preload("sounds/skid.wav");
 }
 
 void

Modified: trunk/supertux/src/badguy/mole.cpp
===================================================================
--- trunk/supertux/src/badguy/mole.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/badguy/mole.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -36,12 +36,18 @@
 	: BadGuy(reader, "images/creatures/mole/mole.sprite", LAYER_TILES-1), state(PRE_THROWING)
 {
   physic.enable_gravity(false);
+  sound_manager->preload("sounds/fall.wav");
+  sound_manager->preload("sounds/squish.wav");
+  sound_manager->preload("sounds/dartfire.wav";
 }
 
 Mole::Mole(const Vector& pos)
 	: BadGuy(pos, "images/creatures/mole/mole.sprite", LAYER_TILES-1), state(PRE_THROWING)
 {
   physic.enable_gravity(false);
+  sound_manager->preload("sounds/fall.wav");
+  sound_manager->preload("sounds/squish.wav");
+  sound_manager->preload("sounds/dartfire.wav";
 }
 
 void

Modified: trunk/supertux/src/badguy/mole_rock.cpp
===================================================================
--- trunk/supertux/src/badguy/mole_rock.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/badguy/mole_rock.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -27,6 +27,8 @@
 {
   physic.enable_gravity(true);
   countMe = false;
+  sound_manager->preload("sounds/fall.wav");
+  sound_manager->preload("sounds/stomp.wav");
 }
 
 MoleRock::MoleRock(const Vector& pos, const Vector& velocity, const BadGuy* parent = 0)
@@ -34,11 +36,15 @@
 {
   physic.enable_gravity(true);
   countMe = false;
+  sound_manager->preload("sounds/fall.wav");
+  sound_manager->preload("sounds/stomp.wav");
 }
 
 MoleRock::MoleRock(const MoleRock& other)
 	: BadGuy(other), parent(other.parent), initial_velocity(Vector(0, -400))
 {
+  sound_manager->preload("sounds/fall.wav");
+  sound_manager->preload("sounds/stomp.wav");
 }
 
 MoleRock::~MoleRock()

Modified: trunk/supertux/src/badguy/stumpy.cpp
===================================================================
--- trunk/supertux/src/badguy/stumpy.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/badguy/stumpy.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -32,7 +32,6 @@
 {
   walk_speed = WALKSPEED;
   max_drop_height = 16;
-  sound_manager->preload("sounds/mr_tree.ogg");
   sound_manager->preload("sounds/mr_treehit.ogg");
 }
 

Modified: trunk/supertux/src/object/ambient_sound.cpp
===================================================================
--- trunk/supertux/src/object/ambient_sound.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/object/ambient_sound.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -109,6 +109,7 @@
     silence_distance = 1/distance_factor;
 
   sound_source = 0; // not playing at the beginning
+  sound_manager->preload(sample);
   latency=0;
 }
 

Modified: trunk/supertux/src/object/flower.cpp
===================================================================
--- trunk/supertux/src/object/flower.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/object/flower.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -40,6 +40,7 @@
   }
   else if(type == ICE_BONUS) {
     sprite = sprite_manager->create("images/powerups/iceflower/iceflower.sprite");
+    sound_manager->preload("sounds/fire-flower.wav");
   } else {
     assert(false);
   }

Modified: trunk/supertux/src/object/invisible_block.cpp
===================================================================
--- trunk/supertux/src/object/invisible_block.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/object/invisible_block.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -33,7 +33,6 @@
 {
   bbox.set_pos(pos);
   sound_manager->preload("sounds/brick.wav");
-  sound_manager->preload("sounds/brick.wav");
 }
 
 void

Modified: trunk/supertux/src/object/player.cpp
===================================================================
--- trunk/supertux/src/object/player.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/object/player.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -113,7 +113,6 @@
   sound_manager->preload("sounds/flip.wav");
   sound_manager->preload("sounds/invincible_start.ogg");
   sound_manager->preload("sounds/splash.ogg");
-  sound_manager->preload("sounds/shoot.wav");
 
   init();
 }

Modified: trunk/supertux/src/sector.cpp
===================================================================
--- trunk/supertux/src/sector.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/sector.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -83,6 +83,8 @@
   add_object(new DisplayEffect("Effect"));
   add_object(new TextObject("Text"));
 
+  sound_manager->preload("sounds/shoot.wav");
+
   // create a new squirrel table for the sector
   using namespace Scripting;
 

Modified: trunk/supertux/src/trigger/door.cpp
===================================================================
--- trunk/supertux/src/trigger/door.cpp	2008-05-13 23:51:13 UTC (rev 5467)
+++ trunk/supertux/src/trigger/door.cpp	2008-05-14 01:48:36 UTC (rev 5468)
@@ -41,6 +41,8 @@
   sprite = sprite_manager->create("images/objects/door/door.sprite");
   sprite->set_action("closed");
   bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
+
+  sound_manager->preload("sounds/door.wav");
 }
 
 Door::Door(int x, int y, std::string sector, std::string spawnpoint)
@@ -53,6 +55,8 @@
   sprite = sprite_manager->create("images/objects/door/door.sprite");
   sprite->set_action("closed");
   bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
+
+  sound_manager->preload("sounds/door.wav");
 }
 
 Door::~Door()
@@ -72,7 +76,7 @@
 
   writer.write_string("sector", target_sector);
   writer.write_string("spawnpoint", target_spawnpoint);
-  sound_manager->preload("sounds/door.wav");
+
   writer.end_list("door");
 }
 




More information about the Supertux-Commit mailing list