[Scummvm-cvs-logs] SF.net SVN: scummvm: [29038] scummvm/trunk
sev at users.sourceforge.net
sev at users.sourceforge.net
Sun Sep 23 11:59:11 CEST 2007
Revision: 29038
http://scummvm.svn.sourceforge.net/scummvm/?rev=29038&view=rev
Author: sev
Date: 2007-09-23 02:59:10 -0700 (Sun, 23 Sep 2007)
Log Message:
-----------
Moved MemoryStreamEndian from Saga to Common.
Modified Paths:
--------------
scummvm/trunk/common/stream.h
scummvm/trunk/engines/saga/actor.h
scummvm/trunk/engines/saga/animation.h
scummvm/trunk/engines/saga/font.cpp
scummvm/trunk/engines/saga/gfx.cpp
scummvm/trunk/engines/saga/image.cpp
scummvm/trunk/engines/saga/isomap.cpp
scummvm/trunk/engines/saga/music.cpp
scummvm/trunk/engines/saga/objectmap.cpp
scummvm/trunk/engines/saga/objectmap.h
scummvm/trunk/engines/saga/palanim.cpp
scummvm/trunk/engines/saga/rscfile.cpp
scummvm/trunk/engines/saga/saga.h
scummvm/trunk/engines/saga/scene.cpp
scummvm/trunk/engines/saga/script.cpp
scummvm/trunk/engines/saga/sndres.cpp
scummvm/trunk/engines/saga/sound.cpp
scummvm/trunk/engines/saga/sound.h
scummvm/trunk/engines/saga/sprite.cpp
scummvm/trunk/engines/saga/sthread.cpp
Removed Paths:
-------------
scummvm/trunk/engines/saga/stream.h
Modified: scummvm/trunk/common/stream.h
===================================================================
--- scummvm/trunk/common/stream.h 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/common/stream.h 2007-09-23 09:59:10 UTC (rev 29038)
@@ -402,7 +402,36 @@
void seek(int32 offs, int whence = SEEK_SET);
};
+
/**
+ * This is a wrapper around MemoryReadStream, but it adds non-endian
+ * read methods whose endianness is set on the stream creation.
+ */
+class MemoryReadStreamEndian : public Common::MemoryReadStream {
+private:
+public:
+ bool _bigEndian;
+ MemoryReadStreamEndian(const byte *buf, uint32 len, bool bigEndian = false) : MemoryReadStream(buf, len), _bigEndian(bigEndian) {}
+
+ uint16 readUint16() {
+ return (_bigEndian) ? readUint16BE(): readUint16LE();
+ }
+
+ uint32 readUint32() {
+ return (_bigEndian) ? readUint32BE(): readUint32LE();
+ }
+
+ inline int16 readSint16() {
+ return (int16)readUint16();
+ }
+
+
+ inline int32 readSint32() {
+ return (int32)readUint32();
+ }
+};
+
+/**
* Simple memory based 'stream', which implements the WriteStream interface for
* a plain memory block.
*/
Modified: scummvm/trunk/engines/saga/actor.h
===================================================================
--- scummvm/trunk/engines/saga/actor.h 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/actor.h 2007-09-23 09:59:10 UTC (rev 29038)
@@ -262,7 +262,7 @@
screenPoint.x = x / ACTOR_LMULT;
screenPoint.y = y / ACTOR_LMULT - z;
}
- void fromStream(Common::MemoryReadStream &stream) {
+ void fromStream(MemoryReadStream &stream) {
x = stream.readUint16LE();
y = stream.readUint16LE();
z = stream.readUint16LE();
Modified: scummvm/trunk/engines/saga/animation.h
===================================================================
--- scummvm/trunk/engines/saga/animation.h 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/animation.h 2007-09-23 09:59:10 UTC (rev 29038)
@@ -28,8 +28,6 @@
#ifndef SAGA_ANIMATION_H
#define SAGA_ANIMATION_H
-#include "saga/stream.h"
-
namespace Saga {
#define MAX_ANIMATIONS 10
Modified: scummvm/trunk/engines/saga/font.cpp
===================================================================
--- scummvm/trunk/engines/saga/font.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/font.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -30,7 +30,6 @@
#include "saga/rscfile.h"
#include "saga/font.h"
-#include "saga/stream.h"
namespace Saga {
Modified: scummvm/trunk/engines/saga/gfx.cpp
===================================================================
--- scummvm/trunk/engines/saga/gfx.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/gfx.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -31,7 +31,6 @@
#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
#include "saga/scene.h"
-#include "saga/stream.h"
#include "common/system.h"
#include "graphics/cursorman.h"
Modified: scummvm/trunk/engines/saga/image.cpp
===================================================================
--- scummvm/trunk/engines/saga/image.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/image.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -27,8 +27,6 @@
#include "saga/saga.h"
-#include "saga/stream.h"
-
namespace Saga {
static int granulate(int value, int granularity) {
Modified: scummvm/trunk/engines/saga/isomap.cpp
===================================================================
--- scummvm/trunk/engines/saga/isomap.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/isomap.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -32,7 +32,6 @@
#include "saga/sagaresnames.h"
#include "saga/scene.h"
#include "saga/isomap.h"
-#include "saga/stream.h"
namespace Saga {
Modified: scummvm/trunk/engines/saga/music.cpp
===================================================================
--- scummvm/trunk/engines/saga/music.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/music.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -30,7 +30,7 @@
#include "saga/rscfile.h"
#include "saga/sagaresnames.h"
#include "saga/music.h"
-#include "saga/stream.h"
+
#include "sound/audiostream.h"
#include "sound/mididrv.h"
#include "sound/midiparser.h"
@@ -57,7 +57,7 @@
const int16 *_bufferEnd;
const int16 *_pos;
const GameSoundInfo *_musicInfo;
- Common::MemoryReadStream *_memoryStream;
+ MemoryReadStream *_memoryStream;
void refill();
bool eosIntern() const {
Modified: scummvm/trunk/engines/saga/objectmap.cpp
===================================================================
--- scummvm/trunk/engines/saga/objectmap.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/objectmap.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -36,7 +36,6 @@
#include "saga/font.h"
#include "saga/interface.h"
#include "saga/objectmap.h"
-#include "saga/stream.h"
#include "saga/actor.h"
#include "saga/scene.h"
#include "saga/isomap.h"
Modified: scummvm/trunk/engines/saga/objectmap.h
===================================================================
--- scummvm/trunk/engines/saga/objectmap.h 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/objectmap.h 2007-09-23 09:59:10 UTC (rev 29038)
@@ -28,8 +28,6 @@
#ifndef SAGA_OBJECTMAP_H
#define SAGA_OBJECTMAP_H
-#include "saga/stream.h"
-
namespace Saga {
Modified: scummvm/trunk/engines/saga/palanim.cpp
===================================================================
--- scummvm/trunk/engines/saga/palanim.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/palanim.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -30,7 +30,6 @@
#include "saga/events.h"
#include "saga/palanim.h"
-#include "saga/stream.h"
namespace Saga {
Modified: scummvm/trunk/engines/saga/rscfile.cpp
===================================================================
--- scummvm/trunk/engines/saga/rscfile.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/rscfile.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -34,7 +34,6 @@
#include "saga/rscfile.h"
#include "saga/scene.h"
#include "saga/sndres.h"
-#include "saga/stream.h"
#include "common/advancedDetector.h"
Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/saga.h 2007-09-23 09:59:10 UTC (rev 29038)
@@ -61,6 +61,9 @@
struct ResourceContext;
struct StringList;
+using Common::MemoryReadStream;
+using Common::MemoryReadStreamEndian;
+
//#define MIN_IMG_RLECODE 3
//#define MODEX_SCANLINE_LIMIT 200 //TODO: remove
Modified: scummvm/trunk/engines/saga/scene.cpp
===================================================================
--- scummvm/trunk/engines/saga/scene.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/scene.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -41,7 +41,6 @@
#include "saga/music.h"
#include "saga/scene.h"
-#include "saga/stream.h"
#include "saga/actor.h"
#include "saga/rscfile.h"
#include "saga/sagaresnames.h"
Modified: scummvm/trunk/engines/saga/script.cpp
===================================================================
--- scummvm/trunk/engines/saga/script.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/script.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -30,7 +30,6 @@
#include "saga/console.h"
#include "saga/script.h"
-#include "saga/stream.h"
#include "saga/interface.h"
#include "saga/itedata.h"
#include "saga/scene.h"
Modified: scummvm/trunk/engines/saga/sndres.cpp
===================================================================
--- scummvm/trunk/engines/saga/sndres.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/sndres.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -32,7 +32,6 @@
#include "saga/rscfile.h"
#include "saga/sndres.h"
#include "saga/sound.h"
-#include "saga/stream.h"
#include "common/file.h"
Modified: scummvm/trunk/engines/saga/sound.cpp
===================================================================
--- scummvm/trunk/engines/saga/sound.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/sound.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -84,7 +84,7 @@
_mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer.buffer, buffer.size, buffer.frequency, flags, -1, volume);
} else {
Audio::AudioStream *stream = NULL;
- Common::MemoryReadStream *tmp = NULL;
+ MemoryReadStream *tmp = NULL;
switch (buffer.soundType) {
#ifdef USE_MAD
Modified: scummvm/trunk/engines/saga/sound.h
===================================================================
--- scummvm/trunk/engines/saga/sound.h 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/sound.h 2007-09-23 09:59:10 UTC (rev 29038)
@@ -96,7 +96,7 @@
SagaEngine *_vm;
Audio::Mixer *_mixer;
- Common::MemoryReadStream *_voxStream;
+ MemoryReadStream *_voxStream;
SndHandle _handles[SOUND_HANDLES];
};
Modified: scummvm/trunk/engines/saga/sprite.cpp
===================================================================
--- scummvm/trunk/engines/saga/sprite.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/sprite.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -34,7 +34,6 @@
#include "saga/font.h"
#include "saga/sprite.h"
-#include "saga/stream.h"
namespace Saga {
Modified: scummvm/trunk/engines/saga/sthread.cpp
===================================================================
--- scummvm/trunk/engines/saga/sthread.cpp 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/sthread.cpp 2007-09-23 09:59:10 UTC (rev 29038)
@@ -33,7 +33,6 @@
#include "saga/script.h"
-#include "saga/stream.h"
#include "saga/scene.h"
#include "saga/sagaresnames.h"
Deleted: scummvm/trunk/engines/saga/stream.h
===================================================================
--- scummvm/trunk/engines/saga/stream.h 2007-09-23 02:15:48 UTC (rev 29037)
+++ scummvm/trunk/engines/saga/stream.h 2007-09-23 09:59:10 UTC (rev 29038)
@@ -1,60 +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.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef SAGA_STREAM_H
-#define SAGA_STREAM_H
-
-#include "common/stream.h"
-
-namespace Saga {
-
-using Common::MemoryReadStream;
-
-class MemoryReadStreamEndian : public Common::MemoryReadStream {
-private:
-public:
- bool _bigEndian;
- MemoryReadStreamEndian(const byte *buf, uint32 len, bool bigEndian = false) : MemoryReadStream(buf, len), _bigEndian(bigEndian) {}
-
- uint16 readUint16() {
- return (_bigEndian) ? readUint16BE(): readUint16LE();
- }
-
- uint32 readUint32() {
- return (_bigEndian) ? readUint32BE(): readUint32LE();
- }
-
- inline int16 readSint16() {
- return (int16)readUint16();
- }
-
-
- inline int32 readSint32() {
- return (int32)readUint32();
- }
-};
-
-} // End of namespace Saga
-#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list