Skip to content

Commit

Permalink
SHERLOCK: Beginnings of Map descendent classes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jun 8, 2015
1 parent 62aad48 commit cffa31c
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 6 deletions.
11 changes: 10 additions & 1 deletion engines/sherlock/map.cpp
Expand Up @@ -20,9 +20,11 @@
*
*/

#include "common/system.h"
#include "sherlock/map.h"
#include "sherlock/sherlock.h"
#include "common/system.h"
#include "sherlock/scalpel/scalpel_map.h"
#include "sherlock/tattoo/tattoo_map.h"

namespace Sherlock {

Expand Down Expand Up @@ -51,6 +53,13 @@ const byte *MapPaths::getPath(int srcLocation, int destLocation) {

/*----------------------------------------------------------------*/

Map *Map::init(SherlockEngine *vm) {
if (vm->getGameID() == GType_SerratedScalpel)
return new Scalpel::ScalpelMap(vm);
else
return new Tattoo::TattooMap(vm);
}

Map::Map(SherlockEngine *vm): _vm(vm), _topLine(g_system->getWidth(), 12, vm->getPlatform()) {
_active = false;
_mapCursors = nullptr;
Expand Down
8 changes: 5 additions & 3 deletions engines/sherlock/map.h
Expand Up @@ -64,7 +64,7 @@ class MapPaths {
};

class Map {
private:
protected:
SherlockEngine *_vm;
Common::Array<MapEntry> _points; // Map locations for each scene
Common::StringArray _locationNames;
Expand All @@ -83,7 +83,9 @@ class Map {
int _cursorIndex;
bool _drawMap;
Surface _iconSave;
private:
protected:
Map(SherlockEngine *vm);

/**
* Load data needed for the map
*/
Expand Down Expand Up @@ -150,7 +152,7 @@ class Map {
int _charPoint, _oldCharPoint;
bool _frameChangeFlag;
public:
Map(SherlockEngine *vm);
static Map *init(SherlockEngine *vm);

const MapEntry &operator[](int idx) { return _points[idx]; }

Expand Down
2 changes: 2 additions & 0 deletions engines/sherlock/module.mk
Expand Up @@ -8,12 +8,14 @@ MODULE_OBJS = \
scalpel/drivers/mt32.o \
scalpel/tsage/logo.o \
scalpel/tsage/resources.o \
scalpel/scalpel_map.o \
scalpel/scalpel_people.o \
scalpel/scalpel_scene.o \
scalpel/scalpel_talk.o \
scalpel/scalpel_user_interface.o \
scalpel/settings.o \
tattoo/tattoo.o \
tattoo/tattoo_map.o \
tattoo/tattoo_people.o \
tattoo/tattoo_resources.o \
tattoo/tattoo_scene.o \
Expand Down
32 changes: 32 additions & 0 deletions engines/sherlock/scalpel/scalpel_map.cpp
@@ -0,0 +1,32 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/

#include "sherlock/scalpel/scalpel_map.h"

namespace Sherlock {

namespace Scalpel {


} // End of namespace Scalpel

} // End of namespace Sherlock
44 changes: 44 additions & 0 deletions engines/sherlock/scalpel/scalpel_map.h
@@ -0,0 +1,44 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/

#ifndef SHERLOCK_SCALPEL_MAP_H
#define SHERLOCK_SCALPEL_MAP_H

#include "common/scummsys.h"
#include "sherlock/map.h"

namespace Sherlock {

class SherlockEngine;

namespace Scalpel {

class ScalpelMap: public Map {
public:
ScalpelMap(SherlockEngine *vm) : Map(vm) {}
};

} // End of namespace Scalpel

} // End of namespace Sherlock

#endif
2 changes: 1 addition & 1 deletion engines/sherlock/sherlock.cpp
Expand Up @@ -94,7 +94,7 @@ void SherlockEngine::initialize() {
_debugger = new Debugger(this);
_events = new Events(this);
_inventory = new Inventory(this);
_map = new Map(this);
_map = Map::init(this);
_music = new Music(this, _mixer);
_journal = new Journal(this);
_people = People::init(this);
Expand Down
9 changes: 9 additions & 0 deletions engines/sherlock/tattoo/tattoo.cpp
Expand Up @@ -65,6 +65,15 @@ void TattooEngine::initialize() {
}

void TattooEngine::startScene() {
if (_scene->_goToScene == OVERHEAD_MAP || _scene->_goToScene == OVERHEAD_MAP2) {
// Show the map
_scene->_currentScene = OVERHEAD_MAP;
_scene->_goToScene = _map->show();

_people->_hSavedPos = Common::Point(-1, -1);
_people->_hSavedFacing = -1;
}

// TODO
}

Expand Down
32 changes: 32 additions & 0 deletions engines/sherlock/tattoo/tattoo_map.cpp
@@ -0,0 +1,32 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/

#include "sherlock/tattoo/tattoo_map.h"

namespace Sherlock {

namespace Tattoo {


} // End of namespace Tattoo

} // End of namespace Sherlock
44 changes: 44 additions & 0 deletions engines/sherlock/tattoo/tattoo_map.h
@@ -0,0 +1,44 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/

#ifndef SHERLOCK_TATTOO_MAP_H
#define SHERLOCK_TATTOO_MAP_H

#include "common/scummsys.h"
#include "sherlock/map.h"

namespace Sherlock {

class SherlockEngine;

namespace Tattoo {

class TattooMap : public Map {
public:
TattooMap(SherlockEngine *vm) : Map(vm) {}
};

} // End of namespace Tattoo

} // End of namespace Sherlock

#endif
2 changes: 1 addition & 1 deletion engines/sherlock/tattoo/tattoo_scene.h
Expand Up @@ -31,7 +31,7 @@ namespace Sherlock {
namespace Tattoo {

enum {
STARTING_INTRO_SCENE = 91
STARTING_INTRO_SCENE = 91, OVERHEAD_MAP2 = 99, OVERHEAD_MAP = 100
};

class TattooScene : public Scene {
Expand Down

0 comments on commit cffa31c

Please sign in to comment.