aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/allocroom.cpp1
-rw-r--r--engines/lab/diff.h11
-rw-r--r--engines/lab/engine.cpp1
-rw-r--r--engines/lab/graphics.cpp1
-rw-r--r--engines/lab/interface.cpp1
-rw-r--r--engines/lab/labfun.h1
-rw-r--r--engines/lab/labsets.cpp1
-rw-r--r--engines/lab/machine.cpp2
-rw-r--r--engines/lab/map.cpp1
-rw-r--r--engines/lab/mouse.cpp1
-rw-r--r--engines/lab/mouse.h1
-rw-r--r--engines/lab/music.cpp1
-rw-r--r--engines/lab/parsefun.h1
-rw-r--r--engines/lab/parsetypes.h2
-rw-r--r--engines/lab/processroom.cpp1
-rw-r--r--engines/lab/readdiff.cpp61
-rw-r--r--engines/lab/savegame.cpp1
-rw-r--r--engines/lab/special.cpp1
-rw-r--r--engines/lab/stddefines.h51
-rw-r--r--engines/lab/text.cpp1
-rw-r--r--engines/lab/text.h3
-rw-r--r--engines/lab/undiff.cpp2
-rw-r--r--engines/lab/vga.cpp8
23 files changed, 44 insertions, 111 deletions
diff --git a/engines/lab/allocroom.cpp b/engines/lab/allocroom.cpp
index b98bd24acb..e960dda3de 100644
--- a/engines/lab/allocroom.cpp
+++ b/engines/lab/allocroom.cpp
@@ -28,7 +28,6 @@
*
*/
-#include "lab/stddefines.h"
#include "lab/parsetypes.h"
namespace Lab {
diff --git a/engines/lab/diff.h b/engines/lab/diff.h
index b4436b8f3f..5ed627834b 100644
--- a/engines/lab/diff.h
+++ b/engines/lab/diff.h
@@ -31,17 +31,18 @@
#ifndef LAB_DIFF_H
#define LAB_DIFF_H
-#include "lab/stddefines.h"
#include "common/file.h"
namespace Lab {
struct DIFFHeader {
- uint16 Version, x, y;
- char depth, fps;
- uint32 BufferSize;
- uint16 Machine;
+ uint16 Version; // unused
+ uint16 x, y;
+ char depth; // unused
+ char fps;
+ uint32 BufferSize; // unused
+ uint16 Machine; // unused
uint32 Flags;
};
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index d96111f2dd..f845dfacca 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -29,7 +29,6 @@
*/
#include "lab/lab.h"
-#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/diff.h"
#include "lab/text.h"
diff --git a/engines/lab/graphics.cpp b/engines/lab/graphics.cpp
index 460d4d5864..413796d916 100644
--- a/engines/lab/graphics.cpp
+++ b/engines/lab/graphics.cpp
@@ -29,7 +29,6 @@
*/
#include "lab/lab.h"
-#include "lab/stddefines.h"
#include "lab/diff.h"
#include "lab/parsetypes.h"
#include "lab/labfun.h"
diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp
index a31e2894a8..f786bb8703 100644
--- a/engines/lab/interface.cpp
+++ b/engines/lab/interface.cpp
@@ -30,7 +30,6 @@
#include "lab/lab.h"
#include "lab/labfun.h"
-#include "lab/stddefines.h"
#include "lab/interface.h"
#include "lab/mouse.h"
#include "common/util.h"
diff --git a/engines/lab/labfun.h b/engines/lab/labfun.h
index ea2c9852ef..4f7573e0b1 100644
--- a/engines/lab/labfun.h
+++ b/engines/lab/labfun.h
@@ -32,7 +32,6 @@
#define LAB_LABFUN_H
#include "common/events.h"
-#include "lab/stddefines.h"
#include "lab/parsetypes.h"
// For the Music class - TODO: Move to another header file
diff --git a/engines/lab/labsets.cpp b/engines/lab/labsets.cpp
index ad721fa2db..2ab9abfe4a 100644
--- a/engines/lab/labsets.cpp
+++ b/engines/lab/labsets.cpp
@@ -29,7 +29,6 @@
*/
#include "lab/lab.h"
-#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/resource.h"
diff --git a/engines/lab/machine.cpp b/engines/lab/machine.cpp
index 2bef80da2d..0667772d89 100644
--- a/engines/lab/machine.cpp
+++ b/engines/lab/machine.cpp
@@ -29,9 +29,7 @@
*/
#include "common/str.h"
-
#include "lab/lab.h"
-#include "lab/stddefines.h"
namespace Lab {
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
index 02cdbfb1ac..36b01d10f7 100644
--- a/engines/lab/map.cpp
+++ b/engines/lab/map.cpp
@@ -29,7 +29,6 @@
*/
#include "lab/lab.h"
-#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/diff.h"
#include "lab/text.h"
diff --git a/engines/lab/mouse.cpp b/engines/lab/mouse.cpp
index a7e62968ec..9ff5117ff6 100644
--- a/engines/lab/mouse.cpp
+++ b/engines/lab/mouse.cpp
@@ -30,7 +30,6 @@
#include "lab/lab.h"
#include "lab/mouse.h"
-#include "lab/stddefines.h"
#include "lab/interface.h"
namespace Lab {
diff --git a/engines/lab/mouse.h b/engines/lab/mouse.h
index 6468ba91c7..4bccb17805 100644
--- a/engines/lab/mouse.h
+++ b/engines/lab/mouse.h
@@ -29,7 +29,6 @@
*/
#include "common/events.h"
-#include "lab/stddefines.h"
#ifndef LAB_MOUSE_H
#define LAB_MOUSE_H
diff --git a/engines/lab/music.cpp b/engines/lab/music.cpp
index b6587ebf1b..8d51320057 100644
--- a/engines/lab/music.cpp
+++ b/engines/lab/music.cpp
@@ -30,7 +30,6 @@
#include "audio/mixer.h"
-#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/mouse.h"
#include "lab/music.h"
diff --git a/engines/lab/parsefun.h b/engines/lab/parsefun.h
index f376a23754..5fbc62cb3a 100644
--- a/engines/lab/parsefun.h
+++ b/engines/lab/parsefun.h
@@ -31,7 +31,6 @@
#ifndef LAB_PARSEFUN_H
#define LAB_PARSEFUN_H
-#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/parsetypes.h"
diff --git a/engines/lab/parsetypes.h b/engines/lab/parsetypes.h
index 2585ae5dbd..3ca441a286 100644
--- a/engines/lab/parsetypes.h
+++ b/engines/lab/parsetypes.h
@@ -31,6 +31,8 @@
#ifndef LAB_PARSETYPES_H
#define LAB_PARSETYPES_H
+#include "common/system.h"
+
namespace Lab {
#define MAXFILELEN 31
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp
index 87a56b0be3..04fe70d3fd 100644
--- a/engines/lab/processroom.cpp
+++ b/engines/lab/processroom.cpp
@@ -31,7 +31,6 @@
#include "gui/message.h"
#include "lab/lab.h"
-#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/parsetypes.h"
#include "lab/parsefun.h"
diff --git a/engines/lab/readdiff.cpp b/engines/lab/readdiff.cpp
index 9e87ad9526..f7fb99592a 100644
--- a/engines/lab/readdiff.cpp
+++ b/engines/lab/readdiff.cpp
@@ -169,10 +169,11 @@ void LabEngine::diffNextFrame() {
}
_music->updateMusic();
- readBlock(&header, 4L, difffile);
- swapULong(&header);
- readBlock(&size, 4L, difffile);
- swapULong(&size);
+ header = READ_LE_UINT32(*difffile);
+ *difffile += 4;
+
+ size = READ_LE_UINT32(*difffile);
+ *difffile += 4;
switch (header) {
case 8L:
@@ -239,9 +240,8 @@ void LabEngine::diffNextFrame() {
(*difffile) += 4;
- readBlock(&samplespeed, 2L, difffile);
- swapUShortPtr(&samplespeed, 1);
- (*difffile) += 2;
+ samplespeed = READ_LE_UINT16(*difffile);
+ (*difffile) += 4;
byte *music = *difffile;
uint32 musicsize = size;
@@ -315,41 +315,44 @@ void playDiff() {
}
continuous = false;
- readBlock(temp, 4L, difffile);
- temp[4] = '\0';
+ uint32 signature = READ_BE_UINT32(*difffile);
+ (*difffile) += 4;
- readBlock(&header, 4L, difffile);
- swapULong(&header);
+ header = READ_LE_UINT32(*difffile);
+ (*difffile) += 4;
- if (!((strcmp((char *)temp, "DIFF") == 0) && (header == 1219009121L))) {
+ if ((signature != MKTAG('D', 'I', 'F', 'F')) || (header != 1219009121L)) {
IsPlaying = false;
return;
}
- readBlock(&header, 4L, difffile);
- swapULong(&header);
+ header = READ_LE_UINT32(*difffile);
+ (*difffile) += 4;
- readBlock(&size, 4L, difffile);
- swapULong(&size);
+ size = READ_LE_UINT32(*difffile);
+ (*difffile) += 4;
if (header == 0) {
// sizeof(headerdata) != 18, but the padding might be at the end
- readBlock(&headerdata.Version, 2, difffile);
- readBlock(&headerdata.x, 2, difffile);
- readBlock(&headerdata.y, 2, difffile);
- readBlock(&headerdata.depth, 1, difffile);
- readBlock(&headerdata.fps, 1, difffile);
- readBlock(&headerdata.BufferSize, 4, difffile);
- readBlock(&headerdata.Machine, 2, difffile);
- readBlock(&headerdata.Flags, 4, difffile);
+ headerdata.Version = READ_LE_UINT16(*difffile);
+ (*difffile) += 2;
+ headerdata.x = READ_LE_UINT16(*difffile);
+ (*difffile) += 2;
+ headerdata.y = READ_LE_UINT16(*difffile);
+ (*difffile) += 2;
+ headerdata.depth = *difffile[0];
+ (*difffile)++;
+ headerdata.fps = *difffile[0];
+ (*difffile)++;
+ headerdata.BufferSize = READ_LE_UINT32(*difffile);
+ (*difffile) += 4;
+ headerdata.Machine = READ_LE_UINT16(*difffile);
+ (*difffile) += 2;
+ headerdata.Flags = READ_LE_UINT32(*difffile);
+ (*difffile) += 4;
(*difffile) += size - 18;
- swapUShortPtr(&headerdata.Version, 3);
- swapULong(&headerdata.BufferSize);
- swapUShortPtr(&headerdata.Machine, 1);
- swapULong(&headerdata.Flags);
-
continuous = CONTINUOUS & headerdata.Flags;
diffwidth = headerdata.x;
diffheight = headerdata.y;
diff --git a/engines/lab/savegame.cpp b/engines/lab/savegame.cpp
index b01ac276c8..d54e6cb491 100644
--- a/engines/lab/savegame.cpp
+++ b/engines/lab/savegame.cpp
@@ -34,7 +34,6 @@
#include "graphics/thumbnail.h"
#include "lab/lab.h"
-#include "lab/stddefines.h"
#include "lab/labfun.h"
namespace Lab {
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 70ec15af06..59cf2d166e 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -40,7 +40,6 @@
#include "lab/diff.h"
#include "lab/text.h"
#include "lab/mouse.h"
-#include "lab/stddefines.h"
#include "lab/parsetypes.h"
#include "lab/resource.h"
diff --git a/engines/lab/stddefines.h b/engines/lab/stddefines.h
deleted file mode 100644
index 8c74d10a99..0000000000
--- a/engines/lab/stddefines.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 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.
- *
- */
-
-#include "common/system.h"
-#include "common/debug.h"
-#include "common/textconsole.h"
-
-#ifndef LAB_STDDEFINES_H
-#define LAB_STDDEFINES_H
-
-namespace Lab {
-
-#define swapUShort(value) (value)
-#define swapUShortPtr(ptr,count) (ptr)
-#define swapShort(value) (value)
-#define swapShortPtr(ptr,count) (ptr)
-#define swapUInt(value) (value)
-#define swapInt(value) (value)
-#define swapULong(value) (value)
-#define swapLong(value) (value)
-
-} // End of namespace Lab
-
-#endif /* LAB_STDDEFINES_H */
diff --git a/engines/lab/text.cpp b/engines/lab/text.cpp
index a7b41f1752..6c5ac8ca01 100644
--- a/engines/lab/text.cpp
+++ b/engines/lab/text.cpp
@@ -29,7 +29,6 @@
*/
#include "lab/lab.h"
-#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/text.h"
diff --git a/engines/lab/text.h b/engines/lab/text.h
index 8d171b2094..7401f02661 100644
--- a/engines/lab/text.h
+++ b/engines/lab/text.h
@@ -31,9 +31,6 @@
#ifndef LAB_TEXT_H
#define LAB_TEXT_H
-
-#include "lab/stddefines.h"
-
namespace Lab {
#if defined(WIN32)
diff --git a/engines/lab/undiff.cpp b/engines/lab/undiff.cpp
index 2b22496011..f7d89898a4 100644
--- a/engines/lab/undiff.cpp
+++ b/engines/lab/undiff.cpp
@@ -28,8 +28,8 @@
*
*/
-#include "lab/stddefines.h"
#include "common/endian.h"
+#include "lab/lab.h"
namespace Lab {
diff --git a/engines/lab/vga.cpp b/engines/lab/vga.cpp
index 48c82b4526..6af1fda319 100644
--- a/engines/lab/vga.cpp
+++ b/engines/lab/vga.cpp
@@ -28,14 +28,12 @@
*
*/
-#include "lab/lab.h"
-#include "lab/stddefines.h"
-#include "lab/mouse.h"
-
#include "graphics/palette.h"
-
#include "common/events.h"
+#include "lab/lab.h"
+#include "lab/mouse.h"
+
namespace Lab {
/*****************************************************************************/