mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
SAGA2: Remove global constructors in floating.cpp
This commit is contained in:
parent
e4ca5a7864
commit
deb8ee29a4
@ -245,8 +245,8 @@ void BackWindow::toFront(void) {}
|
||||
DragBar class member functions
|
||||
* ===================================================================== */
|
||||
|
||||
Point16 DragBar::dragOffset,
|
||||
DragBar::dragPos;
|
||||
StaticPoint16 DragBar::dragOffset = {0, 0};
|
||||
StaticPoint16 DragBar::dragPos = {0, 0};
|
||||
bool DragBar::update;
|
||||
FloatingWindow *DragBar::dragWindow;
|
||||
|
||||
@ -267,7 +267,7 @@ bool DragBar::pointerHit(gPanelMessage &msg) {
|
||||
|
||||
dragPos.x = wExtent.x;
|
||||
dragPos.y = wExtent.y;
|
||||
dragOffset = msg.pickAbsPos;
|
||||
dragOffset.set(msg.pickAbsPos.x, msg.pickAbsPos.y);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -287,7 +287,7 @@ void DragBar::pointerDrag(gPanelMessage &msg) {
|
||||
// If window position has changed, then signal the drawing loop
|
||||
|
||||
if (pos != dragPos) {
|
||||
dragPos = pos;
|
||||
dragPos.set(pos.x, pos.y);
|
||||
update = true;
|
||||
dragWindow = (FloatingWindow *)&window;
|
||||
}
|
||||
|
@ -87,8 +87,8 @@ class FloatingWindow;
|
||||
class DragBar : public gControl {
|
||||
|
||||
public:
|
||||
static Point16 dragOffset, // mouse offset
|
||||
dragPos; // new position of window
|
||||
static StaticPoint16 dragOffset, // mouse offset
|
||||
dragPos; // new position of window
|
||||
static bool update; // true = update window pos
|
||||
static FloatingWindow *dragWindow; // which window to update
|
||||
|
||||
|
@ -29,6 +29,15 @@
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
struct StaticPoint16 {
|
||||
int16 x, y;
|
||||
|
||||
void set(int16 nx, int16 ny) {
|
||||
x = nx;
|
||||
y = ny;
|
||||
}
|
||||
};
|
||||
|
||||
class Point16 {
|
||||
public:
|
||||
int16 x, y;
|
||||
@ -58,6 +67,11 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
Point16(StaticPoint16 p) {
|
||||
x = p.x;
|
||||
y = p.y;
|
||||
}
|
||||
|
||||
void load(Common::SeekableReadStream *stream);
|
||||
|
||||
// Point16 operators
|
||||
|
Loading…
Reference in New Issue
Block a user