aboutsummaryrefslogtreecommitdiff
path: root/engines/access
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-04 21:35:49 -0400
committerPaul Gilbert2014-08-04 21:35:49 -0400
commitbb48a153a6479e08fe37c3547e14622226efeeb2 (patch)
tree426d41999bd0e272c14af45ea803431e8d841f6d /engines/access
parent04d42638cde9022523910b9ec75130bd85ec1fa5 (diff)
downloadscummvm-rg350-bb48a153a6479e08fe37c3547e14622226efeeb2.tar.gz
scummvm-rg350-bb48a153a6479e08fe37c3547e14622226efeeb2.tar.bz2
scummvm-rg350-bb48a153a6479e08fe37c3547e14622226efeeb2.zip
ACCESS: Remove graphics manager, and added more skeleton for Amazon intro
Diffstat (limited to 'engines/access')
-rw-r--r--engines/access/access.cpp9
-rw-r--r--engines/access/access.h6
-rw-r--r--engines/access/amazon/amazon_game.cpp39
-rw-r--r--engines/access/amazon/amazon_game.h22
-rw-r--r--engines/access/asurface.cpp (renamed from engines/access/graphics.cpp)19
-rw-r--r--engines/access/asurface.h (renamed from engines/access/graphics.h)22
-rw-r--r--engines/access/module.mk2
-rw-r--r--engines/access/screen.cpp9
-rw-r--r--engines/access/screen.h13
9 files changed, 94 insertions, 47 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp
index 1470842e1b..af64612e01 100644
--- a/engines/access/access.cpp
+++ b/engines/access/access.cpp
@@ -34,7 +34,6 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_debugger = nullptr;
_events = nullptr;
_files = nullptr;
- _graphics = nullptr;
_screen = nullptr;
_sound = nullptr;
@@ -46,7 +45,6 @@ AccessEngine::~AccessEngine() {
delete _debugger;
delete _events;
delete _files;
- delete _graphics;
delete _screen;
delete _sound;
@@ -68,7 +66,6 @@ void AccessEngine::initialize() {
_debugger = new Debugger(this);
_events = new EventsManager(this);
_files = new FileManager(this);
- _graphics = new GraphicsManager(this);
_screen = new Screen(this);
_sound = new SoundManager(this, _mixer);
@@ -80,11 +77,7 @@ Common::Error AccessEngine::run() {
setVGA();
initialize();
- _screen->setInitialPalettte();
- _events->setCursor(CURSOR_0);
- _events->showCursor();
- _graphics->setPanel(0);
- doTitle();
+ playGame();
dummyLoop();
return Common::kNoError;
diff --git a/engines/access/access.h b/engines/access/access.h
index 05ef545e38..f6d51cc744 100644
--- a/engines/access/access.h
+++ b/engines/access/access.h
@@ -33,7 +33,6 @@
#include "access/debugger.h"
#include "access/events.h"
#include "access/files.h"
-#include "access/graphics.h"
#include "access/screen.h"
#include "access/sound.h"
@@ -87,14 +86,13 @@ protected:
virtual bool hasFeature(EngineFeature f) const;
protected:
/**
- * Show game title
+ * Play the game
*/
- virtual void doTitle() = 0;
+ virtual void playGame() = 0;
public:
Debugger *_debugger;
EventsManager *_events;
FileManager *_files;
- GraphicsManager *_graphics;
Screen *_screen;
SoundManager *_sound;
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index 30733087dd..681819f602 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -28,11 +28,41 @@ namespace Amazon {
AmazonEngine::AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc) :
AccessEngine(syst, gameDesc) {
+ _skipStart = false;
}
AmazonEngine::~AmazonEngine() {
}
+void AmazonEngine::playGame() {
+ _screen->setInitialPalettte();
+ _events->setCursor(CURSOR_0);
+ _events->showCursor();
+ _screen->setPanel(0);
+
+ doTitle();
+ if (shouldQuit())
+ return;
+
+ if (!_skipStart) {
+ _screen->setPanel(3);
+ doOpening();
+ if (shouldQuit())
+ return;
+
+ if (!_skipStart) {
+ doTent();
+ if (shouldQuit())
+ return;
+ }
+ }
+
+ doTitle();
+ if (shouldQuit())
+ return;
+
+ _screen->clearScreen();
+}
void AmazonEngine::doTitle() {
_screen->setDisplayScan();
@@ -70,6 +100,15 @@ void AmazonEngine::doTitle() {
int xp = READ_LE_UINT16(COUNTDOWN + _pCount * 4 + 2);
_screen->plotImage(_objectsTable, id, Common::Point(xp, 71));
}
+ // TODO: More to do
+}
+
+void AmazonEngine::doOpening() {
+ // TODO
+}
+
+void AmazonEngine::doTent() {
+ // TODO
}
} // End of namespace Amazon
diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h
index 33d7833670..79a74b329f 100644
--- a/engines/access/amazon/amazon_game.h
+++ b/engines/access/amazon/amazon_game.h
@@ -30,8 +30,28 @@ namespace Access {
namespace Amazon {
class AmazonEngine : public AccessEngine {
+private:
+ bool _skipStart;
+
+ /**
+ * Do title sequence
+ */
+ void doTitle();
+
+ /**
+ * Do opening sequence
+ */
+ void doOpening();
+
+ /**
+ * Do tent scene of introduction
+ */
+ void doTent();
protected:
- virtual void doTitle();
+ /**
+ * Play the game
+ */
+ virtual void playGame();
public:
AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc);
diff --git a/engines/access/graphics.cpp b/engines/access/asurface.cpp
index c1187f2eb3..a0a790dbdc 100644
--- a/engines/access/graphics.cpp
+++ b/engines/access/asurface.cpp
@@ -20,23 +20,14 @@
*
*/
-#include "graphics/palette.h"
-#include "access/access.h"
-#include "access/graphics.h"
-#include "access/resources.h"
+#include "common/algorithm.h"
+#include "access/asurface.h"
namespace Access {
-GraphicsManager::GraphicsManager(AccessEngine *vm) : _vm(vm) {
- _vesaCurrentWin = 0;
- _currentPanel = 0;
- _hideFlag = true;
-}
-
-void GraphicsManager::setPanel(int num) {
- assert(num < 4);
- _currentPanel = num;
- _msVirtualOffset = _virtualOffsetsTable[num];
+void ASurface::clearBuffer() {
+ byte *pSrc = (byte *)getPixels();
+ Common::fill(pSrc, pSrc + w * h, 0);
}
} // End of namespace Access
diff --git a/engines/access/graphics.h b/engines/access/asurface.h
index df626176fa..ecd04b9682 100644
--- a/engines/access/graphics.h
+++ b/engines/access/asurface.h
@@ -20,31 +20,19 @@
*
*/
-#ifndef ACCESS_GRAPHICS_H
-#define ACCESS_GRAPHICS_H
+#ifndef ACCESS_ASURFACE_H
+#define ACCESS_ASURFACE_H
#include "common/rect.h"
#include "graphics/surface.h"
namespace Access {
-class AccessEngine;
-
-class GraphicsManager {
-private:
- AccessEngine *_vm;
-public:
- int _vesaCurrentWin;
- int _currentPanel;
- Common::Point _msVirtualOffset;
- Common::Point _virtualOffsetsTable[4];
- bool _hideFlag;
+class ASurface : public Graphics::Surface {
public:
- GraphicsManager(AccessEngine *vm);
-
- void setPanel(int num);
+ void clearBuffer();
};
} // End of namespace Access
-#endif /* ACCESS_GRAPHICS_H */
+#endif /* ACCESS_ASURFACE_H */
diff --git a/engines/access/module.mk b/engines/access/module.mk
index c9d593de22..ff4cedbdc6 100644
--- a/engines/access/module.mk
+++ b/engines/access/module.mk
@@ -1,13 +1,13 @@
MODULE := engines/access
MODULE_OBJS := \
+ asurface.o \
access.o \
debugger.o \
decompress.o \
detection.o \
events.o \
files.o \
- graphics.o \
resources.o \
screen.o \
sound.o \
diff --git a/engines/access/screen.cpp b/engines/access/screen.cpp
index cb0154d56e..591bb67a7f 100644
--- a/engines/access/screen.cpp
+++ b/engines/access/screen.cpp
@@ -34,6 +34,9 @@ namespace Access {
Screen::Screen(AccessEngine *vm) : _vm(vm) {
create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
Common::fill(&_tempPalette[0], &_tempPalette[PALETTE_SIZE], 0);
+ _vesaCurrentWin = 0;
+ _currentPanel = 0;
+ _hideFlag = true;
_loadPalFlag = false;
_leftSkip = _rightSkip = 0;
_topSkip = _bottomSkip = 0;
@@ -44,6 +47,12 @@ void Screen::setDisplayScan() {
warning("TODO: setDisplayScan");
}
+void Screen::setPanel(int num) {
+ assert(num < 4);
+ _currentPanel = num;
+ _msVirtualOffset = _virtualOffsetsTable[num];
+}
+
void Screen::updateScreen() {
g_system->updateScreen();
}
diff --git a/engines/access/screen.h b/engines/access/screen.h
index 0d68c1bc7e..295372770a 100644
--- a/engines/access/screen.h
+++ b/engines/access/screen.h
@@ -26,7 +26,7 @@
#include "common/scummsys.h"
#include "common/rect.h"
#include "common/stream.h"
-#include "graphics/surface.h"
+#include "access/asurface.h"
namespace Access {
@@ -35,11 +35,16 @@ class AccessEngine;
#define PALETTE_COUNT 256
#define PALETTE_SIZE (256 * 3)
-class Screen: public Graphics::Surface {
+class Screen: public ASurface {
private:
AccessEngine *_vm;
byte _tempPalette[PALETTE_SIZE];
byte _rawPalette[PALETTE_SIZE];
+ int _vesaCurrentWin;
+ int _currentPanel;
+ Common::Point _msVirtualOffset;
+ Common::Point _virtualOffsetsTable[4];
+ bool _hideFlag;
Common::Rect _lastBounds;
int _leftSkip, _rightSkip;
int _topSkip, _bottomSkip;
@@ -57,6 +62,8 @@ public:
void setDisplayScan();
+ void setPanel(int num);
+
/**
* Update the underlying screen
*/
@@ -72,6 +79,8 @@ public:
*/
void forceFadeIn();
+ void clearScreen() { clearBuffer(); }
+
/**
* Set the initial palette
*/