[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/worldmap level_dot.cxx,1.18,1.19 pin
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/worldmap level_dot.cxx,1.18,1.19 pingus.cxx,1.30,1.31 |
Date: |
10 Apr 2003 14:36:37 -0000 |
Update of /var/lib/cvs/Games/Pingus/src/worldmap
In directory dark:/tmp/cvs-serv23619/src/worldmap
Modified Files:
level_dot.cxx pingus.cxx
Log Message:
fixed a few sorting issues
Index: level_dot.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/level_dot.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- level_dot.cxx 10 Apr 2003 11:51:32 -0000 1.18
+++ level_dot.cxx 10 Apr 2003 14:36:35 -0000 1.19
@@ -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 <ClanLib/Display/Input/mouse.h>
#include <iostream>
#include "../my_gettext.hxx"
#include "../globals.hxx"
@@ -76,15 +77,31 @@
void
LevelDot::draw(GraphicContext& gc)
{
+ Vector mpos = gc.screen_to_world(Vector(CL_Mouse::get_x(),
CL_Mouse::get_y()));
+
+ float x = mpos.x - pos.x;
+ float y = mpos.y - pos.y;
+
+ bool highlight = false;
+
+ if (sqrt(x*x + y*y) < 30.0f)
+ highlight = true;
+
Savegame* savegame = SavegameManager::instance()->get(levelname);
if (savegame
&& (savegame->status == Savegame::FINISHED
|| savegame->status == Savegame::ACCESSIBLE))
{
if (savegame->status == Savegame::FINISHED)
- gc.draw (green_dot_sur, pos);
+ if (highlight)
+ gc.draw (highlight_green_dot_sur, pos);
+ else
+ gc.draw (green_dot_sur, pos);
else
- gc.draw (red_dot_sur, pos);
+ if (highlight)
+ gc.draw (highlight_red_dot_sur, pos);
+ else
+ gc.draw (red_dot_sur, pos);
}
else
{
@@ -129,17 +146,6 @@
void
LevelDot::draw_hover(GraphicContext& gc)
{
- Savegame* savegame = SavegameManager::instance()->get(levelname);
- if (savegame
- && (savegame->status == Savegame::FINISHED
- || savegame->status == Savegame::ACCESSIBLE))
- {
- if (savegame->status == Savegame::FINISHED)
- gc.draw (highlight_green_dot_sur, pos);
- else
- gc.draw (highlight_red_dot_sur, pos);
- }
-
if (accessible())
{
gc.print_center(Fonts::pingus_small,
Index: pingus.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/pingus.cxx,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- pingus.cxx 10 Apr 2003 11:51:32 -0000 1.30
+++ pingus.cxx 10 Apr 2003 14:36:35 -0000 1.31
@@ -29,7 +29,7 @@
Pingus::Pingus (PathGraph* arg_path)
: Drawable("pingus"),
path(arg_path),
- sprite ("worldmap/pingus", "core", 20.0f, Sprite::RIGHT),
+ sprite ("worldmap/pingus", "core", 27.0f, Sprite::RIGHT),
sprite_standing ("worldmap/pingus_standing", "core"),
arrow ("worldmap/arrow", "core")
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldmap level_dot.cxx,1.18,1.19 pingus.cxx,1.30,1.31,
grumbel <=