[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/gui buffer_graphic_context.cxx, 1.3,
From: |
Ingo Ruhnke |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/gui buffer_graphic_context.cxx, 1.3, 1.4 buffer_graphic_context.hxx, 1.4, 1.5 display_graphic_context.cxx, 1.8, 1.9 display_graphic_context.hxx, 1.6, 1.7 game_delta_recorder.hxx, 1.2, 1.3 graphic_context.hxx, 1.6, 1.7 gui_manager.hxx, 1.14, 1.15 gui_screen.cxx, 1.2, 1.3 input_debug_screen.cxx, 1.2, 1.3 input_debug_screen.hxx, 1.2, 1.3 root_gui_manager.cxx, 1.9, 1.10 screen.hxx, 1.3, 1.4 screen_manager_impl.hxx, 1.2, 1.3 |
Date: |
Sun, 19 Oct 2003 14:25:49 +0200 |
Update of /var/lib/cvs/Games/Pingus/src/gui
In directory dark:/tmp/cvs-serv19578/gui
Modified Files:
buffer_graphic_context.cxx buffer_graphic_context.hxx
display_graphic_context.cxx display_graphic_context.hxx
game_delta_recorder.hxx graphic_context.hxx gui_manager.hxx
gui_screen.cxx input_debug_screen.cxx input_debug_screen.hxx
root_gui_manager.cxx screen.hxx screen_manager_impl.hxx
Log Message:
- some more stuff, still not much useable
Index: buffer_graphic_context.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/buffer_graphic_context.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- buffer_graphic_context.cxx 18 Oct 2003 23:17:28 -0000 1.3
+++ buffer_graphic_context.cxx 19 Oct 2003 12:25:47 -0000 1.4
@@ -20,6 +20,7 @@
#include <iostream>
#include "../pingus_error.hxx"
#include "../blitter.hxx"
+#include "../canvas.hxx"
#include "../screenshot.hxx"
#include "buffer_graphic_context.hxx"
@@ -27,7 +28,7 @@
BufferGraphicContext::BufferGraphicContext(int width, int height)
{
- canvas = new CL_Canvas(width, height);
+ canvas = Canvas::create_rgba8888(width, height);
}
CL_Rect
@@ -48,12 +49,14 @@
void
BufferGraphicContext::draw (CL_Surface& sur, int x_pos, int y_pos)
{
+#ifdef CLANLIB_0_6
//std::cout << "BufferGraphicContext: " << x_pos << ", " << y_pos <<
std::endl;
try {
Blitter::put_surface(canvas, sur.get_provider(), x_pos, y_pos);
} catch (PingusError& err) {
std::cout << "BufferGraphicContext: " << err.get_message() << std::endl;
}
+#endif
}
void
Index: buffer_graphic_context.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/buffer_graphic_context.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- buffer_graphic_context.hxx 18 Oct 2003 23:17:28 -0000 1.4
+++ buffer_graphic_context.hxx 19 Oct 2003 12:25:47 -0000 1.5
@@ -23,13 +23,12 @@
#include <string>
#include "../vector.hxx"
#include <ClanLib/Core/Math/rect.h>
-#include <ClanLib/Display/SurfaceProviders/canvas.h>
+#include <ClanLib/Display/pixel_buffer.h>
#include <ClanLib/Display/font.h>
#include "graphic_context.hxx"
class CL_Surface;
class CL_Font;
-class CL_Canvas;
namespace Pingus {
@@ -40,7 +39,7 @@
class BufferGraphicContext : public GraphicContext
{
private:
- CL_Canvas* canvas;
+ CL_PixelBuffer* canvas;
public:
BufferGraphicContext(int width, int height);
Index: display_graphic_context.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/display_graphic_context.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- display_graphic_context.cxx 18 Oct 2003 23:17:28 -0000 1.8
+++ display_graphic_context.cxx 19 Oct 2003 12:25:47 -0000 1.9
@@ -169,14 +169,17 @@
}
else
{
+#ifdef CLANLIB_0_6
sur.draw(w2s_x(x_pos), w2s_y(y_pos),
offset.z, offset.z);
+#endif
}
}
void
DisplayGraphicContext::draw (CL_Surface& sur, int x_pos, int y_pos, int frame)
{
+#ifdef CLANLIB_0_6
if (offset.z == 1.0)
{
sur.draw(w2s_x(x_pos), w2s_y(y_pos), frame);
@@ -187,15 +190,18 @@
offset.z, offset.z,
frame);
}
+#endif
}
void
DisplayGraphicContext::draw (CL_Surface& sur, int x_pos, int y_pos,
float size_x, float size_y, int frame)
{
+#ifdef CLANLIB_0_6
sur.draw(w2s_x(x_pos), w2s_y(y_pos),
size_x * offset.z,
size_y * offset.z, frame);
+#endif
}
void
@@ -227,9 +233,9 @@
DisplayGraphicContext::draw_rect (int x1, int y1, int x2, int y2,
float r, float g, float b, float a)
{
- CL_Display::draw_rect(w2s_x(x1), w2s_y(y1),
- w2s_x(x2), w2s_y(y2),
- r, g, b, a);
+ CL_Display::draw_rect(CL_Rect(w2s_x(x1), w2s_y(y1),
+ w2s_x(x2), w2s_y(y2)),
+ Display::to_color(r, g, b, a));
}
void
@@ -262,19 +268,19 @@
}
void
-DisplayGraphicContext::print_left (FontHandle font, int x_pos, int y_pos,
const std::string& str)
+DisplayGraphicContext::print_left (CL_Font font, int x_pos, int y_pos, const
std::string& str)
{
- font->print_left(w2s_x(x_pos), w2s_y(y_pos), str.c_str ());
+ font.draw(w2s_x(x_pos), w2s_y(y_pos), str.c_str ());
}
void
-DisplayGraphicContext::print_center (FontHandle font, int x_pos, int y_pos,
const std::string& str)
+DisplayGraphicContext::print_center (CL_Font font, int x_pos, int y_pos, const
std::string& str)
{
- font->print_center(w2s_x(x_pos), w2s_y(y_pos), str.c_str ());
+ font.print_center(w2s_x(x_pos), w2s_y(y_pos), str.c_str ());
}
void
-DisplayGraphicContext::print_right (FontHandle font, int x_pos, int y_pos,
const std::string& str)
+DisplayGraphicContext::print_right (CL_Font font, int x_pos, int y_pos, const
std::string& str)
{
font->print_right(w2s_x(x_pos), w2s_y(y_pos), str.c_str ());
}
Index: display_graphic_context.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/display_graphic_context.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- display_graphic_context.hxx 18 Oct 2003 23:17:28 -0000 1.6
+++ display_graphic_context.hxx 19 Oct 2003 12:25:47 -0000 1.7
@@ -122,11 +122,11 @@
void draw_circle (int x_pos, int y_pos, int radius,
float r, float g, float b, float a = 1.0f);
- void print_left (FontHandle font, int x_pos, int y_pos, const std::string&
str);
+ void print_left (CL_Font font, int x_pos, int y_pos, const std::string& str);
- void print_center (FontHandle font, int x_pos, int y_pos, const std::string&
str);
+ void print_center (CL_Font font, int x_pos, int y_pos, const std::string&
str);
- void print_right (FontHandle font, int x_pos, int y_pos, const std::string&
str);
+ void print_right (CL_Font font, int x_pos, int y_pos, const std::string&
str);
private:
DisplayGraphicContext (const DisplayGraphicContext&);
Index: game_delta_recorder.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/game_delta_recorder.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- game_delta_recorder.hxx 19 Apr 2003 10:23:18 -0000 1.2
+++ game_delta_recorder.hxx 19 Oct 2003 12:25:47 -0000 1.3
@@ -20,6 +20,8 @@
#ifndef HEADER_PINGUS_GAME_DELTA_RECORDER_HXX
#define HEADER_PINGUS_GAME_DELTA_RECORDER_HXX
+namespace Pingus {
+
class GameDeltaRecorder
{
private:
@@ -29,6 +31,8 @@
GameDelta* get ();
};
+} // namespace Pingus
+
#endif
/* EOF */
Index: graphic_context.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/graphic_context.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- graphic_context.hxx 18 Oct 2003 23:17:28 -0000 1.6
+++ graphic_context.hxx 19 Oct 2003 12:25:47 -0000 1.7
@@ -23,6 +23,7 @@
#include <string>
#include "../vector.hxx"
#include <ClanLib/Core/Math/rect.h>
+#include <ClanLib/Display/font.h>
class CL_Surface;
class CL_Sprite;
Index: gui_manager.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/gui_manager.hxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- gui_manager.hxx 19 Apr 2003 10:23:18 -0000 1.14
+++ gui_manager.hxx 19 Oct 2003 12:25:47 -0000 1.15
@@ -24,64 +24,68 @@
#include "../input/event.hxx"
#include "component.hxx"
+namespace Pingus {
+
class GameDelta;
-namespace GUI
+namespace GUI {
+
+/** The GUIManager class holds a group of components and manages
+ them. It dispatches the GameDelta to each individual
+ component
+
+ FIXME: We translate GameDelta into another 'language' which is
+ then understood by the GUI, this seems unclear, not sure at
+ which point it is best to split the GameDelta into
+ on_primary_button_press(), etc.
+*/
+class GUIManager : public Component
{
- /** The GUIManager class holds a group of components and manages
- them. It dispatches the GameDelta to each individual
- component
+private:
+ std::vector<Component*> components;
- FIXME: We translate GameDelta into another 'language' which is
- then understood by the GUI, this seems unclear, not sure at
- which point it is best to split the GameDelta into
- on_primary_button_press(), etc.
- */
- class GUIManager : public Component
- {
- private:
- std::vector<Component*> components;
+ /** The component which recieved the last pressed event */
+ Component* primary_pressed_component;
+ Component* secondary_pressed_component;
- /** The component which recieved the last pressed event */
- Component* primary_pressed_component;
- Component* secondary_pressed_component;
+ /** The component over which the mouse was in the last update,
+ used to detecte enter/leave events */
+ Component* mouse_over_component;
- /** The component over which the mouse was in the last update,
- used to detecte enter/leave events */
- Component* mouse_over_component;
+ // FIXME: Hack: should be handled inside the controller
+ int x_pos;
+ int y_pos;
- // FIXME: Hack: should be handled inside the controller
- int x_pos;
- int y_pos;
+ void process_input (const GameDelta& delta);
+ void process_pointer_event (const Input::PointerEvent& event);
+ void process_button_event (unsigned int time_stamp, const
Input::ButtonEvent& event);
+public:
+ GUIManager ();
+ virtual ~GUIManager () {}
- void process_input (const GameDelta& delta);
- void process_pointer_event (const Input::PointerEvent& event);
- void process_button_event (unsigned int time_stamp, const
Input::ButtonEvent& event);
- public:
- GUIManager ();
- virtual ~GUIManager () {}
+ virtual void draw (GraphicContext& gc);
+ virtual void update (const GameDelta& delta);
+ virtual void update (float delta) { UNUSED_ARG (delta); }
- virtual void draw (GraphicContext& gc);
- virtual void update (const GameDelta& delta);
- virtual void update (float delta) { UNUSED_ARG (delta); }
+ /** Add a component to the manager, if delete_component is true
+ the component will get deleted on destruction of the manager,
+ if false is supplied the user has to handle the component
+ itself */
+ void add (Component*, bool delete_component = true);
- /** Add a component to the manager, if delete_component is true
- the component will get deleted on destruction of the manager,
- if false is supplied the user has to handle the component
- itself */
- void add (Component*, bool delete_component = true);
+ /** */
+ void remove (Component*);
- /** */
- void remove (Component*);
+ Component* component_at (int x, int y);
+ virtual bool is_at (int x, int y);
- Component* component_at (int x, int y);
- virtual bool is_at (int x, int y);
+private:
+ GUIManager (const GUIManager&);
+ GUIManager& operator= (const GUIManager&);
+};
- private:
- GUIManager (const GUIManager&);
- GUIManager& operator= (const GUIManager&);
- };
-}
+} // namespace GUI
+} // namespace Pingus
#endif
Index: gui_screen.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/gui_screen.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gui_screen.cxx 19 Apr 2003 10:23:18 -0000 1.2
+++ gui_screen.cxx 19 Oct 2003 12:25:47 -0000 1.3
@@ -22,7 +22,8 @@
#include "gui_screen.hxx"
#include "gui_manager.hxx"
-using namespace GUI;
+namespace Pingus {
+namespace GUI {
GUIScreen::GUIScreen ()
: gui_manager (new GUIManager ())
@@ -158,4 +159,7 @@
}
}
+} // namespace GUI
+} // namespace Pingus
+
/* EOF */
Index: input_debug_screen.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/input_debug_screen.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- input_debug_screen.cxx 19 Apr 2003 10:23:18 -0000 1.2
+++ input_debug_screen.cxx 19 Oct 2003 12:25:47 -0000 1.3
@@ -23,6 +23,8 @@
//#include "input/scroll_event.hxx"
#include "input_debug_screen.hxx"
+namespace Pingus {
+
using namespace Input;
InputDebugScreen::InputDebugScreen ()
@@ -96,4 +98,6 @@
std::cout << "InputDebugScreen::on_shutdown ()" << std::endl;
}
+} // namespace Pingus
+
/* EOF */
Index: input_debug_screen.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/input_debug_screen.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- input_debug_screen.hxx 19 Apr 2003 10:23:18 -0000 1.2
+++ input_debug_screen.hxx 19 Oct 2003 12:25:47 -0000 1.3
@@ -22,6 +22,8 @@
#include "screen.hxx"
+namespace Pingus {
+
class InputDebugScreen : public Screen
{
private:
@@ -45,6 +47,8 @@
void on_shutdown ();
};
+} // namespace Pingus
+
#endif
/* EOF */
Index: root_gui_manager.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/root_gui_manager.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- root_gui_manager.cxx 19 Apr 2003 10:23:18 -0000 1.9
+++ root_gui_manager.cxx 19 Oct 2003 12:25:47 -0000 1.10
@@ -21,6 +21,8 @@
#include "root_gui_manager.hxx"
#include "../input/controller.hxx"
+namespace Pingus {
+
using namespace GUI;
using namespace Input;
@@ -44,4 +46,6 @@
UNUSED_ARG(delta);
}
+} // namespace Pingus
+
/* EOF */
Index: screen.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/screen.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- screen.hxx 18 Oct 2003 12:11:31 -0000 1.3
+++ screen.hxx 19 Oct 2003 12:25:47 -0000 1.4
@@ -22,10 +22,10 @@
#include "game_delta.hxx"
-class GraphicContext;
-
namespace Pingus {
+class GraphicContext;
+
/** A interface for screens. A screen is a Pingus 'thing' which gets
complete controll over the display and input. Examples of
screens are the PingusMenu or a PingusGameSession */
Index: screen_manager_impl.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/screen_manager_impl.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- screen_manager_impl.hxx 19 Apr 2003 10:23:18 -0000 1.2
+++ screen_manager_impl.hxx 19 Oct 2003 12:25:47 -0000 1.3
@@ -22,6 +22,8 @@
#include "pingus.hxx"
+namespace Pingus {
+
class ScreenManagerImpl
{
private:
@@ -37,6 +39,8 @@
ScreenManagerImpl& operator= (const ScreenManagerImpl&);
};
+} // namespace Pingus
+
#endif
/* EOF */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/gui buffer_graphic_context.cxx, 1.3, 1.4 buffer_graphic_context.hxx, 1.4, 1.5 display_graphic_context.cxx, 1.8, 1.9 display_graphic_context.hxx, 1.6, 1.7 game_delta_recorder.hxx, 1.2, 1.3 graphic_context.hxx, 1.6, 1.7 gui_manager.hxx, 1.14, 1.15 gui_screen.cxx, 1.2, 1.3 input_debug_screen.cxx, 1.2, 1.3 input_debug_screen.hxx, 1.2, 1.3 root_gui_manager.cxx, 1.9, 1.10 screen.hxx, 1.3, 1.4 screen_manager_impl.hxx, 1.2, 1.3,
Ingo Ruhnke <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/input/axes Makefile.am, 1.3, 1.4 joystick_axis.cxx, 1.2, 1.3
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/input/buttons Makefile.am, 1.3, 1.4 joystick_button.cxx, 1.3, 1.4 key_button.cxx, 1.3, 1.4 mouse_button.cxx, 1.3, 1.4 mouse_button.hxx, 1.5, 1.6
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/input/axes Makefile.am, 1.3, 1.4 joystick_axis.cxx, 1.2, 1.3
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/input/buttons Makefile.am, 1.3, 1.4 joystick_button.cxx, 1.3, 1.4 key_button.cxx, 1.3, 1.4 mouse_button.cxx, 1.3, 1.4 mouse_button.hxx, 1.5, 1.6
- Index(es):