mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-05 02:17:05 +00:00
FULLPIPE: Implement MovGraphReact::setCenter()
This commit is contained in:
parent
25aa1b72d9
commit
b87d052d01
@ -2027,8 +2027,11 @@ void ReactParallel::createRegion() {
|
||||
// GdiObject::Attach(_rgn, CreatePolygonRgn(_points, 4, 2);
|
||||
}
|
||||
|
||||
void ReactParallel::setCenter() {
|
||||
warning("STUB: ReactParallel::setCenter()");
|
||||
void ReactParallel::setCenter(int x1, int y1, int x2, int y2) {
|
||||
_x1 = x1;
|
||||
_y1 = y1;
|
||||
_x2 = x2;
|
||||
_y2 = y2;
|
||||
}
|
||||
|
||||
ReactPolygonal::ReactPolygonal() {
|
||||
@ -2067,8 +2070,19 @@ void ReactPolygonal::createRegion() {
|
||||
}
|
||||
}
|
||||
|
||||
void ReactPolygonal::setCenter() {
|
||||
warning("STUB: ReactPolygonal::setCenter()");
|
||||
void ReactPolygonal::setCenter(int x1, int y1, int x2, int y2) {
|
||||
int cX = (x2 + x1) / 2;
|
||||
int cY = (y2 + y1) / 2;
|
||||
|
||||
if (_points) {
|
||||
for (int i = 0; i < _pointCount; i++) {
|
||||
_points[i]->x += cX - _centerX;
|
||||
_points[i]->y += cY - _centerY;
|
||||
}
|
||||
}
|
||||
|
||||
_centerX = cX;
|
||||
_centerY = cY;
|
||||
}
|
||||
|
||||
bool MovGraphReact::pointInRegion(int x, int y) {
|
||||
|
@ -74,7 +74,7 @@ public:
|
||||
MovGraphReact() : _pointCount(0), _points(0) {}
|
||||
~MovGraphReact() { free(_points); }
|
||||
|
||||
virtual void setCenter() {}
|
||||
virtual void setCenter(int x1, int y1, int x2, int y2) {}
|
||||
virtual void createRegion() {}
|
||||
virtual bool pointInRegion(int x, int y);
|
||||
};
|
||||
@ -243,11 +243,11 @@ class ReactParallel : public MovGraphReact {
|
||||
int _dx;
|
||||
int _dy;
|
||||
|
||||
public:
|
||||
public:
|
||||
ReactParallel();
|
||||
virtual bool load(MfcArchive &file);
|
||||
|
||||
virtual void setCenter();
|
||||
virtual void setCenter(int x1, int y1, int x2, int y2);
|
||||
virtual void createRegion();
|
||||
};
|
||||
|
||||
@ -256,11 +256,11 @@ class ReactPolygonal : public MovGraphReact {
|
||||
int _centerX;
|
||||
int _centerY;
|
||||
|
||||
public:
|
||||
public:
|
||||
ReactPolygonal();
|
||||
virtual bool load(MfcArchive &file);
|
||||
|
||||
virtual void setCenter();
|
||||
virtual void setCenter(int x1, int y1, int x2, int y2);
|
||||
virtual void createRegion();
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user