1
0
forked from mirrors/0ad

no message

This was SVN commit r23.
This commit is contained in:
janwas
2003-11-04 23:59:41 +00:00
parent df5cf51fa3
commit a6e23bb2e6
3 changed files with 13 additions and 14 deletions
+8 -9
View File
@@ -6,6 +6,7 @@ gee@pyro.nu
//#include "stdafx."
#include "GUI.h"
#include "cgui.h"
///#include "Parser/parser.h"
#include <assert.h>
@@ -166,24 +167,22 @@ void CGUIObject::SetupBaseSettingsInfo(map_Settings &SettingsInfo)
}
extern int gui_mouse_x, gui_mouse_y; // declared in cgui.cpp
// JW: how about MouseOver(mouse_x, mouse_y) instead of accessing the global mouse pos?
//-------------------------------------------------------------------
// Checks if mouse is over and returns result
// Input:
// x, y Absolute mouse position
// mouse_x, mouse_y defined in CGUI
//-------------------------------------------------------------------
bool CGUIObject::MouseOver()
{
if (!GetGUI())
CGUI* gui = GetGUI();
if(!gui)
throw PS_NEEDS_PGUI;
return (gui_mouse_x >= m_BaseSettings.m_Size.left &&
gui_mouse_x <= m_BaseSettings.m_Size.right &&
gui_mouse_y >= m_BaseSettings.m_Size.bottom &&
gui_mouse_y <= m_BaseSettings.m_Size.top);
return (gui->mouse_x >= m_BaseSettings.m_Size.left &&
gui->mouse_x <= m_BaseSettings.m_Size.right &&
gui->mouse_y >= m_BaseSettings.m_Size.bottom &&
gui->mouse_y <= m_BaseSettings.m_Size.top);
}
//-------------------------------------------------------------------