diff options
author | Paul Gilbert | 2013-02-13 22:52:03 -0500 |
---|---|---|
committer | Paul Gilbert | 2013-02-13 22:52:03 -0500 |
commit | edd0a631fccbf847cbe257108950a8261dd97395 (patch) | |
tree | c5574fd19792fe873e51c8b5c48d0c45c17925dc | |
parent | 2b865f6fe2603f25c7554cb19609e4ca72205d38 (diff) | |
download | scummvm-rg350-edd0a631fccbf847cbe257108950a8261dd97395.tar.gz scummvm-rg350-edd0a631fccbf847cbe257108950a8261dd97395.tar.bz2 scummvm-rg350-edd0a631fccbf847cbe257108950a8261dd97395.zip |
HOPKINS: Added a basic base map screen for the Windows version if a PBASE.PCX file can't be found
-rw-r--r-- | engines/hopkins/font.h | 2 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 50 | ||||
-rw-r--r-- | engines/hopkins/hopkins.h | 11 |
3 files changed, 61 insertions, 2 deletions
diff --git a/engines/hopkins/font.h b/engines/hopkins/font.h index 14aa4a7eae..5260025f27 100644 --- a/engines/hopkins/font.h +++ b/engines/hopkins/font.h @@ -61,7 +61,6 @@ private: HopkinsEngine *_vm; void setTextColor(int idx, byte colByte); - void displayText(int xp, int yp, const Common::String &message, int col); int _textSortArray[21]; Common::String _oldName; @@ -84,6 +83,7 @@ public: void showText(int idx); void hideText(int idx); void initTextBuffers(int idx, int messageId, const Common::String &filename, int xp, int yp, int textType, int length, int color); + void displayText(int xp, int yp, const Common::String &message, int col); void displayTextVesa(int xp, int yp, const Common::String &message, int col); void renderTextDisplay(int xp, int yp, const Common::String &msg, int col); void setOptimalColor(int idx1, int idx2, int idx3, int idx4); diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 876acec78f..296c863934 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -2269,9 +2269,57 @@ void HopkinsEngine::displayPlane() { _animationManager._clearAnimationFl = false; } +void HopkinsEngine::loadBaseMap() { + Common::String filename = Common::String::format("%s.PCX", "PBASE"); + Common::File f; + + if (f.exists(filename)) { + // PBASE file exists, so go ahead and load it + _graphicsManager.loadImage("PBASE"); + } else { + // PBASE file doesn't exist, so draw a substitute screen + drawBaseMap(); + } +} + +void HopkinsEngine::drawBaseMap() { + memset(_graphicsManager._vesaScreen, 0, SCREEN_WIDTH * 2 * SCREEN_HEIGHT); + + // List of rectangle areas to draw for exit points + const int rects[] = { + 181, 66, 181 + 16, 66 + 22, + 353, 116, 353 + 22, 116 + 16, + 483, 250, 483 + 20, 250 + 25, + 471, 326, 471 + 27, 326 + 20, + 162, 365, 162 + 21, 365 + 23, + 106, 267, 106 + 20, 267 + 26 + }; + + // Loop through displaying + const int *rectP = &rects[0]; + for (int rectIndex = 0; rectIndex < 6; ++rectIndex, rectP += 4) { + Common::Rect r(rectP[0], rectP[1], rectP[2], rectP[3]); + + for (int yp = r.top; yp <= r.bottom; ++yp) { + byte *pDest = _graphicsManager._vesaScreen + yp * SCREEN_WIDTH + r.left; + Common::fill(pDest, pDest + r.width(), 0xff); + } + } + + // Copy the calculated screen + memcpy(_graphicsManager._vesaBuffer, _graphicsManager._vesaScreen, SCREEN_WIDTH * 2 * SCREEN_HEIGHT); + + // Write some explanatory text + _fontManager.displayText(40, 200, "ScummVM base map - select a square for different rooms", 255); +} + int HopkinsEngine::handleBaseMap() { _globals._disableInventFl = true; - _graphicsManager.loadImage("PBASE"); + + // Load the map image + loadBaseMap(); + + // Set needed colours _graphicsManager.SETCOLOR3(252, 100, 100, 100); _graphicsManager.SETCOLOR3(253, 100, 100, 100); _graphicsManager.SETCOLOR3(251, 100, 100, 100); diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index 04b3558963..4a01dc0f92 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -106,6 +106,17 @@ private: */ int handleBaseMap(); + /** + * Loads the base map from the PBASE file + */ + void loadBaseMap(); + + /** + * Draws a simple base map for the Windows version, which implemented a 'Wolfenstein 3D' + * style shooter for the base, rather than having a map + */ + void drawBaseMap(); + void BTOCEAN(); void OCEAN_HOME(); void OCEAN(int16 curExitId, Common::String backgroundFilename, int16 defaultDirection, int16 exit1, int16 exit2, int16 exit3, int16 exit4, int16 soundId); |