Skip to content

Commit

Permalink
ACCESS: MM - Make Bubble Box variable, add MM bubble boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Jan 9, 2015
1 parent 69952c5 commit 8249de3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
17 changes: 16 additions & 1 deletion engines/access/access.cpp
Expand Up @@ -106,6 +106,10 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
AccessEngine::~AccessEngine() {
delete _animation;
delete _bubbleBox;
delete _helpBox;
delete _travelBox;
delete _invBox;
delete _aboutBox;
delete _char;
delete _debugger;
delete _events;
Expand Down Expand Up @@ -151,7 +155,18 @@ void AccessEngine::initialize() {

// Create sub-objects of the engine
_animation = new AnimationManager(this);
_bubbleBox = new BubbleBox(this);
_bubbleBox = new BubbleBox(this, TYPE_2, 64, 32, 130, 122, 0, 0, 0, 0, "");
if (getGameID() == GType_MartianMemorandum) {
_helpBox = new BubbleBox(this, TYPE_1, 64, 24, 146, 122, 1, 32, 2, 76, "HELP");
_travelBox = new BubbleBox(this, TYPE_1, 64, 32, 194, 122, 1, 24, 2, 74, "TRAVEL");
_invBox = new BubbleBox(this, TYPE_1, 64, 32, 146, 122, 1, 32, 2, 76, "INVENTORY");
_aboutBox = new BubbleBox(this, TYPE_1, 64, 32, 194, 122, 1, 32, 2, 76, "ASK ABOUT");
} else {
_helpBox = nullptr;
_travelBox = nullptr;
_invBox = nullptr;
_aboutBox = nullptr;
}
_char = new CharManager(this);
_debugger = Debugger::init(this);
_events = new EventsManager(this);
Expand Down
4 changes: 4 additions & 0 deletions engines/access/access.h
Expand Up @@ -137,6 +137,10 @@ class AccessEngine : public Engine {
public:
AnimationManager *_animation;
BubbleBox *_bubbleBox;
BubbleBox *_helpBox;
BubbleBox *_travelBox;
BubbleBox *_invBox;
BubbleBox *_aboutBox;
CharManager *_char;
Debugger *_debugger;
EventsManager *_events;
Expand Down
16 changes: 8 additions & 8 deletions engines/access/bubble_box.cpp
Expand Up @@ -26,14 +26,14 @@

namespace Access {

BubbleBox::BubbleBox(AccessEngine *vm) : Manager(vm) {
_type = TYPE_2;
_bounds = Common::Rect(64, 32, 64 + 130, 32 + 122);
_bubbleDisplStr = "";
_fieldD = 0;
_fieldE = 0;
_fieldF = 0;
_field10 = 0;
BubbleBox::BubbleBox(AccessEngine *vm, Access::BoxType type, int x, int y, int w, int h, int val1, int val2, int val3, int val4, Common::String title) : Manager(vm) {
_type = type;
_bounds = Common::Rect(x, y, x + w, y + h);
_bubbleDisplStr = title;
_fieldD = val1;
_fieldE = val2;
_fieldF = val3;
_field10 = val4;
}

void BubbleBox::load(Common::SeekableReadStream *stream) {
Expand Down
4 changes: 2 additions & 2 deletions engines/access/bubble_box.h
Expand Up @@ -36,7 +36,7 @@ namespace Access {

class AccessEngine;

enum BoxType { TYPE_2 = 2, TYPE_4 = 4 };
enum BoxType { TYPE_1 = 1, TYPE_2 = 2, TYPE_4 = 4 };

class BubbleBox : public Manager {
private:
Expand All @@ -56,7 +56,7 @@ class BubbleBox : public Manager {

Common::Array<Common::Rect> _bubbles;
public:
BubbleBox(AccessEngine *vm);
BubbleBox(AccessEngine *vm, Access::BoxType type, int x, int y, int w, int h, int val1, int val2, int val3, int val4, Common::String title);

void load(Common::SeekableReadStream *stream);

Expand Down

0 comments on commit 8249de3

Please sign in to comment.