mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-21 01:05:59 +00:00
SAGA2: Fix a global constructor warning in tilemode.cpp
This commit is contained in:
parent
17bcde4f6f
commit
703ff18cb3
@ -808,7 +808,7 @@ void DisplayNode::drawObject(void) {
|
||||
//-----------------------------------------------------------------------
|
||||
// Do mouse hit-test on objects
|
||||
|
||||
ObjectID pickObject(const Point16 &mouse, StaticTilePoint &objPos) {
|
||||
ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos) {
|
||||
DisplayNode *dn;
|
||||
ObjectID result = Nothing;
|
||||
int32 dist = maxint32;
|
||||
@ -822,7 +822,7 @@ ObjectID pickObject(const Point16 &mouse, StaticTilePoint &objPos) {
|
||||
if (dn->type == nodeTypeObject) {
|
||||
GameObject *obj = dn->object;
|
||||
|
||||
if (obj->parent() == currentWorld && dn->hitBox.ptInside(mouse)) {
|
||||
if (obj->parent() == currentWorld && dn->hitBox.ptInside(mouse.x, mouse.y)) {
|
||||
TilePoint loc = obj->getLocation();
|
||||
int32 newDist = loc.u + loc.v;
|
||||
|
||||
|
@ -48,7 +48,7 @@ class DisplayNode {
|
||||
friend class DisplayNodeList;
|
||||
friend class SpellDisplayList;
|
||||
friend class GameObject;
|
||||
friend ObjectID pickObject(const Point16 &mouse, StaticTilePoint &objPos);
|
||||
friend ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos);
|
||||
|
||||
private:
|
||||
DisplayNode *nextDisplayed; // pointer to next in display list
|
||||
@ -85,7 +85,7 @@ public:
|
||||
const int maxDisplayed = 100;
|
||||
|
||||
class DisplayNodeList {
|
||||
friend ObjectID pickObject(const Point16 &mouse, StaticTilePoint &objPos);
|
||||
friend ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos);
|
||||
|
||||
public:
|
||||
uint16 count; // number of entries in list
|
||||
|
@ -1346,7 +1346,7 @@ bool lineOfSight(
|
||||
bool objObscured(GameObject *testObj);
|
||||
|
||||
// Determine which object mouse pointer is picking
|
||||
ObjectID pickObject(const Point16 &mouse, StaticTilePoint &objPos);
|
||||
ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos);
|
||||
|
||||
// Create enchantment attach it to object
|
||||
ObjectID EnchantObject(
|
||||
|
@ -141,6 +141,11 @@ typedef Point16 Extent16; // contains width and height
|
||||
struct StaticPoint32 {
|
||||
int32 x, y;
|
||||
|
||||
void set(int16 nx, int16 ny) {
|
||||
x = nx;
|
||||
y = ny;
|
||||
}
|
||||
|
||||
friend StaticPoint32 operator+ (StaticPoint32 a, StaticPoint32 b) {
|
||||
StaticPoint32 p;
|
||||
p.x = a.x + b.x;
|
||||
|
@ -185,7 +185,7 @@ Alarm updateAlarm, // max coord update rate
|
||||
bool tileLockFlag; // true if tile mode is locked
|
||||
|
||||
GameObject *mouseObject = NULL; // object being dragged
|
||||
Point32 lastMousePos; // Last mouse position over map
|
||||
StaticPoint32 lastMousePos = {0, 0}; // Last mouse position over map
|
||||
static bool mousePressed, // State of mouse button
|
||||
clickActionDone = true; // Flag indication wether current
|
||||
// mouse click action is done
|
||||
@ -1066,7 +1066,7 @@ static APPFUNC(cmdClickTileMap) {
|
||||
g_vm->_mouseInfo->setText(NULL);
|
||||
g_vm->_mouseInfo->clearGauge();
|
||||
}
|
||||
lastMousePos = ev.mouse;
|
||||
lastMousePos.set(ev.mouse.x, ev.mouse.y);
|
||||
break;
|
||||
|
||||
case gEventMouseDown:
|
||||
|
Loading…
x
Reference in New Issue
Block a user