LAB: Move getText to the Resource class

Also, make getFont() error out when it can't find a font, and get rid
of BigMsgFont
This commit is contained in:
Filippos Karapetis 2015-12-01 02:05:29 +02:00 committed by Willem Jan Palenstijn
parent 51d04a8187
commit 24684fe321
6 changed files with 80 additions and 141 deletions

View file

@ -42,10 +42,6 @@
namespace Lab {
static TextFont *BigMsgFont;
static TextFont bmf;
extern uint16 Direction;
extern CloseDataPtr CPtr;
@ -70,33 +66,6 @@ void setAmigaPal(uint16 *pal, uint16 numcolors) {
g_lab->writeColorRegsSmooth(vgapal, 0, 16);
}
void decrypt(byte *text) {
while (text && *text != '\0') {
*text++ -= (byte)95;
}
}
/*****************************************************************************/
/* Gets a chunk of text and puts it into the graphics memory. */
/*****************************************************************************/
char *getText(const char *filename) {
bool dodecrypt;
byte **tfile;
g_lab->_music->updateMusic();
dodecrypt = (isBuffered(filename) == NULL);
tfile = g_lab->_music->newOpen(filename);
if (!tfile)
return NULL;
if (dodecrypt)
decrypt(*tfile);
return (char *)*tfile;
}
/*****************************************************************************/
/* Reads in an image from disk. */
@ -193,11 +162,6 @@ static bool loadMapData() {
Gadget *gptr;
uint16 counter;
BigMsgFont = &bmf;
if (!(BigMsgFont = g_lab->_resource->getFont("P:Map.fon")))
BigMsgFont = MsgFont;
resetBuffer(); /* Make images load into start of buffer */
buffer = g_lab->_music->newOpen("P:MapImage", Size);