From 52ee33dfa675f0520eb2345c46e2bb0ecaa2aa2f Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 30 May 2016 07:15:43 +0200 Subject: GNAP: Make 2 variables local to setDeviceHotspot --- engines/gnap/gnap.cpp | 12 +++++------- engines/gnap/gnap.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'engines/gnap') diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp index d86d1a484c..f6c758becd 100644 --- a/engines/gnap/gnap.cpp +++ b/engines/gnap/gnap.cpp @@ -160,8 +160,6 @@ GnapEngine::GnapEngine(OSystem *syst, const ADGameDescription *gd) : _fullScreenSpriteId = 0; _deviceX1 = 0; _deviceY1 = 0; - _deviceX2 = 0; - _deviceY2 = 0; _soundTimerIndexA = 0; _soundTimerIndexB = 0; _soundTimerIndexC = 0; @@ -654,19 +652,19 @@ void GnapEngine::removeDeviceIconActive() { void GnapEngine::setDeviceHotspot(int hotspotIndex, int x1, int y1, int x2, int y2) { _deviceX1 = x1; - _deviceX2 = x2; _deviceY1 = y1; - _deviceY2 = y2; + int deviceX2 = x2; + int deviceY2 = y2; if (x1 == -1) _deviceX1 = 730; if (x2 == -1) - _deviceX2 = 780; + deviceX2 = 780; if (y1 == -1) _deviceY1 = 14; if (y2 == -1) - _deviceY2 = 79; + deviceY2 = 79; - _hotspots[hotspotIndex]._rect = Common::Rect(_deviceX1, _deviceY1, _deviceX2, _deviceY2); + _hotspots[hotspotIndex]._rect = Common::Rect(_deviceX1, _deviceY1, deviceX2, deviceY2); _hotspots[hotspotIndex]._flags = SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR; } diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h index 84c40e2969..29665728d5 100644 --- a/engines/gnap/gnap.h +++ b/engines/gnap/gnap.h @@ -296,7 +296,7 @@ public: Graphics::Surface *_fullScreenSprite; int _fullScreenSpriteId; - int _deviceX1, _deviceY1, _deviceX2, _deviceY2; + int _deviceX1, _deviceY1; int _soundTimerIndexA; int _soundTimerIndexB; -- cgit v1.2.3