[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/gui cursor.cxx,1.1,1.2 display.cxx,1
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/gui cursor.cxx,1.1,1.2 display.cxx,1.1,1.2 display.hxx,1.1,1.2 screen_manager.cxx,1.7,1.8 |
Date: |
15 Apr 2003 19:06:52 -0000 |
Update of /var/lib/cvs/Games/Pingus/src/gui
In directory dark:/tmp/cvs-serv5042/gui
Modified Files:
cursor.cxx display.cxx display.hxx screen_manager.cxx
Log Message:
- removed obsolete mouse show/hide stuff
- fixed software cursor a bit
- made the current controller globally reachable
Index: cursor.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/cursor.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cursor.cxx 19 Feb 2003 09:51:44 -0000 1.1
+++ cursor.cxx 15 Apr 2003 19:06:50 -0000 1.2
@@ -17,6 +17,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#include "../input/controller.hxx"
+#include "../input/pointer.hxx"
#include "cursor.hxx"
Cursor::Cursor (std::string ident, std::string datafile)
@@ -38,7 +40,9 @@
void
Cursor::on_event()
{
- //sprite.put_screen (controller->get_pos ());
+ const Input::Pointer* pointer =
Input::Controller::get_current()->get_pointer();
+ sprite.put_screen (static_cast<int>(pointer->get_x_pos ()),
+ static_cast<int>(pointer->get_y_pos ()));
}
/* EOF */
Index: display.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/display.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- display.cxx 19 Feb 2003 09:51:44 -0000 1.1
+++ display.cxx 15 Apr 2003 19:06:50 -0000 1.2
@@ -26,7 +26,6 @@
#include "display.hxx"
std::list<DisplayHook*> Display::display_hooks;
-bool Display::displaying_cursor = false;
DisplayHook::DisplayHook() : is_visible(false)
{
@@ -50,33 +49,6 @@
CL_Display::draw_line(x1, y2, x2, y2, r, g, b, a);
CL_Display::draw_line(x1, y1, x1, y2, r, g, b, a);
CL_Display::draw_line(x2, y1, x2, y2, r, g, b, a);
-}
-
-void
-Display::show_cursor(bool async)
-{
- if (swcursor_enabled)
- CL_MouseCursor::show(async);
-}
-
-void
-Display::hide_cursor()
-{
- if (swcursor_enabled)
- CL_MouseCursor::hide();
-}
-
-void
-Display::set_cursor(CL_MouseCursorProvider *provider, int frame)
-{
- if (swcursor_enabled)
- CL_MouseCursor::set_cursor(provider, frame);
-}
-
-bool
-Display::cursor_shown()
-{
- return displaying_cursor;
}
void
Index: display.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/display.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- display.hxx 19 Feb 2003 09:51:44 -0000 1.1
+++ display.hxx 15 Apr 2003 19:06:50 -0000 1.2
@@ -24,7 +24,6 @@
#include <list>
class DisplayHook;
-class CL_MouseCursorProvider;
/** A flip display hook can be used to attach an event to a
flip_screen(). An example usage for this is a software mouse
@@ -50,15 +49,9 @@
class Display
{
private:
- static bool displaying_cursor;
static std::list<DisplayHook*> display_hooks;
public:
static void draw_rect(int x1, int y1, int x2, int y2, float r, float g,
float b, float a);
-
- static void show_cursor(bool show_async=true);
- static void hide_cursor();
- static void set_cursor(CL_MouseCursorProvider *provider, int frame=0);
- static bool cursor_shown();
static void flip_display(bool sync=false);
Index: screen_manager.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/gui/screen_manager.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- screen_manager.cxx 15 Apr 2003 10:33:15 -0000 1.7
+++ screen_manager.cxx 15 Apr 2003 19:06:50 -0000 1.8
@@ -19,8 +19,10 @@
#include <iostream>
#include <ClanLib/Display/Display/display.h>
+#include <ClanLib/Display/Display/mousecursor.h>
#include "../globals.hxx"
+#include "cursor.hxx"
#include "display.hxx"
#include "screen_manager.hxx"
#include "../fade_out.hxx"
@@ -49,6 +51,16 @@
else
input_controller = new Input::Controller(controller_file);
+ Input::Controller::set_current(input_controller);
+
+ Cursor* cursor = 0;
+ if (swcursor_enabled)
+ {
+ cursor = new Cursor("cursors/animcross", "core");
+ Display::add_flip_screen_hook(cursor);
+ CL_MouseCursor::hide();
+ }
+
DeltaManager delta_manager;
// Main loop for the menu
@@ -79,6 +91,9 @@
// Most likly the screen will get changed in this update call
get_current_screen()->update (delta);
+ if (cursor)
+ cursor->update(time_delta);
+
// Last screen has poped, so we are going to end here
if (screens.empty ())
continue;
@@ -122,6 +137,8 @@
CL_System::sleep (0);
}
+ Display::remove_flip_screen_hook(cursor);
+ delete cursor;
delete input_controller;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/gui cursor.cxx,1.1,1.2 display.cxx,1.1,1.2 display.hxx,1.1,1.2 screen_manager.cxx,1.7,1.8,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src client.cxx,1.43,1.44 level_result.cxx,1.11,1.12 loading.cxx,1.3,1.4 pingu.cxx,1.40,1.41 pingus_main.cxx,1.82,1.83 theme_selector.cxx,1.10,1.11
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/input controller.cxx,1.26,1.27 controller.hxx,1.17,1.18
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src client.cxx,1.43,1.44 level_result.cxx,1.11,1.12 loading.cxx,1.3,1.4 pingu.cxx,1.40,1.41 pingus_main.cxx,1.82,1.83 theme_selector.cxx,1.10,1.11
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/input controller.cxx,1.26,1.27 controller.hxx,1.17,1.18
- Index(es):