[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src spot_map.cxx,1.19,1.20
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src spot_map.cxx,1.19,1.20 |
Date: |
7 Oct 2002 23:53:43 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv9923
Modified Files:
spot_map.cxx
Log Message:
fixed bug crash bug #696 when pingus explode near the screen border
Index: spot_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/spot_map.cxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- spot_map.cxx 27 Sep 2002 11:26:44 -0000 1.19
+++ spot_map.cxx 7 Oct 2002 23:53:41 -0000 1.20
@@ -244,11 +244,15 @@
PingusSpotMap::remove(CL_SurfaceProvider* sprovider, int x, int y)
{
// Get the start tile and end tile
- int start_x = x / tile_size;
- int start_y = y / tile_size;
- int end_x = (x + sprovider->get_width()) / tile_size;
- int end_y = (y + sprovider->get_height()) / tile_size;
-
+ int start_x = Math::max(x / tile_size, 0);
+ int start_y = Math::max(y / tile_size, 0);
+ int end_x = Math::min((x + sprovider->get_width()) / tile_size,
+ static_cast<unsigned int>(width/tile_size));
+ int end_y = Math::min((y + sprovider->get_height()) / tile_size,
+ static_cast<unsigned int>(height/tile_size));
+
+
+
for(int ix = start_x; ix <= end_x; ++ix)
{
for(int iy = start_y; iy <= end_y; ++iy)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src spot_map.cxx,1.19,1.20,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src client.cxx,1.28,1.29 game_session.cxx,1.17,1.18 timer.cxx,1.2,1.3 timer.hxx,1.5,1.6
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src pingu_holder.cxx,1.15,1.16 pingu_holder.hxx,1.13,1.14 world.cxx,1.30,1.31 world.hxx,1.17,1.18
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src client.cxx,1.28,1.29 game_session.cxx,1.17,1.18 timer.cxx,1.2,1.3 timer.hxx,1.5,1.6
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src pingu_holder.cxx,1.15,1.16 pingu_holder.hxx,1.13,1.14 world.cxx,1.30,1.31 world.hxx,1.17,1.18
- Index(es):