aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-02-28 23:24:09 +0100
committerStrangerke2014-02-28 23:24:09 +0100
commita440c6a20e614c64dcd88380ee5273e9aad77169 (patch)
tree4c29514b920573bcbe6a64b377481c194d441451
parent81d733aec0c4422fa8c0b34b0c7f4d5b74c991c0 (diff)
downloadscummvm-rg350-a440c6a20e614c64dcd88380ee5273e9aad77169.tar.gz
scummvm-rg350-a440c6a20e614c64dcd88380ee5273e9aad77169.tar.bz2
scummvm-rg350-a440c6a20e614c64dcd88380ee5273e9aad77169.zip
TONY: Reduce the scope of more variables
-rw-r--r--engines/tony/game.cpp5
-rw-r--r--engines/tony/gfxcore.cpp9
-rw-r--r--engines/tony/gfxengine.cpp9
3 files changed, 9 insertions, 14 deletions
diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp
index 986eac99aa..c102242dfd 100644
--- a/engines/tony/game.cpp
+++ b/engines/tony/game.cpp
@@ -140,8 +140,6 @@ void RMOptionButton::setActiveState(bool bState) {
\****************************************************************************/
RMOptionSlide::RMOptionSlide(const RMPoint &pt, int nRange, int nStartValue, int slideSize) {
- RMResRaw *raw;
-
_pos = pt;
_nSlideSize = slideSize;
_nMax = nRange;
@@ -154,6 +152,7 @@ RMOptionSlide::RMOptionSlide(const RMPoint &pt, int nRange, int nStartValue, int
_sliderSingle = NULL;
// Sliders
+ RMResRaw *raw;
INIT_GFX16_FROMRAW(20029, _sliderCenter);
INIT_GFX16_FROMRAW(20030, _sliderLeft);
INIT_GFX16_FROMRAW(20031, _sliderRight);
@@ -966,6 +965,8 @@ void RMOptionScreen::changeState(CORO_PARAM, OptionScreenState newState) {
void RMOptionScreen::doFrame(CORO_PARAM, RMInput *input) {
CORO_BEGIN_CONTEXT;
bool bLeftClick, bRightClick;
+ RMResRaw *raw;
+
RMPoint mousePos;
bool bRefresh;
int i;
diff --git a/engines/tony/gfxcore.cpp b/engines/tony/gfxcore.cpp
index 3afad9b373..9254d59df6 100644
--- a/engines/tony/gfxcore.cpp
+++ b/engines/tony/gfxcore.cpp
@@ -821,27 +821,24 @@ void RMGfxSourceBuffer8RLE::setAlreadyCompressed() {
}
void RMGfxSourceBuffer8RLE::compressRLE() {
- byte *startline;
byte *cur;
byte curdata;
byte *src;
- byte *startsrc;
- int rep;
// Perform RLE compression for lines
cur = _megaRLEBuf;
src = _buf;
for (int y = 0; y < _dimy; y++) {
// Save the beginning of the line
- startline = cur;
+ byte *startline = cur;
// Leave space for the length of the line
cur += 2;
// It starts from the empty space
curdata = 0;
- rep = 0;
- startsrc = src;
+ int rep = 0;
+ byte *startsrc = src;
for (int x = 0; x < _dimx;) {
if ((curdata == 0 && *src == 0) || (curdata == 1 && *src == _alphaBlendColor)
|| (curdata == 2 && (*src != _alphaBlendColor && *src != 0))) {
diff --git a/engines/tony/gfxengine.cpp b/engines/tony/gfxengine.cpp
index 92469b7276..efbf63a6f5 100644
--- a/engines/tony/gfxengine.cpp
+++ b/engines/tony/gfxengine.cpp
@@ -352,11 +352,10 @@ void RMGfxEngine::initCustomDll() {
}
void RMGfxEngine::itemIrq(uint32 dwItem, int nPattern, int nStatus) {
- RMItem *item;
assert(GLOBALS._gfxEngine);
if (GLOBALS._gfxEngine->_bLocationLoaded) {
- item = GLOBALS._gfxEngine->_loc.getItemFromCode(dwItem);
+ RMItem *item = GLOBALS._gfxEngine->_loc.getItemFromCode(dwItem);
if (item != NULL) {
if (nPattern != -1) {
item->setPattern(nPattern, true);
@@ -452,8 +451,8 @@ void RMGfxEngine::unloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result) {
void RMGfxEngine::init() {
// Screen loading
- RMResRaw *raw;
RMGfxSourceBuffer16 *load = NULL;
+ RMResRaw *raw;
INIT_GFX16_FROMRAW(20038, load);
_bigBuf.addPrim(new RMGfxPrimitive(load));
_bigBuf.drawOT(Common::nullContext);
@@ -722,9 +721,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
if (_ctx->ver >= 5) {
// Version 5
- bool bStat = false;
-
- bStat = _ctx->f->readByte();
+ bool bStat = _ctx->f->readByte();
_tony.setShepherdess(bStat);
bStat = _ctx->f->readByte();
_inter.setPerorate(bStat);