[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src blitter.cxx, 1.33, 1.34 blitter_impl.
From: |
Ingo Ruhnke |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src blitter.cxx, 1.33, 1.34 blitter_impl.hxx, 1.15, 1.16 button_panel.cxx, 1.27, 1.28 col_map.cxx, 1.22, 1.23 col_map.hxx, 1.14, 1.15 console.cxx, 1.18, 1.19 console.hxx, 1.15, 1.16 demo_session.cxx, 1.11, 1.12 fps_counter.cxx, 1.10, 1.11 fps_counter.hxx, 1.9, 1.10 game_session.cxx, 1.41, 1.42 global_event.cxx, 1.13, 1.14 gui_obj.cxx, 1.3, 1.4 hurry_up.cxx, 1.9, 1.10 hurry_up.hxx, 1.10, 1.11 loading.cxx, 1.9, 1.10 menu_button.hxx, 1.6, 1.7 multiline_text.cxx, 1.9, 1.10 multiline_text.hxx, 1.8, 1.9 pingus_counter.cxx, 1.17, 1.18 pingus_counter.hxx, 1.13, 1.14 pingus_counter_bar.cxx, 1.10, 1.11 pingus_main.cxx, 1.101, 1.102 pingus_menu_manager.cxx, 1.28, 1.29 pingus_resource.cxx, 1.31, 1.32 pingus_sub_menu.cxx, 1.1, 1.2 playfield.cxx, 1.38, 1.39 playfield_view.cxx, 1.6, 1.7 result.cxx, 1.3, 1.4 result.hxx, 1.8, 1.9 result_screen.cxx, 1.19, 1.20 savegame.cxx, 1.5, 1.6 savegame.hxx, 1.6, 1.7 screenshot.cxx, 1.16, 1.17 smallmap.cxx, 1.40, 1.41 smallmap.hxx, 1.20, 1.21 smallmap_image.cxx, 1.12, 1.13 smallmap_image.hxx, 1.10, 1.11 spot_map.cxx, 1.29, 1.30 sprite.cxx, 1.16, 1.17 start_screen.cxx, 1.21, 1.22 story_screen.cxx, 1.23, 1.24 string_format.cxx, 1.3, 1.4 string_format.hxx, 1.2, 1.3 target_provider.cxx, 1.3, 1.4 theme.cxx, 1.21, 1.22 theme.hxx, 1.8, 1.9 theme_selector.cxx, 1.15, 1.16 theme_selector.hxx, 1.9, 1.10 time_display.cxx, 1.18, 1.19 time_display.hxx, 1.13, 1.14 |
Date: |
Tue, 21 Oct 2003 23:37:08 +0200 |
Update of /var/lib/cvs/Games/Pingus/src
In directory dark:/tmp/cvs-serv23485
Modified Files:
blitter.cxx blitter_impl.hxx button_panel.cxx col_map.cxx
col_map.hxx console.cxx console.hxx demo_session.cxx
fps_counter.cxx fps_counter.hxx game_session.cxx
global_event.cxx gui_obj.cxx hurry_up.cxx hurry_up.hxx
loading.cxx menu_button.hxx multiline_text.cxx
multiline_text.hxx pingus_counter.cxx pingus_counter.hxx
pingus_counter_bar.cxx pingus_main.cxx pingus_menu_manager.cxx
pingus_resource.cxx pingus_sub_menu.cxx playfield.cxx
playfield_view.cxx result.cxx result.hxx result_screen.cxx
savegame.cxx savegame.hxx screenshot.cxx smallmap.cxx
smallmap.hxx smallmap_image.cxx smallmap_image.hxx
spot_map.cxx sprite.cxx start_screen.cxx story_screen.cxx
string_format.cxx string_format.hxx target_provider.cxx
theme.cxx theme.hxx theme_selector.cxx theme_selector.hxx
time_display.cxx time_display.hxx
Log Message:
- some more stuff
Index: blitter.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/blitter.cxx,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- blitter.cxx 21 Oct 2003 11:01:52 -0000 1.33
+++ blitter.cxx 21 Oct 2003 21:37:05 -0000 1.34
@@ -345,6 +345,7 @@
assert (sur);
return create_canvas(sur.get_provider());
#endif
+ return 0;
}
CL_PixelBuffer*
@@ -406,6 +407,7 @@
assert (sur);
return CL_Surface(Blitter::scale_surface_to_canvas(sur, width, height),
true);
#endif
+ return CL_Surface();
}
CL_PixelBuffer*
@@ -608,6 +610,7 @@
CL_Surface
Blitter::rotate_90 (const CL_Surface& sur)
{
+#ifdef CLANLIB_0_6
CL_PixelBuffer* prov = sur.get_provider ();
if (prov->is_indexed())
@@ -646,8 +649,8 @@
canvas->lock ();
float r, b, g, a;
- for (unsigned int y = 0; y < sur.get_height (); ++y)
- for (unsigned int x = 0; x < sur.get_width (); ++x)
+ for (int y = 0; y < sur.get_height (); ++y)
+ for (int x = 0; x < sur.get_width (); ++x)
{
prov->get_pixel (x, y, &r, &g, &b, &a);
canvas->draw_pixel (sur.get_height () - 1 - y, x , r, g, b, a);
@@ -657,6 +660,8 @@
prov->unlock ();
return CL_Surface(canvas, true);
}
+#endif
+ return CL_Surface();
}
Index: blitter_impl.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/blitter_impl.hxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- blitter_impl.hxx 21 Oct 2003 11:01:52 -0000 1.15
+++ blitter_impl.hxx 21 Oct 2003 21:37:05 -0000 1.16
@@ -183,6 +183,7 @@
inline
CL_Surface modify(const CL_Surface& sur, const TransF&)
{
+#ifdef CLANLIB_0_6
CL_PixelBuffer* prov = sur.get_provider ();
int pwidth = prov->get_width();
int pheight = prov->get_height();
@@ -237,8 +238,8 @@
canvas->lock ();
float r, b, g, a;
- for (unsigned int y = 0; y < sur.get_height (); ++y)
- for (unsigned int x = 0; x < sur.get_width (); ++x)
+ for (int y = 0; y < sur.get_height (); ++y)
+ for (int x = 0; x < sur.get_width (); ++x)
{
prov->get_pixel (x, y, &r, &g, &b, &a);
canvas->draw_pixel (TransF::get_x(pwidth, pheight, x, y),
@@ -250,6 +251,8 @@
prov->unlock ();
return CL_Surface(canvas, true);
}
+#endif
+ return CL_Surface();
}
} // namespace BlitterImpl
Index: button_panel.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/button_panel.cxx,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- button_panel.cxx 21 Oct 2003 11:01:52 -0000 1.27
+++ button_panel.cxx 21 Oct 2003 21:37:05 -0000 1.28
@@ -17,7 +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 <ClanLib/Display/Input/mouse.h>
+#include <ClanLib/Display/mouse.h>
#include <iostream>
#include <algorithm>
#include "globals.hxx"
@@ -66,17 +66,17 @@
}
pressed_button = 0;
- wheel_slot = CL_Mouse::sig_button_press().connect(this,
&ButtonPanel::on_wheel_move);
+ wheel_slot = CL_Mouse::sig_key_down().connect(this,
&ButtonPanel::on_wheel_move);
}
void
ButtonPanel::on_wheel_move(const CL_InputEvent& key)
{
- if (key.id == CL_MOUSE_WHEELDOWN)
+ if (key.id == CL_MOUSE_WHEEL_DOWN)
{
next_action();
}
- else if (key.id == CL_MOUSE_WHEELUP)
+ else if (key.id == CL_MOUSE_WHEEL_UP)
{
previous_action();
}
Index: col_map.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/col_map.cxx,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- col_map.cxx 21 Oct 2003 11:01:52 -0000 1.22
+++ col_map.cxx 21 Oct 2003 21:37:06 -0000 1.23
@@ -77,15 +77,7 @@
}
void
-ColMap::remove(const CL_Surface& sur, int x, int y)
-{
-#ifdef CLANLIB_0_6
- remove(sur.get_provider(), x, y);
-#endif
-}
-
-void
-ColMap::remove(const CL_PixelBuffer& provider, int x, int y)
+ColMap::remove(CL_PixelBuffer& provider, int x, int y)
{
#ifdef CLANLIB_0_6
++serial;
@@ -189,7 +181,7 @@
// Puts a surface on the colmap
void
-ColMap::put(const CL_PixelBuffer& provider, int sur_x, int sur_y,
Groundtype::GPType pixel)
+ColMap::put(CL_PixelBuffer& provider, int sur_x, int sur_y, Groundtype::GPType
pixel)
{
// transparent groundpieces are only drawn on the gfx map, not on the colmap
if (pixel == Groundtype::GP_TRANSPARENT)
@@ -207,6 +199,7 @@
provider.lock();
+#ifdef CLANLIB_0_6
if (provider.get_depth() == 32)
{
float r, g, b, a;
@@ -262,6 +255,8 @@
{
std::cout << "ColMap: Unsupported color depth, ignoring" << std::endl;
}
+#endif
+
// FIXME: Memory hole
// provider.unlock();
}
@@ -269,12 +264,12 @@
void
ColMap::draw(GraphicContext& gc)
{
- CL_PixelBuffer canvas = Canvas::create(width, height);
+ CL_PixelBuffer* canvas = Canvas::create_rgba8888(width, height);
CL_Surface sur;
unsigned char* buffer;
- canvas.lock();
- buffer = static_cast<unsigned char*>(canvas.get_data());
+ canvas->lock();
+ buffer = static_cast<unsigned char*>(canvas->get_data());
for(int i = 0; i < (width * height); ++i)
{
@@ -312,7 +307,7 @@
// FIXME: Memory hole
#if COLMAP_WITH_MEMORY_HOLE
- canvas.unlock();
+ canvas->unlock();
#endif
sur = CL_Surface(canvas, true);
Index: col_map.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/col_map.hxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- col_map.hxx 21 Oct 2003 11:01:52 -0000 1.14
+++ col_map.hxx 21 Oct 2003 21:37:06 -0000 1.15
@@ -79,10 +79,10 @@
bool blit_allowed (int x, int y, Groundtype::GPType);
void put(int x, int y, Groundtype::GPType p = Groundtype::GP_GROUND);
- void put(const CL_PixelBuffer&, int x, int y, Groundtype::GPType);
+ void put(CL_PixelBuffer&, int x, int y, Groundtype::GPType);
/// void remove(int x, int y);
- void remove(const CL_PixelBuffer&, int x, int y);
+ void remove(CL_PixelBuffer&, int x, int y);
void draw(GraphicContext& gc);
Index: console.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/console.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- console.cxx 21 Oct 2003 11:01:52 -0000 1.18
+++ console.cxx 21 Oct 2003 21:37:06 -0000 1.19
@@ -103,9 +103,9 @@
str = str.substr(pos, str.size());
}
- buffer.push_back(str);
- buffer.pop_front();
- str = "";
+ buffer.push_back(str);
+ buffer.pop_front();
+ str = "";
}
}
@@ -160,10 +160,10 @@
CL_Display::get_height() - (font.get_height() * (number_of_lines + 3));
// The background of the console
- CL_Display::fill_rect(0, start_y_pos - 15,
- CL_Display::get_width(),
- CL_Display::get_height(),
- 0.0, 0.0, 0.0, 0.5);
+ CL_Display::fill_rect(CL_Rect(0, start_y_pos - 15,
+ CL_Display::get_width(),
+ CL_Display::get_height()),
+ Display::to_color(0.0, 0.0, 0.0, 0.5));
const std::list<std::string>& buffer = streambuf.get_buffer ();
@@ -179,10 +179,10 @@
i < number_of_lines && i + window_start < buffer.size();
++it, ++i)
{
- font.print_left(10,
- start_y_pos + (i * (font.get_height() + 2)),
- it->c_str()
- );
+ font.draw(10,
+ start_y_pos + (i * (font.get_height() + 2)),
+ it->c_str()
+ );
}
}
Index: console.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/console.hxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- console.hxx 20 Oct 2003 19:28:54 -0000 1.15
+++ console.hxx 21 Oct 2003 21:37:06 -0000 1.16
@@ -22,6 +22,7 @@
#include <string>
#include <iostream>
+#include <ClanLib/Display/font.h>
#include "gui/display.hxx"
class CL_Font;
Index: demo_session.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/demo_session.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- demo_session.cxx 20 Oct 2003 19:28:54 -0000 1.11
+++ demo_session.cxx 21 Oct 2003 21:37:06 -0000 1.12
@@ -18,6 +18,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <ClanLib/Display/keyboard.h>
+#include <ClanLib/Display/keys.h>
#include "math.hxx"
#include "xml_pdf.hxx"
#include "true_server.hxx"
@@ -54,6 +55,7 @@
void
DemoSession::draw_background(GraphicContext& gc)
{
+#ifdef CLANLIB_0_6
World* world = server->get_world();
if (CL_Keyboard::get_keycode(CL_KEY_LEFT))
@@ -88,6 +90,7 @@
server->get_world()->draw(gc);
CL_System::keep_alive();
}
+#endif
}
/** Pass a delta to the screen */
Index: fps_counter.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/fps_counter.cxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- fps_counter.cxx 20 Oct 2003 19:28:54 -0000 1.10
+++ fps_counter.cxx 21 Oct 2003 21:37:06 -0000 1.11
@@ -52,12 +52,13 @@
void
FPSCounter::on_event()
{
+#ifdef CLANLIB_0_6
update_fps_counter();
if (odd_frame)
{
- font->print_right(CL_Display::get_width(),
- CL_Display::get_height() - (2 * font->get_height()),
+ font.print_right(CL_Display::get_width(),
+ CL_Display::get_height() - (2 * font.get_height()),
"o");
odd_frame = false;
}
@@ -66,9 +67,10 @@
odd_frame = true;
}
- font->print_right(CL_Display::get_width(),
- CL_Display::get_height() - font->get_height(),
- fps_string);
+ font.print_right(CL_Display::get_width(),
+ CL_Display::get_height() - font.get_height(),
+ fps_string);
+#endif
}
void
Index: fps_counter.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/fps_counter.hxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- fps_counter.hxx 21 Oct 2003 11:01:52 -0000 1.9
+++ fps_counter.hxx 21 Oct 2003 21:37:06 -0000 1.10
@@ -20,7 +20,7 @@
#ifndef HEADER_PINGUS_FPS_COUNTER_HXX
#define HEADER_PINGUS_FPS_COUNTER_HXX
-#include <ClanLib/Dislpay/font.h>
+#include <ClanLib/Display/font.h>
#include "gui/display.hxx"
namespace Pingus {
Index: game_session.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/game_session.cxx,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- game_session.cxx 18 Oct 2003 23:17:27 -0000 1.41
+++ game_session.cxx 21 Oct 2003 21:37:06 -0000 1.42
@@ -119,7 +119,7 @@
{ // Write the savegame
Savegame savegame;
savegame.levelname = result.plf->get_resname();
- savegame.time = result.used_time;
+ savegame.needed_time = result.used_time;
savegame.saved_pingus = result.saved;
if (result.saved >= result.needed)
Index: global_event.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/global_event.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- global_event.cxx 21 Oct 2003 11:01:52 -0000 1.13
+++ global_event.cxx 21 Oct 2003 21:37:06 -0000 1.14
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <algorithm>
#include <ClanLib/Display/keyboard.h>
+#include <ClanLib/Display/input_event.h>
#include <ClanLib/Display/keys.h>
#include "screenshot.hxx"
#include "console.hxx"
@@ -39,7 +40,7 @@
void
GlobalEvent::on_button_press(const CL_InputEvent& event)
{
- if (device == CL_Input::keyboards[0])
+ if (event.device.get_type() == CL_InputEvent::keyboard)
{
switch (key.id)
{
@@ -119,10 +120,6 @@
void
GlobalEvent::on_button_release(const CL_InputEvent& event)
{
- if (device == CL_Input::keyboards[0])
- {
-
- }
}
} // namespace Pingus
Index: gui_obj.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui_obj.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gui_obj.cxx 18 Oct 2003 23:17:27 -0000 1.3
+++ gui_obj.cxx 21 Oct 2003 21:37:06 -0000 1.4
@@ -47,10 +47,9 @@
void
GuiObj::draw_clipped()
{
- CL_Display::push_clip_rect();
- CL_Display::set_clip_rect(CL_ClipRect(x1, y1, x2, y2));
+ CL_Display::push_cliprect(CL_Rect(x1, y1, x2, y2));
draw();
- CL_Display::pop_clip_rect();
+ CL_Display::pop_cliprect();
}
void
Index: hurry_up.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/hurry_up.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- hurry_up.cxx 18 Oct 2003 23:17:27 -0000 1.9
+++ hurry_up.cxx 21 Oct 2003 21:37:06 -0000 1.10
@@ -46,18 +46,20 @@
void
HurryUp::draw(GraphicContext& gc)
{
+#ifdef CLANLIB_0_6
if (is_finished) return;
if (is_running)
{
- font->print_right(CL_Display::get_width() - static_cast<int>(x_pos),
+ font.print_right(CL_Display::get_width() - static_cast<int>(x_pos),
CL_Display::get_height()/2 - font->get_height(),
"Hurry");
- font->print_left(static_cast<int>(x_pos),
+ font.print_left(static_cast<int>(x_pos),
CL_Display::get_height()/2 - font->get_height(),
"Up");
}
UNUSED_ARG(gc);
+#endif
}
void
Index: hurry_up.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/hurry_up.hxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- hurry_up.hxx 21 Oct 2003 11:01:52 -0000 1.10
+++ hurry_up.hxx 21 Oct 2003 21:37:06 -0000 1.11
@@ -26,6 +26,7 @@
namespace Pingus {
+class GraphicContext;
class Client;
/** Hurry up if the time goes over... */
Index: loading.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/loading.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- loading.cxx 21 Oct 2003 11:01:52 -0000 1.9
+++ loading.cxx 21 Oct 2003 21:37:06 -0000 1.10
@@ -76,13 +76,14 @@
str.c_str());
#endif
- CL_Display::fill_rect(50, CL_Display::get_height() - 100,
- CL_Display::get_width() - 50, CL_Display::get_height()
- 50,
- 0.5, 0.5, 0.5, 1.0);
+ CL_Display::fill_rect(CL_Rect(50, CL_Display::get_height() - 100,
+ CL_Display::get_width() - 50,
CL_Display::get_height() - 50),
+ Display::to_color(0.5, 0.5, 0.5, 1.0));
- CL_Display::fill_rect(50, CL_Display::get_height() - 100,
- 50 + (int)((CL_Display::get_width()-100) * progress),
CL_Display::get_height() - 50,
- 1.0, 0.0, 0.0, 1.0);
+ CL_Display::fill_rect(CL_Rect(50, CL_Display::get_height() - 100,
+ 50 + (int)((CL_Display::get_width()-100) *
progress),
+ CL_Display::get_height() - 50),
+ Display::to_color(1.0, 0.0, 0.0, 1.0));
Display::flip_display();
}
Index: menu_button.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/menu_button.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- menu_button.hxx 20 Oct 2003 19:28:54 -0000 1.6
+++ menu_button.hxx 21 Oct 2003 21:37:06 -0000 1.7
@@ -22,11 +22,9 @@
#include <string>
#include <ClanLib/Display/surface.h>
-
+#include <ClanLib/Display/font.h>
#include "gui/component.hxx"
-class CL_Font;
-
namespace Pingus {
class PingusMenu;
Index: multiline_text.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/multiline_text.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- multiline_text.cxx 21 Oct 2003 11:01:52 -0000 1.9
+++ multiline_text.cxx 21 Oct 2003 21:37:06 -0000 1.10
@@ -28,11 +28,10 @@
{
width = -1;
height = -1;
- font = 0;
}
void
-MultiLineText::set_font(CL_Font* f)
+MultiLineText::set_font(CL_Font f)
{
font = f;
}
@@ -96,7 +95,7 @@
++i)
{
font.draw(x_pos, y_pos + y_inc, i->c_str());
- y_inc += font->get_height();
+ y_inc += font.get_height();
}
}
@@ -125,8 +124,10 @@
i != text.end();
++i)
{
- font->print_center(x_pos, y_pos + y_inc, i->c_str());
- y_inc += font->get_height();
+#ifdef CLANLIB_0_6
+ font.print_center(x_pos, y_pos + y_inc, i->c_str());
+#endif
+ y_inc += font.get_height();
}
}
Index: multiline_text.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/multiline_text.hxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- multiline_text.hxx 21 Oct 2003 11:01:52 -0000 1.8
+++ multiline_text.hxx 21 Oct 2003 21:37:06 -0000 1.9
@@ -36,7 +36,7 @@
public:
MultiLineText();
- void set_font(CL_Font*);
+ void set_font(CL_Font font);
void set_text(const std::string&, int width);
void print_left(int, int);
void print_right(int, int);
Index: pingus_counter.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_counter.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- pingus_counter.cxx 18 Oct 2003 23:17:27 -0000 1.17
+++ pingus_counter.cxx 21 Oct 2003 21:37:06 -0000 1.18
@@ -56,7 +56,9 @@
world->get_pingus()->get_number_of_exited(),
server->get_plf()->get_number_to_save());
- font->print_center(CL_Display::get_width ()/2,3, str);
+#ifdef CLANLIB_0_6
+ font.print_center(CL_Display::get_width ()/2,3, str);
+#endif
UNUSED_ARG(gc);
}
Index: pingus_counter.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_counter.hxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- pingus_counter.hxx 21 Oct 2003 11:01:52 -0000 1.13
+++ pingus_counter.hxx 21 Oct 2003 21:37:06 -0000 1.14
@@ -28,6 +28,7 @@
namespace Pingus {
+class GraphicContext;
class World;
class Server;
Index: pingus_counter_bar.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_counter_bar.cxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- pingus_counter_bar.cxx 21 Oct 2003 11:01:52 -0000 1.10
+++ pingus_counter_bar.cxx 21 Oct 2003 21:37:06 -0000 1.11
@@ -21,7 +21,7 @@
#include "pingus_counter_bar.hxx"
#include "pingu_holder.hxx"
#include "server.hxx"
-#include "display.hxx"
+#include "gui/display.hxx"
#include "world.hxx"
namespace Pingus {
Index: pingus_main.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- pingus_main.cxx 20 Oct 2003 19:28:54 -0000 1.101
+++ pingus_main.cxx 21 Oct 2003 21:37:06 -0000 1.102
@@ -1003,7 +1003,7 @@
Story::init();
ScreenManager::init();
PingusMenuManager::init();
- PingusSound::init();
+ Sound::PingusSound::init();
PingusResource::init();
XMLhelper::init();
PinguActionFactory::init();
@@ -1026,7 +1026,7 @@
XMLhelper::deinit();
Fonts::deinit();
PingusResource::deinit();
- PingusSound::deinit();
+ Sound::PingusSound::deinit();
PingusMenuManager::deinit();
PLFResMgr::free_plf_map();
WorldObjDataFactory::deinit();
Index: pingus_menu_manager.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_menu_manager.cxx,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- pingus_menu_manager.cxx 21 Oct 2003 11:01:52 -0000 1.28
+++ pingus_menu_manager.cxx 21 Oct 2003 21:37:06 -0000 1.29
@@ -141,7 +141,7 @@
void
PingusMenuManager::on_startup()
{
- PingusSound::play_music("pingus-1.it");
+ Sound::PingusSound::play_music("pingus-1.it");
}
PingusMenuManager*
Index: pingus_resource.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_resource.cxx,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- pingus_resource.cxx 21 Oct 2003 11:01:52 -0000 1.31
+++ pingus_resource.cxx 21 Oct 2003 21:37:06 -0000 1.32
@@ -270,12 +270,12 @@
ResDescriptor::RD_RESOURCE));
}
-CL_Font*
+CL_Font
PingusResource::load_font(const ResDescriptor& res_desc)
{
pout(PINGUS_DEBUG_RESOURCES) << "PingusResource: Loading font: " << res_desc
<< std::endl;
- CL_Font* font = font_map[res_desc];
+ CL_Font font = font_map[res_desc];
if (font)
{
@@ -315,6 +315,7 @@
void
PingusResource::cleanup ()
{
+#ifdef CLANLIB_0_6
pout(PINGUS_DEBUG_RESOURCES) << "PingusResource::cleanup ()" << std::endl;
for (std::map<ResDescriptor, CL_Surface>::iterator i = surface_map.begin ();
@@ -338,6 +339,7 @@
surface_map.erase(i);
}
}
+#endif
}
unsigned int
Index: pingus_sub_menu.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_sub_menu.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pingus_sub_menu.cxx 12 Jun 2002 19:06:12 -0000 1.1
+++ pingus_sub_menu.cxx 21 Oct 2003 21:37:06 -0000 1.2
@@ -19,6 +19,8 @@
#include "pingus_sub_menu.hxx"
+namespace Pingus {
+
PingusSubMenu::PingusSubMenu (PingusMenuManager* m)
: manager (m)
{
@@ -28,4 +30,6 @@
{
}
+} // namespace Pingus
+
/* EOF */
Index: playfield.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/playfield.cxx,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- playfield.cxx 21 Oct 2003 11:01:52 -0000 1.38
+++ playfield.cxx 21 Oct 2003 21:37:06 -0000 1.39
@@ -28,6 +28,7 @@
#include "server.hxx"
#include "true_server.hxx"
#include "pingu.hxx"
+#include "gui/display.hxx"
#include "button_panel.hxx"
namespace Pingus {
@@ -105,9 +106,9 @@
i != clipping_rectangles.end();
i++)
{
- CL_Display::fill_rect(i->left, i->top,
- i->right + 1, i->bottom + 1,
- 0.0, 0.0, 0.0, 1.0);
+ CL_Display::fill_rect(CL_Rect(i->left, i->top,
+ i->right + 1, i->bottom + 1),
+ Display::to_color(0.0, 0.0, 0.0, 1.0));
}
}
@@ -116,7 +117,7 @@
{
CL_Display::draw_line (mouse_x, mouse_y,
scroll_center_x, scroll_center_y-15,
- 0.0f, 1.0f, 0.0f, 1.0f);
+ Display::to_color(0.0f, 1.0f, 0.0f, 1.0f));
CL_Display::draw_line (mouse_x, mouse_y,
scroll_center_x, scroll_center_y,
Index: playfield_view.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/playfield_view.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- playfield_view.cxx 21 Oct 2003 11:01:52 -0000 1.6
+++ playfield_view.cxx 21 Oct 2003 21:37:06 -0000 1.7
@@ -27,7 +27,7 @@
world (w), x_offset (0), y_offset (0)
{
// FIXME: Cliprects should be handled in the GraphicContext
- set_clip_rect(rect.x1, rect.y1, rect.x2, rect.y2);
+ set_clip_rect(rect.left, rect.top, rect.right, rect.bottom);
}
PlayfieldView::~PlayfieldView ()
Index: result.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/result.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- result.cxx 19 Apr 2003 10:23:17 -0000 1.3
+++ result.cxx 21 Oct 2003 21:37:06 -0000 1.4
@@ -20,6 +20,8 @@
//#include <iostream>
//#include "result.hxx"
+namespace Pingus {
+
/*Result::Result()
{
n_action = LevelInterrupt::quit;
@@ -106,4 +108,7 @@
return unknown = a;
}
*/
+
+} // namespace Pingus
+
/* EOF */
Index: result.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/result.hxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- result.hxx 19 Apr 2003 10:23:17 -0000 1.8
+++ result.hxx 21 Oct 2003 21:37:06 -0000 1.9
@@ -23,6 +23,8 @@
#include "plf_handle.hxx"
#include "pingus.hxx"
+namespace Pingus {
+
/** Result of a Pingus game */
struct Result
{
@@ -52,6 +54,8 @@
}
};
+} // namespace Pingus
+
#endif
/* EOF */
Index: result_screen.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/result_screen.cxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- result_screen.cxx 18 Oct 2003 23:17:27 -0000 1.19
+++ result_screen.cxx 21 Oct 2003 21:37:06 -0000 1.20
@@ -69,12 +69,12 @@
void on_pointer_enter ()
{
SurfaceButton::on_pointer_enter();
- PingusSound::play_sound("tick");
+ Sound::PingusSound::play_sound("tick");
}
void on_click() {
parent->close_screen();
- PingusSound::play_sound("yipee");
+ Sound::PingusSound::play_sound("yipee");
}
};
@@ -107,7 +107,7 @@
void on_pointer_enter()
{
SurfaceButton::on_pointer_enter();
- PingusSound::play_sound ("tick");
+ Sound::PingusSound::play_sound ("tick");
}
};
@@ -135,7 +135,7 @@
void on_pointer_enter()
{
SurfaceButton::on_pointer_enter();
- PingusSound::play_sound ("tick");
+ Sound::PingusSound::play_sound ("tick");
}
};
@@ -268,11 +268,11 @@
{
if (result.success())
{
- PingusSound::play_music("success_1.it");
+ Sound::PingusSound::play_music("success_1.it");
}
else
{
- PingusSound::play_music("pingus-2.it");
+ Sound::PingusSound::play_music("pingus-2.it");
}
}
Index: savegame.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/savegame.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- savegame.cxx 18 Oct 2003 23:17:27 -0000 1.5
+++ savegame.cxx 21 Oct 2003 21:37:06 -0000 1.6
@@ -26,7 +26,7 @@
namespace Pingus {
std::string
-Savegame::status_to_string (Status status)
+Savegame::status_to_string (S_Status status)
{
switch (status)
{
@@ -42,7 +42,7 @@
}
}
-Savegame::Status
+Savegame::S_Status
Savegame::string_to_status (std::string str)
{
str = string_downcase(str);
@@ -68,10 +68,10 @@
read_xml(doc, node);
}
-Savegame::Savegame(std::string arg_levelname, Status arg_status, int arg_time,
int arg_saved_pingus)
+Savegame::Savegame(std::string arg_levelname, S_Status arg_status, int
arg_time, int arg_saved_pingus)
: levelname(arg_levelname),
status(arg_status),
- time(arg_time),
+ needed_time(arg_time),
saved_pingus(arg_saved_pingus)
{
}
Index: savegame.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/savegame.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- savegame.hxx 21 Oct 2003 11:01:52 -0000 1.6
+++ savegame.hxx 21 Oct 2003 21:37:06 -0000 1.7
@@ -31,15 +31,15 @@
{
private:
public:
- enum Status { FINISHED, // level is successfully finished
+ enum S_Status { FINISHED, // level is successfully finished
ACCESSIBLE, // level is accessible and can be played
NONE }; // level is not finished and cannot be accessed
- static std::string status_to_string (Status s);
- static Status string_to_status (std::string s);
+ static std::string status_to_string (S_Status s);
+ static S_Status string_to_status (std::string s);
std::string levelname;
- Status status;
+ S_Status status;
/** Time needed to finish the level, only valid if status == FINISHED */
int needed_time;
@@ -49,7 +49,7 @@
Savegame();
Savegame(xmlDocPtr doc, xmlNodePtr node);
- Savegame(std::string arg_levelname, Status arg_status, int arg_time, int
arg_saved_pingus);
+ Savegame(std::string arg_levelname, S_Status arg_status, int arg_time, int
arg_saved_pingus);
void read_xml (xmlDocPtr doc, xmlNodePtr node);
void write_xml(std::ostream& xml);
Index: screenshot.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/screenshot.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- screenshot.cxx 19 Oct 2003 12:25:47 -0000 1.16
+++ screenshot.cxx 21 Oct 2003 21:37:06 -0000 1.17
@@ -24,16 +24,18 @@
#include <iostream>
#include <ClanLib/Display/display.h>
-#include <ClanLib/Display/target.h>
#include "system.hxx"
#include "screenshot.hxx"
#include "gettext.h"
+namespace Pingus {
+
// Saves a screenshot to file, it return the filename the screenshot
// was saved to.
std::string
Screenshot::make_screenshot()
{
+#ifdef CLANLIB_0_6
CL_Target* target = CL_Display::get_target();
if (target)
@@ -51,6 +53,8 @@
std::cout << _("Screenshot: Couldn't save screenshot") << std::endl;
return "";
}
+#endif
+ return "";
}
void
@@ -62,6 +66,7 @@
void
Screenshot::save_target_to_file_fast(CL_Target* target, const std::string&
filename)
{
+#ifdef CLANLIB_0_6
target->lock();
int num_pixels = target->get_width() * target->get_height();
unsigned char* buffer = new unsigned char[num_pixels * 3];
@@ -119,6 +124,7 @@
target->unlock();
save_ppm(filename, buffer, target->get_width(), target->get_height());
delete[] buffer;
+#endif
}
void
@@ -149,6 +155,7 @@
void
Screenshot::save_target_to_file_slow(CL_Target* target, const std::string&
filename)
{
+#ifdef CLANLIB_0_6
std::ofstream out(filename.c_str());
out << "P3\n"
@@ -172,6 +179,7 @@
}
target->unlock();
+#endif
}
std::string
@@ -204,5 +212,6 @@
return std::string(buffer);
}
+} // namespace Pingus
/* EOF */
Index: smallmap.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/smallmap.cxx,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- smallmap.cxx 20 Oct 2003 19:28:54 -0000 1.40
+++ smallmap.cxx 21 Oct 2003 21:37:06 -0000 1.41
@@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <ClanLib/Display/display.h>
-#include <ClanLib/Display/pixel_buffer.h>
#include "pingu_holder.hxx"
#include "gui/display.hxx"
#include "playfield.hxx"
@@ -26,6 +25,7 @@
#include "pingus_resource.hxx"
#include "smallmap.hxx"
#include "col_map.hxx"
+#include "canvas.hxx"
#include "true_server.hxx"
#include "pingu.hxx"
#include "math.hxx"
@@ -57,7 +57,6 @@
SmallMap::~SmallMap()
{
- delete canvas;
}
void
@@ -95,7 +94,7 @@
height = max_height;
}
- canvas = new CL_Canvas(width, height);
+ canvas = Canvas::create_rgba8888(width, height);
}
canvas->lock();
@@ -252,9 +251,9 @@
y = static_cast<int>(y_pos + ((*i)->get_y() * height /
world->get_colmap()->get_height()));
//FIXME: Replace this with draw_pixel (only availabe in 0.7)
- CL_Display::draw_line(x, y, x, y, 1.0, 1.0, 0.0, 1.0);
- CL_Display::draw_line(x, y-1, x, y-1, 1.0, 1.0, 0.0, 1.0);
- CL_Display::draw_line(x, y-2, x, y-2, 1.0, 1.0, 0.0, 1.0);
+ CL_Display::draw_line(x, y, x, y, Display::to_color(1.0, 1.0, 0.0,
1.0));
+ CL_Display::draw_line(x, y-1, x, y-1, Display::to_color(1.0, 1.0, 0.0,
1.0));
+ CL_Display::draw_line(x, y-2, x, y-2, Display::to_color(1.0, 1.0, 0.0,
1.0));
}
}
Index: smallmap.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/smallmap.hxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- smallmap.hxx 19 Oct 2003 12:25:47 -0000 1.20
+++ smallmap.hxx 21 Oct 2003 21:37:06 -0000 1.21
@@ -21,10 +21,10 @@
#define HEADER_PINGUS_SMALLMAP_HXX
#include <ClanLib/Display/surface.h>
+#include <ClanLib/Display/pixel_buffer.h>
#include "gui/component.hxx"
class CL_Key;
-class CL_Canvas;
namespace Pingus {
@@ -48,7 +48,7 @@
CL_Surface sur;
/** The canvas that represents the small-colmap */
- CL_Canvas* canvas;
+ CL_PixelBuffer* canvas;
/** Horizontal position of the small map */
int x_pos;
Index: smallmap_image.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/smallmap_image.cxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- smallmap_image.cxx 20 Oct 2003 19:28:54 -0000 1.12
+++ smallmap_image.cxx 21 Oct 2003 21:37:06 -0000 1.13
@@ -21,6 +21,7 @@
#include "world.hxx"
#include "smallmap_image.hxx"
#include "col_map.hxx"
+#include "canvas.hxx"
#include "server.hxx"
namespace Pingus {
@@ -51,7 +52,7 @@
CL_Surface
SmallMapImage::create_surface (Server * server, int width, int height)
{
- CL_Canvas* canvas;
+ CL_PixelBuffer* canvas;
unsigned char* buffer;
unsigned char* cbuffer;
unsigned char current_pixel;
@@ -62,7 +63,7 @@
ColMap* colmap = world->get_colmap();
buffer = colmap->get_data();
- canvas = new CL_Canvas(width, height);
+ canvas = Canvas::create_rgba8888(width, height);
canvas->lock();
Index: smallmap_image.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/smallmap_image.hxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- smallmap_image.hxx 20 Oct 2003 19:28:54 -0000 1.10
+++ smallmap_image.hxx 21 Oct 2003 21:37:06 -0000 1.11
@@ -24,6 +24,8 @@
#include <ClanLib/Display/surface.h>
#include "vector.hxx"
+namespace Pingus {
+
class Server;
/** The base image of the small map, it doesn't handle any userinput,
@@ -49,9 +51,8 @@
SmallMapImage& operator= (const SmallMapImage&);
};
+} // namespace Pingus
+
#endif
/* EOF */
-
-
-
Index: spot_map.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/spot_map.cxx,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- spot_map.cxx 20 Oct 2003 19:28:54 -0000 1.29
+++ spot_map.cxx 21 Oct 2003 21:37:06 -0000 1.30
@@ -66,7 +66,9 @@
void
MapTileSurface::reload(void)
{
+#ifdef CLANLIB_0_6
surface.reload();
+#endif
}
void
@@ -78,6 +80,7 @@
void
MapTileSurface::check_empty()
{
+#ifdef CLANLIB_0_6
// FIXME: obsolete
CL_PixelBuffer* provider = surface.get_provider();
unsigned char* buffer;
@@ -98,6 +101,7 @@
}
surface.get_provider()->unlock();
+#endif
}
PingusSpotMap::PingusSpotMap(PLF* plf)
Index: sprite.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/sprite.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- sprite.cxx 18 Oct 2003 23:17:27 -0000 1.16
+++ sprite.cxx 21 Oct 2003 21:37:06 -0000 1.17
@@ -35,7 +35,7 @@
Sprite::Sprite (const Sprite& sprite)
: frame (sprite.frame),
frames_per_second (sprite.frames_per_second),
- sur (sprite.sur),
+ sur(sprite.sur),
direction (sprite.direction),
looptype (sprite.looptype),
is_finished (sprite.is_finished),
Index: start_screen.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/start_screen.cxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- start_screen.cxx 18 Oct 2003 23:17:27 -0000 1.21
+++ start_screen.cxx 21 Oct 2003 21:37:06 -0000 1.22
@@ -77,7 +77,7 @@
void on_click()
{
- PingusSound::play_sound("yipee");
+ Sound::PingusSound::play_sound("yipee");
parent->start_game();
}
@@ -85,7 +85,7 @@
void on_pointer_enter()
{
SurfaceButton::on_pointer_enter();
- PingusSound::play_sound ("tick");
+ Sound::PingusSound::play_sound ("tick");
}
};
@@ -118,7 +118,7 @@
void on_pointer_enter()
{
SurfaceButton::on_pointer_enter();
- PingusSound::play_sound ("tick");
+ Sound::PingusSound::play_sound ("tick");
}
};
Index: story_screen.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/story_screen.cxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- story_screen.cxx 20 Oct 2003 19:28:54 -0000 1.23
+++ story_screen.cxx 21 Oct 2003 21:37:06 -0000 1.24
@@ -81,7 +81,7 @@
void on_pointer_enter()
{
SurfaceButton::on_pointer_enter();
- PingusSound::play_sound ("tick", .3);
+ Sound::PingusSound::play_sound ("tick", .3);
}
void on_click()
Index: string_format.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/string_format.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- string_format.cxx 18 Oct 2003 23:17:27 -0000 1.3
+++ string_format.cxx 21 Oct 2003 21:37:06 -0000 1.4
@@ -23,7 +23,7 @@
namespace Pingus {
std::string
-StringFormat::break_line (std::string text, int length, CL_Font* font)
+StringFormat::break_line (std::string text, int length, const CL_Font& font)
{
unsigned int pos = 0;
while ((pos = text.find('\t', pos)) != std::string::npos)
@@ -42,7 +42,7 @@
}
else if (pos < text.length() - 1 && text[pos + 1] == ' ' && text[pos +
2] == '\n')
{
- text.replace(pos, 3, 1, '\n'); // whitespace between
the two \n doesn't matter
+ text.replace(pos, 3, 1, '\n'); // whitespace between
the two \n doesn't matter
}
else
{
@@ -54,7 +54,7 @@
text.replace(pos - 1, 2, 1, '\n'); // no whitespace in
front
if (pos < text.length() && text[pos + 1] == ' ')
- text.replace(pos, 2, 1, '\n'); // no
whitespace behind
+ text.replace(pos, 2, 1, '\n'); // no whitespace
behind
++pos; // we don't want to
find it again
}
@@ -63,23 +63,24 @@
while ((pos = text.find(" ", pos)) != std::string::npos)
text.replace(pos, 2, 1, ' ');
-
+#ifdef CLANLIB_0_6
int start_pos = 0;
int previous_space = 0;
pos = 0;
+
while ((pos = text.find(' ', pos + 1)) != std::string::npos)
{
- if (font->get_text_width(text.substr(start_pos, pos - start_pos)) >
length)
+ if (font.get_text_width(text.substr(start_pos, pos - start_pos)) >
length)
{
text[previous_space] = '\n';
start_pos = previous_space + 1;
}
- else if (font->get_text_width(text.substr(start_pos, text.length())) <=
length)
+ else if (font.get_text_width(text.substr(start_pos, text.length())) <=
length)
break;
previous_space = pos;
}
-
+#endif
return text;
}
Index: string_format.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/string_format.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- string_format.hxx 18 Oct 2003 23:17:27 -0000 1.2
+++ string_format.hxx 21 Oct 2003 21:37:06 -0000 1.3
@@ -29,7 +29,7 @@
class StringFormat {
public:
- static std::string break_line (std::string text, int length, CL_Font* font);
+ static std::string break_line (std::string text, int length, const CL_Font&
font);
};
} // namespace Pingus
Index: target_provider.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/target_provider.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- target_provider.cxx 20 Oct 2003 19:28:54 -0000 1.3
+++ target_provider.cxx 21 Oct 2003 21:37:06 -0000 1.4
@@ -17,7 +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 <ClanLib/Display/SurfaceProviders/canvas.h>
+#include <ClanLib/Display/pixel_buffer.h>
#include "target_provider.hxx"
namespace Pingus {
Index: theme.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/theme.cxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- theme.cxx 20 Oct 2003 19:28:55 -0000 1.21
+++ theme.cxx 21 Oct 2003 21:37:06 -0000 1.22
@@ -38,10 +38,10 @@
namespace Pingus {
Theme::Theme (const std::string& filename_)
- : font(Fonts::pingus_small),
- title(Fonts::pingus_large),
- filename (filename_),
- is_loaded(false)
+ : font(Fonts::pingus_small),
+ title(Fonts::pingus_large),
+ filename (filename_),
+ is_loaded(false)
{
}
@@ -111,12 +111,12 @@
i < levelnames.end();
++i, ++j)
{
- int width = font->get_text_width(i->c_str());
+ int width = font.get_text_width(i->c_str());
if ((CL_Display::get_width()/2 - width/2) < x
&& (CL_Display::get_width()/2 + width/2) > x
&& y_pos < y
- && (y_pos + font->get_height()) > y)
+ && (y_pos + font.get_height()) > y)
{
if (j <= accessible_levels)
{
@@ -126,7 +126,7 @@
}
return -1;
}
- y_pos += font->get_height() + 4;
+ y_pos += font.get_height() + 4;
}
return -1;
}
@@ -190,34 +190,34 @@
if (j > accessible_levels)
{
// Level is not yet accessible
- font->print_center(x_center, y_pos, (*i).c_str());
- CL_Display::fill_rect(x_center - font->get_text_width(i->c_str())/2 -
1,
+ font.print_center(x_center, y_pos, (*i).c_str());
+ CL_Display::fill_rect(x_center - font.get_text_width(i->c_str())/2 -
1,
y_pos - 1,
- x_center + font->get_text_width(i->c_str())/2 +
1,
- y_pos + font->get_height() + 1,
+ x_center + font.get_text_width(i->c_str())/2 +
1,
+ y_pos + font.get_height() + 1,
0.0, 0.0, 0.0, 0.5);
}
else if (j == current_level)
{
// Level is accessible
- CL_Display::fill_rect(x_center - font->get_text_width(i->c_str())/2 -
1,
+ CL_Display::fill_rect(x_center - font.get_text_width(i->c_str())/2 -
1,
y_pos - 1,
- x_center + font->get_text_width(i->c_str())/2 +
1,
- y_pos + font->get_height() + 1,
+ x_center + font.get_text_width(i->c_str())/2 +
1,
+ y_pos + font.get_height() + 1,
0.0f, 0.0f, 0.0f, 1.0f);
- CL_Display::draw_rect(x_center - font->get_text_width(i->c_str())/2 -
1,
+ CL_Display::draw_rect(x_center - font.get_text_width(i->c_str())/2 -
1,
y_pos - 1,
- x_center + font->get_text_width(i->c_str())/2 +
1,
- y_pos + font->get_height() + 1,
+ x_center + font.get_text_width(i->c_str())/2 +
1,
+ y_pos + font.get_height() + 1,
1.0f, 1.0f, 1.0f, 1.0f);
- font->print_center(x_center, y_pos, (*i).c_str());
+ font.print_center(x_center, y_pos, (*i).c_str());
}
else
{
- font->print_center(x_center, y_pos, (*i).c_str());
+ font.print_center(x_center, y_pos, (*i).c_str());
}
++j;
- y_pos += font->get_height() + 4;
+ y_pos += font.get_height() + 4;
}
}
Index: theme.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/theme.hxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- theme.hxx 20 Oct 2003 19:28:55 -0000 1.8
+++ theme.hxx 21 Oct 2003 21:37:06 -0000 1.9
@@ -35,8 +35,8 @@
PLTXML plt;
CL_Surface surface;
CL_Surface background;
- CL_Font* font;
- CL_Font* title;
+ CL_Font font;
+ CL_Font title;
/** The last level, which is accessible */
int accessible_levels;
Index: theme_selector.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/theme_selector.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- theme_selector.cxx 21 Oct 2003 11:01:52 -0000 1.15
+++ theme_selector.cxx 21 Oct 2003 21:37:06 -0000 1.16
@@ -22,7 +22,6 @@
#include <iostream>
#include <ClanLib/Display/display.h>
#include <ClanLib/Display/font.h>
-#include <ClanLib/Display/input.h>
#include <ClanLib/Display/keyboard.h>
#include <ClanLib/Display/mouse.h>
#include <ClanLib/Core/System/system.h>
@@ -49,8 +48,8 @@
ListBox::draw_offset(int x, int y)
{
int i = 0;
- CL_Display::fill_rect(x, y, x + 200, CL_Display::get_height() - 20,
- 0.0, 0.0, 0.0, 0.5);
+ CL_Display::fill_rect(CL_Rect(x, y, x + 200, CL_Display::get_height() - 20),
+ Display::to_color(0.0, 0.0, 0.0, 0.5));
for(ListIter item = items.begin(); item != items.end(); ++item) {
item->draw_offset(x, y + (i++ * 20)); // FIXME i++ is a bit ambigious here
}
Index: theme_selector.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/theme_selector.hxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- theme_selector.hxx 21 Oct 2003 11:01:52 -0000 1.9
+++ theme_selector.hxx 21 Oct 2003 21:37:06 -0000 1.10
@@ -39,7 +39,7 @@
{
private:
std::string label;
- CL_Font* font;
+ CL_Font font;
public:
ListItem(std::string);
@@ -102,10 +102,10 @@
std::vector<Theme*>::iterator current_theme;
/** A large font, used for the Title Name */
- CL_Font* title_font;
+ CL_Font title_font;
/** This font is used for the levelnames */
- CL_Font* theme_font;
+ CL_Font theme_font;
/// The red arrow to the right
CL_Surface right_arrow;
Index: time_display.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/time_display.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- time_display.cxx 21 Oct 2003 11:01:52 -0000 1.18
+++ time_display.cxx 21 Oct 2003 21:37:06 -0000 1.19
@@ -65,7 +65,9 @@
time_string = to_string(time_value);
}
- font->print_right(CL_Display::get_width() - 5, 3, time_string);
+#ifdef CLANLIB_0_6
+ font.print_right(CL_Display::get_width() - 5, 3, time_string);
+#endif
}
UNUSED_ARG(gc);
Index: time_display.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/time_display.hxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- time_display.hxx 21 Oct 2003 11:01:52 -0000 1.13
+++ time_display.hxx 21 Oct 2003 21:37:06 -0000 1.14
@@ -21,6 +21,7 @@
#define HEADER_PINGUS_TIME_DISPLAY_HXX
#include <ClanLib/Display/surface.h>
+#include <ClanLib/Display/font.h>
#include "gui/component.hxx"
class CL_Font;
@@ -29,12 +30,13 @@
class Server;
class Client;
+class GraphicContext;
class TimeDisplay : public GUI::Component
{
private:
Server* server;
- CL_Font* font;
+ CL_Font font;
CL_Surface infinity_symbol;
public:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src blitter.cxx, 1.33, 1.34 blitter_impl.hxx, 1.15, 1.16 button_panel.cxx, 1.27, 1.28 col_map.cxx, 1.22, 1.23 col_map.hxx, 1.14, 1.15 console.cxx, 1.18, 1.19 console.hxx, 1.15, 1.16 demo_session.cxx, 1.11, 1.12 fps_counter.cxx, 1.10, 1.11 fps_counter.hxx, 1.9, 1.10 game_session.cxx, 1.41, 1.42 global_event.cxx, 1.13, 1.14 gui_obj.cxx, 1.3, 1.4 hurry_up.cxx, 1.9, 1.10 hurry_up.hxx, 1.10, 1.11 loading.cxx, 1.9, 1.10 menu_button.hxx, 1.6, 1.7 multiline_text.cxx, 1.9, 1.10 multiline_text.hxx, 1.8, 1.9 pingus_counter.cxx, 1.17, 1.18 pingus_counter.hxx, 1.13, 1.14 pingus_counter_bar.cxx, 1.10, 1.11 pingus_main.cxx, 1.101, 1.102 pingus_menu_manager.cxx, 1.28, 1.29 pingus_resource.cxx, 1.31, 1.32 pingus_sub_menu.cxx, 1.1, 1.2 playfield.cxx, 1.38, 1.39 playfield_view.cxx, 1.6, 1.7 result.cxx, 1.3, 1.4 result.hxx, 1.8, 1.9 result_screen.cxx, 1.19, 1.20 savegame.cxx, 1.5, 1.6 savegame.hxx, 1.6, 1.7 screenshot.cxx, 1.16, 1.17 smallmap.cxx, 1.40, 1.41 smallmap.hxx, 1.20, 1.21 smallmap_image.cxx, 1.12, 1.13 smallmap_image.hxx, 1.10, 1.11 spot_map.cxx, 1.29, 1.30 sprite.cxx, 1.16, 1.17 start_screen.cxx, 1.21, 1.22 story_screen.cxx, 1.23, 1.24 string_format.cxx, 1.3, 1.4 string_format.hxx, 1.2, 1.3 target_provider.cxx, 1.3, 1.4 theme.cxx, 1.21, 1.22 theme.hxx, 1.8, 1.9 theme_selector.cxx, 1.15, 1.16 theme_selector.hxx, 1.9, 1.10 time_display.cxx, 1.18, 1.19 time_display.hxx, 1.13, 1.14,
Ingo Ruhnke <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/input/axes joystick_axis.cxx, 1.5, 1.6
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/gui component.hxx, 1.15, 1.16 gui_screen.cxx, 1.4, 1.5
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/input/axes joystick_axis.cxx, 1.5, 1.6
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/gui component.hxx, 1.15, 1.16 gui_screen.cxx, 1.4, 1.5
- Index(es):