Files
scummvm/engines/freescape/games/eclipse/dos.cpp
T

80 lines
2.7 KiB
C++

/* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
#include "common/file.h"
#include "freescape/freescape.h"
#include "freescape/games/eclipse/eclipse.h"
#include "freescape/language/8bitDetokeniser.h"
namespace Freescape {
extern byte kEGADefaultPalette[16][3];
void EclipseEngine::initDOS() {
_viewArea = Common::Rect(40, 32, 280, 132);
}
void EclipseEngine::loadAssetsDOSFullGame() {
Common::File file;
if (_renderMode == Common::kRenderEGA) {
file.open("SCN1E.DAT");
if (file.isOpen()) {
_title = load8bitBinImage(&file, 0x0);
_title->setPalette((byte *)&kEGADefaultPalette, 0, 16);
}
file.close();
file.open("TOTEE.EXE");
if (!file.isOpen())
error("Failed to open TOTEE.EXE");
loadFonts(&file, 0xd403);
load8bitBinary(&file, 0x3ce0, 16);
for (auto &it : _areaMap) {
it._value->addStructure(_areaMap[255]);
for (int16 id = 183; id < 207; id++)
it._value->addObjectFromArea(id, _areaMap[255]);
}
_border = load8bitBinImage(&file, 0x210);
_border->setPalette((byte *)&kEGADefaultPalette, 0, 16);
} else if (_renderMode == Common::kRenderCGA) {
file.open("TOTEC.EXE");
if (!file.isOpen())
error("Failed to open TOTEC.EXE");
load8bitBinary(&file, 0x7bb0, 4); // TODO
} else
error("Invalid or unsupported render mode %s for Total Eclipse", Common::getRenderModeDescription(_renderMode));
}
void EclipseEngine::drawDOSUI(Graphics::Surface *surface) {
int score = _gameStateVars[k8bitVariableScore];
uint32 yellow = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0x55);
uint32 black = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00);
uint32 white = _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0xFF, 0xFF, 0xFF);
if (!_currentAreaMessages.empty())
drawStringInSurface(_currentAreaMessages[0], 102, 135, black, yellow, surface);
drawStringInSurface(Common::String::format("%07d", score), 136, 6, black, white, surface);
}
} // End of namespace Freescape