aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-12-27 14:18:40 +0100
committerEugene Sandulenko2015-12-15 00:05:02 +0100
commit60d4f0a0695f8eaf5aced2df7dfe3c191e37ae25 (patch)
tree1ce530de9ed84db544ce8492d9875840c750d897
parent60388893a95e8ef3044dd00dd10087967be04fdf (diff)
downloadscummvm-rg350-60d4f0a0695f8eaf5aced2df7dfe3c191e37ae25.tar.gz
scummvm-rg350-60d4f0a0695f8eaf5aced2df7dfe3c191e37ae25.tar.bz2
scummvm-rg350-60d4f0a0695f8eaf5aced2df7dfe3c191e37ae25.zip
LAB: Initial support for lowres mode
-rw-r--r--engines/lab/detection.cpp5
-rw-r--r--engines/lab/engine.cpp569
-rw-r--r--engines/lab/graphics.cpp33
-rw-r--r--engines/lab/interface.cpp13
-rw-r--r--engines/lab/intro.cpp41
-rw-r--r--engines/lab/lab.cpp8
-rw-r--r--engines/lab/lab.h2
-rw-r--r--engines/lab/mouse.cpp8
-rw-r--r--engines/lab/special.cpp92
-rw-r--r--engines/lab/vga.cpp20
10 files changed, 258 insertions, 533 deletions
diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp
index 3c9174aa8c..1cd78a16db 100644
--- a/engines/lab/detection.cpp
+++ b/engines/lab/detection.cpp
@@ -127,6 +127,10 @@ Common::Platform LabEngine::getPlatform() const {
return _gameDescription->platform;
}
+uint32 LabEngine::getFeatures() const {
+ return _gameDescription->flags;
+}
+
} // End of namespace Lab
class LabMetaEngine : public AdvancedMetaEngine {
@@ -136,6 +140,7 @@ public:
_maxScanDepth = 4;
_directoryGlobs = directoryGlobs;
+ _flags = kADFlagUseExtraAsHint;
}
virtual const char *getName() const {
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index 61042708eb..447a8fec55 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -56,7 +56,6 @@ extern InventoryData *Inventory;
extern uint16 NumInv, RoomNum, ManyRooms, HighestCondition, Direction;
CloseDataPtr CPtr;
-#if !defined(DOSCODE)
CrumbData BreadCrumbs[MAX_CRUMBS];
uint16 NumCrumbs;
bool DroppingCrumbs;
@@ -69,7 +68,6 @@ bool IsCrumbWaiting;
int followCrumbs();
void mayShowCrumbIndicator();
void mayShowCrumbIndicatorOff();
-#endif
bool Alternate = false, ispal = false, noupdatediff = false, MainDisplay = true, QuitLab = false, DoNotReset = false;
@@ -131,12 +129,7 @@ static uint32 BUFFERSIZE = BIGBUFFERSIZE;
static byte *MovePanelBuffer, *InvPanelBuffer;
static uint32 MovePanelBufferSize, InvPanelBufferSize;
-static Image *MoveImages[20],
-#if defined(DOSCODE)
- *InvImages[6];
-#else
- *InvImages[10];
-#endif
+static Image *MoveImages[20], *InvImages[10];
static Gadget *MoveGadgetList, *InvGadgetList;
@@ -173,14 +166,14 @@ void drawPanel(void) {
drawHLine(0, VGAScaleY(170) + 1, VGAScaleX(319)); /* The horizontal lines under the black one */
drawGadgetList(MoveGadgetList);
} else {
-#if defined(DOSCODE)
- drawVLine(VGAScaleX(124), VGAScaleY(170) + 1, VGAScaleY(199)); /* Vertical Black lines */
- drawVLine(VGAScaleX(194), VGAScaleY(170) + 1, VGAScaleY(199));
-#else
- drawVLine(VGAScaleX(90), VGAScaleY(170) + 1, VGAScaleY(199)); /* Vertical Black lines */
- drawVLine(VGAScaleX(160), VGAScaleY(170) + 1, VGAScaleY(199));
- drawVLine(VGAScaleX(230), VGAScaleY(170) + 1, VGAScaleY(199));
-#endif
+ if (g_lab->getPlatform() != Common::kPlatformWindows) {
+ drawVLine(VGAScaleX(124), VGAScaleY(170) + 1, VGAScaleY(199)); /* Vertical Black lines */
+ drawVLine(VGAScaleX(194), VGAScaleY(170) + 1, VGAScaleY(199));
+ } else {
+ drawVLine(VGAScaleX(90), VGAScaleY(170) + 1, VGAScaleY(199)); /* Vertical Black lines */
+ drawVLine(VGAScaleX(160), VGAScaleY(170) + 1, VGAScaleY(199));
+ drawVLine(VGAScaleX(230), VGAScaleY(170) + 1, VGAScaleY(199));
+ }
setAPen(4);
drawHLine(0, VGAScaleY(170) + 1, VGAScaleX(122)); /* The horizontal lines under the black one */
@@ -188,14 +181,14 @@ void drawPanel(void) {
drawHLine(VGAScaleX(196), VGAScaleY(170) + 1, VGAScaleX(319));
drawVLine(VGAScaleX(1), VGAScaleY(170) + 2, VGAScaleY(198)); /* The vertical high light lines */
-#if defined(DOSCODE)
- drawVLine(VGAScaleX(126), VGAScaleY(170) + 2, VGAScaleY(198));
- drawVLine(VGAScaleX(196), VGAScaleY(170) + 2, VGAScaleY(198));
-#else
- drawVLine(VGAScaleX(92), VGAScaleY(170) + 2, VGAScaleY(198));
- drawVLine(VGAScaleX(162), VGAScaleY(170) + 2, VGAScaleY(198));
- drawVLine(VGAScaleX(232), VGAScaleY(170) + 2, VGAScaleY(198));
-#endif
+ if (g_lab->getPlatform() != Common::kPlatformWindows) {
+ drawVLine(VGAScaleX(126), VGAScaleY(170) + 2, VGAScaleY(198));
+ drawVLine(VGAScaleX(196), VGAScaleY(170) + 2, VGAScaleY(198));
+ } else {
+ drawVLine(VGAScaleX(92), VGAScaleY(170) + 2, VGAScaleY(198));
+ drawVLine(VGAScaleX(162), VGAScaleY(170) + 2, VGAScaleY(198));
+ drawVLine(VGAScaleX(232), VGAScaleY(170) + 2, VGAScaleY(198));
+ }
drawGadgetList(InvGadgetList);
}
@@ -281,47 +274,48 @@ bool setUpScreens(void) {
/* Creates the gadgets for the movement control panel */
y = VGAScaleY(173) - SVGACord(2);
-#if !defined(DOSCODE)
- MoveGadgetList = createButton(VGAScaleX(1), y, 0, 't', MoveImages[0], MoveImages[1]);
- curgad = MoveGadgetList;
- curgad->NextGadget = createButton(VGAScaleX(33), y, 1, 'm', MoveImages[2], MoveImages[3]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(65), y, 2, 'o', MoveImages[4], MoveImages[5]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(97), y, 3, 'c', MoveImages[6], MoveImages[7]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(129), y, 4, 'l', MoveImages[8], MoveImages[9]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(161), y, 5, 'i', MoveImages[12], MoveImages[13]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(193), y, 6, VKEY_LTARROW, MoveImages[14], MoveImages[15]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(225), y, 7, VKEY_UPARROW, MoveImages[16], MoveImages[17]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(257), y, 8, VKEY_RTARROW, MoveImages[18], MoveImages[19]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(289), y, 9, 'p', MoveImages[10], MoveImages[11]);
-#else
- MoveGadgetList = createButton(VGAScaleX(1), y, 0, MoveImages[0], MoveImages[1]);
- curgad = MoveGadgetList;
- curgad->NextGadget = createButton(VGAScaleX(33), y, 1, MoveImages[2], MoveImages[3]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(65), y, 2, MoveImages[4], MoveImages[5]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(97), y, 3, MoveImages[6], MoveImages[7]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(129), y, 4, MoveImages[8], MoveImages[9]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(161), y, 5, MoveImages[12], MoveImages[13]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(193), y, 6, MoveImages[14], MoveImages[15]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(225), y, 7, MoveImages[16], MoveImages[17]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(257), y, 8, MoveImages[18], MoveImages[19]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(289), y, 9, MoveImages[10], MoveImages[11]);
-#endif
+
+ if (g_lab->getPlatform() != Common::kPlatformWindows) {
+ MoveGadgetList = createButton(VGAScaleX(1), y, 0, 't', MoveImages[0], MoveImages[1]);
+ curgad = MoveGadgetList;
+ curgad->NextGadget = createButton(VGAScaleX(33), y, 1, 'm', MoveImages[2], MoveImages[3]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(65), y, 2, 'o', MoveImages[4], MoveImages[5]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(97), y, 3, 'c', MoveImages[6], MoveImages[7]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(129), y, 4, 'l', MoveImages[8], MoveImages[9]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(161), y, 5, 'i', MoveImages[12], MoveImages[13]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(193), y, 6, VKEY_LTARROW, MoveImages[14], MoveImages[15]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(225), y, 7, VKEY_UPARROW, MoveImages[16], MoveImages[17]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(257), y, 8, VKEY_RTARROW, MoveImages[18], MoveImages[19]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(289), y, 9, 'p', MoveImages[10], MoveImages[11]);
+ } else {
+ MoveGadgetList = createButton(VGAScaleX(1), y, 0, 0, MoveImages[0], MoveImages[1]);
+ curgad = MoveGadgetList;
+ curgad->NextGadget = createButton(VGAScaleX(33), y, 1, 0, MoveImages[2], MoveImages[3]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(65), y, 2, 0, MoveImages[4], MoveImages[5]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(97), y, 3, 0, MoveImages[6], MoveImages[7]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(129), y, 4, 0, MoveImages[8], MoveImages[9]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(161), y, 5, 0, MoveImages[12], MoveImages[13]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(193), y, 6, 0, MoveImages[14], MoveImages[15]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(225), y, 7, 0, MoveImages[16], MoveImages[17]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(257), y, 8, 0, MoveImages[18], MoveImages[19]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(289), y, 9, 0, MoveImages[10], MoveImages[11]);
+ }
InvPanelBufferSize = sizeOfFile("P:Inv");
@@ -340,45 +334,44 @@ bool setUpScreens(void) {
file->close();
*buffer = InvPanelBuffer;
-#if !defined(DOSCODE)
-
- for (counter = 0; counter < 10; counter++)
- readImage(buffer, &(InvImages[counter]));
-
- InvGadgetList = createButton(VGAScaleX(24), y, 0, 'm', InvImages[0], InvImages[1]);
- curgad = InvGadgetList;
- curgad->NextGadget = createButton(VGAScaleX(56), y, 1, 'g', InvImages[2], InvImages[3]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(94), y, 2, 'u', InvImages[4], InvImages[5]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(126), y, 3, 'l', MoveImages[8], MoveImages[9]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(164), y, 4, VKEY_LTARROW, MoveImages[14], MoveImages[15]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(196), y, 5, VKEY_RTARROW, MoveImages[18], MoveImages[19]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(234), y, 6, 'b', InvImages[6], InvImages[7]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(266), y, 7, 'f', InvImages[8], InvImages[9]);
- curgad = curgad->NextGadget;
-#else
-
- for (counter = 0; counter < 6; counter++)
- readImage(buffer, &(InvImages[counter]));
-
- InvGadgetList = createButton(VGAScaleX(58), y, 0, InvImages[0], InvImages[1]);
- curgad = InvGadgetList;
- curgad->NextGadget = createButton(VGAScaleX(90), y, 1, InvImages[2], InvImages[3]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(128), y, 2, InvImages[4], InvImages[5]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(160), y, 3, MoveImages[8], MoveImages[9]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(198), y, 4, MoveImages[14], MoveImages[15]);
- curgad = curgad->NextGadget;
- curgad->NextGadget = createButton(VGAScaleX(230), y, 5, MoveImages[18], MoveImages[19]);
- curgad = curgad->NextGadget;
-#endif
+
+ if (g_lab->getPlatform() == Common::kPlatformWindows) {
+ for (counter = 0; counter < 10; counter++)
+ readImage(buffer, &(InvImages[counter]));
+
+ InvGadgetList = createButton(VGAScaleX(24), y, 0, 'm', InvImages[0], InvImages[1]);
+ curgad = InvGadgetList;
+ curgad->NextGadget = createButton(VGAScaleX(56), y, 1, 'g', InvImages[2], InvImages[3]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(94), y, 2, 'u', InvImages[4], InvImages[5]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(126), y, 3, 'l', MoveImages[8], MoveImages[9]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(164), y, 4, VKEY_LTARROW, MoveImages[14], MoveImages[15]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(196), y, 5, VKEY_RTARROW, MoveImages[18], MoveImages[19]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(234), y, 6, 'b', InvImages[6], InvImages[7]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(266), y, 7, 'f', InvImages[8], InvImages[9]);
+ curgad = curgad->NextGadget;
+ } else {
+ for (counter = 0; counter < 6; counter++)
+ readImage(buffer, &(InvImages[counter]));
+
+ InvGadgetList = createButton(VGAScaleX(58), y, 0, 0, InvImages[0], InvImages[1]);
+ curgad = InvGadgetList;
+ curgad->NextGadget = createButton(VGAScaleX(90), y, 1, 0, InvImages[2], InvImages[3]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(128), y, 2, 0, InvImages[4], InvImages[5]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(160), y, 3, 0, MoveImages[8], MoveImages[9]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(198), y, 4, 0, MoveImages[14], MoveImages[15]);
+ curgad = curgad->NextGadget;
+ curgad->NextGadget = createButton(VGAScaleX(230), y, 5, 0, MoveImages[18], MoveImages[19]);
+ curgad = curgad->NextGadget;
+ }
return true;
}
@@ -462,19 +455,6 @@ static void checkRoomMusic(void) {
}
-
-#if defined(DOSCODE)
-#define MONLTMARGIN 0
-#define MONRTMARGIN 319
-#define MONTOPMARGIN 0
-#define LUTERTMARGIN 124
-#else
-#define MONLTMARGIN 2
-#define MONRTMARGIN 317
-#define MONTOPMARGIN 2
-#define LUTERTMARGIN 128
-#endif
-
/******************************************************************************/
/* Checks whether the close up is one of the special case closeups. */
/******************************************************************************/
@@ -482,23 +462,37 @@ static bool doCloseUp(CloseDataPtr cptr) {
if (cptr == NULL)
return false;
+ int monltmargin, monrtmargin, montopmargin, lutertmargin;
+
+ if (g_lab->getPlatform() != Common::kPlatformWindows) {
+ monltmargin = 0;
+ monrtmargin = 319;
+ montopmargin = 0;
+ lutertmargin = 124;
+ } else {
+ monltmargin = 2;
+ monrtmargin = 317;
+ montopmargin = 2;
+ lutertmargin = 128;
+ }
+
if ((cptr->CloseUpType == MUSEUMMONITOR) || (cptr->CloseUpType == LIBRARYMONITOR) ||
(cptr->CloseUpType == WINDOWMONITOR))
- doMonitor(cptr->GraphicName, cptr->Message, false, MONLTMARGIN, MONTOPMARGIN, MONRTMARGIN, 165);
+ doMonitor(cptr->GraphicName, cptr->Message, false, monltmargin, montopmargin, monrtmargin, 165);
else if (cptr->CloseUpType == GRAMAPHONEMONITOR)
- doMonitor(cptr->GraphicName, cptr->Message, false, MONLTMARGIN, MONTOPMARGIN, 171, 165);
+ doMonitor(cptr->GraphicName, cptr->Message, false, monltmargin, montopmargin, 171, 165);
else if (cptr->CloseUpType == UNICYCLEMONITOR)
- doMonitor(cptr->GraphicName, cptr->Message, false, 100, MONTOPMARGIN, MONRTMARGIN, 165);
+ doMonitor(cptr->GraphicName, cptr->Message, false, 100, montopmargin, monrtmargin, 165);
else if (cptr->CloseUpType == STATUEMONITOR)
- doMonitor(cptr->GraphicName, cptr->Message, false, 117, MONTOPMARGIN, MONRTMARGIN, 165);
+ doMonitor(cptr->GraphicName, cptr->Message, false, 117, montopmargin, monrtmargin, 165);
else if (cptr->CloseUpType == TALISMANMONITOR)
- doMonitor(cptr->GraphicName, cptr->Message, false, MONLTMARGIN, MONTOPMARGIN, 184, 165);
+ doMonitor(cptr->GraphicName, cptr->Message, false, monltmargin, montopmargin, 184, 165);
else if (cptr->CloseUpType == LUTEMONITOR)
- doMonitor(cptr->GraphicName, cptr->Message, false, MONLTMARGIN, MONTOPMARGIN, LUTERTMARGIN, 165);
+ doMonitor(cptr->GraphicName, cptr->Message, false, monltmargin, montopmargin, lutertmargin, 165);
else if (cptr->CloseUpType == CLOCKMONITOR)
- doMonitor(cptr->GraphicName, cptr->Message, false, MONLTMARGIN, MONTOPMARGIN, 206, 165);
+ doMonitor(cptr->GraphicName, cptr->Message, false, monltmargin, montopmargin, 206, 165);
else if (cptr->CloseUpType == TERMINALMONITOR)
- doMonitor(cptr->GraphicName, cptr->Message, true, MONLTMARGIN, MONTOPMARGIN, MONRTMARGIN, 165);
+ doMonitor(cptr->GraphicName, cptr->Message, true, monltmargin, montopmargin, monrtmargin, 165);
else
return false;
@@ -710,12 +704,8 @@ static void decIncInv(uint16 *CurInv, bool dec) {
}
-#if defined(DOSCODE)
static bool nosvgamem = false;
static bool didintro = false;
-#else
-int didintro = false; // change to int do labw.c can access
-#endif
static bool novesa = false, noaudio = false;
/******************************************************************************/
@@ -725,19 +715,14 @@ static void process(void) {
IntuiMessage *Msg;
uint32 Class;
- uint16 Code, Qualifier, MouseX, MouseY, ActionMode = 4, CurInv = MAPNUM, /* Lab: Labyrinth specific initialization */
- LastInv = MAPNUM, /* Lab: Labyrinth specific initialization */
- Old;
+ uint16 Code, Qualifier, MouseX, MouseY, ActionMode = 4;
+ uint16 CurInv = MAPNUM, LastInv = MAPNUM, Old;
- bool ForceDraw = false, doit, GotMessage = true;
+ bool ForceDraw = false, doit, GotMessage = true;
- uint16 OldRoomNum,
-#if !defined(DOSCODE)
- OldDirection,
-#endif
- GadID, NewDir;
+ uint16 OldRoomNum, OldDirection, GadID, NewDir;
- CloseDataPtr OldCPtr, TempCPtr, HCPtr = NULL;
+ CloseDataPtr OldCPtr, TempCPtr, HCPtr = NULL;
ViewDataPtr VPtr;
VGASetPal(initcolors, 8);
@@ -778,10 +763,9 @@ static void process(void) {
/* Sees what kind of close up we're in and does the appropriate stuff, if any. */
if (doCloseUp(CPtr)) {
CPtr = NULL;
-#if !defined(DOSCODE)
+
mayShowCrumbIndicator();
WSDL_UpdateScreen();
-#endif
}
/* Sets the current picture properly on the screen */
@@ -816,24 +800,17 @@ static void process(void) {
drawRoomMessage(CurInv, CPtr);
ForceDraw = false;
-#if !defined(DOSCODE)
mayShowCrumbIndicator();
WSDL_UpdateScreen();
if (!FollowingCrumbs)
eatMessages();
-
-#else
- eatMessages();
-#endif
}
if (ForceDraw) {
drawRoomMessage(CurInv, CPtr);
ForceDraw = false;
-#if !defined(DOSCODE)
WSDL_UpdateScreen();
-#endif
}
}
@@ -846,7 +823,6 @@ static void process(void) {
checkRoomMusic();
g_music->newCheckMusic();
diffNextFrame();
-#if !defined(DOSCODE)
if (FollowingCrumbs) {
int result = followCrumbs();
@@ -878,7 +854,6 @@ static void process(void) {
mayShowCrumbIndicator();
WSDL_UpdateScreen();
-#endif
} else {
GotMessage = true;
@@ -891,11 +866,9 @@ static void process(void) {
replyMsg((void *) Msg);
-#if !defined(DOSCODE)
FollowingCrumbs = false;
from_crumbs:
-#endif
DoBlack = false;
if ((Class == RAWKEY) && (!LongWinInFront)) {
@@ -903,18 +876,14 @@ from_crumbs:
Class = MOUSEBUTTONS;
Qualifier = IEQUALIFIER_LEFTBUTTON;
mouseXY(&MouseX, &MouseY);
- }
-
-#if !defined(DOSCODE)
- else if (Code == 'b' || Code == 'B') { /* Start bread crumbs */
+ } else if (g_lab->getPlatform() == Common::kPlatformWindows &&
+ (Code == 'b' || Code == 'B')) { /* Start bread crumbs */
BreadCrumbs[0].RoomNum = 0;
NumCrumbs = 0;
DroppingCrumbs = true;
mayShowCrumbIndicator();
WSDL_UpdateScreen();
- }
-
- else if (Code == 'f' || Code == 'F' ||
+ } else if (Code == 'f' || Code == 'F' ||
Code == 'r' || Code == 'R') { /* Follow bread crumbs */
if (DroppingCrumbs) {
if (NumCrumbs > 0) {
@@ -945,11 +914,7 @@ from_crumbs:
WSDL_UpdateScreen();
}
}
- }
-
-#endif
-
- else if ((Code == 315) || (Code == 'x') || (Code == 'X')
+ } else if ((Code == 315) || (Code == 'x') || (Code == 'X')
|| (Code == 'q') || (Code == 'Q')) { /* Quit? */
DoNotDrawMessage = false;
drawMessage("Do you want to quit? (Y/N)");
@@ -968,13 +933,7 @@ from_crumbs:
replyMsg((void *) Msg); /* Can't do this in non-IBM versions */
if (Msg->Class == RAWKEY) {
-#if defined(DOSCODE)
-
- if ((Msg->Code == 'Y') || (Msg->Code == 'y'))
-#else
- if ((Msg->Code == 'Y') || (Msg->Code == 'y') || (Msg->Code == 'Q') || (Msg->Code == 'q'))
-#endif
- {
+ if ((Msg->Code == 'Y') || (Msg->Code == 'y') || (Msg->Code == 'Q') || (Msg->Code == 'q')) {
doit = true;
break;
} else if (Msg->Code < 128) {
@@ -993,58 +952,9 @@ from_crumbs:
ForceDraw = true;
interfaceOn();
}
- }
-
-#ifdef undef
- else if (Code == 324) {
- if (BUFFERSIZE >= BIGBUFFERSIZE) { /* F10 key to switch resolutions */
- blackAllScreen();
- setMode((char) OldMode);
-
- Alternate = false;
- MainDisplay = true;
- attachGadgetList(NULL);
- fillUpMusic(true);
- g_system->delayMillis(750);
-
- IsHiRes = !IsHiRes;
-
- free(MovePanelBuffer);
- free(InvPanelBuffer);
- freeButtonList(MoveGadgetList);
- freeButtonList(InvGadgetList);
- MoveGadgetList = NULL;
- InvGadgetList = NULL;
-
- if (!setUpScreens()) {
- IsHiRes = false;
- setUpScreens();
- }
-
- blackAllScreen();
- resetBuffer();
- CPtr = NULL;
- DoBlack = true;
- CurFileName = " ";
- closeFont(MsgFont);
- openFont("P:AvanteG.12", &MsgFont);
- /*
- mouseReset();
- */
- initMouse();
- drawPanel();
- perFlipGadget(ActionMode);
- } else
- drawMessage("Not enough memory to change resolutions.");
- }
-
-#endif
-
- else if (Code == 9) { /* TAB key */
+ } else if (Code == 9) { /* TAB key */
Class = DELTAMOVE;
- }
-
- else if (Code == 27) { /* ESC key */
+ } else if (Code == 27) { /* ESC key */
CPtr = NULL;
}
@@ -1060,13 +970,9 @@ from_crumbs:
DoNotDrawMessage = false;
drawPanel();
drawRoomMessage(CurInv, CPtr);
-#if !defined(DOSCODE)
WSDL_UpdateScreen();
-#endif
}
- }
-
- else if ((Class == GADGETUP) && !Alternate) {
+ } else if ((Class == GADGETUP) && !Alternate) {
if (GadID <= 5) {
if ((ActionMode == 4) && (GadID == 4) && (CPtr != NULL)) {
doMainView(&CPtr);
@@ -1074,13 +980,9 @@ from_crumbs:
DoBlack = true;
HCPtr = NULL;
CPtr = NULL;
-#if !defined(DOSCODE)
mayShowCrumbIndicator();
WSDL_UpdateScreen();
-#endif
- }
-
- else if (GadID == 5) {
+ } else if (GadID == 5) {
eatMessages();
Alternate = true;
@@ -1098,10 +1000,9 @@ from_crumbs:
drawPanel();
drawRoomMessage(CurInv, CPtr);
-#if !defined(DOSCODE)
+
mayShowCrumbIndicator();
WSDL_UpdateScreen();
-#endif
} else {
Old = ActionMode;
ActionMode = GadID;
@@ -1122,21 +1023,14 @@ from_crumbs:
else if (GadID == 4)
drawMessage(LOOKWHAT);
-#if !defined(DOSCODE)
WSDL_UpdateScreen();
-#endif
}
- }
-
- else if (GadID == 9) {
+ } else if (GadID == 9) {
doUse(MAPNUM);
-#if !defined(DOSCODE)
+
mayShowCrumbIndicator();
WSDL_UpdateScreen();
-#endif
- }
-
- else if (GadID >= 6) { /* Arrow Gadgets */
+ } else if (GadID >= 6) { /* Arrow Gadgets */
CPtr = NULL;
HCPtr = NULL;
@@ -1147,19 +1041,18 @@ from_crumbs:
drawMessage(TURNRIGHT);
CurFileName = " ";
-#if !defined(DOSCODE)
+
OldDirection = Direction;
-#endif
+
NewDir = Direction;
processArrow(&NewDir, GadID - 6);
doTurn(Direction, NewDir, &CPtr);
DoBlack = true;
Direction = NewDir;
ForceDraw = true;
-#if !defined(DOSCODE)
+
mayShowCrumbIndicator();
WSDL_UpdateScreen();
-#endif
} else if (GadID == 7) {
OldRoomNum = RoomNum;
@@ -1181,15 +1074,6 @@ from_crumbs:
}
}
-#if defined(DEMODATA)
- {
- void writeDemoData();
- writeDemoData();
- }
-#endif
-
-#if !defined(DOSCODE)
-
if (FollowingCrumbs) {
if (IsCrumbTurning) {
if (Direction == OldDirection) {
@@ -1235,12 +1119,9 @@ from_crumbs:
mayShowCrumbIndicator();
WSDL_UpdateScreen();
-#endif
}
}
- }
-
- else if ((Class == GADGETUP) && Alternate) {
+ } else if ((Class == GADGETUP) && Alternate) {
DoBlack = true;
if (GadID == 0) {
@@ -1253,9 +1134,8 @@ from_crumbs:
interfaceOn(); /* Sets the correct gadget list */
drawPanel();
drawRoomMessage(CurInv, CPtr);
-#if !defined(DOSCODE)
+
WSDL_UpdateScreen();
-#endif
}
GadID--;
@@ -1280,21 +1160,14 @@ from_crumbs:
if (doit) {
drawMessage("Disk operation failed.");
VGASetPal(initcolors, 8);
-#if !defined(DOSCODE)
+
WSDL_UpdateScreen();
-#endif
- g_system->delayMillis(1000);
- }
-#if !defined(DOSCODE)
- else {
+ g_system->delayMillis(1000);
+ } else {
WSDL_UpdateScreen();
}
-
-#endif
- }
-
- else if (GadID == 1) {
+ } else if (GadID == 1) {
if (!doUse(CurInv)) {
Old = ActionMode;
ActionMode = 5; /* Use button */
@@ -1304,13 +1177,10 @@ from_crumbs:
drawMessage(USEONWHAT);
MainDisplay = true;
-#if !defined(DOSCODE)
+
WSDL_UpdateScreen();
-#endif
}
- }
-
- else if (GadID == 2) {
+ } else if (GadID == 2) {
MainDisplay = !MainDisplay;
if ((CurInv == 0) || (CurInv > NumInv)) {
@@ -1324,41 +1194,28 @@ from_crumbs:
Inventory[CurInv].BInvName)
Test = getInvName(CurInv);
-#if !defined(DOSCODE)
WSDL_UpdateScreen();
-#endif
- }
-
- else if (GadID == 3) { /* Left gadget */
+ } else if (GadID == 3) { /* Left gadget */
decIncInv(&CurInv, true);
LastInv = CurInv;
DoNotDrawMessage = false;
drawRoomMessage(CurInv, CPtr);
-#if !defined(DOSCODE)
- WSDL_UpdateScreen();
-#endif
- }
- else if (GadID == 4) { /* Right gadget */
+ WSDL_UpdateScreen();
+ } else if (GadID == 4) { /* Right gadget */
decIncInv(&CurInv, false);
LastInv = CurInv;
DoNotDrawMessage = false;
drawRoomMessage(CurInv, CPtr);
-#if !defined(DOSCODE)
- WSDL_UpdateScreen();
-#endif
- }
-#if !defined(DOSCODE)
- else if (GadID == 5) { /* bread crumbs */
+ WSDL_UpdateScreen();
+ } else if (GadID == 5) { /* bread crumbs */
BreadCrumbs[0].RoomNum = 0;
NumCrumbs = 0;
DroppingCrumbs = true;
mayShowCrumbIndicator();
WSDL_UpdateScreen();
- }
-
- else if (GadID == 6) { /* follow crumbs */
+ } else if (GadID == 6) { /* follow crumbs */
if (DroppingCrumbs) {
if (NumCrumbs > 0) {
FollowingCrumbs = true;
@@ -1387,11 +1244,7 @@ from_crumbs:
}
}
}
- }
-
-#endif
-
- else if ((Class == MOUSEBUTTONS) && (IEQUALIFIER_LEFTBUTTON & Qualifier) && MainDisplay) {
+ } else if ((Class == MOUSEBUTTONS) && (IEQUALIFIER_LEFTBUTTON & Qualifier) && MainDisplay) {
interfaceOff();
MainDisplay = true;
@@ -1423,9 +1276,7 @@ from_crumbs:
CurFileName = NewFileName;
else if (MouseY < (VGAScaleY(149) + SVGACord(2)))
drawMessage(NOTHING);
- }
-
- else if ((ActionMode == 1) /* Manipulate an object */ ||
+ } else if ((ActionMode == 1) /* Manipulate an object */ ||
(ActionMode == 2) /* Open up a "door" */ ||
(ActionMode == 3)) { /* Close a "door" */
if (doActionRule(MouseX, MouseY, ActionMode, RoomNum, &CPtr))
@@ -1434,9 +1285,7 @@ from_crumbs:
if (MouseY < (VGAScaleY(149) + SVGACord(2)))
drawMessage(NOTHING);
}
- }
-
- else if (ActionMode == 4) { /* Look at closeups */
+ } else if (ActionMode == 4) { /* Look at closeups */
TempCPtr = CPtr;
setCurClose(MouseX, MouseY, &TempCPtr);
@@ -1451,9 +1300,7 @@ from_crumbs:
drawMessage(NOTHING);
} else if (MouseY < (VGAScaleY(149) + SVGACord(2)))
drawMessage(NOTHING);
- }
-
- else if ((ActionMode == 5) &&
+ } else if ((ActionMode == 5) &&
g_lab->_conditions->in(CurInv)) { /* Use an item on something else */
if (doOperateRule(MouseX, MouseY, CurInv, &CPtr)) {
CurFileName = NewFileName;
@@ -1465,13 +1312,9 @@ from_crumbs:
}
}
-#if !defined(DOSCODE)
mayShowCrumbIndicator();
WSDL_UpdateScreen();
-#endif
- }
-
- else if (Class == DELTAMOVE) {
+ } else if (Class == DELTAMOVE) {
VPtr = getViewData(RoomNum, Direction);
OldCPtr = VPtr->closeUps;
@@ -1499,9 +1342,7 @@ from_crumbs:
if (HCPtr)
mouseMove(scaleX((HCPtr->x1 + HCPtr->x2) / 2), scaleY((HCPtr->y1 + HCPtr->y2) / 2));
- }
-
- else if ((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) {
+ } else if ((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) {
eatMessages();
Alternate = !Alternate;
DoBlack = true;
@@ -1518,10 +1359,9 @@ from_crumbs:
drawPanel();
drawRoomMessage(CurInv, CPtr);
-#if !defined(DOSCODE)
+
mayShowCrumbIndicator();
WSDL_UpdateScreen();
-#endif
}
}
}
@@ -1546,36 +1386,23 @@ from_crumbs:
}
-/*
- void mySignalHandler(int sig)
- {
- signal(sig, mySignalHandler);
- }
- */
-
-
-
-#if defined(DOSCODE)
-void (__interrupt __far *oldctrlc)(), (__interrupt __far *oldctrlcb)();
-
-uint16 iretdummy;
-void __interrupt __far myiret() {
- iretdummy++;
-}
-#endif
-
-
-void inner_main() {
+void LabEngine::go() {
bool mem, dointro = false;
uint16 counter;
getMode(&OldMode);
- IsHiRes = true;
DoMusic = true;
g_music->_turnMusicOn = true;
dointro = true;
+ IsHiRes = ((getFeatures() & GF_LOWRES) == 0);
+
+ if (IsHiRes)
+ warning("Running in HiRes mode");
+ else
+ warning("Running in LowRes mode");
+
#if 0
for (counter = 1; counter < argc; counter++) {
#if defined(DOSCODE)
@@ -1613,16 +1440,8 @@ void inner_main() {
if (initBuffer(BUFFERSIZE, true)) {
mem = true;
} else {
-#if defined(DOSCODE)
- BUFFERSIZE = SMALLBUFFERSIZE;
- mem = initBuffer(BUFFERSIZE, true);
- IsHiRes = false;
- nosvgamem = true;
-#else
- // unacceptable !!!!
warning("initBuffer() failed");
return;
-#endif
}
if (!initAudio()) {
@@ -1641,11 +1460,7 @@ void inner_main() {
if (!initMouse()) {
setMode((char) OldMode);
-#if defined(DOSCODE)
- _dos_setvect(0x23, oldctrlc);
- _dos_setvect(0x1B, oldctrlcb);
-#endif
- debug("\n\nMouse or mouse driver not installed!\n\n");
+
return;
}
@@ -1660,13 +1475,9 @@ void inner_main() {
openFont("P:AvanteG.12", &MsgFont);
if (dointro && mem) {
-#if defined(DOSCODE)
didintro = true;
-#endif
introSequence();
-#if !defined(DOSCODE)
didintro = true;
-#endif
} else
DoBlack = true;
@@ -1688,27 +1499,12 @@ void inner_main() {
readPict("P:End/L2In.9", true);
readPict("P:End/Lost", true);
-#if defined(DOSCODE)
- counter = 600;
-
- while (counter) {
- newCheckMusic();
- diffNextFrame();
- waitTOF();
- counter--;
- }
-
-#else
-
warning("STUB: waitForPress");
while (!1) { // 1 means ignore SDL_ProcessInput calls
g_music->newCheckMusic();
diffNextFrame();
waitTOF();
}
-
- // If we weren't exiting, a call to a mythical SDL_StopWaitForPress() would be in order.
-#endif
}
closeFont(MsgFont);
@@ -1721,25 +1517,19 @@ void inner_main() {
freeAudio();
mouseReset();
- setMode((char) OldMode);
-
-#if defined(DOSCODE)
- _dos_setvect(0x23, oldctrlc);
- _dos_setvect(0x1B, oldctrlcb);
-#endif
+ setMode((char)OldMode);
}
-#if !defined(DOSCODE)
/*****************************************************************************/
/* New code to allow quick(er) return navigation in game. */
/*****************************************************************************/
int followCrumbs() {
// NORTH, SOUTH, EAST, WEST
static int movement[4][4] = {
- { VKEY_UPARROW, VKEY_RTARROW, VKEY_RTARROW, VKEY_LTARROW }, { VKEY_RTARROW, VKEY_UPARROW, VKEY_LTARROW, VKEY_RTARROW }, { VKEY_LTARROW, VKEY_RTARROW, VKEY_UPARROW, VKEY_RTARROW }, { VKEY_RTARROW, VKEY_LTARROW, VKEY_RTARROW, VKEY_UPARROW }
-#if 0
- { -1, EAST, EAST, WEST }, { WEST, -1, EAST, WEST }, { NORTH, SOUTH, -1, SOUTH }, { NORTH, SOUTH, NORTH, -1 }
-#endif
+ { VKEY_UPARROW, VKEY_RTARROW, VKEY_RTARROW, VKEY_LTARROW },
+ { VKEY_RTARROW, VKEY_UPARROW, VKEY_LTARROW, VKEY_RTARROW },
+ { VKEY_LTARROW, VKEY_RTARROW, VKEY_UPARROW, VKEY_RTARROW },
+ { VKEY_RTARROW, VKEY_LTARROW, VKEY_RTARROW, VKEY_UPARROW }
};
int ExitDir;
@@ -1805,6 +1595,9 @@ Image DropCrumbsImage = { 24, 24, dropCrumbs };
Image DropCrumbsOffImage = { 24, 24, dropCrumbsOff };
void mayShowCrumbIndicator() {
+ if (g_lab->getPlatform() != Common::kPlatformWindows)
+ return;
+
if (DroppingCrumbs && MainDisplay) {
mouseHide();
drawMaskImage(&DropCrumbsImage, 612, 4);
@@ -1813,12 +1606,14 @@ void mayShowCrumbIndicator() {
}
void mayShowCrumbIndicatorOff() {
+ if (g_lab->getPlatform() != Common::kPlatformWindows)
+ return;
+
if (MainDisplay) {
mouseHide();
drawMaskImage(&DropCrumbsOffImage, 612, 4);
mouseShow();
}
}
-#endif
} // End of namespace Lab
diff --git a/engines/lab/graphics.cpp b/engines/lab/graphics.cpp
index 41f4a7960a..3d91fd4197 100644
--- a/engines/lab/graphics.cpp
+++ b/engines/lab/graphics.cpp
@@ -28,6 +28,7 @@
*
*/
+#include "lab/lab.h"
#include "lab/stddefines.h"
#include "lab/diff.h"
#include "lab/parsetypes.h"
@@ -675,23 +676,29 @@ static void doScrollWipe(char *filename) {
/* Does the scroll bounce. Assumes bitmap already in memory. */
/*****************************************************************************/
static void doScrollBounce(void) {
- byte *mem;
- uint16 width, height, startline, counter,
-#if defined(DOSCODE)
- newby[5] = {5, 4, 3, 2, 1}, newby1[8] = {3, 3, 2, 2, 2, 1, 1, 1};
-#else
- newby[5] = {10, 8, 6, 4, 2}, newby1[8] = {6, 6, 4, 4, 4, 2, 2, 2};
-#endif
+ const uint16 *newby, *newby1;
+
+ const uint16 newbyd[5] = {5, 4, 3, 2, 1}, newby1d[8] = {3, 3, 2, 2, 2, 1, 1, 1};
+ const uint16 newbyw[5] = {10, 8, 6, 4, 2}, newby1w[8] = {6, 6, 4, 4, 4, 2, 2, 2};
+
+ if (g_lab->getPlatform() != Common::kPlatformWindows) {
+ newby = newbyd;
+ newby1 = newby1d;
+ } else {
+ newby = newbyw;
+ newby1 = newby1w;
+ }
+
mouseHide();
- width = VGAScaleX(320);
- height = VGAScaleY(149) + SVGACord(2);
- mem = RawDiffBM.Planes[0];
+ int width = VGAScaleX(320);
+ int height = VGAScaleY(149) + SVGACord(2);
+ byte *mem = RawDiffBM.Planes[0];
g_music->fillUpMusic(true);
- startline = headerdata.y - height - 1;
+ int startline = headerdata.y - height - 1;
- for (counter = 0; counter < 5; counter++) {
+ for (int counter = 0; counter < 5; counter++) {
g_music->newCheckMusic();
startline -= newby[counter];
copyPage(width, height, 0, startline, mem);
@@ -700,7 +707,7 @@ static void doScrollBounce(void) {
waitTOF();
}
- for (counter = 8; counter > 0; counter--) {
+ for (int counter = 8; counter > 0; counter--) {
g_music->newCheckMusic();
startline += newby1[counter - 1];
copyPage(width, height, 0, startline, mem);
diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp
index e843d9b4cf..c70d19b2bb 100644
--- a/engines/lab/interface.cpp
+++ b/engines/lab/interface.cpp
@@ -124,23 +124,12 @@ uint16 makeGadgetKeyEquiv(uint16 key) {
/* of gadgets. */
/*****************************************************************************/
static Gadget *checkNumGadgetHit(Gadget *gadlist, uint16 key) {
-#if !defined(DOSCODE)
uint16 gkey = key - '0';
-#else
- key = key - '0';
-#endif
while (gadlist != NULL) {
-#if !defined(DOSCODE)
-
if ((gkey - 1 == gadlist->GadgetID || (gkey == 0 && gadlist->GadgetID == 9) ||
(gadlist->KeyEquiv != 0 && makeGadgetKeyEquiv(key) == gadlist->KeyEquiv))
- && !(GADGETOFF & gadlist->GadgetFlags))
-#else
- if ((((key - 1) == gadlist->GadgetID) || ((key == 0) && (gadlist->GadgetID == 9))) &&
- !(GADGETOFF & gadlist->GadgetFlags))
-#endif
- {
+ && !(GADGETOFF & gadlist->GadgetFlags)) {
mouseHide();
drawImage(gadlist->ImAlt, gadlist->x, gadlist->y);
mouseShow();
diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp
index bac197eeb4..09f92c0698 100644
--- a/engines/lab/intro.cpp
+++ b/engines/lab/intro.cpp
@@ -28,6 +28,7 @@
*
*/
+#include "lab/lab.h"
#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/timing.h"
@@ -272,15 +273,16 @@ void introSequence(void) {
DoBlack = true;
-#if defined(DOSCODE)
- readPict("p:Intro/EA0", true);
- readPict("p:Intro/EA1", true);
- readPict("p:Intro/EA2", true);
- readPict("p:Intro/EA3", true);
-#elif defined(ALL_LOGOS) || defined(NDEBUG)
- readPict("p:Intro/WYRMKEEP", true);
- microDelay(4, 0, NULL);
-#endif
+ if (g_lab->getPlatform() != Common::kPlatformWindows) {
+ readPict("p:Intro/EA0", true);
+ readPict("p:Intro/EA1", true);
+ readPict("p:Intro/EA2", true);
+ readPict("p:Intro/EA3", true);
+ } else {
+ readPict("p:Intro/WYRMKEEP", true);
+ microDelay(4, 0);
+ }
+
blackAllScreen();
g_music->initMusic();
@@ -292,7 +294,6 @@ void introSequence(void) {
noscreenchange = false;
FadePalette = Palette;
-#if defined(ALL_LOGOS) || defined(NDEBUG)
for (counter = 0; counter < 16; counter++) {
Palette[counter] = ((diffcmap[counter * 3] >> 2) << 8) +
@@ -300,11 +301,11 @@ void introSequence(void) {
(diffcmap[counter * 3 + 2] >> 2);
}
- newCheckMusic();
+ g_music->newCheckMusic();
fade(true, 0);
for (int times = 0; times < 150; times++) {
- newCheckMusic();
+ g_music->newCheckMusic();
uint16 temp = Palette[2];
for (counter = 2; counter < 15; counter++)
@@ -318,7 +319,7 @@ void introSequence(void) {
fade(false, 0);
blackAllScreen();
-#endif
+
g_music->newCheckMusic();
readPict("p:Intro/Title.A", true);
@@ -327,15 +328,17 @@ void introSequence(void) {
readPict("p:Intro/BA", true);
readPict("p:Intro/AC", true);
musicDelay();
-#if !defined(DOSCODE)
- musicDelay(); // more credits on this page now
-#endif
+
+ if (g_lab->getPlatform() == Common::kPlatformWindows)
+ musicDelay(); // more credits on this page now
+
readPict("p:Intro/CA", true);
readPict("p:Intro/AD", true);
musicDelay();
-#if !defined(DOSCODE)
- musicDelay(); // more credits on this page now
-#endif
+
+ if (g_lab->getPlatform() == Common::kPlatformWindows)
+ musicDelay(); // more credits on this page now
+
readPict("p:Intro/DA", true);
musicDelay();
diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp
index 911ad6d255..16839dad29 100644
--- a/engines/lab/lab.cpp
+++ b/engines/lab/lab.cpp
@@ -60,12 +60,14 @@ LabEngine::~LabEngine() {
}
Common::Error LabEngine::run() {
- // Initialize graphics using following:
- initGraphics(640, 480, true);
+ if (getFeatures() & GF_LOWRES)
+ initGraphics(320, 200, false);
+ else
+ initGraphics(640, 480, true);
g_music = new Music();
- inner_main();
+ go();
return Common::kNoError;
}
diff --git a/engines/lab/lab.h b/engines/lab/lab.h
index 72e359c291..882541780e 100644
--- a/engines/lab/lab.h
+++ b/engines/lab/lab.h
@@ -50,11 +50,13 @@ public:
~LabEngine();
virtual Common::Error run();
+ void go();
bool hasFeature(EngineFeature f) const;
const ADGameDescription *_gameDescription;
Common::Platform getPlatform() const;
+ uint32 getFeatures() const;
LargeSet *_conditions, *_roomsFound;
};
diff --git a/engines/lab/mouse.cpp b/engines/lab/mouse.cpp
index 753e8ff302..e68ce6ffa5 100644
--- a/engines/lab/mouse.cpp
+++ b/engines/lab/mouse.cpp
@@ -133,10 +133,10 @@ void attachGadgetList(Gadget *GadList) {
static void drawMouse(void) {
if (BackImage.ImageData) {
- if (backx <= 640 - BackImage.Width && backy <= 480 - BackImage.Height)
+ if (backx <= VGAScreenWidth - BackImage.Width && backy <= VGAScreenHeight - BackImage.Height)
drawMaskImage(&MouseImage, backx, backy);
} else {
- if (CurMouseX <= 640 - MouseImage.Width && CurMouseY <= 480 - MouseImage.Height)
+ if (CurMouseX <= VGAScreenWidth - MouseImage.Width && CurMouseY <= VGAScreenHeight - MouseImage.Height)
drawMaskImage(&MouseImage, CurMouseX, CurMouseY);
}
}
@@ -151,13 +151,13 @@ static void getBackMouse(void) {
backx = CurMouseX;
backy = CurMouseY;
- if (backx <= 640 - BackImage.Width && backy <= 480 - BackImage.Height)
+ if (backx <= VGAScreenWidth - BackImage.Width && backy <= VGAScreenHeight - BackImage.Height)
readScreenImage(&BackImage, backx, backy);
}
static void restoreBackMouse(void) {
if (BackImage.ImageData) {
- if (backx <= 640 - BackImage.Width && backy <= 480 - BackImage.Height)
+ if (backx <= VGAScreenWidth - BackImage.Width && backy <= VGAScreenHeight - BackImage.Height)
drawImage(&BackImage, backx, backy);
BackImage.ImageData = NULL;
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 3ab548a82e..038f8b88b6 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -187,9 +187,7 @@ static void changeCombination(uint16 number) {
} else
waitTOF();
-#if !defined(DOSCODE)
display.ImageData = getVGABaseAddr();
-#endif
scrollDisplayY(2, VGAScaleX(combx[number]), VGAScaleY(65), VGAScaleX(combx[number]) + (Images[combnum])->Width - 1, VGAScaleY(65) + (Images[combnum])->Height);
@@ -204,9 +202,7 @@ static void changeCombination(uint16 number) {
else
g_lab->_conditions->exclElement(COMBINATIONUNLOCKED);
-#if !defined(DOSCODE)
ungetVGABaseAddr();
-#endif
}
@@ -248,9 +244,6 @@ void mouseCombination(uint16 x, uint16 y) {
/*----------------------------- Tile Puzzle Rules ----------------------------*/
/*----------------------------------------------------------------------------*/
-
-
-
Image *Tiles[16];
int16 CurTile[4] [4] = {
{ 1, 5, 9, 13 },
@@ -703,14 +696,12 @@ static bool loadJournalData() {
BackG.Im = JLeft;
BackG.ImAlt = JLeftAlt;
-#if !defined(DOSCODE)
BackG.KeyEquiv = VKEY_LTARROW;
-#endif
+
ForwardG.Im = JRight;
ForwardG.ImAlt = JRightAlt;
-#if !defined(DOSCODE)
ForwardG.KeyEquiv = VKEY_RTARROW;
-#endif
+
CancelG.Im = JCancel;
CancelG.ImAlt = JCancelAlt;
@@ -785,18 +776,14 @@ static void turnPage(bool FromLeft) {
for (counter = 0; counter < VGAScreenWidth; counter += 8) {
g_music->updateMusic();
waitTOF();
-#if !defined(DOSCODE)
ScreenImage.ImageData = getVGABaseAddr();
-#endif
bltBitMap(&JBackImage, counter, 0, &ScreenImage, counter, 0, 8, VGAScreenHeight);
}
} else {
for (counter = (VGAScreenWidth - 8); counter > 0; counter -= 8) {
g_music->updateMusic();
waitTOF();
-#if !defined(DOSCODE)
ScreenImage.ImageData = getVGABaseAddr();
-#endif
bltBitMap(&JBackImage, counter, 0, &ScreenImage, counter, 0, 8, VGAScreenHeight);
}
}
@@ -819,9 +806,7 @@ static void drawJournal(uint16 wipenum, bool needFade) {
drawJournalText();
-#if !defined(DOSCODE)
ScreenImage.ImageData = getVGABaseAddr();
-#endif
if (wipenum == 0)
bltBitMap(&JBackImage, 0, 0, &ScreenImage, 0, 0, VGAScreenWidth, VGAScreenHeight);
@@ -838,9 +823,7 @@ static void drawJournal(uint16 wipenum, bool needFade) {
else
unGhoastGadget(&ForwardG);
-#if !defined(DOSCODE)
ungetVGABaseAddr();
-#endif
if (needFade)
@@ -948,9 +931,7 @@ void doJournal() {
fade(false, 0);
mouseHide();
-#if !defined(DOSCODE)
ScreenImage.ImageData = getVGABaseAddr();
-#endif
setAPen(0);
rectFill(0, 0, VGAScreenWidth - 1, VGAScreenHeight - 1);
@@ -958,9 +939,7 @@ void doJournal() {
journalCleanUp();
-#if !defined(DOSCODE)
ungetVGABaseAddr();
-#endif
}
@@ -996,64 +975,6 @@ static char DriveName[5] [MAXDEVNAMES];
/* and returned the number of drives that it found. */
/*****************************************************************************/
uint16 doDisks(void) {
-#if defined(DOSCODE)
- uint16 many = 0, counter = 2;
- union REGS regs;
- char str[5];
-
- if (manydisks)
- return manydisks;
-
- while ((counter < 7) && (many < MAXDEVNAMES)) {
- memset(&regs, 0, sizeof(regs));
- /*
- regs.h.ah = 0x32;
- regs.h.dl = counter+1;
- int386(0x21, &regs, &regs);
- if (regs.h.al == 0)
- {
- */
- regs.h.ah = 0x36;
- regs.h.dl = counter + 1;
- int386(0x21, &regs, &regs);
-
- if (regs.w.ax != 0xFFFF) {
- str[0] = counter + 'A';
- str[1] = ':';
- str[2] = '\\';
- str[3] = 0;
- strcpy(DriveName[many], str);
- many++;
- }
-
- counter++;
- }
-
- return many;
-#elif defined(WIN32)
- extern void winGetDriveLetters(char cdLetters[], int size);
- char letters[28];
- char str[5];
- uint16 many = 0, counter = 2;
-
- if (manydisks)
- return manydisks;
-
- winGetDriveLetters(letters, 28);
-
- while ((counter < 7) && (many < MAXDEVNAMES) && letters[many] != 0) {
- str[0] = letters[many];
- str[1] = ':';
- str[2] = '\\';
- str[3] = 0;
- strcpy(DriveName[many], str);
- many++;
- counter++;
- }
-
- return many;
-#else
- // !!!!goofy test code
char str[5];
str[0] = 'C';
str[1] = ':';
@@ -1061,13 +982,8 @@ uint16 doDisks(void) {
str[3] = 0;
strcpy(DriveName[0], str);
return 1;
-#endif
}
-
-
-
-
/*****************************************************************************/
/* Does the user interface to save or restore a game position */
/*****************************************************************************/
@@ -1222,8 +1138,8 @@ static void drawSaveLoad() {
thumbnail.Width = 128;
thumbnail.Height = 72;
thumbnail.ImageData = g_SaveGameInfo[j].SaveGameImage;
- screen.Width = 640;
- screen.Height = 480;
+ screen.Width = VGAScreenWidth;
+ screen.Height = VGAScreenHeight;
screen.ImageData = getVGABaseAddr();
bltBitMap(&thumbnail, 0, 0, &screen, 72, 67 + i * 75, 128, 72);
ungetVGABaseAddr();
diff --git a/engines/lab/vga.cpp b/engines/lab/vga.cpp
index 10e52e1dd5..c850f5268d 100644
--- a/engines/lab/vga.cpp
+++ b/engines/lab/vga.cpp
@@ -75,10 +75,16 @@ void setMode(char mode) {
bool createScreen(bool HiRes) {
//VGABASEADDRESS = (unsigned long)malloc(640 * 480);
VGABASEADDRESS = 0;
- VGAScreenWidth = 640;
- VGAScreenHeight = 480;
+
+ if (HiRes) {
+ VGAScreenWidth = 640;
+ VGAScreenHeight = 480;
+ } else {
+ VGAScreenWidth = 320;
+ VGAScreenHeight = 200;
+ }
VGAPages = 1;
- VGABytesPerPage = 640 * 480;
+ VGABytesPerPage = VGAScreenWidth * VGAScreenHeight;
g_DisplayBuffer = (byte *)malloc(VGABytesPerPage);
g_Pixels = (byte *)calloc(VGABytesPerPage, 4);
@@ -156,8 +162,8 @@ void WSDL_ProcessInput(bool can_delay) {
g_MouseX = 0;
g_MouseAtEdge = true;
}
- if (g_MouseX > 639) {
- g_MouseX = 640;
+ if (g_MouseX > VGAScreenWidth - 1) {
+ g_MouseX = VGAScreenWidth;
g_MouseAtEdge = true;
}
@@ -166,8 +172,8 @@ void WSDL_ProcessInput(bool can_delay) {
g_MouseY = 0;
g_MouseAtEdge = true;
}
- if (g_MouseY > 479) {
- g_MouseY = 480;
+ if (g_MouseY > VGAScreenHeight - 1) {
+ g_MouseY = VGAScreenHeight;
g_MouseAtEdge = true;
}