[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src pingus_resource.cxx, 1.35, 1.36 sprit
From: |
Ingo Ruhnke |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src pingus_resource.cxx, 1.35, 1.36 sprite.cxx, 1.19, 1.20 |
Date: |
Sat, 13 Dec 2003 17:23:41 +0100 |
Update of /var/lib/cvs/Games/Pingus/src
In directory dark:/tmp/cvs-serv13851/src
Modified Files:
pingus_resource.cxx sprite.cxx
Log Message:
- editor starts now
- level startup screen also shows partly
Index: pingus_resource.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_resource.cxx,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- pingus_resource.cxx 13 Dec 2003 15:10:44 -0000 1.35
+++ pingus_resource.cxx 13 Dec 2003 16:23:39 -0000 1.36
@@ -109,6 +109,7 @@
PingusResource::load_sprite(const std::string& res_name,
const std::string& datafile)
{
+ std::cout << "PingusResource::load_sprite: " << res_name << ", " << datafile
<< std::endl;
CL_ResourceManager* res = get(datafile);
return CL_Sprite(res_name, res);
}
Index: sprite.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/sprite.cxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- sprite.cxx 22 Oct 2003 12:35:47 -0000 1.19
+++ sprite.cxx 13 Dec 2003 16:23:39 -0000 1.20
@@ -37,7 +37,7 @@
float arg_frames_per_second,
Sprite::Direction dir,
LoopType arg_loop_type)
- : sprite(PingusResource::load_sprite(arg_sprite_name, arg_datafile)),
+ : //sprite(PingusResource::load_sprite(arg_sprite_name, arg_datafile)),
frame (0.0f),
frames_per_second (arg_frames_per_second),
direction (dir),
@@ -50,13 +50,9 @@
void
Sprite::draw (int x, int y)
{
- //if (!sprite)// FIXME: CL0.7
- //return;
-
#ifdef CLANLIB_0_6
// FIXME: HACK
update (0.0f);
- //std::cout << "Frame: " << round(frame) << " " << frame << " " <<
max_frames () << std::endl;
switch (direction)
{
@@ -123,34 +119,42 @@
void
Sprite::set_align_center ()
{
+#ifdef CLANLIB_0_6
x_align = -int(sprite.get_width ())/2;
y_align = -int(sprite.get_height ())/2;
+#endif
}
void
Sprite::set_align_center_bottom ()
{
+#ifdef CLANLIB_0_6
x_align = -int(sprite.get_width ())/2;
y_align = -int(sprite.get_height ());
+#endif
}
void
Sprite::next_frame ()
{
+#ifdef CLANLIB_0_6
++frame;
if (Math::round(frame) >= int(sprite.get_frame_count()))
frame = 0;
+#endif
}
void
Sprite::previous_frame ()
{
+#ifdef CLANLIB_0_6
--frame;
if (Math::round(frame) < 0)
frame = sprite.get_frame_count() - 1;
+#endif
}
@@ -169,6 +173,7 @@
int
Sprite::max_frames ()
{
+#ifdef CLANLIB_0_6
switch (direction)
{
case NONE:
@@ -180,6 +185,9 @@
assert (0);
return 0;
}
+#else
+ return 0;
+#endif
}
void
@@ -266,13 +274,19 @@
int
Sprite::get_width ()
{
- return sprite.get_width();
+ if (!sprite)
+ return 0;
+ else
+ return sprite.get_width();
}
int
Sprite::get_height ()
{
- return sprite.get_height();
+ if (!sprite)
+ return 0;
+ else
+ return sprite.get_height();
}
} // namespace Pingus
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src pingus_resource.cxx, 1.35, 1.36 sprite.cxx, 1.19, 1.20,
Ingo Ruhnke <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus configure.ac,1.20,1.21
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/data/data core.xml, 1.1, 1.2 editor.xml, 1.1, 1.2
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus configure.ac,1.20,1.21
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/data/data core.xml, 1.1, 1.2 editor.xml, 1.1, 1.2
- Index(es):