diff options
author | Nicola Mettifogo | 2008-12-14 10:08:31 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-12-14 10:08:31 +0000 |
commit | e98bc7e402a52eadbdf0e5a7e989b9c507e0adf0 (patch) | |
tree | c232f675670110a8e06201dea74f3fc8d39e7b5b /engines | |
parent | 116980367a0c4610b595d6d294bf32775c9356b7 (diff) | |
download | scummvm-rg350-e98bc7e402a52eadbdf0e5a7e989b9c507e0adf0.tar.gz scummvm-rg350-e98bc7e402a52eadbdf0e5a7e989b9c507e0adf0.tar.bz2 scummvm-rg350-e98bc7e402a52eadbdf0e5a7e989b9c507e0adf0.zip |
Removed some unused code.
svn-id: r35357
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/graphics.h | 2 | ||||
-rw-r--r-- | engines/parallaction/gui_br.cpp | 1 | ||||
-rw-r--r-- | engines/parallaction/gui_ns.cpp | 1 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 13 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 2 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 7 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 1 | ||||
-rw-r--r-- | engines/parallaction/parser_br.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/walk.cpp | 17 |
9 files changed, 13 insertions, 33 deletions
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index 22ec7455f9..c643a61369 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -517,7 +517,6 @@ public: // other items int setItem(GfxObj* obj, uint16 x, uint16 y, byte transparentColor = 0); void setItemFrame(uint item, uint16 f); - void hideDialogueStuff(); void freeItems(); // background surface @@ -527,7 +526,6 @@ public: void grabBackground(const Common::Rect& r, Graphics::Surface &dst); void fillBackground(const Common::Rect& r, byte color); void invertBackground(const Common::Rect& r); - void freeBackground(); // palette void setPalette(Palette palette); diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp index 68bb154750..d0be95574d 100644 --- a/engines/parallaction/gui_br.cpp +++ b/engines/parallaction/gui_br.cpp @@ -57,7 +57,6 @@ public: } if (_fadeSteps == 0) { - _vm->freeBackground(); return _helper->getState(_nextState); } diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp index 458fa765fd..a4df53ad90 100644 --- a/engines/parallaction/gui_ns.cpp +++ b/engines/parallaction/gui_ns.cpp @@ -51,7 +51,6 @@ public: virtual MenuInputState* run() { uint32 curTime = _vm->_system->getMillis(); if (curTime - _startTime > _timeOut) { - _vm->freeBackground(); return _helper->getState(_nextState); } return this; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index a49c425091..ad02171052 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -117,8 +117,6 @@ Common::Error Parallaction::init() { _location._startPosition.y = -1000; _location._startFrame = 0; - _pathBuffer = 0; - _screenSize = _screenWidth * _screenHeight; strcpy(_characterName1, "null"); @@ -305,21 +303,10 @@ void Parallaction::showSlide(const char *name, int x, int y) { } -void Parallaction::freeBackground() { - - _pathBuffer = 0; - -} - void Parallaction::setBackground(const char* name, const char* mask, const char* path) { - BackgroundInfo *info = new BackgroundInfo; _disk->loadScenery(*info, name, mask, path); - _gfx->setBackground(kBackgroundLocation, info); - _pathBuffer = &info->path; - - return; } void Parallaction::showLocationComment(const Common::String &text, bool end) { diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 659b52d17a..3fe0ef49a2 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -282,7 +282,6 @@ public: Table *_localFlagNames; CommandExec *_cmdExec; ProgramExec *_programExec; - PathBuffer *_pathBuffer; Inventory *_inventory; BalloonManager *_balloonMan; DialogueManager *_dialogueMan; @@ -344,7 +343,6 @@ public: void updateDoor(ZonePtr z, bool close); void showZone(ZonePtr z, bool visible); void setBackground(const char *background, const char *mask, const char *path); - void freeBackground(); void highlightInventoryItem(ItemPosition pos); int16 getHoverInventoryItem(int16 x, int16 y); int addInventoryItem(ItemName item); diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 15ebc219b3..b44bd450a6 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -42,8 +42,8 @@ const char *Parallaction_br::_partNames[] = { "PART4" }; -Parallaction_br::Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction_ns(syst, gameDesc), - _locationParser(0), _programParser(0) { +Parallaction_br::Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction_ns(syst, gameDesc), + _locationParser(0), _programParser(0) { } Common::Error Parallaction_br::init() { @@ -100,7 +100,7 @@ Common::Error Parallaction_br::init() { Parallaction_br::~Parallaction_br() { freeFonts(); - + delete _locationParser; delete _programParser; } @@ -182,7 +182,6 @@ void Parallaction_br::freeLocation(bool removeAll) { // free open location stuff clearSubtitles(); - freeBackground(); _gfx->clearGfxObjects(kGfxObjNormal); _gfx->freeLabels(); _subtitle[0] = _subtitle[1] = -1; diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index ff806533f1..17f0343259 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -323,7 +323,6 @@ void Parallaction_ns::changeLocation(char *location) { _input->waitForButtonEvent(kMouseLeftUp); _gfx->freeLabels(); - freeBackground(); } if (locname.hasCharacter()) { diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index 474b206551..6fbd1232f0 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -1244,8 +1244,6 @@ void LocationParser_br::parse(Script *script) { LocationParser_ns::parse(script2); _vm->_gfx->setBackground(kBackgroundLocation, ctxt.info); - _vm->_pathBuffer = &ctxt.info->path; - ZoneList::iterator it = _vm->_location._zones.begin(); for ( ; it != _vm->_location._zones.end(); it++) { diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index 145dfae17a..ec24a29979 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -29,7 +29,7 @@ namespace Parallaction { -#define IS_PATH_CLEAR(x,y) _vm->_pathBuffer->getValue((x), (y)) +#define IS_PATH_CLEAR(x,y) _vm->_gfx->_backgroundInfo->path.getValue((x), (y)) inline byte PathBuffer::getValue(uint16 x, uint16 y) { byte m = data[(x >> 3) + y * internalWidth]; @@ -56,15 +56,18 @@ void PathBuilder_NS::correctPathPoint(Common::Point &to) { if (IS_PATH_CLEAR(to.x, to.y)) return; + int maxX = _vm->_gfx->_backgroundInfo->path.w; + int maxY = _vm->_gfx->_backgroundInfo->path.h; + int16 right = to.x; int16 left = to.x; do { right++; - } while (!IS_PATH_CLEAR(right, to.y) && (right < _vm->_pathBuffer->w)); + } while (!IS_PATH_CLEAR(right, to.y) && (right < maxX)); do { left--; } while (!IS_PATH_CLEAR(left, to.y) && (left > 0)); - right = (right == _vm->_pathBuffer->w) ? 1000 : right - to.x; + right = (right == maxX) ? 1000 : right - to.x; left = (left == 0) ? 1000 : to.x - left; @@ -75,9 +78,9 @@ void PathBuilder_NS::correctPathPoint(Common::Point &to) { } while (!IS_PATH_CLEAR(to.x, top) && (top > 0)); do { bottom++; - } while (!IS_PATH_CLEAR(to.x, bottom) && (bottom < _vm->_pathBuffer->h)); + } while (!IS_PATH_CLEAR(to.x, bottom) && (bottom < maxY)); top = (top == 0) ? 1000 : to.y - top; - bottom = (bottom == _vm->_pathBuffer->h) ? 1000 : bottom - to.y; + bottom = (bottom == maxY) ? 1000 : bottom - to.y; int16 closeX = (right >= left) ? left : right; @@ -247,7 +250,7 @@ uint16 PathBuilder_NS::walkFunc1(const Common::Point &to, Common::Point& node) { void PathWalker_NS::clipMove(Common::Point& pos, const Common::Point& to) { - if ((pos.x < to.x) && (pos.x < _vm->_pathBuffer->w) && IS_PATH_CLEAR(pos.x + 2, pos.y)) { + if ((pos.x < to.x) && (pos.x < _vm->_gfx->_backgroundInfo->path.w) && IS_PATH_CLEAR(pos.x + 2, pos.y)) { pos.x = (pos.x + 2 < to.x) ? pos.x + 2 : to.x; } @@ -255,7 +258,7 @@ void PathWalker_NS::clipMove(Common::Point& pos, const Common::Point& to) { pos.x = (pos.x - 2 > to.x) ? pos.x - 2 : to.x; } - if ((pos.y < to.y) && (pos.y < _vm->_pathBuffer->h) && IS_PATH_CLEAR(pos.x, pos.y + 2)) { + if ((pos.y < to.y) && (pos.y < _vm->_gfx->_backgroundInfo->path.h) && IS_PATH_CLEAR(pos.x, pos.y + 2)) { pos.y = (pos.y + 2 <= to.y) ? pos.y + 2 : to.y; } |