LAB: Some cleanup of the monitor code

This commit is contained in:
Filippos Karapetis 2015-12-05 18:14:50 +02:00 committed by Willem Jan Palenstijn
parent c42973604c
commit ab1d9771d2

View File

@ -59,8 +59,7 @@ static bool GotBackImage = false;
static uint16 monitorPage;
static const char *TextFileName;
Image *MonButton, *AltMonButton, *MonQuit, *AltMonQuit, *MonBack, *AltMonBack,
*MonDown, *AltMonDown, *MonUp, *AltMonUp;
Image *MonButton;
extern uint16 *FadePalette;
extern BitMap *DispBitMap, *DrawBitMap;
@ -450,16 +449,6 @@ bool LabEngine::saveRestoreGame() {
return isOK;
}
/*****************************************************************************/
/* Makes sure that the buttons are in memory. */
/*****************************************************************************/
static void getMonImages() {
Common::File *buttonFile = g_lab->_resource->openDataFile("P:MonImage");
MonButton = new Image(buttonFile);
delete buttonFile;
}
/*****************************************************************************/
/* Draws the text for the monitor. */
/*****************************************************************************/
@ -639,7 +628,9 @@ void LabEngine::doMonitor(char *background, char *textfile, bool isinteractive,
FadePalette = hipal;
TextFont *monitorFont = _resource->getFont("P:Map.fon");
getMonImages();
Common::File *buttonFile = g_lab->_resource->openDataFile("P:MonImage");
MonButton = new Image(buttonFile);
delete buttonFile;
ntext = _resource->getText(textfile);
loadBackPict(background, false);