Update of /cvsroot/super-tux/supertux/lib/special
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31225/lib/special
Modified Files:
sprite.cpp sprite.h
Log Message:
- Major changes in Setup-API.
- Moved all sound handling into SoundManager,
which became a singleton.
Index: sprite.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/lib/special/sprite.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sprite.cpp 22 Jul 2004 19:07:50 -0000 1.3
+++ sprite.cpp 25 Jul 2004 19:03:34 -0000 1.4
@@ -34,14 +34,14 @@
LispReader reader(cur);
if(!reader.read_string("name", name))
- st_abort("Sprite wihtout name", "");
+ Termination::abort("Sprite wihtout name", "");
reader.read_int("x-hotspot", x_hotspot);
reader.read_int("y-hotspot", y_hotspot);
reader.read_float("fps", fps);
std::vector<std::string> images;
if(!reader.read_string_vector("images", images))
- st_abort("Sprite contains no images: ", name.c_str());
+ Termination::abort("Sprite contains no images: ", name.c_str());
for(std::vector<std::string>::size_type i = 0; i < images.size(); ++i)
{
Index: sprite.h
===================================================================
RCS file: /cvsroot/super-tux/supertux/lib/special/sprite.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sprite.h 22 Jul 2004 19:07:50 -0000 1.3
+++ sprite.h 25 Jul 2004 19:03:34 -0000 1.4
@@ -32,24 +32,6 @@
class Sprite
{
- private:
- std::string name;
-
- int x_hotspot;
- int y_hotspot;
-
- /** Frames per second */
- float fps;
-
- /** Number of seconds that a frame is displayed until it is switched
- to the next frame */
- float frame_delay;
-
- float time;
-
- std::vector<Surface*> surfaces;
-
- void init_defaults();
public:
/** cur has to be a pointer to data in the form of ((x-hotspot 5)
(y-hotspot 10) ...) */
@@ -86,7 +68,25 @@
return surfaces[frame];
else
return surfaces[0];
- }
+ }
+ private:
+ std::string name;
+
+ int x_hotspot;
+ int y_hotspot;
+
+ /** Frames per second */
+ float fps;
+
+ /** Number of seconds that a frame is displayed until it is switched
+ to the next frame */
+ float frame_delay;
+
+ float time;
+
+ std::vector<Surface*> surfaces;
+
+ void init_defaults();
};
} //namespace SuperTux
|