aboutsummaryrefslogtreecommitdiff
path: root/engines/lab/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/lab/engine.cpp')
-rw-r--r--engines/lab/engine.cpp44
1 files changed, 11 insertions, 33 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index 37e86fba81..9af2a22fb6 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -208,8 +208,6 @@ static bool LastTooLong = false;
/* Draws the message for the room. */
/******************************************************************************/
static void drawRoomMessage(uint16 CurInv, CloseDataPtr cptr) {
- char text[250], ManyText[8], *ManyPtr;
-
if (LastTooLong) {
LastTooLong = false;
return;
@@ -220,12 +218,8 @@ static void drawRoomMessage(uint16 CurInv, CloseDataPtr cptr) {
if ((CurInv == LAMPNUM) && g_lab->_conditions->in(LAMPON)) /* LAB: Labyrith specific */
drawMessage(LAMPONMSG);
else if (Inventory[CurInv].Many > 1) {
- ManyPtr = numtostr(ManyText, Inventory[CurInv].Many);
- strcpy(text, Inventory[CurInv].name);
- strcat(text, " (");
- strcat(text, ManyPtr);
- strcat(text, ")");
- drawMessage(text);
+ Common::String roomMessage = Common::String(Inventory[CurInv].name) + " (" + Common::String::format("%d", Inventory[CurInv].Many) + ")";
+ drawMessage(roomMessage.c_str());
} else
drawMessage(Inventory[CurInv].name);
}
@@ -249,19 +243,14 @@ bool setUpScreens() {
return false;
/* Loads in the graphics for the movement control panel */
- MovePanelBufferSize = sizeOfFile("P:Control");
-
- if (MovePanelBufferSize == 0L)
- return false;
-
- if (!(MovePanelBuffer = (byte *)calloc(MovePanelBufferSize, 1)))
- return false;
-
Common::File *file = openPartial("P:Control");
-
if (!file)
return false;
+ MovePanelBufferSize = file->size();
+ if (!MovePanelBufferSize || !(MovePanelBuffer = (byte *)calloc(MovePanelBufferSize, 1)))
+ return false;
+
file->read(MovePanelBuffer, MovePanelBufferSize);
file->close();
@@ -315,19 +304,14 @@ bool setUpScreens() {
curgad->NextGadget = createButton(VGAScaleX(289), y, 9, 0, MoveImages[10], MoveImages[11]);
}
- InvPanelBufferSize = sizeOfFile("P:Inv");
-
- if (InvPanelBufferSize == 0L)
- return false;
-
- if (!(InvPanelBuffer = (byte *)calloc(InvPanelBufferSize, 1)))
- return false;
-
file = openPartial("P:Inv");
-
if (!file)
return false;
+ InvPanelBufferSize = file->size();
+ if (!InvPanelBufferSize || !(InvPanelBuffer = (byte *)calloc(InvPanelBufferSize, 1)))
+ return false;
+
file->read(InvPanelBuffer, InvPanelBufferSize);
file->close();
@@ -413,19 +397,13 @@ void eatMessages() {
do {
Msg = getMsg();
-
- if (Msg) {
+ if (Msg)
replyMsg((void *) Msg);
- }
} while (Msg);
return;
}
-
-
-
-
static uint16 lastmusicroom = 1;