aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/lab/graphics.cpp5
-rw-r--r--engines/lab/labfile.cpp31
2 files changed, 6 insertions, 30 deletions
diff --git a/engines/lab/graphics.cpp b/engines/lab/graphics.cpp
index 5fb12370a3..360ffa873a 100644
--- a/engines/lab/graphics.cpp
+++ b/engines/lab/graphics.cpp
@@ -48,7 +48,6 @@ extern char diffcmap[256 * 3], lastcmap[256 * 3];
extern bool IsBM, NoFlip, nopalchange;
extern int32 ReadSoFar;
-extern bool ReadIsDone, ReadIsError;
extern bool DoBlack, stopsound;
extern bool IsHiRes;
extern TextFont *MsgFont;
@@ -74,8 +73,6 @@ bool readPict(const char *filename, bool PlayOnce) {
stopDiff();
ReadSoFar = 0L;
- ReadIsDone = false;
- ReadIsError = false;
file = g_music->newOpen(filename);
@@ -132,8 +129,6 @@ byte *readPictToMem(const char *filename, uint16 x, uint16 y) {
stopDiff();
ReadSoFar = 0L;
- ReadIsDone = false;
- ReadIsError = false;
allocFile((void **)&Mem, (int32) x * (int32) y, "Bitmap");
CurMem = Mem;
diff --git a/engines/lab/labfile.cpp b/engines/lab/labfile.cpp
index e5ff4916df..c2acb203a5 100644
--- a/engines/lab/labfile.cpp
+++ b/engines/lab/labfile.cpp
@@ -35,7 +35,6 @@
namespace Lab {
#define MAXREADSIZE 30720L
-#define DMABUGSIZE 0 /* The number of bytes the DMA driver might screw */
/* NOTE: set to 0 for non-CDTV machines. */
@@ -46,7 +45,6 @@ byte **startoffile = &startoffilestorage;
static uint32 buffersize, realbuffersize;
int32 ReadSoFar;
-bool ReadIsError, ReadIsDone;
/*****************************************************************************/
/* Returns the size of a file. */
@@ -145,19 +143,14 @@ static void *getCurMemLabFile(uint32 size) {
/* Checks if a file is already buffered. */
/*****************************************************************************/
byte **isBuffered(const char *fileName) {
- uint16 RMarker;
-
if (fileName == NULL)
return NULL;
- RMarker = 0;
-
- while (RMarker < MAXMARKERS) {
- if (strcmp(FileMarkers[RMarker].name, fileName) == 0) {
- *startoffile = (byte *) FileMarkers[RMarker].Start;
+ for (int i = 0; i < MAXMARKERS; i++) {
+ if (strcmp(FileMarkers[i].name, fileName) == 0) {
+ *startoffile = (byte *)FileMarkers[i].Start;
return startoffile;
- } else
- RMarker++;
+ }
}
return NULL;
@@ -174,8 +167,6 @@ bool allocFile(void **Ptr, uint32 Size, const char *fileName) {
uint16 RMarker;
byte **temp;
- Size += DMABUGSIZE;
-
if (1 & Size) /* Memory is required to be even aligned */
Size++;
@@ -221,8 +212,6 @@ byte **openFile(const char *name) {
if (!file.isOpen()) {
warning("Cannot open file %s", translateFileName(name));
- ReadIsError = true;
- ReadIsDone = true;
return NULL;
}
@@ -336,14 +325,8 @@ void freeBuffer() {
/* Clears all the buffers. */
/*****************************************************************************/
static void flushBuffers() {
- uint16 RMarker;
-
- RMarker = 0;
-
- while (RMarker < MAXMARKERS) {
- freeFile(RMarker);
- RMarker++;
- }
+ for (int i = 0; i < MAXMARKERS; i++)
+ freeFile(i);
}
@@ -354,8 +337,6 @@ static void flushBuffers() {
void *stealBufMem(int32 Size) {
void *Mem;
- Size += DMABUGSIZE;
-
flushBuffers();
Mem = buffer;