[Scummvm-cvs-logs] SF.net SVN: scummvm:[45516] scummvm/trunk/engines/draci
spalek at users.sourceforge.net
spalek at users.sourceforge.net
Fri Oct 30 03:15:41 CET 2009
Revision: 45516
http://scummvm.svn.sourceforge.net/scummvm/?rev=45516&view=rev
Author: spalek
Date: 2009-10-30 02:15:41 +0000 (Fri, 30 Oct 2009)
Log Message:
-----------
Move WalkingMap instance to Game, and clean up parameters
Modified Paths:
--------------
scummvm/trunk/engines/draci/game.cpp
scummvm/trunk/engines/draci/game.h
scummvm/trunk/engines/draci/script.cpp
Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp 2009-10-30 02:15:28 UTC (rev 45515)
+++ scummvm/trunk/engines/draci/game.cpp 2009-10-30 02:15:41 UTC (rev 45516)
@@ -982,7 +982,7 @@
return;
Surface *surface = _vm->_screen->getSurface();
- _hero = _currentRoom._walkingMap.findNearestWalkable(x, y, surface->getDimensions());
+ _hero = _walkingMap.findNearestWalkable(x, y, surface->getDimensions());
debugC(3, kDraciLogicDebugLevel, "Walk to x: %d y: %d", _hero.x, _hero.y);
// FIXME: Need to add proper walking (this only warps the dragon to position)
@@ -1076,7 +1076,7 @@
_currentRoom._numGates = roomReader.readByte();
debugC(4, kDraciLogicDebugLevel, "Music: %d", getMusicTrack());
- debugC(4, kDraciLogicDebugLevel, "Map: %d", _currentRoom._mapID);
+ debugC(4, kDraciLogicDebugLevel, "Map: %d", getMapID());
debugC(4, kDraciLogicDebugLevel, "Palette: %d", _currentRoom._palette);
debugC(4, kDraciLogicDebugLevel, "Overlays: %d", _currentRoom._numOverlays);
debugC(4, kDraciLogicDebugLevel, "Init: %d", _currentRoom._init);
@@ -1100,7 +1100,7 @@
}
// Load the walking map
- loadWalkingMap(_currentRoom._mapID);
+ loadWalkingMap(getMapID());
// Load the room's objects
for (uint i = 0; i < _info._numObjects; ++i) {
@@ -1144,7 +1144,7 @@
for (uint i = 0; i < kScreenWidth; ++i) {
for (uint j = 0; j < kScreenHeight; ++j) {
- if (_currentRoom._walkingMap.isWalkable(i, j)) {
+ if (_walkingMap.isWalkable(i, j)) {
wlk[j * kScreenWidth + i] = 2;
}
}
@@ -1257,12 +1257,9 @@
}
void Game::loadWalkingMap(int mapID) {
- if (mapID < 0) {
- mapID = _currentRoom._mapID;
- }
const BAFile *f;
f = _vm->_walkingMapsArchive->getFile(mapID);
- _currentRoom._walkingMap.load(f->_data, f->_length);
+ _walkingMap.load(f->_data, f->_length);
}
GameObject *Game::getObject(uint objNum) {
@@ -1564,6 +1561,10 @@
return _info._mapRoom;
}
+int Game::getMapID() const {
+ return _currentRoom._mapID;
+}
+
void Game::schedulePalette(int paletteID) {
_scheduledPalette = paletteID;
}
Modified: scummvm/trunk/engines/draci/game.h
===================================================================
--- scummvm/trunk/engines/draci/game.h 2009-10-30 02:15:28 UTC (rev 45515)
+++ scummvm/trunk/engines/draci/game.h 2009-10-30 02:15:41 UTC (rev 45516)
@@ -150,7 +150,6 @@
struct Room {
int _roomNum;
byte _music;
- WalkingMap _walkingMap;
int _mapID;
int _palette;
int _numOverlays;
@@ -220,7 +219,7 @@
int loadAnimation(uint animNum, uint z);
void loadOverlays();
void loadObject(uint numObj);
- void loadWalkingMap(int mapID); // <0 means the room's default walking map
+ void loadWalkingMap(int mapID); // but leaves _currentRoom._mapID untouched
void loadItem(int itemID);
uint getNumObjects() const;
@@ -259,6 +258,7 @@
int getEscRoom() const;
int getMapRoom() const;
+ int getMapID() const;
int getMarkedAnimationIndex() const;
void setMarkedAnimationIndex(int index);
@@ -339,6 +339,7 @@
bool _inventoryExit;
Room _currentRoom;
+ WalkingMap _walkingMap;
int _newRoom;
int _newGate;
int _previousRoom;
Modified: scummvm/trunk/engines/draci/script.cpp
===================================================================
--- scummvm/trunk/engines/draci/script.cpp 2009-10-30 02:15:28 UTC (rev 45515)
+++ scummvm/trunk/engines/draci/script.cpp 2009-10-30 02:15:41 UTC (rev 45516)
@@ -837,7 +837,7 @@
void Script::roomMap(Common::Queue<int> ¶ms) {
// Load the default walking map for the room
- _vm->_game->loadWalkingMap(-1);
+ _vm->_game->loadWalkingMap(_vm->_game->getMapID());
}
void Script::disableQuickHero(Common::Queue<int> ¶ms) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list