[Scummvm-cvs-logs] CVS: scummvm-new/scumm/smush chunk.cpp,NONE,1.1 chunk.h,NONE,1.1 chunk_type.h,NONE,1.1 blitter.cpp,1.1,1.2 blitter.h,1.1,1.2 channel.h,1.1,1.2 codec1.cpp,1.1,1.2 codec1.h,1.1,1.2 codec37.cpp,1.1,1.2 codec37.h,1.1,1.2 codec44.cpp,1.1,1.2 codec44.h,1.1,1.2 codec47.cpp,1.1,1.2 codec47.h,1.1,1.2 color.h,1.1,1.2 decoder.h,1.1,1.2 frenderer.h,1.1,1.2 imuse_channel.cpp,1.1,1.2 player.cpp,1.1,1.2 player.h,1.1,1.2 saud_channel.cpp,1.1,1.2 scumm_renderer.h,1.1,1.2 chunck.cpp,1.1,NONE chunck.h,1.1,NONE chunck_type.h,1.1,NONE
Pawe? Ko?odziejski
aquadran at users.sourceforge.net
Sat Aug 24 10:19:05 CEST 2002
Update of /cvsroot/scummvm/scummvm-new/scumm/smush
In directory usw-pr-cvs1:/tmp/cvs-serv15335/scumm/smush
Modified Files:
blitter.cpp blitter.h channel.h codec1.cpp codec1.h
codec37.cpp codec37.h codec44.cpp codec44.h codec47.cpp
codec47.h color.h decoder.h frenderer.h imuse_channel.cpp
player.cpp player.h saud_channel.cpp scumm_renderer.h
Added Files:
chunk.cpp chunk.h chunk_type.h
Removed Files:
chunck.cpp chunck.h chunck_type.h
Log Message:
changed name from Chunck to Chunk
--- NEW FILE: chunk.cpp ---
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001/2002 The ScummVM project
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: /cvsroot/scummvm/scummvm-new/scumm/smush/chunk.cpp,v 1.1 2002/08/24 17:18:55 aquadran Exp $
*
*/
#include <stdafx.h>
#include "Chunk.h"
#include <stdio.h> // for FILE, fopen, fclose, fseek and ftell
#include <string.h> // for memcpy
/*! @brief very small and fast wrapper for a ifstream.
implements reference counting, so that ::file_Chunk does not leak memory !
*/
class FilePtr {
char * _filename;
FILE * _ifs;
int _refcount;
int _curPos;
public:
FilePtr(const char * fname) : _refcount(1), _curPos(0) {
debug(9, "FilePtr created for %s", fname);
_filename = strdup(fname);
_ifs = fopen(fname, "rb");
if(_ifs == NULL) error("FilePtr unable to read file \"%s\"", fname);
}
~FilePtr() {
debug(9, "FilePtr destroyed for %s", _filename);
free(_filename);
fclose(_ifs);
}
int tell() {
return _curPos;
}
bool seek(int pos) {
if(pos != _curPos) {
fseek(_ifs, pos, SEEK_SET);
_curPos = pos;
}
return true;
}
bool read(void * ptr, int size) {
fread(ptr, size, 1, _ifs);
_curPos += size;
return true;
}
void incRef() {
_refcount++;
}
void decRef() {
if(--_refcount == 0)
delete this;
}
};
const char * Chunk::ChunkString(Chunk::type t) {
static char data[5];
data[0] = (char)((t >> 24) & 0xFF);
data[1] = (char)((t >> 16) & 0xFF);
data[2] = (char)((t >> 8) & 0xFF);
data[3] = (char)((t >> 0) & 0xFF);
data[4] = 0;
return data;
}
FileChunk::FileChunk() : _data(0), _type(0), _size(0), _curPos(0) {
}
FileChunk::~FileChunk() {
if(_data) _data->decRef();
}
FileChunk::FileChunk(const char * fname) {
_data = new FilePtr(fname);
_data->read(&_type, 4);
_type = TO_BE_32(_type);
_data->read(&_size, 4);
_size = TO_BE_32(_size);
_offset = _data->tell();
_curPos = 0;
}
Chunk::type FileChunk::getType() const {
return _type;
}
unsigned int FileChunk::getSize() const {
return _size;
}
Chunk * FileChunk::subBlock() {
FileChunk * ptr = new FileChunk;
ptr->_data = _data;
_data->incRef();
_data->seek(_offset + _curPos);
unsigned int temp;
_data->read(&temp, 4);
ptr->_type = TO_BE_32(temp);
_data->read(&temp, 4);
ptr->_size = TO_BE_32(temp);
ptr->_offset = _offset + _curPos + 8;
ptr->_curPos = 0;
seek(8 + ptr->getSize());
return ptr;
}
bool FileChunk::eof() const {
return _curPos >= _size;
}
unsigned int FileChunk::tell() const {
return _curPos;
}
bool FileChunk::seek(int delta, seek_type dir) {
switch(dir) {
case seek_cur:
_curPos += delta;
break;
case seek_start:
if(delta < 0) error("invalid seek request");
_curPos = (unsigned int)delta;
break;
case seek_end:
if(delta > 0 || (_size + delta) < 0) error("invalid seek request");
_curPos = (unsigned int)(_size + delta);
break;
}
if(_curPos > _size) {
error("invalid seek request : %d > %d (delta == %d)", _curPos, _size, delta);
}
return true;
}
bool FileChunk::read(void * buffer, unsigned int size) {
if(size <= 0 || (_curPos + size) > _size) error("invalid buffer read request");
_data->seek(_offset + _curPos);
_data->read(buffer, size);
_curPos += size;
return true;
}
char FileChunk::getChar() {
if(_curPos >= _size) error("invalid char read request");
_data->seek(_offset + _curPos);
char buffer;
_data->read(&buffer, sizeof(buffer));
_curPos+= sizeof(buffer);
return buffer;
}
unsigned char FileChunk::getByte() {
if(_curPos >= _size) error("invalid byte read request");
_data->seek(_offset + _curPos);
unsigned char buffer;
_data->read(&buffer, sizeof(buffer));
_curPos+= sizeof(buffer);
return buffer;
}
short FileChunk::getShort() {
unsigned short buffer = getWord();
return *((short*)&buffer);
}
unsigned short FileChunk::getWord() {
if(_curPos >= _size - 1) error("invalid word read request");
_data->seek(_offset + _curPos);
unsigned short buffer;
_data->read(&buffer, sizeof(buffer));
_curPos+= sizeof(buffer);
return TO_LE_16(buffer);
}
unsigned int FileChunk::getDword() {
if(_curPos >= _size - 3) error("invalid dword read request");
_data->seek(_offset + _curPos);
unsigned int buffer;
_data->read(&buffer, sizeof(buffer));
_curPos+= sizeof(buffer);
return TO_LE_32(buffer);
}
ContChunk::ContChunk(char * data) {
if(data == 0) error("Chunk() called with NULL pointer");
_type = (Chunk::type)READ_BE_UINT32(data);
_size = READ_BE_UINT32(data+4);
_data = data + sizeof(Chunk::type) + sizeof(unsigned int);
_curPos = 0;
}
Chunk::type ContChunk::getType() const {
return _type;
}
unsigned int ContChunk::getSize() const {
return _size;
}
Chunk * ContChunk::subBlock() {
ContChunk * ptr = new ContChunk(_data + _curPos);
seek(sizeof(Chunk::type) + sizeof(unsigned int) + ptr->getSize());
return ptr;
}
bool ContChunk::eof() const {
return _curPos >= _size;
}
unsigned int ContChunk::tell() const {
return _curPos;
}
bool ContChunk::seek(int delta, seek_type dir) {
switch(dir) {
case seek_cur:
_curPos += delta;
break;
case seek_start:
if(delta < 0) error("invalid seek request");
_curPos = (unsigned int)delta;
break;
case seek_end:
if(delta > 0 || (_size + delta) < 0) error("invalid seek request");
_curPos = (unsigned int)(_size + delta);
break;
}
if(_curPos > _size) {
error("invalid seek request : %d > %d (delta == %d)", _curPos, _size, delta);
}
return true;
}
bool ContChunk::read(void * buffer, unsigned int size) {
if(size <= 0 || (_curPos + size) > _size) error("invalid buffer read request");
memcpy(buffer, _data + _curPos, size);
_curPos += size;
return true;
}
char ContChunk::getChar() {
if(_curPos >= _size) error("invalid char read request");
return _data[_curPos++];
}
unsigned char ContChunk::getByte() {
if(_curPos >= _size) error("invalid byte read request");
unsigned char * ptr = (unsigned char *)(_data + _curPos);
_curPos += 1;
return *ptr;
}
short ContChunk::getShort() {
if(_curPos >= _size - 1) error("invalid short read request");
unsigned short buffer = getWord();
return *((short*)&buffer);
}
unsigned short ContChunk::getWord() {
if(_curPos >= _size - 1) error("invalid word read request");
unsigned short * ptr = (unsigned short *)(_data + _curPos);
_curPos += 2;
return READ_LE_UINT16(ptr);
}
unsigned int ContChunk::getDword() {
if(_curPos >= _size - 3) error("invalid dword read request");
unsigned int * ptr = (unsigned int *)(_data + _curPos);
_curPos += 4;
return READ_LE_UINT32(ptr);
}
--- NEW FILE: chunk.h ---
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001/2002 The ScummVM project
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: /cvsroot/scummvm/scummvm-new/scumm/smush/chunk.h,v 1.1 2002/08/24 17:18:55 aquadran Exp $
*
*/
#ifndef __CHUNK_H_
#define __CHUNK_H_
#include "config.h"
/*! @brief Interface for Chunk handling
This class is an interface for reading from a Chunk.
\todo handle big endian system.
*/
class Chunk {
public:
enum seek_type { seek_start, seek_end, seek_cur };
virtual ~Chunk() {};
typedef unsigned int type; //!< type of a Chunk (i.e. The first 4byte field of the Chunk structure).
/*! @brief convert a type to a string
Utility function that convert a type to a string.
@param t the type to convert to a string
@return the converted string
*/
static const char * ChunkString(type t);
virtual type getType() const = 0; //!< return the type of the Chunk
virtual unsigned int getSize() const = 0; //!< return the size of the Chunk
virtual Chunk * subBlock() = 0; //!< extract a subChunk from the current read position
virtual bool eof() const = 0; //!< is the Chunk completely read ?
virtual unsigned int tell() const = 0; //!< get the Chunk current read position
virtual bool seek(int delta, seek_type dir = seek_cur) = 0; //!< move the current read position inside the Chunk
virtual bool read(void * buffer, unsigned int size) = 0; //!< read some data for the current read position
virtual char getChar() = 0; //!< extract the character at the current read position
virtual unsigned char getByte() = 0; //!< extract the byte at the current read position
virtual short getShort() = 0; //!< extract the short at the current read position
virtual unsigned short getWord() = 0; //!< extract the word at the current read position
virtual unsigned int getDword()= 0; //!< extract the dword at the current read position
};
class FilePtr;
/*! @brief file based ::Chunk
This class is an implementation of ::Chunk that handles file.
*/
class FileChunk : public Chunk {
private:
FilePtr * _data;
type _type;
unsigned int _size;
unsigned int _offset;
unsigned int _curPos;
protected:
FileChunk();
public:
FileChunk(const char * fname);
virtual ~FileChunk();
type getType() const;
unsigned int getSize() const;
Chunk * subBlock();
bool eof() const;
unsigned int tell() const;
bool seek(int delta, seek_type dir = seek_cur);
bool read(void * buffer, unsigned int size);
char getChar();
unsigned char getByte();
short getShort();
unsigned short getWord();
unsigned int getDword();
};
/*! @brief memory based ::Chunk
This class is an implementation of ::Chunk that handles a memory buffer.
*/
class ContChunk : public Chunk {
private:
char * _data;
Chunk::type _type;
unsigned int _size;
unsigned int _curPos;
public:
ContChunk(char * data);
Chunk::type getType() const;
unsigned int getSize() const;
Chunk * subBlock();
bool eof() const;
unsigned int tell() const;
bool seek(int delta, seek_type dir = seek_cur);
bool read(void * buffer, unsigned int size);
char getChar();
unsigned char getByte();
short getShort();
unsigned short getWord();
unsigned int getDword();
};
#endif
--- NEW FILE: chunk_type.h ---
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001/2002 The ScummVM project
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: /cvsroot/scummvm/scummvm-new/scumm/smush/chunk_type.h,v 1.1 2002/08/24 17:18:55 aquadran Exp $
*
*/
#ifndef __CHUNK_TYPE_H
#define __CHUNK_TYPE_H
#include "Chunk.h"
#define MAKE_TYPE(a,b,c,d) (Chunk::type)( ((a) << 24) | ((b) << 16) | ((c) << 8) | (d) )
static const Chunk::type TYPE_ANIM = MAKE_TYPE('A', 'N', 'I', 'M');
static const Chunk::type TYPE_AHDR = MAKE_TYPE('A', 'H', 'D', 'R');
static const Chunk::type TYPE_FRME = MAKE_TYPE('F', 'R', 'M', 'E');
static const Chunk::type TYPE_NPAL = MAKE_TYPE('N', 'P', 'A', 'L');
static const Chunk::type TYPE_FOBJ = MAKE_TYPE('F', 'O', 'B', 'J');
static const Chunk::type TYPE_PSAD = MAKE_TYPE('P', 'S', 'A', 'D');
static const Chunk::type TYPE_TRES = MAKE_TYPE('T', 'R', 'E', 'S');
static const Chunk::type TYPE_XPAL = MAKE_TYPE('X', 'P', 'A', 'L');
static const Chunk::type TYPE_IACT = MAKE_TYPE('I', 'A', 'C', 'T');
static const Chunk::type TYPE_STOR = MAKE_TYPE('S', 'T', 'O', 'R');
static const Chunk::type TYPE_FTCH = MAKE_TYPE('F', 'T', 'C', 'H');
static const Chunk::type TYPE_SKIP = MAKE_TYPE('S', 'K', 'I', 'P');
static const Chunk::type TYPE_STRK = MAKE_TYPE('S', 'T', 'R', 'K');
static const Chunk::type TYPE_SMRK = MAKE_TYPE('S', 'M', 'R', 'K');
static const Chunk::type TYPE_SHDR = MAKE_TYPE('S', 'H', 'D', 'R');
static const Chunk::type TYPE_SDAT = MAKE_TYPE('S', 'D', 'A', 'T');
static const Chunk::type TYPE_SAUD = MAKE_TYPE('S', 'A', 'U', 'D');
static const Chunk::type TYPE_iMUS = MAKE_TYPE('i', 'M', 'U', 'S');
static const Chunk::type TYPE_FRMT = MAKE_TYPE('F', 'R', 'M', 'T');
static const Chunk::type TYPE_TEXT = MAKE_TYPE('T', 'E', 'X', 'T');
static const Chunk::type TYPE_REGN = MAKE_TYPE('R', 'E', 'G', 'N');
static const Chunk::type TYPE_STOP = MAKE_TYPE('S', 'T', 'O', 'P');
static const Chunk::type TYPE_MAP_ = MAKE_TYPE('M', 'A', 'P', ' ');
static const Chunk::type TYPE_DATA = MAKE_TYPE('D', 'A', 'T', 'A');
static const Chunk::type TYPE_ETRS = MAKE_TYPE('E', 'T', 'R', 'S');
#undef MAKE_TYPE
#endif
Index: blitter.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/blitter.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- blitter.cpp 24 Aug 2002 15:31:37 -0000 1.1
+++ blitter.cpp 24 Aug 2002 17:18:55 -0000 1.2
@@ -21,7 +21,7 @@
#include <stdafx.h>
#include "blitter.h"
-#include "chunck.h"
+#include "chunk.h"
#include <assert.h>
#include <string.h> // for memcpy
@@ -114,7 +114,7 @@
}
}
-void Blitter::blit(Chunck & src, unsigned int len) {
+void Blitter::blit(Chunk & src, unsigned int len) {
while(len) {
if(_outside) {
#ifdef DEBUG_CLIPPER
@@ -185,7 +185,7 @@
advanceBlock();
}
-void Blitter::putBlock(Chunck & src) {
+void Blitter::putBlock(Chunk & src) {
if(_cur.getX() + 3 < _src.right() && _cur.getY() + 3 < _src.bottom()) { // This is clipping
assert((_clip.getX() & 3) == 0);
unsigned int * dst = (unsigned int *)_offset;
Index: blitter.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/blitter.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- blitter.h 24 Aug 2002 15:31:37 -0000 1.1
+++ blitter.h 24 Aug 2002 17:18:55 -0000 1.2
@@ -36,7 +36,7 @@
#include "rect.h"
-class Chunck;
+class Chunk;
/*! @brief class for handling blitting on a frame buffer
This class allows to perform secure blitting to a frame buffer in several ways.
@@ -64,13 +64,13 @@
Blitter(char * buffer, const Point & dstsize, const Rect & src);
virtual ~Blitter();
void blit(char *, unsigned int); //!< This method allows to blit directly some data from a buffer
- void blit(Chunck &, unsigned int); //!< This method allows to blit directly some data from a chunck
+ void blit(Chunk &, unsigned int); //!< This method allows to blit directly some data from a Chunk
void put(char); //!< This method allows to blit one byte
void put(char, unsigned int); //!< This method allows to blit one byte several times
void advance(int = 1, int = 0); //!< This method allows to advance the current position in the blitter
void advanceBlock(int = 1, int = 0); //!< This method allows to advance the current position in the blitter in terms of blocks
void putBlock(unsigned int); //!< This method allows to blit one block from an int value repeated 4 time
- void putBlock(Chunck &); //!< This method allows to blit one block directly read from a chunck
+ void putBlock(Chunk &); //!< This method allows to blit one block directly read from a Chunk
void putBlock(unsigned char *); //!< This method allows to blit one block directly from a buffer
void putBlock(unsigned int, unsigned int, unsigned int, unsigned int); //!< This method allows to blit one block from a 4 int value
void blockCopy(int); //!< This method allows to copy one block from another separated by the given offset
Index: channel.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/channel.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- channel.h 24 Aug 2002 15:31:37 -0000 1.1
+++ channel.h 24 Aug 2002 17:18:55 -0000 1.2
@@ -34,8 +34,8 @@
# endif
#endif
-class Chunck;
-class ContChunck;
+class Chunk;
+class ContChunk;
/*! @brief interface for a sound channel (a track)
@@ -45,7 +45,7 @@
public:
virtual ~_Channel() {};
// called by the smush_player
- virtual bool appendData(Chunck & b, int size) = 0;
+ virtual bool appendData(Chunk & b, int size) = 0;
virtual bool setParameters(int, int, int, int) = 0;
virtual bool checkParameters(int, int, int, int, int) = 0;
// called by the mixer
@@ -76,9 +76,9 @@
int _sbufferSize; //!< sound buffer size
protected:
- void handleStrk(Chunck & c);
- void handleSmrk(Chunck & c);
- void handleShdr(Chunck & c);
+ void handleStrk(Chunk & c);
+ void handleSmrk(Chunk & c);
+ void handleShdr(Chunk & c);
bool handleSubTags(int & offset);
bool processBuffer();
void recalcVolumeTable();
@@ -89,7 +89,7 @@
bool isTerminated() const;
bool setParameters(int duration, int flags, int vol1, int vol2);
bool checkParameters(int index, int duration, int flags, int vol1, int vol2);
- bool appendData(Chunck & b, int size);
+ bool appendData(Chunk & b, int size);
int availableSoundData() const;
void getSoundData(short * sound_buffer, int size);
void getSoundData(char * sound_buffer, int size) { error("16bit request for SAUD channel should never happen"); };
@@ -128,11 +128,11 @@
int decode(int size, int &ret);
void decode();
bool processBuffer();
- bool handleMap(Chunck &);
- bool handleFormat(Chunck &);
- bool handleText(Chunck &);
- bool handleRegion(Chunck &);
- bool handleStop(Chunck &);
+ bool handleMap(Chunk &);
+ bool handleFormat(Chunk &);
+ bool handleText(Chunk &);
+ bool handleRegion(Chunk &);
+ bool handleStop(Chunk &);
bool handleSubTags(int & offset);
public:
@@ -141,7 +141,7 @@
bool isTerminated() const;
bool setParameters(int nbframes, int size, int unk1, int unk2);
bool checkParameters(int index, int nbframes, int size, int unk1, int unk2);
- bool appendData(Chunck & b, int size);
+ bool appendData(Chunk & b, int size);
int availableSoundData() const;
void getSoundData(short * sound_buffer, int size);
void getSoundData(char * sound_buffer, int size);
Index: codec1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/codec1.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- codec1.cpp 24 Aug 2002 15:31:37 -0000 1.1
+++ codec1.cpp 24 Aug 2002 17:18:55 -0000 1.2
@@ -21,13 +21,13 @@
#include <stdafx.h>
#include "codec1.h"
-#include "chunck.h"
+#include "chunk.h"
#include "blitter.h"
Codec1Decoder::~Codec1Decoder() {
}
-bool Codec1Decoder::decode(Blitter & dst, Chunck & src) {
+bool Codec1Decoder::decode(Blitter & dst, Chunk & src) {
int val;
int size_line;
int code, length;
Index: codec1.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/codec1.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- codec1.h 24 Aug 2002 15:31:37 -0000 1.1
+++ codec1.h 24 Aug 2002 17:18:55 -0000 1.2
@@ -42,7 +42,7 @@
class Codec1Decoder : public Decoder {
public:
virtual ~Codec1Decoder();
- bool decode(Blitter &, Chunck &);
+ bool decode(Blitter &, Chunk &);
};
#endif
Index: codec37.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/codec37.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- codec37.cpp 24 Aug 2002 15:31:37 -0000 1.1
+++ codec37.cpp 24 Aug 2002 17:18:55 -0000 1.2
@@ -21,7 +21,7 @@
#include <stdafx.h>
#include "codec37.h"
-#include "chunck.h"
+#include "chunk.h"
#include "blitter.h"
#include <assert.h>
@@ -200,7 +200,7 @@
}
}
-void Codec37Decoder::proc1(Blitter & dst, Chunck & src, int next_offs, int bw, int bh, int size) {
+void Codec37Decoder::proc1(Blitter & dst, Chunk & src, int next_offs, int bw, int bh, int size) {
unsigned char * decoded = new unsigned char[size];
int w = 0;
while(!src.eof()) {
@@ -234,7 +234,7 @@
delete []decoded;
}
-void Codec37Decoder::proc2(Blitter & dst, Chunck & src, int size) { // This is codec1 like...
+void Codec37Decoder::proc2(Blitter & dst, Chunk & src, int size) { // This is codec1 like...
#ifdef DEBUG_CODEC37_PROC2
int decoded_size = 0;
int coded_size = 0;
@@ -258,7 +258,7 @@
} while (size);
}
-void Codec37Decoder::proc3WithFDFE(Blitter & dst, Chunck & src, int next_offs, int bw, int bh) {
+void Codec37Decoder::proc3WithFDFE(Blitter & dst, Chunk & src, int next_offs, int bw, int bh) {
do {
int i = bw;
do {
@@ -293,7 +293,7 @@
} while (--bh);
}
-void Codec37Decoder::proc3WithoutFDFE(Blitter & dst, Chunck & src, int next_offs, int bw, int bh) {
+void Codec37Decoder::proc3WithoutFDFE(Blitter & dst, Chunk & src, int next_offs, int bw, int bh) {
do {
int i = bw;
do {
@@ -316,7 +316,7 @@
} while (--bh);
}
-void Codec37Decoder::proc4(Blitter & dst, Chunck & src, int next_offs, int bw, int bh) {
+void Codec37Decoder::proc4(Blitter & dst, Chunk & src, int next_offs, int bw, int bh) {
#ifdef DEBUG_CODEC37_PROC4
int b_nb = 0;
#endif
@@ -371,7 +371,7 @@
} while (--bh);
}
-bool Codec37Decoder::decode(Blitter & dst, Chunck & src) {
+bool Codec37Decoder::decode(Blitter & dst, Chunk & src) {
int width = getRect().width();
int height = getRect().height();
int bw = (width + 3) >> 2, bh = (height + 3) >> 2;
Index: codec37.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/codec37.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- codec37.h 24 Aug 2002 15:31:37 -0000 1.1
+++ codec37.h 24 Aug 2002 17:18:55 -0000 1.2
@@ -74,13 +74,13 @@
return r | (r << 16);
}
void maketable(int, int);
- void proc1(Blitter &, Chunck &, int, int, int, int);
- void proc2(Blitter &, Chunck &, int);
- void proc3WithFDFE(Blitter &, Chunck &, int, int, int);
- void proc3WithoutFDFE(Blitter &, Chunck &, int, int, int);
- void proc4(Blitter &, Chunck &, int, int, int);
+ void proc1(Blitter &, Chunk &, int, int, int, int);
+ void proc2(Blitter &, Chunk &, int);
+ void proc3WithFDFE(Blitter &, Chunk &, int, int, int);
+ void proc3WithoutFDFE(Blitter &, Chunk &, int, int, int);
+ void proc4(Blitter &, Chunk &, int, int, int);
public:
- bool decode(Blitter &, Chunck &);
+ bool decode(Blitter &, Chunk &);
};
#endif
Index: codec44.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/codec44.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- codec44.cpp 24 Aug 2002 15:31:37 -0000 1.1
+++ codec44.cpp 24 Aug 2002 17:18:55 -0000 1.2
@@ -21,10 +21,10 @@
#include <stdafx.h>
#include "codec44.h"
-#include "chunck.h"
+#include "chunk.h"
#include "blitter.h"
-bool Codec44Decoder::decode(Blitter & dst, Chunck & src) {
+bool Codec44Decoder::decode(Blitter & dst, Chunk & src) {
int size_line;
int num;
int w, width = getRect().width() + 1;
Index: codec44.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/codec44.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- codec44.h 24 Aug 2002 15:31:37 -0000 1.1
+++ codec44.h 24 Aug 2002 17:18:55 -0000 1.2
@@ -41,7 +41,7 @@
*/
class Codec44Decoder : public Decoder {
public:
- bool decode(Blitter & dst, Chunck & src);
+ bool decode(Blitter & dst, Chunk & src);
};
#endif
Index: codec47.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/codec47.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- codec47.cpp 24 Aug 2002 15:31:37 -0000 1.1
+++ codec47.cpp 24 Aug 2002 17:18:55 -0000 1.2
@@ -21,13 +21,13 @@
#include <stdafx.h>
#include "codec47.h"
-#include "chunck.h"
+#include "chunk.h"
#include "blitter.h"
DumpDecoder::~DumpDecoder() {
}
-bool DumpDecoder::decode(Blitter & dst, Chunck & src) {
+bool DumpDecoder::decode(Blitter & dst, Chunk & src) {
int n = 0, i = 0;
int seq = src.getWord();
int codec = src.getByte();
Index: codec47.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/codec47.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- codec47.h 24 Aug 2002 15:31:37 -0000 1.1
+++ codec47.h 24 Aug 2002 17:18:55 -0000 1.2
@@ -32,7 +32,7 @@
class DumpDecoder : public Decoder {
public:
virtual ~DumpDecoder();
- bool decode(Blitter &, Chunck &);
+ bool decode(Blitter &, Chunk &);
};
#endif
Index: color.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/color.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- color.h 24 Aug 2002 15:31:37 -0000 1.1
+++ color.h 24 Aug 2002 17:18:55 -0000 1.2
@@ -19,18 +19,18 @@
*
*/
-#ifndef __COLOR_H_
-#define __COLOR_H_
+#ifndef __Chunk_H_
+#define __Chunk_H_
#include "config.h"
-/*! @brief simple class for handling a color.
+/*! @brief simple class for handling a Chunk.
- This small class is an helper for colors.
+ This small class is an helper for Chunks.
*/
class Color {
public:
- typedef unsigned char value_type; //!< The type of the color components.
+ typedef unsigned char value_type; //!< The type of the Chunk components.
private:
value_type _r; //!< The red component.
value_type _g; //!< The green component.
@@ -47,7 +47,7 @@
/*! @brief handle delta palette modification
This method is used specifically by player::handleDeltaPalette().
- It updates the color component using delta values given as short.
+ It updates the Chunk component using delta values given as short.
@param ptr pointer to a table of 3 shorts that contain delta values to use.
*/
Index: decoder.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/decoder.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- decoder.h 24 Aug 2002 15:31:37 -0000 1.1
+++ decoder.h 24 Aug 2002 17:18:55 -0000 1.2
@@ -27,7 +27,7 @@
#include "rect.h"
class Blitter;
-class Chunck;
+class Chunk;
/*! @brief base class for codec decompression.
@@ -45,7 +45,7 @@
Decoder() {};
virtual ~Decoder() {};
virtual bool initSize(const Point & p, const Rect & r) { _p = p; _r = r; return true; };
- virtual bool decode(Blitter &, Chunck &) = 0;
+ virtual bool decode(Blitter &, Chunk &) = 0;
};
#endif
Index: frenderer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/frenderer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- frenderer.h 24 Aug 2002 15:31:37 -0000 1.1
+++ frenderer.h 24 Aug 2002 17:18:55 -0000 1.2
@@ -131,7 +131,7 @@
/*! @brief draw a centered and possibly using multiple lines string.
This method performs calculation of the string size before choosing where to draw it.
- As I still not have figured out exactly what is the meaning of the fields in the TRES chunck,
+ As I still not have figured out exactly what is the meaning of the fields in the TRES Chunk,
the real meaning of the parameters can be quite difficult to understand.
@remark The current implementation is incorrect in the sense that it does not conform to the original game.
Index: imuse_channel.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/imuse_channel.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- imuse_channel.cpp 24 Aug 2002 15:31:37 -0000 1.1
+++ imuse_channel.cpp 24 Aug 2002 17:18:55 -0000 1.2
@@ -21,8 +21,8 @@
#include <stdafx.h>
#include "channel.h"
-#include "chunck.h"
-#include "chunck_type.h"
+#include "chunk.h"
+#include "chunk_type.h"
#include <assert.h>
#include <string.h> // for memcpy.h
@@ -63,12 +63,12 @@
return true;
}
-bool ImuseChannel::appendData(Chunck & b, int size) {
+bool ImuseChannel::appendData(Chunk & b, int size) {
if(_dataSize == -1) { // First call
assert(size > 8);
- Chunck::type imus_type = b.getDword(); imus_type = TO_BE_32(imus_type);
+ Chunk::type imus_type = b.getDword(); imus_type = TO_BE_32(imus_type);
unsigned int imus_size = b.getDword(); imus_size = TO_BE_32(imus_size);
- if(imus_type != TYPE_iMUS) error("Invalid CHUNCK for imuse_channel");
+ if(imus_type != TYPE_iMUS) error("Invalid Chunk for imuse_channel");
size -= 8;
_tbufferSize = size;
assert(_tbufferSize);
@@ -96,8 +96,8 @@
return processBuffer();
}
-bool ImuseChannel::handleFormat(Chunck & src) {
- if(src.getSize() != 20) error("invalid size for FRMT chunck");
+bool ImuseChannel::handleFormat(Chunk & src) {
+ if(src.getSize() != 20) error("invalid size for FRMT Chunk");
unsigned imuse_start = src.getDword();
imuse_start = TO_BE_32(imuse_start);
src.seek(4);
@@ -111,23 +111,23 @@
return true;
}
-bool ImuseChannel::handleText(Chunck & src) {
+bool ImuseChannel::handleText(Chunk & src) {
return true;
}
-bool ImuseChannel::handleRegion(Chunck & src) {
- if(src.getSize() != 8) error("invalid size for REGN chunck");
+bool ImuseChannel::handleRegion(Chunk & src) {
+ if(src.getSize() != 8) error("invalid size for REGN Chunk");
return true;
}
-bool ImuseChannel::handleStop(Chunck & src) {
- if(src.getSize() != 4) error("invalid size for STOP chunck");
+bool ImuseChannel::handleStop(Chunk & src) {
+ if(src.getSize() != 4) error("invalid size for STOP Chunk");
return true;
}
-bool ImuseChannel::handleMap(Chunck & map) {
+bool ImuseChannel::handleMap(Chunk & map) {
while(!map.eof()) {
- Chunck * sub = map.subBlock();
+ Chunk * sub = map.subBlock();
switch(sub->getType()) {
case TYPE_FRMT:
handleFormat(*sub);
@@ -142,7 +142,7 @@
handleStop(*sub);
break;
default:
- error("Unknown iMUS subchunck found : %s, %d", Chunck::ChunckString(sub->getType()), sub->getSize());
+ error("Unknown iMUS subChunk found : %s, %d", Chunk::ChunkString(sub->getType()), sub->getSize());
}
delete sub;
}
@@ -195,13 +195,13 @@
bool ImuseChannel::handleSubTags(int & offset) {
int available_size = _tbufferSize - offset;
if(available_size >= 8) {
- Chunck::type type = READ_BE_UINT32(_tbuffer + offset);
+ Chunk::type type = READ_BE_UINT32(_tbuffer + offset);
unsigned int size = READ_BE_UINT32(_tbuffer + offset + 4);
switch(type) {
case TYPE_MAP_:
_inData = false;
if(available_size >= (size + 8)) {
- ContChunck c((char*)_tbuffer + offset);
+ ContChunk c((char*)_tbuffer + offset);
handleMap(c);
}
break;
@@ -225,7 +225,7 @@
}
return false;
default:
- error("unknown chunck in iMUS track : %s ", Chunck::ChunckString(type));
+ error("unknown Chunk in iMUS track : %s ", Chunk::ChunkString(type));
}
offset += size + 8;
return true;
Index: player.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/player.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- player.cpp 24 Aug 2002 15:31:37 -0000 1.1
+++ player.cpp 24 Aug 2002 17:18:55 -0000 1.2
@@ -24,7 +24,7 @@
#include "renderer.h"
#include "channel.h"
-#include "chunck_type.h"
+#include "Chunk_type.h"
#include "rect.h"
#include "blitter.h"
@@ -209,16 +209,16 @@
if(_fr[3]) delete _fr[3];
}
-void SmushPlayer::checkBlock(const Chunck & b, Chunck::type type_expected, unsigned int min_size) {
+void SmushPlayer::checkBlock(const Chunk & b, Chunk::type type_expected, unsigned int min_size) {
if(type_expected != b.getType()) {
- error("chunck type is different from expected : %d != %d", b.getType(), type_expected);
+ error("Chunk type is different from expected : %d != %d", b.getType(), type_expected);
}
if(min_size > b.getSize()) {
- error( "chunck size is inferior than minimum required size : %d < %d", b.getSize(), min_size);
+ error( "Chunk size is inferior than minimum required size : %d < %d", b.getSize(), min_size);
}
}
-void SmushPlayer::handleSoundBuffer(int track_id, int index, int max_frames, int flags, int vol, int bal, Chunck & b, int size) {
+void SmushPlayer::handleSoundBuffer(int track_id, int index, int max_frames, int flags, int vol, int bal, Chunk & b, int size) {
debug(6, "smush_player::handleSoundBuffer(%d)", track_id);
if(!_voices && (flags & 128) == 128) return;
if(!_bgmusic && (flags & 64) == 64) return;
@@ -234,7 +234,7 @@
c->appendData(b, size);
}
-void SmushPlayer::handleSoundFrame(Chunck & b) {
+void SmushPlayer::handleSoundFrame(Chunk & b) {
checkBlock(b, TYPE_PSAD);
debug(6, "SmushPlayer::handleSoundFrame()");
if(!_outputSound) return;
@@ -253,7 +253,7 @@
handleSoundBuffer(track_id, index, max_frames, flags, vol, bal, b, size);
}
-void SmushPlayer::handleSkip(Chunck & b) {
+void SmushPlayer::handleSkip(Chunk & b) {
checkBlock(b, TYPE_SKIP, 4);
int code = b.getDword();
debug(6, "SmushPlayer::handleSkip(%d)", code);
@@ -263,17 +263,17 @@
_skipNext =true;
}
-void SmushPlayer::handleStore(Chunck & b) {
+void SmushPlayer::handleStore(Chunk & b) {
checkBlock(b, TYPE_STOR, 4);
debug(6, "SmushPlayer::handleStore()");
}
-void SmushPlayer::handleFetch(Chunck & b) {
+void SmushPlayer::handleFetch(Chunk & b) {
checkBlock(b, TYPE_FTCH, 6);
debug(6, "SmushPlayer::handleFetch()");
}
-void SmushPlayer::handleImuseBuffer(int track_id, int index, int nbframes, int size, int unk1, int unk2, Chunck & b, int bsize) {
+void SmushPlayer::handleImuseBuffer(int track_id, int index, int nbframes, int size, int unk1, int unk2, Chunk & b, int bsize) {
_Channel * c = _mixer->findChannel(track_id);
if(c == 0) {
c = new ImuseChannel(track_id, _soundFrequency);
@@ -286,7 +286,7 @@
c->appendData(b, bsize);
}
-void SmushPlayer::handleImuseAction8(Chunck & b, int flags, int unknown, int track_id) {
+void SmushPlayer::handleImuseAction8(Chunk & b, int flags, int unknown, int track_id) {
assert(flags == 46 && unknown == 0);
int unknown2 = b.getWord();
track_id |= unknown2 << 16;
@@ -297,7 +297,7 @@
handleImuseBuffer(track_id, index, nbframes, size, unknown, unknown2, b, bsize);
}
-void SmushPlayer::handleImuseAction(Chunck & b) {
+void SmushPlayer::handleImuseAction(Chunk & b) {
checkBlock(b, TYPE_IACT, 8);
debug(6, "SmushPlayer::handleImuseAction()");
if(!_outputSound) return;
@@ -320,7 +320,7 @@
}
}
-void SmushPlayer::handleTextResource(Chunck & b) {
+void SmushPlayer::handleTextResource(Chunk & b) {
checkBlock(b, TYPE_TRES, 18);
int pos_x = b.getShort();
int pos_y = b.getShort();
@@ -375,13 +375,13 @@
}
}
-void SmushPlayer::readPalette(Palette & out, Chunck & in) {
+void SmushPlayer::readPalette(Palette & out, Chunk & in) {
unsigned char buffer[768];
in.read(buffer, 768);
out = Palette(buffer);
}
-void SmushPlayer::handleDeltaPalette(Chunck & b) {
+void SmushPlayer::handleDeltaPalette(Chunk & b) {
checkBlock(b, TYPE_XPAL);
debug(6, "SmushPlayer::handleDeltaPalette()");
if(b.getSize() == 768 * 3 + 4) {
@@ -407,14 +407,14 @@
}
}
-void SmushPlayer::handleNewPalette(Chunck & b) {
+void SmushPlayer::handleNewPalette(Chunk & b) {
checkBlock(b, TYPE_NPAL, 768);
debug(6, "SmushPlayer::handleNewPalette()");
readPalette(_pal, b);
updatePalette();
}
-void SmushPlayer::decodeCodec(Chunck & b, const Rect & r, Decoder & codec) {
+void SmushPlayer::decodeCodec(Chunk & b, const Rect & r, Decoder & codec) {
assert(_curBuffer);
Blitter blit(_curBuffer, _frameSize, r);
codec.decode(blit, b);
@@ -449,7 +449,7 @@
_alreadyInit = true;
}
-void SmushPlayer::handleFrameObject(Chunck & b) {
+void SmushPlayer::handleFrameObject(Chunk & b) {
checkBlock(b, TYPE_FOBJ, 14);
if(_skipNext) {
_skipNext = false;
@@ -496,14 +496,14 @@
}
}
-void SmushPlayer::handleFrame(Chunck & b) {
+void SmushPlayer::handleFrame(Chunk & b) {
checkBlock(b, TYPE_FRME);
debug(6, "SmushPlayer::handleFrame(%d)", _frame);
_alreadyInit = false;
_skipNext = false;
while(!b.eof()) {
- Chunck * sub = b.subBlock();
+ Chunk * sub = b.subBlock();
if(sub->getSize() & 1) b.seek(1);
switch(sub->getType()) {
case TYPE_NPAL:
@@ -534,7 +534,7 @@
handleSkip(*sub);
break;
default:
- error("Unknown frame subchunck found : %s, %d", Chunck::ChunckString(sub->getType()), sub->getSize());
+ error("Unknown frame subChunk found : %s, %d", Chunk::ChunkString(sub->getType()), sub->getSize());
}
delete sub;
}
@@ -553,7 +553,7 @@
_frame++;
}
-void SmushPlayer::handleAnimHeader(Chunck & b) {
+void SmushPlayer::handleAnimHeader(Chunk & b) {
checkBlock(b, TYPE_AHDR, 774);
debug(6, "SmushPlayer::handleAnimHeader()");
_version = b.getWord();
@@ -619,7 +619,7 @@
if(is_encoded) {
static const int ETRS_HEADER_LENGTH = 16;
assert(length > ETRS_HEADER_LENGTH);
- Chunck::type type = READ_BE_UINT32(filebuffer);
+ Chunk::type type = READ_BE_UINT32(filebuffer);
if(type != TYPE_ETRS) error("invalid type for file"); // mem leak !!!
char * old = filebuffer;
filebuffer = new char[length - ETRS_HEADER_LENGTH];
@@ -730,12 +730,12 @@
}
}
}
- FileChunck base = FileChunck(file);
+ FileChunk base = FileChunk(file);
checkBlock(base, TYPE_ANIM);
while(!base.eof()) {
- Chunck * sub = base.subBlock();
+ Chunk * sub = base.subBlock();
switch(sub->getType()) {
case TYPE_AHDR:
handleAnimHeader(*sub);
@@ -744,7 +744,7 @@
handleFrame(*sub);
break;
default:
- error("Unknown chunck found : %d, %d", sub->getType(), sub->getSize());
+ error("Unknown Chunk found : %d, %d", sub->getType(), sub->getSize());
}
delete sub;
if(_renderer->prematureClose())
Index: player.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/player.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- player.h 24 Aug 2002 15:31:37 -0000 1.1
+++ player.h 24 Aug 2002 17:18:55 -0000 1.2
@@ -26,7 +26,7 @@
#include "rect.h"
#include "mixer.h"
-#include "chunck.h"
+#include "chunk.h"
#include "palette.h"
#include "codec1.h"
#include "codec37.h"
@@ -81,23 +81,23 @@
protected:
bool readString(const char * file, bool &);
void clean();
- void checkBlock(const Chunck &, Chunck::type, unsigned int = 0);
- void handleAnimHeader(Chunck &);
- void handleFrame(Chunck &);
- void handleNewPalette(Chunck &);
- void handleFrameObject(Chunck &);
- void handleSoundBuffer(int, int, int, int, int, int, Chunck &, int);
- void handleImuseBuffer(int, int, int, int, int, int, Chunck &, int);
- void handleSoundFrame(Chunck &);
- void handleSkip(Chunck &);
- void handleStore(Chunck &);
- void handleFetch(Chunck &);
- void handleImuseAction8(Chunck &, int flags, int unknown, int track_id);
- void handleImuseAction(Chunck &);
- void handleTextResource(Chunck &);
- void handleDeltaPalette(Chunck &);
- void decodeCodec(Chunck &, const Rect &, Decoder &);
- void readPalette(Palette &, Chunck &);
+ void checkBlock(const Chunk &, Chunk::type, unsigned int = 0);
+ void handleAnimHeader(Chunk &);
+ void handleFrame(Chunk &);
+ void handleNewPalette(Chunk &);
+ void handleFrameObject(Chunk &);
+ void handleSoundBuffer(int, int, int, int, int, int, Chunk &, int);
+ void handleImuseBuffer(int, int, int, int, int, int, Chunk &, int);
+ void handleSoundFrame(Chunk &);
+ void handleSkip(Chunk &);
+ void handleStore(Chunk &);
+ void handleFetch(Chunk &);
+ void handleImuseAction8(Chunk &, int flags, int unknown, int track_id);
+ void handleImuseAction(Chunk &);
+ void handleTextResource(Chunk &);
+ void handleDeltaPalette(Chunk &);
+ void decodeCodec(Chunk &, const Rect &, Decoder &);
+ void readPalette(Palette &, Chunk &);
void initSize(const Rect &, bool, bool);
};
Index: saud_channel.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/saud_channel.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- saud_channel.cpp 24 Aug 2002 15:31:37 -0000 1.1
+++ saud_channel.cpp 24 Aug 2002 17:18:55 -0000 1.2
@@ -21,8 +21,8 @@
#include <stdafx.h>
#include "channel.h"
-#include "chunck.h"
-#include "chunck_type.h"
+#include "chunk.h"
+#include "chunk_type.h"
#include <assert.h>
#include <string.h> // for memcpy.h
@@ -30,18 +30,18 @@
#define min(x, y) ((x) > (y) ? (y) : (x))
#endif
-void SaudChannel::handleStrk(Chunck & b) {
+void SaudChannel::handleStrk(Chunk & b) {
int size = b.getSize();
if(size != 14 && size != 10) {
error("STRK has a invalid size : %d", size);
}
}
-void SaudChannel::handleSmrk(Chunck & b) {
+void SaudChannel::handleSmrk(Chunk & b) {
_markReached = true;
}
-void SaudChannel::handleShdr(Chunck & b) {
+void SaudChannel::handleShdr(Chunk & b) {
int size = b.getSize();
if(size != 4) warning("SMRK has a invalid size : %d", size);
}
@@ -49,14 +49,14 @@
bool SaudChannel::handleSubTags(int & offset) {
int available_size = _tbufferSize - offset;
if(available_size >= 8) {
- Chunck::type type = READ_BE_UINT32(_tbuffer + offset);
+ Chunk::type type = READ_BE_UINT32(_tbuffer + offset);
unsigned int size = READ_BE_UINT32(_tbuffer + offset + 4);
switch(type) {
case TYPE_STRK:
_inData = false;
if(available_size >= (size + 8)) {
- ContChunck c((char*)_tbuffer + offset);
+ ContChunk c((char*)_tbuffer + offset);
handleStrk(c);
}
else
@@ -65,7 +65,7 @@
case TYPE_SMRK:
_inData = false;
if(available_size >= (size + 8)) {
- ContChunck c((char*)_tbuffer + offset);
+ ContChunk c((char*)_tbuffer + offset);
handleSmrk(c);
}
else
@@ -74,7 +74,7 @@
case TYPE_SHDR:
_inData = false;
if(available_size >= (size + 8)) {
- ContChunck c((char*)_tbuffer + offset);
+ ContChunk c((char*)_tbuffer + offset);
handleShdr(c);
}
else
@@ -86,7 +86,7 @@
offset += 8;
return false;
default:
- error("unknown chunck in SAUD track : %s ", Chunck::ChunckString(type));
+ error("unknown Chunk in SAUD track : %s ", Chunk::ChunkString(type));
}
offset += size + 8;
return true;
@@ -232,12 +232,12 @@
return true;
}
-bool SaudChannel::appendData(Chunck & b, int size) {
+bool SaudChannel::appendData(Chunk & b, int size) {
if(_dataSize == -1) { // First call
assert(size > 8);
- Chunck::type saud_type = b.getDword(); saud_type = TO_BE_32(saud_type);
+ Chunk::type saud_type = b.getDword(); saud_type = TO_BE_32(saud_type);
unsigned int saud_size = b.getDword(); saud_size = TO_BE_32(saud_size);
- if(saud_type != TYPE_SAUD) error("Invalid CHUNCK for SaudChannel : %X", saud_type);
+ if(saud_type != TYPE_SAUD) error("Invalid Chunk for SaudChannel : %X", saud_type);
size -= 8;
_dataSize = -2; // We don't get here again...
}
Index: scumm_renderer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm-new/scumm/smush/scumm_renderer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- chunck.cpp DELETED ---
--- chunck.h DELETED ---
--- chunck_type.h DELETED ---
More information about the Scummvm-git-logs
mailing list