mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
ZVISION: screenSpaceToImageSpace return 0,0 when pointer outside working window.
This commit is contained in:
parent
aba818d195
commit
b9ad7e80a5
@ -385,30 +385,34 @@ Common::Rect RenderManager::renderTextToWorkingWindow(uint32 idNumber, const Com
|
||||
}
|
||||
|
||||
const Common::Point RenderManager::screenSpaceToImageSpace(const Common::Point &point) {
|
||||
// Convert from screen space to working window space
|
||||
Common::Point newPoint(point - Common::Point(_workingWindow.left, _workingWindow.top));
|
||||
if (_workingWindow.contains(point)) {
|
||||
// Convert from screen space to working window space
|
||||
Common::Point newPoint(point - Common::Point(_workingWindow.left, _workingWindow.top));
|
||||
|
||||
RenderTable::RenderState state = _renderTable.getRenderState();
|
||||
if (state == RenderTable::PANORAMA || state == RenderTable::TILT) {
|
||||
newPoint = _renderTable.convertWarpedCoordToFlatCoord(newPoint);
|
||||
RenderTable::RenderState state = _renderTable.getRenderState();
|
||||
if (state == RenderTable::PANORAMA || state == RenderTable::TILT) {
|
||||
newPoint = _renderTable.convertWarpedCoordToFlatCoord(newPoint);
|
||||
}
|
||||
|
||||
if (state == RenderTable::PANORAMA) {
|
||||
newPoint -= (Common::Point(_screenCenterX, 0) - _backgroundOffset);
|
||||
} else if (state == RenderTable::TILT) {
|
||||
newPoint -= (Common::Point(0, _screenCenterY) - _backgroundOffset);
|
||||
}
|
||||
|
||||
if (newPoint.x < 0)
|
||||
newPoint.x += _backgroundWidth;
|
||||
else if (newPoint.x >= _backgroundWidth)
|
||||
newPoint.x -= _backgroundWidth;
|
||||
if (newPoint.y < 0)
|
||||
newPoint.y += _backgroundHeight;
|
||||
else if (newPoint.y >= _backgroundHeight)
|
||||
newPoint.y -= _backgroundHeight;
|
||||
|
||||
return newPoint;
|
||||
} else {
|
||||
return Common::Point(0, 0);
|
||||
}
|
||||
|
||||
if (state == RenderTable::PANORAMA) {
|
||||
newPoint -= (Common::Point(_screenCenterX, 0) - _backgroundOffset);
|
||||
} else if (state == RenderTable::TILT) {
|
||||
newPoint -= (Common::Point(0, _screenCenterY) - _backgroundOffset);
|
||||
}
|
||||
|
||||
if (newPoint.x < 0)
|
||||
newPoint.x += _backgroundWidth;
|
||||
else if (newPoint.x >= _backgroundWidth)
|
||||
newPoint.x -= _backgroundWidth;
|
||||
if (newPoint.y < 0)
|
||||
newPoint.y += _backgroundHeight;
|
||||
else if (newPoint.y >= _backgroundHeight)
|
||||
newPoint.y -= _backgroundHeight;
|
||||
|
||||
return newPoint;
|
||||
}
|
||||
|
||||
const Common::Point RenderManager::imageSpaceToWorkingWindowSpace(const Common::Point &point) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user