LAB: Get rid of stddefines

This commit is contained in:
Strangerke 2015-12-01 01:16:15 +01:00 committed by Willem Jan Palenstijn
parent 0fbf62f7f0
commit f817c1de2e
23 changed files with 44 additions and 111 deletions

View file

@ -28,7 +28,6 @@
*
*/
#include "lab/stddefines.h"
#include "lab/parsetypes.h"
namespace Lab {

View file

@ -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;
};

View file

@ -29,7 +29,6 @@
*/
#include "lab/lab.h"
#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/diff.h"
#include "lab/text.h"

View file

@ -29,7 +29,6 @@
*/
#include "lab/lab.h"
#include "lab/stddefines.h"
#include "lab/diff.h"
#include "lab/parsetypes.h"
#include "lab/labfun.h"

View file

@ -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"

View file

@ -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

View file

@ -29,7 +29,6 @@
*/
#include "lab/lab.h"
#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/resource.h"

View file

@ -29,9 +29,7 @@
*/
#include "common/str.h"
#include "lab/lab.h"
#include "lab/stddefines.h"
namespace Lab {

View file

@ -29,7 +29,6 @@
*/
#include "lab/lab.h"
#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/diff.h"
#include "lab/text.h"

View file

@ -30,7 +30,6 @@
#include "lab/lab.h"
#include "lab/mouse.h"
#include "lab/stddefines.h"
#include "lab/interface.h"
namespace Lab {

View file

@ -29,7 +29,6 @@
*/
#include "common/events.h"
#include "lab/stddefines.h"
#ifndef LAB_MOUSE_H
#define LAB_MOUSE_H

View file

@ -30,7 +30,6 @@
#include "audio/mixer.h"
#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/mouse.h"
#include "lab/music.h"

View file

@ -31,7 +31,6 @@
#ifndef LAB_PARSEFUN_H
#define LAB_PARSEFUN_H
#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/parsetypes.h"

View file

@ -31,6 +31,8 @@
#ifndef LAB_PARSETYPES_H
#define LAB_PARSETYPES_H
#include "common/system.h"
namespace Lab {
#define MAXFILELEN 31

View file

@ -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"

View file

@ -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;

View file

@ -34,7 +34,6 @@
#include "graphics/thumbnail.h"
#include "lab/lab.h"
#include "lab/stddefines.h"
#include "lab/labfun.h"
namespace Lab {

View file

@ -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"

View file

@ -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 */

View file

@ -29,7 +29,6 @@
*/
#include "lab/lab.h"
#include "lab/stddefines.h"
#include "lab/labfun.h"
#include "lab/text.h"

View file

@ -31,9 +31,6 @@
#ifndef LAB_TEXT_H
#define LAB_TEXT_H
#include "lab/stddefines.h"
namespace Lab {
#if defined(WIN32)

View file

@ -28,8 +28,8 @@
*
*/
#include "lab/stddefines.h"
#include "common/endian.h"
#include "lab/lab.h"
namespace Lab {

View file

@ -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 {
/*****************************************************************************/