[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.77,1.78 console.cxx,1.2
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.77,1.78 console.cxx,1.2,1.3 fade_out.cxx,1.1,1.2 multiline_text.cxx,1.2,1.3 pingus_resource.cxx,1.3,1.4 pingus_resource.hxx,1.2,1.3 smallmap.cxx,1.3,1.4 spot_map.cxx,1.3,1.4 world.cxx,1.6,1.7 |
Date: |
20 Jun 2002 16:48:13 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv22378
Modified Files:
Makefile.am console.cxx fade_out.cxx multiline_text.cxx
pingus_resource.cxx pingus_resource.hxx smallmap.cxx
spot_map.cxx world.cxx
Log Message:
Some win32 fixes
Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/Makefile.am,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- Makefile.am 12 Jun 2002 19:11:29 -0000 1.77
+++ Makefile.am 20 Jun 2002 16:48:11 -0000 1.78
@@ -200,6 +200,7 @@
multiplayer_client.cxx worldobj_data_factory.cxx \
multiplayer_client_child.cxx worldobj_group_data.cxx \
multiplayer_config.cxx xml_helper.cxx \
-multiplayer_game.cxx xml_plf.cxx
+multiplayer_game.cxx xml_plf.cxx \
+math.hxx
## EOF ##
Index: console.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/console.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- console.cxx 13 Jun 2002 14:25:12 -0000 1.2
+++ console.cxx 20 Jun 2002 16:48:11 -0000 1.3
@@ -17,12 +17,14 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#include <assert.h>
#include <ClanLib/Display/Display/display.h>
#include <ClanLib/Display/Font/font.h>
#include "pingus_resource.hxx"
#include "console.hxx"
+#include "math.hxx"
-using namespace std;
+using namespace Pingus;
// Globale console
Console console;
@@ -104,7 +106,7 @@
}
Console::Console()
- : ostream (&streambuf)
+ : std::ostream (&streambuf)
{
is_init = false;
is_visible = false;
@@ -142,9 +144,9 @@
CL_Display::get_height() - (font->get_height() * (number_of_lines + 3));
if (draw_current_line)
- start_index = max(0, current_pos - number_of_lines);
+ start_index = Math::max(0, current_pos - number_of_lines);
else
- start_index = max(0, current_pos - number_of_lines-1);
+ start_index = Math::max(0, current_pos - number_of_lines-1);
CL_Display::fill_rect(0, start_y_pos,
CL_Display::get_width(),
Index: fade_out.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/fade_out.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fade_out.cxx 12 Jun 2002 19:09:37 -0000 1.1
+++ fade_out.cxx 20 Jun 2002 16:48:11 -0000 1.2
@@ -23,7 +23,9 @@
#include "display.hxx"
#include "fade_out.hxx"
#include "globals.hxx"
+#include "math.hxx"
+using namespace Pingus;
using namespace std;
FadeOut::FadeOut (float seconds, Color color)
@@ -66,7 +68,7 @@
float
FadeOut::get_progress ()
{
- return min(passed_time/complete_time, 1.0f);
+ return Math::min(passed_time/complete_time, 1.0f);
}
void
Index: multiline_text.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/multiline_text.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- multiline_text.cxx 13 Jun 2002 14:25:12 -0000 1.2
+++ multiline_text.cxx 20 Jun 2002 16:48:11 -0000 1.3
@@ -17,9 +17,12 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#include <assert.h>
#include <ClanLib/Display/Font/font.h>
#include "multiline_text.hxx"
+#include "math.hxx"
+using namespace Pingus;
using namespace std;
MultiLineText::MultiLineText()
@@ -77,7 +80,7 @@
*/
width = 0;
for(vector<string>::iterator i = text.begin(); i != text.end(); i++)
- width = max(width, font->get_text_width(i->c_str()));
+ width = Math::max(width, font->get_text_width(i->c_str()));
height = text.size() * font->get_height();
}
Index: pingus_resource.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_resource.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pingus_resource.cxx 18 Jun 2002 21:17:16 -0000 1.3
+++ pingus_resource.cxx 20 Jun 2002 16:48:11 -0000 1.4
@@ -17,6 +17,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#include <assert.h>
#include <ClanLib/png.h>
#include <ClanLib/Display/Font/font.h>
#include "system.hxx"
Index: pingus_resource.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_resource.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pingus_resource.hxx 18 Jun 2002 21:17:16 -0000 1.2
+++ pingus_resource.hxx 20 Jun 2002 16:48:11 -0000 1.3
@@ -52,6 +52,10 @@
///
PingusResource();
+ /** */
+ static unsigned int get_mtime (const std::string& res_name,
+ const std::string& datafile);
+
/** Load a surface with res_name from datafile */
static CL_Surface load_surface(const std::string& res_name,
const std::string& datafile);
Index: smallmap.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/smallmap.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- smallmap.cxx 17 Jun 2002 15:45:26 -0000 1.3
+++ smallmap.cxx 20 Jun 2002 16:48:11 -0000 1.4
@@ -30,7 +30,9 @@
#include "col_map.hxx"
#include "server.hxx"
#include "pingu.hxx"
+#include "math.hxx"
+using namespace Pingus;
using namespace std;
SmallMap::SmallMap()
@@ -163,8 +165,8 @@
Display::draw_rect(x_of,
y_of + CL_Display::get_height() - sur.get_height(),
- x_of + min(rwidth, int(sur.get_width())),
- y_of + min(rheight, int(sur.get_height())) +
CL_Display::get_height() - sur.get_height(),
+ x_of + Math::min(rwidth, int(sur.get_width())),
+ y_of + Math::min(rheight, int(sur.get_height())) +
CL_Display::get_height() - sur.get_height(),
0.0, 1.0, 0.0, 1.0);
// FIXME: This should use put_target(), but put_target(), does not
Index: spot_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/spot_map.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- spot_map.cxx 20 Jun 2002 12:22:51 -0000 1.3
+++ spot_map.cxx 20 Jun 2002 16:48:11 -0000 1.4
@@ -28,7 +28,9 @@
#include "spot_map.hxx"
#include "my_gettext.hxx"
#include "col_map.hxx"
+#include "math.hxx"
+using namespace Pingus;
using namespace std;
MapTileSurface::MapTileSurface()
@@ -326,8 +328,8 @@
sprovider,
x - (ix * tile_size), y - (iy * tile_size),
// FIXME, I am broken
- max(x, ix * tile_size),
- max(y, iy * tile_size));
+ Math::max(x, ix * tile_size),
+ Math::max(y, iy * tile_size));
tile[ix][iy].reload();
}
}
@@ -571,10 +573,10 @@
void
PingusSpotMap::mark_tiles_not_empty(int x_pos, int y_pos, int sur_width, int
sur_height)
{
- int start_x = max(0, x_pos / tile_size);
- int start_y = max(0, y_pos / tile_size);
- int stop_x = min(width / tile_size, (x_pos + sur_width - 1) / tile_size +
1);
- int stop_y = min(height / tile_size, (y_pos + sur_height - 1) / tile_size +
1);
+ int start_x = Math::max(0, x_pos / tile_size);
+ int start_y = Math::max(0, y_pos / tile_size);
+ int stop_x = Math::min(width / tile_size, (x_pos + sur_width - 1) /
tile_size + 1);
+ int stop_y = Math::min(height / tile_size, (y_pos + sur_height - 1) /
tile_size + 1);
//cout << "X: " << start_x << " Y: " << start_y << endl;
//cout << "stop_X: " << stop_x << " stop_Y: " << stop_y << endl;
Index: world.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/world.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- world.cxx 19 Jun 2002 15:19:26 -0000 1.6
+++ world.cxx 20 Jun 2002 16:48:11 -0000 1.7
@@ -17,6 +17,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#include <assert.h>
#include "force_vector.hxx"
#include "plf.hxx"
#include "pingu_holder.hxx"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.77,1.78 console.cxx,1.2,1.3 fade_out.cxx,1.1,1.2 multiline_text.cxx,1.2,1.3 pingus_resource.cxx,1.3,1.4 pingus_resource.hxx,1.2,1.3 smallmap.cxx,1.3,1.4 spot_map.cxx,1.3,1.4 world.cxx,1.6,1.7,
grumbel <=