2014-10-06 14:50:05 +02:00
|
|
|
/* 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 2
|
|
|
|
* 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This code is based on Labyrinth of Time code with assistance of
|
|
|
|
*
|
|
|
|
* Copyright (c) 1993 Terra Nova Development
|
|
|
|
* Copyright (c) 2004 The Wyrmkeep Entertainment Co.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-12-27 14:18:40 +01:00
|
|
|
#include "lab/lab.h"
|
2015-12-01 20:10:42 +01:00
|
|
|
#include "lab/anim.h"
|
2014-10-06 14:50:05 +02:00
|
|
|
#include "lab/parsetypes.h"
|
2015-12-01 21:42:44 +01:00
|
|
|
#include "lab/image.h"
|
2014-10-06 14:50:05 +02:00
|
|
|
#include "lab/labfun.h"
|
|
|
|
#include "lab/parsefun.h"
|
|
|
|
#include "lab/text.h"
|
2015-10-08 06:39:59 +03:00
|
|
|
#include "lab/resource.h"
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
namespace Lab {
|
|
|
|
|
2014-12-26 00:32:42 +01:00
|
|
|
BitMap bit1, bit2, *DispBitMap = &bit1, *DrawBitMap = &bit1;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 20:10:42 +01:00
|
|
|
extern bool stopsound;
|
2015-12-02 11:58:53 +01:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Scales the x co-ordinates to that of the new display. In the room parser */
|
|
|
|
/* file, co-ordinates are set up on a 360x336 display. */
|
|
|
|
/*****************************************************************************/
|
|
|
|
uint16 scaleX(uint16 x) {
|
|
|
|
if (g_lab->_isHiRes)
|
|
|
|
return (uint16)((x * 16) / 9);
|
|
|
|
else
|
|
|
|
return (uint16)((x * 8) / 9);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Scales the y co-ordinates to that of the new display. In the room parser */
|
|
|
|
/* file, co-ordinates are set up on a 368x336 display. */
|
|
|
|
/*****************************************************************************/
|
|
|
|
uint16 scaleY(uint16 y) {
|
|
|
|
if (g_lab->_isHiRes)
|
|
|
|
return (y + (y / 14));
|
|
|
|
else
|
|
|
|
return ((y * 10) / 24);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Scales the VGA cords to SVGA if necessary; otherwise, returns VGA cords. */
|
|
|
|
/*****************************************************************************/
|
|
|
|
int16 VGAScaleX(int16 x) {
|
|
|
|
if (g_lab->_isHiRes)
|
|
|
|
return (x * 2);
|
|
|
|
else
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Scales the VGA cords to SVGA if necessary; otherwise, returns VGA cords. */
|
|
|
|
/*****************************************************************************/
|
|
|
|
int16 VGAScaleY(int16 y) {
|
|
|
|
if (g_lab->_isHiRes)
|
|
|
|
return ((y * 12) / 5);
|
|
|
|
else
|
|
|
|
return y;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint16 SVGACord(uint16 cord) {
|
|
|
|
if (g_lab->_isHiRes)
|
|
|
|
return cord;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Converts SVGA cords to VGA if necessary, otherwise returns VGA cords. */
|
|
|
|
/*****************************************************************************/
|
|
|
|
int VGAUnScaleX(int x) {
|
|
|
|
if (g_lab->_isHiRes)
|
|
|
|
return (x / 2);
|
|
|
|
else
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Converts SVGA cords to VGA if necessary, otherwise returns VGA cords. */
|
|
|
|
/*****************************************************************************/
|
|
|
|
int VGAUnScaleY(int y) {
|
|
|
|
if (g_lab->_isHiRes)
|
|
|
|
return ((y * 5) / 12);
|
|
|
|
else
|
|
|
|
return y;
|
|
|
|
}
|
|
|
|
|
2014-10-06 14:50:05 +02:00
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
/*------ From readPict.c. Reads in pictures and animations from disk. ------*/
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Reads in a picture into the dest bitmap. */
|
|
|
|
/*****************************************************************************/
|
2015-12-01 10:35:31 +01:00
|
|
|
bool readPict(const char *filename, bool playOnce) {
|
2015-12-01 20:10:42 +01:00
|
|
|
g_lab->_anim->stopDiff();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
byte **file = g_lab->_music->newOpen(filename);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
if (file == NULL) {
|
|
|
|
if ((filename[0] == 'p') || (filename[0] == 'P'))
|
|
|
|
blackScreen();
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-01 15:00:26 +01:00
|
|
|
DispBitMap->_bytesPerRow = g_lab->_screenWidth;
|
|
|
|
DispBitMap->_rows = g_lab->_screenHeight;
|
|
|
|
DispBitMap->_flags = BITMAPF_VIDEO;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 20:10:42 +01:00
|
|
|
g_lab->_anim->readDiff(playOnce);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Reads in a music file. Ignores any graphics. */
|
|
|
|
/*****************************************************************************/
|
2015-07-21 22:21:38 +03:00
|
|
|
bool readMusic(const char *filename, bool waitTillFinished) {
|
2015-11-30 00:34:43 +01:00
|
|
|
Common::File *file = g_lab->_resource->openDataFile(filename, MKTAG('D', 'I', 'F', 'F'));
|
2015-11-30 01:17:05 +01:00
|
|
|
g_lab->_music->updateMusic();
|
|
|
|
if (!g_lab->_music->_doNotFilestopSoundEffect)
|
|
|
|
g_lab->_music->stopSoundEffect();
|
2015-07-21 22:21:38 +03:00
|
|
|
if (!file)
|
2014-10-06 14:50:05 +02:00
|
|
|
return false;
|
|
|
|
|
2015-12-02 00:34:51 +01:00
|
|
|
g_lab->_anim->_doBlack = false;
|
2015-12-01 20:10:42 +01:00
|
|
|
g_lab->_anim->readSound(waitTillFinished, file);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Reads in a picture into buffer memory. */
|
|
|
|
/*****************************************************************************/
|
|
|
|
byte *readPictToMem(const char *filename, uint16 x, uint16 y) {
|
2015-12-01 11:18:11 +01:00
|
|
|
byte *mem;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 20:10:42 +01:00
|
|
|
g_lab->_anim->stopDiff();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
allocFile((void **)&mem, (int32)x * (int32)y, "Bitmap");
|
|
|
|
byte *curMem = mem;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
byte **file = g_lab->_music->newOpen(filename);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
if (file == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
2015-12-01 15:00:26 +01:00
|
|
|
DispBitMap->_bytesPerRow = x;
|
|
|
|
DispBitMap->_rows = y;
|
|
|
|
DispBitMap->_flags = BITMAPF_NONE;
|
|
|
|
DispBitMap->_planes[0] = curMem;
|
|
|
|
DispBitMap->_planes[1] = DispBitMap->_planes[0] + 0x10000;
|
|
|
|
DispBitMap->_planes[2] = DispBitMap->_planes[1] + 0x10000;
|
|
|
|
DispBitMap->_planes[3] = DispBitMap->_planes[2] + 0x10000;
|
|
|
|
DispBitMap->_planes[4] = DispBitMap->_planes[3] + 0x10000;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 20:10:42 +01:00
|
|
|
g_lab->_anim->readDiff(true);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
return mem;
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
/*------------ Does all the text rendering to the message boxes. ------------*/
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
bool DoNotDrawMessage = false;
|
|
|
|
|
|
|
|
/*----- The flowText routines -----*/
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* Extracts the first word from a string. */
|
|
|
|
/******************************************************************************/
|
2015-12-01 10:35:31 +01:00
|
|
|
static void getWord(char *wordBuffer, const char *mainBuffer, uint16 *wordWidth) {
|
2014-10-06 14:50:05 +02:00
|
|
|
uint16 width = 0;
|
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
while ((mainBuffer[width] != ' ') && mainBuffer[width] &&
|
|
|
|
(mainBuffer[width] != '\n')) {
|
|
|
|
wordBuffer[width] = mainBuffer[width];
|
2014-10-06 14:50:05 +02:00
|
|
|
width++;
|
|
|
|
}
|
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
wordBuffer[width] = 0;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
*wordWidth = width;
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* Gets a line of text for flowText; makes sure that its length is less than */
|
|
|
|
/* or equal to the maximum width. */
|
|
|
|
/******************************************************************************/
|
2015-12-01 10:35:31 +01:00
|
|
|
static void getLine(TextFont *tf, char *lineBuffer, const char **mainBuffer, uint16 lineWidth) {
|
|
|
|
uint16 curWidth = 0, wordWidth;
|
|
|
|
char wordBuffer[100];
|
2014-10-06 14:50:05 +02:00
|
|
|
bool doit = true;
|
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
lineWidth += textLength(tf, " ", 1);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
lineBuffer[0] = 0;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
while ((*mainBuffer)[0] && doit) {
|
|
|
|
getWord(wordBuffer, *mainBuffer, &wordWidth);
|
|
|
|
strcat(wordBuffer, " ");
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
if ((curWidth + textLength(tf, wordBuffer, wordWidth + 1)) <= lineWidth) {
|
|
|
|
strcat(lineBuffer, wordBuffer);
|
|
|
|
(*mainBuffer) += wordWidth;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
if ((*mainBuffer)[0] == '\n')
|
2014-10-06 14:50:05 +02:00
|
|
|
doit = false;
|
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
if ((*mainBuffer)[0])
|
|
|
|
(*mainBuffer)++;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
curWidth = textLength(tf, lineBuffer, strlen(lineBuffer));
|
2014-10-06 14:50:05 +02:00
|
|
|
} else
|
|
|
|
doit = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* Dumps a chunk of text to an arbitrary box; flows it within that box and */
|
|
|
|
/* optionally centers it. Returns the number of characters that were */
|
|
|
|
/* processed. */
|
|
|
|
/* */
|
|
|
|
/* Note: Every individual word MUST be int16 enough to fit on a line, and */
|
|
|
|
/* each line less than 255 characters. */
|
|
|
|
/******************************************************************************/
|
|
|
|
uint32 flowText(void *font, /* the TextAttr pointer */
|
2015-02-17 11:17:59 +02:00
|
|
|
int16 spacing, /* How much vertical spacing between the lines */
|
2015-11-30 02:09:54 +01:00
|
|
|
byte pencolor, /* pen number to use for text */
|
|
|
|
byte backpen, /* the background color */
|
2014-10-06 14:50:05 +02:00
|
|
|
bool fillback, /* Whether to fill the background */
|
|
|
|
bool centerh, /* Whether to center the text horizontally */
|
|
|
|
bool centerv, /* Whether to center the text vertically */
|
|
|
|
bool output, /* Whether to output any text */
|
|
|
|
uint16 x1, /* Cords */
|
|
|
|
uint16 y1, uint16 x2, uint16 y2, const char *str) { /* The text itself */
|
2015-12-03 11:01:50 +01:00
|
|
|
TextFont *_msgFont = (TextFont *)font;
|
2014-10-06 14:50:05 +02:00
|
|
|
char linebuffer[256];
|
|
|
|
const char *temp;
|
|
|
|
uint16 numlines, actlines, fontheight, width;
|
|
|
|
uint16 x, y;
|
|
|
|
|
|
|
|
if (fillback) {
|
2015-11-24 23:59:30 +01:00
|
|
|
g_lab->setAPen(backpen);
|
|
|
|
g_lab->rectFill(x1, y1, x2, y2);
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (str == NULL)
|
|
|
|
return 0L;
|
|
|
|
|
2015-11-24 23:59:30 +01:00
|
|
|
g_lab->setAPen(pencolor);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-03 11:01:50 +01:00
|
|
|
fontheight = textHeight(_msgFont) + spacing;
|
2014-10-06 14:50:05 +02:00
|
|
|
numlines = (y2 - y1 + 1) / fontheight;
|
|
|
|
width = x2 - x1 + 1;
|
|
|
|
y = y1;
|
|
|
|
|
|
|
|
if (centerv && output) {
|
|
|
|
temp = str;
|
|
|
|
actlines = 0;
|
|
|
|
|
|
|
|
while (temp[0]) {
|
2015-12-03 11:01:50 +01:00
|
|
|
getLine(_msgFont, linebuffer, &temp, width);
|
2014-10-06 14:50:05 +02:00
|
|
|
actlines++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (actlines <= numlines)
|
|
|
|
y += ((y2 - y1 + 1) - (actlines * fontheight)) / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
temp = str;
|
|
|
|
|
|
|
|
while (numlines && str[0]) {
|
2015-12-03 11:01:50 +01:00
|
|
|
getLine(_msgFont, linebuffer, &str, width);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
x = x1;
|
|
|
|
|
|
|
|
if (centerh)
|
2015-12-03 11:01:50 +01:00
|
|
|
x += (width - textLength(_msgFont, linebuffer, strlen(linebuffer))) / 2;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
if (output)
|
2015-12-03 11:01:50 +01:00
|
|
|
text(_msgFont, x, y, pencolor, linebuffer, strlen(linebuffer));
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
numlines--;
|
|
|
|
y += fontheight;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (str - temp);
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* Calls flowText, but flows it to memory. Same restrictions as flowText. */
|
|
|
|
/******************************************************************************/
|
2015-12-01 10:35:31 +01:00
|
|
|
uint32 flowTextToMem(Image *destIm, void *font, /* the TextAttr pointer */
|
2015-02-17 11:17:59 +02:00
|
|
|
int16 spacing, /* How much vertical spacing between the lines */
|
2015-11-30 02:09:54 +01:00
|
|
|
byte pencolor, /* pen number to use for text */
|
|
|
|
byte backpen, /* the background color */
|
2014-10-06 14:50:05 +02:00
|
|
|
bool fillback, /* Whether to fill the background */
|
|
|
|
bool centerh, /* Whether to center the text horizontally */
|
|
|
|
bool centerv, /* Whether to center the text vertically */
|
|
|
|
bool output, /* Whether to output any text */
|
|
|
|
uint16 x1, /* Cords */
|
|
|
|
uint16 y1, uint16 x2, uint16 y2, const char *str) { /* The text itself */
|
2015-11-23 17:34:02 +01:00
|
|
|
uint32 res, vgabyte = g_lab->_screenBytesPerPage;
|
2015-12-01 10:35:31 +01:00
|
|
|
byte *tmp = g_lab->_currentDisplayBuffer;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-02 11:49:01 +01:00
|
|
|
g_lab->_currentDisplayBuffer = destIm->_imageData;
|
|
|
|
g_lab->_screenBytesPerPage = (uint32)destIm->_width * (int32)destIm->_height;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
res = flowText(font, spacing, pencolor, backpen, fillback, centerh, centerv, output, x1, y1, x2, y2, str);
|
|
|
|
|
2015-11-23 17:34:02 +01:00
|
|
|
g_lab->_screenBytesPerPage = vgabyte;
|
2015-12-01 10:35:31 +01:00
|
|
|
g_lab->_currentDisplayBuffer = tmp;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*----- The control panel stuff -----*/
|
|
|
|
|
|
|
|
void createBox(uint16 y2) {
|
2015-11-24 23:59:30 +01:00
|
|
|
g_lab->setAPen(7); /* Message box area */
|
|
|
|
g_lab->rectFill(VGAScaleX(4), VGAScaleY(154), VGAScaleX(315), VGAScaleY(y2 - 2));
|
|
|
|
|
|
|
|
g_lab->setAPen(0); /* Box around message area */
|
|
|
|
g_lab->drawHLine(VGAScaleX(2), VGAScaleY(152), VGAScaleX(317));
|
|
|
|
g_lab->drawVLine(VGAScaleX(317), VGAScaleY(152), VGAScaleY(y2));
|
|
|
|
g_lab->drawHLine(VGAScaleX(2), VGAScaleY(y2), VGAScaleX(317));
|
|
|
|
g_lab->drawVLine(VGAScaleX(2), VGAScaleY(152), VGAScaleY(y2));
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
2015-11-29 18:10:06 +01:00
|
|
|
int32 LabEngine::longDrawMessage(const char *str) {
|
2015-12-01 10:35:31 +01:00
|
|
|
char newText[512];
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
if (str == NULL)
|
2015-07-21 22:21:38 +03:00
|
|
|
return 0;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-29 18:10:06 +01:00
|
|
|
_event->attachGadgetList(NULL);
|
|
|
|
_event->mouseHide();
|
2015-12-01 10:35:31 +01:00
|
|
|
strcpy(newText, str);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-03 11:01:50 +01:00
|
|
|
if (!_longWinInFront) {
|
|
|
|
_longWinInFront = true;
|
2015-12-01 11:18:11 +01:00
|
|
|
setAPen(3); /* Clear Area */
|
|
|
|
rectFill(0, VGAScaleY(149) + SVGACord(2), VGAScaleX(319), VGAScaleY(199));
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
createBox(198);
|
2015-11-29 18:10:06 +01:00
|
|
|
_event->mouseShow();
|
2015-07-21 22:21:38 +03:00
|
|
|
|
2015-12-03 11:01:50 +01:00
|
|
|
return flowText(_msgFont, 0, 1, 7, false, true, true, true, VGAScaleX(6), VGAScaleY(155), VGAScaleX(313), VGAScaleY(195), str);
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
2015-11-29 18:10:06 +01:00
|
|
|
void LabEngine::drawStaticMessage(byte index) {
|
2015-11-30 00:34:43 +01:00
|
|
|
drawMessage(_resource->getStaticText((StaticText)index).c_str());
|
2015-10-08 06:39:59 +03:00
|
|
|
}
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* Draws a message to the message box. */
|
|
|
|
/******************************************************************************/
|
2015-11-29 18:10:06 +01:00
|
|
|
void LabEngine::drawMessage(const char *str) {
|
2014-10-06 14:50:05 +02:00
|
|
|
if (DoNotDrawMessage) {
|
|
|
|
DoNotDrawMessage = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (str) {
|
2015-12-03 11:01:50 +01:00
|
|
|
if ((textLength(_msgFont, str, strlen(str)) > VGAScaleX(306))) {
|
2014-10-06 14:50:05 +02:00
|
|
|
longDrawMessage(str);
|
2015-12-01 10:35:31 +01:00
|
|
|
_lastMessageLong = true;
|
2014-10-06 14:50:05 +02:00
|
|
|
} else {
|
2015-12-03 11:01:50 +01:00
|
|
|
if (_longWinInFront) {
|
|
|
|
_longWinInFront = false;
|
2015-12-01 11:18:11 +01:00
|
|
|
drawPanel();
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
2015-11-29 18:10:06 +01:00
|
|
|
_event->mouseHide();
|
2014-10-06 14:50:05 +02:00
|
|
|
createBox(168);
|
2015-12-03 11:01:50 +01:00
|
|
|
text(_msgFont, VGAScaleX(7), VGAScaleY(155) + SVGACord(2), 1, str, strlen(str));
|
2015-11-29 18:10:06 +01:00
|
|
|
_event->mouseShow();
|
2015-12-01 10:35:31 +01:00
|
|
|
_lastMessageLong = false;
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
/*--------------------------- All the wipe stuff. ---------------------------*/
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#define TRANSWIPE 1
|
|
|
|
#define SCROLLWIPE 2
|
|
|
|
#define SCROLLBLACK 3
|
|
|
|
#define SCROLLBOUNCE 4
|
|
|
|
#define TRANSPORTER 5
|
|
|
|
#define READFIRSTFRAME 6
|
|
|
|
#define READNEXTFRAME 7
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Scrolls the display to black. */
|
|
|
|
/*****************************************************************************/
|
2015-11-29 18:10:06 +01:00
|
|
|
void LabEngine::doScrollBlack() {
|
2014-10-06 14:50:05 +02:00
|
|
|
byte *mem, *tempmem;
|
2015-12-01 10:35:31 +01:00
|
|
|
Image im;
|
2014-10-06 14:50:05 +02:00
|
|
|
uint32 size, copysize;
|
2015-12-01 10:35:31 +01:00
|
|
|
uint32 *baseAddr;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-29 18:10:06 +01:00
|
|
|
_event->mouseHide();
|
2015-12-01 11:18:11 +01:00
|
|
|
uint16 width = VGAScaleX(320);
|
|
|
|
uint16 height = VGAScaleY(149) + SVGACord(2);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
allocFile((void **)&mem, (int32)width * (int32)height, "Temp Mem");
|
2014-12-27 01:28:50 +01:00
|
|
|
|
2015-12-02 11:49:01 +01:00
|
|
|
im._width = width;
|
|
|
|
im._height = height;
|
|
|
|
im._imageData = mem;
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2015-12-01 21:42:44 +01:00
|
|
|
im.readScreenImage(0, 0);
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
baseAddr = (uint32 *)getCurrentDrawingBuffer();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
uint16 by = VGAScaleX(4);
|
|
|
|
uint16 nheight = height;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
while (nheight) {
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-30 00:12:01 +01:00
|
|
|
if (!_isHiRes)
|
2015-12-01 11:18:11 +01:00
|
|
|
waitTOF();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
baseAddr = (uint32 *)getCurrentDrawingBuffer();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
if (by > nheight)
|
|
|
|
by = nheight;
|
|
|
|
|
|
|
|
mem += by * width;
|
|
|
|
nheight -= by;
|
2015-12-01 10:35:31 +01:00
|
|
|
size = (int32)nheight * (int32)width;
|
2014-10-06 14:50:05 +02:00
|
|
|
tempmem = mem;
|
|
|
|
|
|
|
|
while (size) {
|
2015-12-01 11:18:11 +01:00
|
|
|
if (size > _screenBytesPerPage)
|
|
|
|
copysize = _screenBytesPerPage;
|
2014-10-06 14:50:05 +02:00
|
|
|
else
|
|
|
|
copysize = size;
|
|
|
|
|
|
|
|
size -= copysize;
|
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
memcpy(baseAddr, tempmem, copysize);
|
2014-10-06 14:50:05 +02:00
|
|
|
tempmem += copysize;
|
|
|
|
}
|
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
setAPen(0);
|
|
|
|
rectFill(0, nheight, width - 1, nheight + by - 1);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
screenUpdate();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-30 00:12:01 +01:00
|
|
|
if (!_isHiRes) {
|
2014-10-06 14:50:05 +02:00
|
|
|
if (nheight <= (height / 8))
|
|
|
|
by = 1;
|
|
|
|
else if (nheight <= (height / 4))
|
|
|
|
by = 2;
|
|
|
|
else if (nheight <= (height / 2))
|
|
|
|
by = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
freeAllStolenMem();
|
2015-11-29 18:10:06 +01:00
|
|
|
_event->mouseShow();
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void copyPage(uint16 width, uint16 height, uint16 nheight, uint16 startline, byte *mem) {
|
2015-12-01 10:35:31 +01:00
|
|
|
uint32 size, offSet, copysize;
|
|
|
|
uint16 curPage;
|
|
|
|
uint32 *baseAddr;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
baseAddr = (uint32 *)g_lab->getCurrentDrawingBuffer();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
size = (int32)(height - nheight) * (int32)width;
|
2014-10-06 14:50:05 +02:00
|
|
|
mem += startline * width;
|
2015-12-01 10:35:31 +01:00
|
|
|
curPage = ((int32)nheight * (int32)width) / g_lab->_screenBytesPerPage;
|
|
|
|
offSet = ((int32)nheight * (int32)width) - (curPage * g_lab->_screenBytesPerPage);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
while (size) {
|
2015-12-01 10:35:31 +01:00
|
|
|
if (size > (g_lab->_screenBytesPerPage - offSet))
|
|
|
|
copysize = g_lab->_screenBytesPerPage - offSet;
|
2014-10-06 14:50:05 +02:00
|
|
|
else
|
|
|
|
copysize = size;
|
|
|
|
|
|
|
|
size -= copysize;
|
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
memcpy(baseAddr + (offSet >> 2), mem, copysize);
|
2014-10-06 14:50:05 +02:00
|
|
|
mem += copysize;
|
2015-12-01 10:35:31 +01:00
|
|
|
curPage++;
|
|
|
|
offSet = 0;
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Scrolls the display to a new picture from a black screen. */
|
|
|
|
/*****************************************************************************/
|
2015-11-29 18:10:06 +01:00
|
|
|
void LabEngine::doScrollWipe(char *filename) {
|
2015-12-01 11:18:11 +01:00
|
|
|
uint16 startline = 0, onrow = 0;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-29 18:10:06 +01:00
|
|
|
_event->mouseHide();
|
2015-12-01 11:18:11 +01:00
|
|
|
uint16 width = VGAScaleX(320);
|
|
|
|
uint16 height = VGAScaleY(149) + SVGACord(2);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-30 01:17:05 +01:00
|
|
|
while (_music->isSoundEffectActive()) {
|
|
|
|
_music->updateMusic();
|
2015-12-01 11:18:11 +01:00
|
|
|
waitTOF();
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
2015-12-02 00:34:51 +01:00
|
|
|
_anim->_isBM = true;
|
2014-10-06 14:50:05 +02:00
|
|
|
readPict(filename, true);
|
2015-12-02 00:34:51 +01:00
|
|
|
setPalette(_anim->_diffPalette, 256);
|
|
|
|
_anim->_isBM = false;
|
|
|
|
byte *mem = _anim->_rawDiffBM._planes[0];
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2015-12-01 11:18:11 +01:00
|
|
|
uint16 by = VGAScaleX(3);
|
|
|
|
uint16 nheight = height;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-02 00:34:51 +01:00
|
|
|
while (onrow < _anim->_headerdata._height) {
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
if ((by > nheight) && nheight)
|
|
|
|
by = nheight;
|
|
|
|
|
2015-12-02 00:34:51 +01:00
|
|
|
if ((startline + by) > (_anim->_headerdata._height - height - 1))
|
2014-10-06 14:50:05 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
if (nheight)
|
|
|
|
nheight -= by;
|
|
|
|
|
|
|
|
copyPage(width, height, nheight, startline, mem);
|
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
screenUpdate();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
if (!nheight)
|
|
|
|
startline += by;
|
|
|
|
|
|
|
|
onrow += by;
|
|
|
|
|
|
|
|
if (nheight <= (height / 4))
|
|
|
|
by = VGAScaleX(5);
|
|
|
|
else if (nheight <= (height / 3))
|
|
|
|
by = VGAScaleX(4);
|
|
|
|
else if (nheight <= (height / 2))
|
|
|
|
by = VGAScaleX(3);
|
|
|
|
}
|
|
|
|
|
2015-11-29 18:10:06 +01:00
|
|
|
_event->mouseShow();
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Does the scroll bounce. Assumes bitmap already in memory. */
|
|
|
|
/*****************************************************************************/
|
2015-11-29 18:10:06 +01:00
|
|
|
void LabEngine::doScrollBounce() {
|
2014-12-27 14:18:40 +01:00
|
|
|
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};
|
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
if (getPlatform() != Common::kPlatformWindows) {
|
2014-12-27 14:18:40 +01:00
|
|
|
newby = newbyd;
|
|
|
|
newby1 = newby1d;
|
|
|
|
} else {
|
|
|
|
newby = newbyw;
|
|
|
|
newby1 = newby1w;
|
|
|
|
}
|
|
|
|
|
2015-11-29 18:10:06 +01:00
|
|
|
_event->mouseHide();
|
2014-12-27 14:18:40 +01:00
|
|
|
int width = VGAScaleX(320);
|
|
|
|
int height = VGAScaleY(149) + SVGACord(2);
|
2015-12-02 00:34:51 +01:00
|
|
|
byte *mem = _anim->_rawDiffBM._planes[0];
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2015-12-02 00:34:51 +01:00
|
|
|
int startline = _anim->_headerdata._height - height - 1;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-27 23:18:15 +01:00
|
|
|
for (int i = 0; i < 5; i++) {
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2015-11-27 23:18:15 +01:00
|
|
|
startline -= newby[i];
|
2014-10-06 14:50:05 +02:00
|
|
|
copyPage(width, height, 0, startline, mem);
|
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
screenUpdate();
|
|
|
|
waitTOF();
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
2015-11-27 23:18:15 +01:00
|
|
|
for (int i = 8; i > 0; i--) {
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2015-11-27 23:18:15 +01:00
|
|
|
startline += newby1[i - 1];
|
2014-10-06 14:50:05 +02:00
|
|
|
copyPage(width, height, 0, startline, mem);
|
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
screenUpdate();
|
|
|
|
waitTOF();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-11-29 18:10:06 +01:00
|
|
|
_event->mouseShow();
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Does the transporter wipe. */
|
|
|
|
/*****************************************************************************/
|
2015-12-01 10:35:31 +01:00
|
|
|
void LabEngine::doTransWipe(CloseDataPtr *cPtr, char *filename) {
|
|
|
|
uint16 lastY, curY, linesdone = 0, lineslast;
|
|
|
|
Image imSource, imDest;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-30 00:12:01 +01:00
|
|
|
if (_isHiRes) {
|
2014-10-06 14:50:05 +02:00
|
|
|
lineslast = 3;
|
2015-12-01 10:35:31 +01:00
|
|
|
lastY = 358;
|
2014-10-06 14:50:05 +02:00
|
|
|
} else {
|
|
|
|
lineslast = 1;
|
2015-12-01 10:35:31 +01:00
|
|
|
lastY = 148;
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
2015-11-27 23:18:15 +01:00
|
|
|
for (uint16 i = 0; i < 2; i++) {
|
2015-12-01 10:35:31 +01:00
|
|
|
curY = i * 2;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
while (curY < lastY) {
|
2014-10-06 14:50:05 +02:00
|
|
|
if (linesdone >= lineslast) {
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2015-12-01 11:18:11 +01:00
|
|
|
waitTOF();
|
2014-10-06 14:50:05 +02:00
|
|
|
linesdone = 0;
|
|
|
|
}
|
|
|
|
|
2015-12-03 14:22:04 +02:00
|
|
|
overlayRect(0, 0, curY, _screenWidth - 1, curY + 1);
|
2015-12-01 10:35:31 +01:00
|
|
|
curY += 4;
|
2014-10-06 14:50:05 +02:00
|
|
|
linesdone++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
setAPen(0);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-27 23:18:15 +01:00
|
|
|
for (uint16 i = 0; i < 2; i++) {
|
2015-12-01 10:35:31 +01:00
|
|
|
curY = i * 2;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
while (curY <= lastY) {
|
2014-10-06 14:50:05 +02:00
|
|
|
if (linesdone >= lineslast) {
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2015-12-01 11:18:11 +01:00
|
|
|
waitTOF();
|
2014-10-06 14:50:05 +02:00
|
|
|
linesdone = 0;
|
|
|
|
}
|
|
|
|
|
2015-12-01 11:18:11 +01:00
|
|
|
rectFill(0, curY, _screenWidth - 1, curY + 1);
|
2015-12-01 10:35:31 +01:00
|
|
|
curY += 4;
|
2014-10-06 14:50:05 +02:00
|
|
|
linesdone++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (filename == NULL)
|
2015-12-03 01:06:04 +01:00
|
|
|
g_lab->_curFileName = getPictName(cPtr);
|
2014-10-06 14:50:05 +02:00
|
|
|
else if (filename[0] > ' ')
|
2015-12-03 01:06:04 +01:00
|
|
|
g_lab->_curFileName = filename;
|
2014-10-06 14:50:05 +02:00
|
|
|
else
|
2015-12-03 01:06:04 +01:00
|
|
|
g_lab->_curFileName = getPictName(cPtr);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-03 01:06:04 +01:00
|
|
|
byte *BitMapMem = readPictToMem(g_lab->_curFileName, _screenWidth, lastY + 5);
|
2015-12-02 00:34:51 +01:00
|
|
|
setPalette(_anim->_diffPalette, 256);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
if (BitMapMem) {
|
2015-12-02 11:49:01 +01:00
|
|
|
imSource._width = _screenWidth;
|
|
|
|
imSource._height = lastY;
|
|
|
|
imSource._imageData = BitMapMem;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-02 11:49:01 +01:00
|
|
|
imDest._width = _screenWidth;
|
|
|
|
imDest._height = _screenHeight;
|
|
|
|
imDest._imageData = getCurrentDrawingBuffer();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-11-27 23:18:15 +01:00
|
|
|
for (uint16 i = 0; i < 2; i++) {
|
2015-12-01 10:35:31 +01:00
|
|
|
curY = i * 2;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
while (curY < lastY) {
|
2014-10-06 14:50:05 +02:00
|
|
|
if (linesdone >= lineslast) {
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2015-12-01 11:18:11 +01:00
|
|
|
waitTOF();
|
2014-10-06 14:50:05 +02:00
|
|
|
linesdone = 0;
|
|
|
|
}
|
|
|
|
|
2015-12-02 11:49:01 +01:00
|
|
|
imDest._imageData = getCurrentDrawingBuffer();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-02 11:54:42 +01:00
|
|
|
imSource.bltBitMap(0, curY, &imDest, 0, curY, _screenWidth, 2);
|
2015-12-03 14:22:04 +02:00
|
|
|
overlayRect(0, 0, curY, _screenWidth - 1, curY + 1);
|
2015-12-01 10:35:31 +01:00
|
|
|
curY += 4;
|
2014-10-06 14:50:05 +02:00
|
|
|
linesdone++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-27 23:18:15 +01:00
|
|
|
for (uint16 i = 0; i < 2; i++) {
|
2015-12-01 10:35:31 +01:00
|
|
|
curY = i * 2;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
while (curY <= lastY) {
|
2014-10-06 14:50:05 +02:00
|
|
|
if (linesdone >= lineslast) {
|
2015-11-30 01:17:05 +01:00
|
|
|
_music->updateMusic();
|
2015-12-01 11:18:11 +01:00
|
|
|
waitTOF();
|
2014-10-06 14:50:05 +02:00
|
|
|
linesdone = 0;
|
|
|
|
}
|
|
|
|
|
2015-12-02 11:49:01 +01:00
|
|
|
imDest._imageData = getCurrentDrawingBuffer();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
if (curY == lastY)
|
2015-12-02 11:54:42 +01:00
|
|
|
imSource.bltBitMap(0, curY, &imDest, 0, curY, _screenWidth, 1);
|
2014-10-06 14:50:05 +02:00
|
|
|
else
|
2015-12-02 11:54:42 +01:00
|
|
|
imSource.bltBitMap(0, curY, &imDest, 0, curY, _screenWidth, 2);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-01 10:35:31 +01:00
|
|
|
curY += 4;
|
2014-10-06 14:50:05 +02:00
|
|
|
linesdone++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Does a certain number of pre-programmed wipes. */
|
|
|
|
/*****************************************************************************/
|
2015-12-01 10:35:31 +01:00
|
|
|
void LabEngine::doWipe(uint16 wipeType, CloseDataPtr *cPtr, char *filename) {
|
|
|
|
if ((wipeType == TRANSWIPE) || (wipeType == TRANSPORTER))
|
|
|
|
doTransWipe(cPtr, filename);
|
|
|
|
else if (wipeType == SCROLLWIPE)
|
2014-10-06 14:50:05 +02:00
|
|
|
doScrollWipe(filename);
|
2015-12-01 10:35:31 +01:00
|
|
|
else if (wipeType == SCROLLBLACK)
|
2014-10-06 14:50:05 +02:00
|
|
|
doScrollBlack();
|
2015-12-01 10:35:31 +01:00
|
|
|
else if (wipeType == SCROLLBOUNCE)
|
2014-10-06 14:50:05 +02:00
|
|
|
doScrollBounce();
|
2015-12-01 10:35:31 +01:00
|
|
|
else if (wipeType == READFIRSTFRAME)
|
2014-10-06 14:50:05 +02:00
|
|
|
readPict(filename, false);
|
2015-12-01 10:35:31 +01:00
|
|
|
else if (wipeType == READNEXTFRAME)
|
2015-12-01 20:10:42 +01:00
|
|
|
_anim->diffNextFrame();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Changes the front screen to black. */
|
|
|
|
/*****************************************************************************/
|
|
|
|
void blackScreen() {
|
2015-12-03 14:22:04 +02:00
|
|
|
byte pal[256 * 3];
|
|
|
|
memset(pal, 0, 248 * 3);
|
|
|
|
g_lab->writeColorRegs(pal, 8, 248);
|
2015-12-01 20:10:42 +01:00
|
|
|
|
|
|
|
g_system->delayMillis(32);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Changes the front screen to white. */
|
|
|
|
/*****************************************************************************/
|
|
|
|
void whiteScreen() {
|
2015-12-03 14:22:04 +02:00
|
|
|
byte pal[256 * 3];
|
|
|
|
memset(pal, 255, 248 * 3);
|
|
|
|
g_lab->writeColorRegs(pal, 8, 248);
|
2015-12-01 20:10:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Changes the entire screen to black. */
|
|
|
|
/*****************************************************************************/
|
|
|
|
void blackAllScreen() {
|
2015-12-03 14:22:04 +02:00
|
|
|
byte pal[256 * 3];
|
|
|
|
memset(pal, 0, 256 * 3);
|
|
|
|
g_lab->writeColorRegs(pal, 0, 256);
|
2015-12-01 20:10:42 +01:00
|
|
|
|
|
|
|
g_system->delayMillis(32);
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace Lab
|