mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 13:50:13 +00:00
FREESCAPE: refactored init code and added onscreen controls for driller dos
This commit is contained in:
parent
7533d82a1f
commit
a2d23b37a1
@ -486,6 +486,22 @@ private:
|
||||
void drawC64UI(Graphics::Surface *surface) override;
|
||||
void drawAmigaAtariSTUI(Graphics::Surface *surface) override;
|
||||
void onScreenControls(Common::Point mouse) override;
|
||||
void initAmigaAtari();
|
||||
void initDOS();
|
||||
void initZX();
|
||||
void initCPC();
|
||||
void initC64();
|
||||
|
||||
Common::Rect _moveFowardArea;
|
||||
Common::Rect _moveLeftArea;
|
||||
Common::Rect _moveRightArea;
|
||||
Common::Rect _moveBackArea;
|
||||
Common::Rect _moveUpArea;
|
||||
Common::Rect _moveDownArea;
|
||||
Common::Rect _deployDrillArea;
|
||||
Common::Rect _infoScreenArea;
|
||||
Common::Rect _saveGameArea;
|
||||
Common::Rect _loadGameArea;
|
||||
|
||||
Graphics::ManagedSurface *load8bitTitleImage(Common::SeekableReadStream *file, int offset);
|
||||
Graphics::ManagedSurface *load8bitDemoImage(Common::SeekableReadStream *file, int offset);
|
||||
|
@ -217,4 +217,19 @@ void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
|
||||
}
|
||||
}
|
||||
|
||||
void DrillerEngine::initAmigaAtari() {
|
||||
_viewArea = Common::Rect(36, 16, 284, 118);
|
||||
|
||||
_moveFowardArea = Common::Rect(184, 125, 199, 144);
|
||||
_moveLeftArea = Common::Rect(161, 145, 174, 164);
|
||||
_moveRightArea = Common::Rect(207, 145, 222, 164);
|
||||
_moveBackArea = Common::Rect(184, 152, 199, 171);
|
||||
_moveUpArea = Common::Rect(231, 145, 246, 164);
|
||||
_moveDownArea = Common::Rect(254, 145, 269, 164);
|
||||
_deployDrillArea = Common::Rect(284, 145, 299, 166);
|
||||
_infoScreenArea = Common::Rect(125, 172, 152, 197);
|
||||
_saveGameArea = Common::Rect(9, 145, 39, 154);
|
||||
_loadGameArea = Common::Rect(9, 156, 39, 164);
|
||||
}
|
||||
|
||||
} // End of namespace Freescape
|
@ -26,6 +26,10 @@
|
||||
|
||||
namespace Freescape {
|
||||
|
||||
void DrillerEngine::initC64() {
|
||||
_viewArea = Common::Rect(32, 16, 288, 119);
|
||||
}
|
||||
|
||||
void DrillerEngine::loadAssetsC64FullGame() {
|
||||
Common::File file;
|
||||
if (_targetName.hasPrefix("spacestationoblivion")) {
|
||||
|
@ -27,6 +27,10 @@
|
||||
|
||||
namespace Freescape {
|
||||
|
||||
void DrillerEngine::initCPC() {
|
||||
_viewArea = Common::Rect(36, 16, 284, 117);
|
||||
}
|
||||
|
||||
byte kCPCPaletteTitleData[4][3] = {
|
||||
{0x00, 0x00, 0x00},
|
||||
{0x00, 0x80, 0xff},
|
||||
|
@ -29,6 +29,24 @@ namespace Freescape {
|
||||
extern byte kCGAPalettePinkBlueWhiteData[4][3];
|
||||
extern byte kEGADefaultPaletteData[16][3];
|
||||
|
||||
void DrillerEngine::initDOS() {
|
||||
if (_renderMode == Common::kRenderEGA)
|
||||
_viewArea = Common::Rect(40, 16, 280, 117);
|
||||
else if (_renderMode == Common::kRenderCGA)
|
||||
_viewArea = Common::Rect(36, 16, 284, 117);
|
||||
else
|
||||
error("Invalid or unknown render mode");
|
||||
|
||||
_moveFowardArea = Common::Rect(73, 144, 101, 152);
|
||||
_moveLeftArea = Common::Rect(73, 150, 86, 159);
|
||||
_moveRightArea = Common::Rect(88, 152, 104, 160);
|
||||
_moveBackArea = Common::Rect(73, 160, 101, 168);
|
||||
_moveUpArea = Common::Rect(219, 144, 243, 155);
|
||||
_moveDownArea = Common::Rect(219, 157, 243, 167);
|
||||
_deployDrillArea = Common::Rect(140, 175, 179, 191);
|
||||
_infoScreenArea = Common::Rect(130, 125, 188, 144);
|
||||
}
|
||||
|
||||
/*
|
||||
The following functions are only used for decoding title images for
|
||||
the US release of Driller ("Space Station Oblivion")
|
||||
|
@ -41,22 +41,16 @@ DrillerEngine::DrillerEngine(OSystem *syst, const ADGameDescription *gd) : Frees
|
||||
if (!Common::parseBool(ConfMan.get("automatic_drilling"), _useAutomaticDrilling))
|
||||
error("Failed to parse bool from automatic_drilling option");
|
||||
|
||||
if (isDOS()) {
|
||||
if (_renderMode == Common::kRenderEGA)
|
||||
_viewArea = Common::Rect(40, 16, 280, 117);
|
||||
else if (_renderMode == Common::kRenderCGA)
|
||||
_viewArea = Common::Rect(36, 16, 284, 117);
|
||||
else
|
||||
error("Invalid or unknown render mode");
|
||||
}
|
||||
if (isDOS())
|
||||
initDOS();
|
||||
else if (isAmiga() || isAtariST())
|
||||
_viewArea = Common::Rect(36, 16, 284, 118);
|
||||
initAmigaAtari();
|
||||
else if (isSpectrum())
|
||||
_viewArea = Common::Rect(56, 20, 264, 124);
|
||||
initZX();
|
||||
else if (isCPC())
|
||||
_viewArea = Common::Rect(36, 16, 284, 117);
|
||||
initCPC();
|
||||
else if (isC64())
|
||||
_viewArea = Common::Rect(32, 16, 288, 119);
|
||||
initC64();
|
||||
|
||||
_playerHeightNumber = 1;
|
||||
_playerHeights.push_back(16);
|
||||
@ -826,44 +820,30 @@ bool DrillerEngine::checkIfGameEnded() {
|
||||
}
|
||||
|
||||
void DrillerEngine::onScreenControls(Common::Point mouse) {
|
||||
|
||||
if (isAmiga() || isAtariST()) {
|
||||
Common::Rect arrowFoward(184, 125, 199, 144);
|
||||
Common::Rect arrowLeft(161, 145, 174, 164);
|
||||
Common::Rect arrowRight(207, 145, 222, 164);
|
||||
Common::Rect arrowBack(184, 152, 199, 171);
|
||||
Common::Rect arrowUp(231, 145, 246, 164);
|
||||
Common::Rect arrowDown(254, 145, 269, 164);
|
||||
Common::Rect deployDrill(284, 145, 299, 166);
|
||||
Common::Rect infoScreen(125, 172, 152, 197);
|
||||
Common::Rect saveGame(9, 145, 39, 154);
|
||||
Common::Rect loadGame(9, 156, 39, 164);
|
||||
|
||||
if (arrowFoward.contains(mouse))
|
||||
move(kForwardMovement, _scaleVector.x(), 20.0);
|
||||
else if (arrowLeft.contains(mouse))
|
||||
move(kLeftMovement, _scaleVector.y(), 20.0);
|
||||
else if (arrowRight.contains(mouse))
|
||||
move(kRightMovement, _scaleVector.y(), 20.0);
|
||||
else if (arrowBack.contains(mouse))
|
||||
move(kBackwardMovement, _scaleVector.x(), 20.0);
|
||||
else if (arrowUp.contains(mouse))
|
||||
rise();
|
||||
else if (arrowDown.contains(mouse))
|
||||
lower();
|
||||
else if (deployDrill.contains(mouse))
|
||||
pressedKey(Common::KEYCODE_d);
|
||||
else if (infoScreen.contains(mouse))
|
||||
drawInfoMenu();
|
||||
else if (saveGame.contains(mouse)) {
|
||||
_gfx->setViewport(_fullscreenViewArea);
|
||||
saveGameDialog();
|
||||
_gfx->setViewport(_viewArea);
|
||||
} else if (loadGame.contains(mouse)) {
|
||||
_gfx->setViewport(_fullscreenViewArea);
|
||||
loadGameDialog();
|
||||
_gfx->setViewport(_viewArea);
|
||||
}
|
||||
if (_moveFowardArea.contains(mouse))
|
||||
move(kForwardMovement, _scaleVector.x(), 20.0);
|
||||
else if (_moveLeftArea.contains(mouse))
|
||||
move(kLeftMovement, _scaleVector.y(), 20.0);
|
||||
else if (_moveRightArea.contains(mouse))
|
||||
move(kRightMovement, _scaleVector.y(), 20.0);
|
||||
else if (_moveBackArea.contains(mouse))
|
||||
move(kBackwardMovement, _scaleVector.x(), 20.0);
|
||||
else if (_moveUpArea.contains(mouse))
|
||||
rise();
|
||||
else if (_moveDownArea.contains(mouse))
|
||||
lower();
|
||||
else if (_deployDrillArea.contains(mouse))
|
||||
pressedKey(Common::KEYCODE_d);
|
||||
else if (_infoScreenArea.contains(mouse))
|
||||
drawInfoMenu();
|
||||
else if (_saveGameArea.contains(mouse)) {
|
||||
_gfx->setViewport(_fullscreenViewArea);
|
||||
saveGameDialog();
|
||||
_gfx->setViewport(_viewArea);
|
||||
} else if (_loadGameArea.contains(mouse)) {
|
||||
_gfx->setViewport(_fullscreenViewArea);
|
||||
loadGameDialog();
|
||||
_gfx->setViewport(_viewArea);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,10 @@
|
||||
|
||||
namespace Freescape {
|
||||
|
||||
void DrillerEngine::initZX() {
|
||||
_viewArea = Common::Rect(56, 20, 264, 124);
|
||||
}
|
||||
|
||||
void DrillerEngine::loadAssetsZXFullGame() {
|
||||
Common::File file;
|
||||
file.open("driller.zx.title");
|
||||
|
Loading…
Reference in New Issue
Block a user