LAB: Handle some differences of the Amiga version

The Amiga version is still not working, as the CONTROL and INV files
are missing, and the format of the font files is different
This commit is contained in:
Filippos Karapetis 2015-12-18 05:42:26 +02:00 committed by Willem Jan Palenstijn
parent 1c02487a00
commit c5528a631d
6 changed files with 34 additions and 14 deletions

View file

@ -87,7 +87,7 @@ static const ADGameDescription labDescriptions[] = {
AD_ENTRY1s("doors", "7bf458df6ec30cc8ef4665e4d7c77f59", 2537), // game/doors AD_ENTRY1s("doors", "7bf458df6ec30cc8ef4665e4d7c77f59", 2537), // game/doors
Common::EN_ANY, Common::EN_ANY,
Common::kPlatformAmiga, Common::kPlatformAmiga,
ADGF_NO_FLAGS, Lab::GF_LOWRES,
GUIO0() GUIO0()
}, },
AD_TABLE_END_MARKER AD_TABLE_END_MARKER

View file

@ -405,6 +405,7 @@ void DisplayMan::setUpScreens() {
createScreen(_vm->_isHiRes); createScreen(_vm->_isHiRes);
// TODO: The CONTROL file is not present in the Amiga version
Common::File *controlFile = _vm->_resource->openDataFile("P:Control"); Common::File *controlFile = _vm->_resource->openDataFile("P:Control");
for (uint16 i = 0; i < 20; i++) for (uint16 i = 0; i < 20; i++)
_vm->_moveImages[i] = new Image(controlFile, _vm); _vm->_moveImages[i] = new Image(controlFile, _vm);
@ -426,6 +427,7 @@ void DisplayMan::setUpScreens() {
moveButtonList->push_back(e->createButton(257, y, 8, VKEY_RTARROW, moveImages[18], moveImages[19])); moveButtonList->push_back(e->createButton(257, y, 8, VKEY_RTARROW, moveImages[18], moveImages[19]));
moveButtonList->push_back(e->createButton(289, y, 9, 'p', moveImages[10], moveImages[11])); moveButtonList->push_back(e->createButton(289, y, 9, 'p', moveImages[10], moveImages[11]));
// TODO: The INV file is not present in the Amiga version
Common::File *invFile = _vm->_resource->openDataFile("P:Inv"); Common::File *invFile = _vm->_resource->openDataFile("P:Inv");
if (_vm->getPlatform() == Common::kPlatformWindows) { if (_vm->getPlatform() == Common::kPlatformWindows) {
for (uint16 imgIdx = 0; imgIdx < 10; imgIdx++) for (uint16 imgIdx = 0; imgIdx < 10; imgIdx++)

View file

@ -1154,7 +1154,10 @@ void LabEngine::go() {
_graphics->setUpScreens(); _graphics->setUpScreens();
_event->initMouse(); _event->initMouse();
_msgFont = _resource->getFont("P:AvanteG.12"); if (getPlatform() != Common::kPlatformAmiga)
_msgFont = _resource->getFont("F:AvanteG.12");
else
_msgFont = _resource->getFont("F:Map.fon");
_event->mouseHide(); _event->mouseHide();
Intro *intro = new Intro(this); Intro *intro = new Intro(this);

View file

@ -325,7 +325,7 @@ void Intro::introSequence() {
_vm->_graphics->blackAllScreen(); _vm->_graphics->blackAllScreen();
_vm->_music->updateMusic(); _vm->_music->updateMusic();
TextFont *msgFont = _vm->_resource->getFont("P:Map.fon"); TextFont *msgFont = _vm->_resource->getFont("F:Map.fon");
_vm->_anim->_noPalChange = true; _vm->_anim->_noPalChange = true;
nReadPict("Intro.1", true); nReadPict("Intro.1", true);

View file

@ -51,6 +51,7 @@ void Resource::readStaticText() {
} }
TextFont *Resource::getFont(const char *fileName) { TextFont *Resource::getFont(const char *fileName) {
// TODO: Add support for the font format of the Amiga version
Common::File *dataFile = openDataFile(fileName, MKTAG('V', 'G', 'A', 'F')); Common::File *dataFile = openDataFile(fileName, MKTAG('V', 'G', 'A', 'F'));
uint32 headerSize = 4 + 2 + 256 * 3 + 4; uint32 headerSize = 4 + 2 + 256 * 3 + 4;
@ -154,15 +155,29 @@ Common::String Resource::translateFileName(Common::String filename) {
filename.toUppercase(); filename.toUppercase();
Common::String fileNameStrFinal; Common::String fileNameStrFinal;
if (filename.hasPrefix("P:")) { if (filename.hasPrefix("P:") || filename.hasPrefix("F:")) {
if (_vm->_isHiRes) if (_vm->_isHiRes)
fileNameStrFinal = "GAME/SPICT/"; fileNameStrFinal = "GAME/SPICT/";
else else
fileNameStrFinal = "GAME/PICT/"; fileNameStrFinal = "GAME/PICT/";
} else if (filename.hasPrefix("LAB:"))
if (_vm->getPlatform() == Common::kPlatformAmiga) {
if (filename.hasPrefix("P:")) {
fileNameStrFinal = "PICT/";
} else {
fileNameStrFinal = "LABFONTS/";
filename += "T"; // all the Amiga fonts have a ".FONT" suffix
}
}
} else if (filename.hasPrefix("LAB:")) {
if (_vm->getPlatform() != Common::kPlatformAmiga)
fileNameStrFinal = "GAME/"; fileNameStrFinal = "GAME/";
else if (filename.hasPrefix("MUSIC:")) } else if (filename.hasPrefix("MUSIC:")) {
if (_vm->getPlatform() != Common::kPlatformAmiga)
fileNameStrFinal = "GAME/MUSIC/"; fileNameStrFinal = "GAME/MUSIC/";
else
fileNameStrFinal = "MUSIC/";
}
if (filename.contains(':')) { if (filename.contains(':')) {
while (filename[0] != ':') { while (filename[0] != ':') {

View file

@ -51,7 +51,7 @@ namespace Lab {
* Does the things to properly set up the detective notes. * Does the things to properly set up the detective notes.
*/ */
void LabEngine::doNotes() { void LabEngine::doNotes() {
TextFont *noteFont = _resource->getFont("P:Note.fon"); TextFont *noteFont = _resource->getFont("F:Note.fon");
char *noteText = _resource->getText("Lab:Rooms/Notes"); char *noteText = _resource->getText("Lab:Rooms/Notes");
Common::Rect textRect = Common::Rect(_utils->vgaScaleX(25) + _utils->svgaCord(15), _utils->vgaScaleY(50), _utils->vgaScaleX(295) - _utils->svgaCord(15), _utils->vgaScaleY(148)); Common::Rect textRect = Common::Rect(_utils->vgaScaleX(25) + _utils->svgaCord(15), _utils->vgaScaleY(50), _utils->vgaScaleX(295) - _utils->svgaCord(15), _utils->vgaScaleY(148));
@ -66,7 +66,7 @@ void LabEngine::doNotes() {
* OpenHiRes already called. * OpenHiRes already called.
*/ */
void LabEngine::doWestPaper() { void LabEngine::doWestPaper() {
TextFont *paperFont = _resource->getFont("P:News22.fon"); TextFont *paperFont = _resource->getFont("F:News22.fon");
char *paperText = _resource->getText("Lab:Rooms/Date"); char *paperText = _resource->getText("Lab:Rooms/Date");
Common::Rect textRect = Common::Rect(_utils->vgaScaleX(57), _utils->vgaScaleY(77) + _utils->svgaCord(2), _utils->vgaScaleX(262), _utils->vgaScaleY(91)); Common::Rect textRect = Common::Rect(_utils->vgaScaleX(57), _utils->vgaScaleY(77) + _utils->svgaCord(2), _utils->vgaScaleX(262), _utils->vgaScaleY(91));
@ -74,7 +74,7 @@ void LabEngine::doWestPaper() {
_graphics->closeFont(paperFont); _graphics->closeFont(paperFont);
delete[] paperText; delete[] paperText;
paperFont = _resource->getFont("P:News32.fon"); paperFont = _resource->getFont("F:News32.fon");
paperText = _resource->getText("Lab:Rooms/Headline"); paperText = _resource->getText("Lab:Rooms/Headline");
int fileLen = strlen(paperText) - 1; int fileLen = strlen(paperText) - 1;
@ -93,7 +93,7 @@ void LabEngine::doWestPaper() {
_graphics->closeFont(paperFont); _graphics->closeFont(paperFont);
delete[] paperText; delete[] paperText;
paperFont = _resource->getFont("P:Note.fon"); paperFont = _resource->getFont("F:Note.fon");
paperText = _resource->getText("Lab:Rooms/Col1"); paperText = _resource->getText("Lab:Rooms/Col1");
charsPrinted = _graphics->flowText(paperFont, -4, 0, 0, false, false, false, true, _utils->vgaRectScale(45, y, 158, 148), paperText); charsPrinted = _graphics->flowText(paperFont, -4, 0, 0, false, false, false, true, _utils->vgaRectScale(45, y, 158, 148), paperText);
delete[] paperText; delete[] paperText;
@ -109,7 +109,7 @@ void LabEngine::doWestPaper() {
* Loads in the data for the journal. * Loads in the data for the journal.
*/ */
void LabEngine::loadJournalData() { void LabEngine::loadJournalData() {
_journalFont = _resource->getFont("P:Journal.fon"); _journalFont = _resource->getFont("F:Journal.fon");
_music->updateMusic(); _music->updateMusic();
char filename[20]; char filename[20];
@ -496,7 +496,7 @@ void LabEngine::doMonitor(char *background, char *textfile, bool isinteractive,
_lastPage = false; _lastPage = false;
_graphics->_fadePalette = _highPalette; _graphics->_fadePalette = _highPalette;
TextFont *monitorFont = _resource->getFont("P:Map.fon"); TextFont *monitorFont = _resource->getFont("F:Map.fon");
Common::File *buttonFile = _resource->openDataFile("P:MonImage"); Common::File *buttonFile = _resource->openDataFile("P:MonImage");
_monitorButton = new Image(buttonFile, this); _monitorButton = new Image(buttonFile, this);
delete buttonFile; delete buttonFile;