[Scummvm-git-logs] scummvm master -> 101b497274f0538a5e7fb683cff6009e449c711a

a-yyg 76591232+a-yyg at users.noreply.github.com
Fri Jul 2 19:22:13 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
101b497274 SAGA2: Clean up audio interface


Commit: 101b497274f0538a5e7fb683cff6009e449c711a
    https://github.com/scummvm/scummvm/commit/101b497274f0538a5e7fb683cff6009e449c711a
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-03T04:21:40+09:00

Commit Message:
SAGA2: Clean up audio interface

Changed paths:
  R engines/saga2/queues.h
    engines/saga2/audio.cpp
    engines/saga2/audio.h
    engines/saga2/noise.cpp


diff --git a/engines/saga2/audio.cpp b/engines/saga2/audio.cpp
index a0e339d932..6463f4d32b 100644
--- a/engines/saga2/audio.cpp
+++ b/engines/saga2/audio.cpp
@@ -70,7 +70,7 @@ audioInterface::~audioInterface() {
 	warning("STUB: audioInteraface::~audioInterface()");
 }
 
-void audioInterface::initAudioInterface(audioInterfaceSettings &ais) {
+void audioInterface::initAudioInterface() {
 	warning("STUB: audioInterface::initAudioInterface()");
 }
 
@@ -113,11 +113,6 @@ void audioInterface::stopMusic(void) {
 	warning("STUB: audioInterface::stopMusic()");
 }
 
-bool audioInterface::goodMIDICard(void) {
-	warning("STUB: audioInterface::goodMIDICard()");
-	return false;
-}
-
 void audioInterface::queueSound(soundSegment s, int16 loopFactor, sampleLocation where) {
 	warning("STUB: audioInterface::queueSound(%d,  @%d,%d)", s, where.x, where.y);
 	SoundInstance si;
diff --git a/engines/saga2/audio.h b/engines/saga2/audio.h
index 20c9b59cd3..04f6b9a428 100644
--- a/engines/saga2/audio.h
+++ b/engines/saga2/audio.h
@@ -28,14 +28,9 @@
 #define SAGA2_AUDIO_H
 
 #include "audio/mixer.h"
-#include "saga2/queues.h"
 
 namespace Saga2 {
 
-/* ===================================================================== *
-   the library(s) must be recompiled if you change these settings
- * ===================================================================== */
-
 #define QUEUES_EXTERNAL_ALLOCATION 1
 
 // TODO: FIXME. STUB
@@ -50,136 +45,12 @@ inline void audioFatal(char *msg) {
 typedef int8 Volume;
 typedef Point32 sampleLocation;
 
-enum soundSampleRate {
-	soundRate11K = 11025,
-	soundRate22K = 22050,
-	soundRate44K = 44100
-};
-
-class soundSample { //: private DList
-public:
-	// sampleFlags
-	enum soundSampleStatus {
-		sampleNone,
-		sampleMore,
-		sampleStop,
-		samplePart,
-		sampleDone,
-		sampleKill
-	};
-
-	enum soundSampleChannels {
-		channelMono,
-		channelStereo,
-		channelLeftOnly,
-		channelRightOnly
-	};
-
-	enum soundSampleGranularity {
-		granularity8Bit,
-		granularity16Bit
-	};
-
-
-	// sampleFlags
-	enum soundSampleFlags {
-		sampleLooped = 0x0001,
-		sampleSigned = 0x0002,
-		sampleRvrsed = 0x0004
-	};
-private:
-	bool                    initialized;
-	soundSampleChannels     defaultChannels;
-	soundSampleRate         defaultSpeed;
-	soundSampleGranularity  defaultDataSize;
-protected:
-	Volume                  volume;
-
-public:
-	soundSampleChannels     channels;
-	soundSampleRate         speed;
-	soundSampleGranularity  dataSize;
-	uint32                  sampleFlags;
-	uint32                  loopCount;
-	soundSampleStatus       status;
-	soundSegment            curSeg;
-	soundSegment            headSeg;
-	void                    *sourceBuffer;
-	PublicQueue<uint32>     segmentList;
-
-	soundSample(soundSegment sa[]);  //, sampleLocation pos=Point32( 0, 0 ));
-	soundSample(soundSegment seg);  //, sampleLocation pos=Point32( 0, 0 ));
-	virtual ~soundSample();
-
-	soundSample &operator=(const soundSample &src);
-	soundSample(const soundSample &src);
-	bool operator==(const soundSample &src2) const;
-
-	virtual Volume getVolume(void);
-	virtual void setVolume(Volume v);
-
-	virtual void moveTo(Point32) {}
-
-	int init(void) {
-		defaultChannels = channelMono;
-		defaultSpeed = soundRate22K;
-		defaultDataSize = granularity16Bit;
-		initialized = true;
-		return 0;
-	}
-
-	void setDefaultProfile(soundSampleChannels  c, soundSampleRate r, soundSampleGranularity  g) {
-		if (initialized != true) init();
-		defaultChannels = c;
-		defaultSpeed = r;
-		defaultDataSize = g;
-	}
-
-	soundSampleChannels     getDefaultChannels(void) {
-		return defaultChannels;
-	}
-	soundSampleRate         getDefaultSpeed(void)    {
-		return defaultSpeed;
-	}
-	soundSampleGranularity  getDefaultDataSize(void) {
-		return defaultDataSize;
-	}
-
-	uint32 format(void);
-	uint32 flags(void);
-};
-
 typedef Volume(*audioAttenuationFunction)(sampleLocation loc, Volume maxVol);
 #define ATTENUATOR( name ) Volume name( sampleLocation loc, Volume maxVol )
 
-class positionedSample : public soundSample {
-	sampleLocation          Pos;
-public:
-	positionedSample(soundSegment sa[], sampleLocation pos = Point32(0, 0));
-	positionedSample(soundSegment seg, sampleLocation pos = Point32(0, 0));
-	virtual Volume getVolume(void);
-	void moveTo(Point32 newLoc) {
-		Pos = newLoc;
-	}
-	virtual void setVolume(Volume v);
-
-};
-
-
-/*******************************************************************/
-/* DRIVERS subdirectory                                            */
-
 #define DRIVER_PATH "DRIVERS"
 #define UNDRIVER_PATH ".."
 
-/*******************************************************************/
-/* typedefs                                                        */
-
-typedef positionedSample *pSAMPLE;
-
-/*******************************************************************/
-/* Volume controls                                                 */
-
 #define Here Point32(0,0)
 
 typedef int8 Volume;
@@ -209,44 +80,6 @@ enum volumeMode {
 	volumeUpDown       // relative mode
 };
 
-/*******************************************************************/
-/* Audio Fade                                                      */
-
-struct audioFade {
-	int16       fadeOutTime,
-	            fadeInTime,            // Actually it starts fading in immediately
-	            overlapTime;
-};
-
-
-/*******************************************************************/
-/* Audio Interface Settings                                        */
-
-struct audioInterfaceSettings {
-	int16   soundBuffers;              // Buffers aside from Music, Voice & loop buffers
-	uint32  voiceBufferSize;           // Size of voice buffer
-	uint32  musicBufferSize;           // Size of music buffers
-	uint32  soundBufferSize;           // Size of sound effects buffers
-	uint32  loopBufferSize;            // Size of looped effect buffer
-
-	audioInterfaceSettings(int16 sb, uint32 vbs, uint32 mbs, uint32 sbs, uint32 lbs) {
-		soundBuffers = sb;
-		voiceBufferSize = vbs;
-		musicBufferSize = mbs;
-		soundBufferSize = sbs;
-		loopBufferSize = lbs;
-	}
-
-private:
-	audioInterfaceSettings();
-};
-
-
-/*******************************************************************/
-/*                                                                 */
-/* Audio Interface Class                                           */
-/*                                                                 */
-/*******************************************************************/
 struct SoundInstance {
 	soundSegment seg;
 	bool loop;
@@ -254,90 +87,14 @@ struct SoundInstance {
 };
 
 class audioInterface {
-public:
-	enum BufferRequest {
-		requestRecycled = -2L,
-		requestFailed   = -1L,
-		requestVoice    = 0L,
-		requestMusic0   = 1L,
-		requestMusic1   = 2L,
-		requestLoop     = 3L,
-		requestSound0   = 4L,
-		requestSound1   = 5L,
-		requestSound2   = 6L,
-		maxBuffers      = 7L,
-		requestMusic    = 8L,
-		requestSound    = 9L
-	};
-
 private:
-	enum sampleFlags {
-		sampleClear   = 0L,
-		sampleMoving  = 1L << 0,
-		sampleQueued  = 1L << 1
-	};
-
-	enum sampleStopLevel {
-		sStopCleanup  = 0L,
-		sStopSegment  = 1L,
-		sStopSample   = 2L,
-		sStopQueue    = 3L
-	};
-
-	enum queueFlags {
-		qrQueueEmpty  = 0L,
-		qrBufNotAlloc = 1L,
-		qrSegNotOpen  = 2L,
-		qrBufNotReady = 3L,
-		qrWaiting     = 4L,
-		qrPlayDone    = 5L,
-		qrFinishing   = 6L,
-		qrFinished    = 7L,
-		qrCleanup     = 8L
-	};
-
-	int16                   instance;
 	int16                   initialized;
 
 	HTIMER                  gameTimer;
 
-	queueFlags              queueRes;
-
-	BufferRequest           numBuffers;
-
-	int16                   flags[maxBuffers];
-	int16                   state[maxBuffers];
-	pSAMPLE                 samples[maxBuffers];
-	soundSegment            lastID[maxBuffers];           // ID of music currently playing
-
-	BufferRequest           voiceBuffer;          // buffer to feed voice into
-	BufferRequest           activeLoop;       // currently playing loop
-	BufferRequest           activeMusic;
-
-	BufferRequest           nextMBuf;
 	soundSegment            playing;           // ID of music currently playing
 	soundSegment            looping;           // ID of music currently playing
 
-
-	audioFade               fader;
-
-
-	Volume                  SoundVolume,       // Sound Master Volume
-	                        MusicVolume,       // Music Master Volume
-	                        mVolume,           // music volume
-	                        sVolume,           // sound volume
-	                        vVolume,           // voice volume
-	                        lVolume;           // loops volume
-
-	int16                   sEnabled,          // sound enabled
-	                        vEnabled,          // voice enabled
-	                        mEnabled,          // music enabled
-	                        lEnabled;          // loops enabled
-	bool                    suspended;
-
-	int32                   mQuality;          // MIDI driver quality
-	int32                   suspendCalls;
-
 public:
 	Audio::SoundHandle _speechSoundHandle;
 	Audio::SoundHandle _sfxSoundHandle;
@@ -345,14 +102,10 @@ public:
 	Common::Queue<SoundInstance> _speechQueue;
 	Common::Queue<SoundInstance> _sfxQueue;
 	Common::Queue<SoundInstance> _bgmQueue;
-	HDIGDRIVER              dig;               // AIL sample driver
-	HMDIDRIVER              mid;               // AIL MIDI driver
 	audioAttenuationFunction attenuator;
 
-
 private:
 	char                    status[256];       // audio status messages
-	int16                   verbosity;
 
 public:
 	// ctor, dtor, initialization
@@ -360,11 +113,10 @@ public:
 	~audioInterface();
 
 	// init, cleanup
-	void initAudioInterface(audioInterfaceSettings &ais);
+	void initAudioInterface();
 	void cleanupAudioInterface(void);
 
 	// timer calls
-	void adjustGameSpeed(int32 multiplyBy, int32 thenDivideBy);
 	void suspendGameClock(void);
 	void resumeGameClock(void);
 
@@ -378,15 +130,12 @@ public:
 	soundSegment currentMusic(void) {
 		return playing;    // ID of music currently playing
 	}
-	bool goodMIDICard(void);
 
 	// sound calls
 	void queueSound(soundSegment s, int16 loopFactor = 1, sampleLocation where = Here);
-	void queueSoundSample(positionedSample *ss, int16 loopFactor);
 
 	// loop calls
 	void queueLoop(soundSegment s, int16 loopFactor = 0, sampleLocation where = Here);
-	void queueLoopSample(positionedSample *ss, int16 loopFactor = 0);
 	void stopLoop(void);
 	void setLoopPosition(sampleLocation newLoc);
 	soundSegment currentLoop(void) {
@@ -397,8 +146,6 @@ public:
 	void queueVoice(soundSegment s, sampleLocation where = Here);
 	void queueVoice(soundSegment s[], sampleLocation where = Here);
 	void stopVoice(void);
-	void endVoice(sampleStopLevel ssl = sStopCleanup);
-	void resetState(BufferRequest br);
 	bool talking(void);
 	bool saying(soundSegment s);
 
@@ -420,56 +167,14 @@ public:
 
 	//debugging calls
 	char *statusMessage(void);
-	void shutoffAudio(void);
-	void setVerbosity(int16 n) {
-		verbosity = n;
-	}
 	int16 getQueueSize(void) {
 		return _speechQueue.size() + _sfxQueue.size() + _bgmQueue.size();
 	}
 
 	// moving sample calls
 	audioAttenuationFunction setAttenuator(audioAttenuationFunction newAF);
-
-
-private:
-	void playMusic(BufferRequest targBuffer, positionedSample *ss, int16 loopFactor);
-
-	void setSoundMasterVolume(Volume val);
-	void setMusicMasterVolume(Volume val);
-	void setBufferVolume(BufferRequest, Volume val);
-	void setMusicVolume(Volume val);
-	void setSoundVolume(Volume val);
-	void setVoiceVolume(Volume val);
-	void setLoopsVolume(Volume val);
-	inline bool checkMask(volumeTarget t, volumeTarget m, bool e, volumeTarget vtm) {
-		if ((t & m) && (getVolume(m) > 0) && (getVolume(vtm) > 0))
-			return e;
-		return true;
-	}
-
-	void audioFatalError(char *s);
-	void audioError(char *s);
-	void audioEPrintf(char *s, ...);
-	void audioErrorID(int);
-	void audioStatus(char *s);
-	void audioStatCat(char *s);
-
-	void setSample(BufferRequest sampNo, positionedSample *ss);
-
-#ifdef __WATCOMC__
-#pragma off ( unreferenced ) ;
-#endif
-	static ATTENUATOR(defaultAttenuator) {
-		return maxVol;
-	}
-#ifdef __WATCOMC__
-#pragma on ( unreferenced ) ;
-#endif
 };
 
-void disableAudio(void);
-
 } // end of namespace Saga2
 
 #endif
diff --git a/engines/saga2/noise.cpp b/engines/saga2/noise.cpp
index ed1639a6f3..4b15b92070 100644
--- a/engines/saga2/noise.cpp
+++ b/engines/saga2/noise.cpp
@@ -135,14 +135,6 @@ static ATTENUATOR(volumeFromDist) {
 //	after system initialization - startup code
 
 void startAudio(void) {
-	audioInterfaceSettings audioBufferSizes = audioInterfaceSettings(
-	            (int16)  2,       // number of sound buffers
-	            (uint32) 32768,   // voice buffer size   32k
-	            (uint32) 65536,   // music buffer size   64k
-	            (uint32) 131072,   // sound buffer size 128k
-	            (uint32) 400000    // sound buffer size
-	        );
-
 	bool disVoice = true, disMusic = true, disSound = true, disLoops = true;
 
 	if (audio->active()) {
@@ -183,7 +175,7 @@ void startAudio(void) {
 				error("Laryngitis Error (No voice resource context)!\n");
 		}
 
-		audio->initAudioInterface(audioBufferSizes);
+		audio->initAudioInterface();
 		//audio->setMusicFadeStyle(15,15,5);
 		audio->setMusicFadeStyle(0, 0, 0);
 		oldAttenuator = audio->setAttenuator(&volumeFromDist);
@@ -252,14 +244,6 @@ void toggleMusic(void) {
    Audio hooks for videos
  * ===================================================================== */
 
-//-----------------------------------------------------------------------
-//	hook used by videos
-
-HDIGDRIVER &digitalAudioDriver(void) {
-	assert(audio);
-	return audio->dig;
-}
-
 //-----------------------------------------------------------------------
 //  suspend & resume calls
 
diff --git a/engines/saga2/queues.h b/engines/saga2/queues.h
deleted file mode 100644
index 645051f284..0000000000
--- a/engines/saga2/queues.h
+++ /dev/null
@@ -1,373 +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
- * aint32 with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- *
- * Based on the original sources
- *   Faery Tale II -- The Halls of the Dead
- *   (c) 1993-1996 The Wyrmkeep Entertainment Co.
- */
-
-#ifndef SAGA2_QUEUES_H
-#define SAGA2_QUEUES_H
-
-namespace Saga2 {
-
-//
-// Queue Types:
-//   SimpleQueue : queue of items
-//   PublicQueue : queue of items - fully public
-//   SimplePtrQueue : queue of pointers to items
-//   PublicPtrQueue : queue of pointers to items - fully public
-//
-
-/* ===================================================================== *
-    Memory management
- * ===================================================================== */
-
-#ifndef QUEUES_EXTERNAL_ALLOCATION
-#define queueAlloc( s ) malloc( s )
-#define queueFree( s ) free( s )
-#else
-extern void *queueAlloc(size_t s);
-extern void queueFree(void *mem);
-#endif
-
-
-//
-//  to make a queue of ints do
-//    SimpleQueue<int> foo;
-//  this template uses pass-by-value so I'd
-//  recommend using
-//    SimpleQueue<HugeStruct *>
-//  instead of
-//    SimpleQueue<HugeStruct>
-//
-//  be sure you check the return value on
-//  insert() calls
-//
-
-template <class BASETYPE> class SimpleQueue {
-	// Embedded type for member elements
-	struct SimpleQueueElement {
-		BASETYPE data;
-		SimpleQueueElement *next;
-
-	public:
-		SimpleQueueElement(BASETYPE b) {
-			next = NULL;
-			data = b;
-		}
-		~SimpleQueueElement() { }
-		void *operator new (size_t s) {
-			return queueAlloc(s);
-		}
-		void operator delete (void *m) {
-			queueFree(m);
-		}
-	private:
-		SimpleQueueElement();
-	} *head, *tail;
-public:
-
-	SimpleQueue() {
-		head = NULL;
-		tail = NULL;
-	}
-	~SimpleQueue() {
-		while (head) get();
-	}
-	void *operator new (size_t s) {
-		return queueAlloc(s);
-	}
-	void operator delete (void *m) {
-		queueFree(m);
-	}
-
-	bool isEmpty(void) {
-		return head == NULL;
-	}
-
-	BASETYPE first(void) {
-		if (isEmpty()) return 0;
-		else return head->data;
-	}
-
-	BASETYPE get(void) {
-		SimpleQueueElement *oldHead = head;
-		BASETYPE r = first();
-		if (isEmpty())  return r;
-		if (NULL == (head = head->next)) tail = NULL;
-		delete oldHead;
-		return r;
-	}
-
-	bool insert(const BASETYPE b) {
-		SimpleQueueElement *newElt = new SimpleQueueElement(b);
-		if (newElt == NULL)  return false;
-		if (tail)
-			tail->next = newElt;
-		else
-			head = newElt;
-		tail = newElt;
-		return true;
-	}
-};
-
-//
-//
-// This is a variation where everything is public
-//
-//
-//
-//
-
-
-template <class BASETYPE> class PublicQueue {
-	// Embedded type for member elements
-public:
-	struct PublicQueueElement {
-		BASETYPE data;
-		PublicQueueElement *next;
-
-	public:
-		PublicQueueElement(BASETYPE b) {
-			next = NULL;
-			data = b;
-		}
-		~PublicQueueElement() { }
-		void *operator new (size_t s) {
-			return queueAlloc(s);
-		}
-		void operator delete (void *m) {
-			queueFree(m);
-		}
-	private:
-		PublicQueueElement();
-	} *head, *tail;
-
-	PublicQueue() {
-		head = NULL;
-		tail = NULL;
-	}
-	~PublicQueue() {
-		while (head) get();
-	}
-	void *operator new (size_t s) {
-		return queueAlloc(s);
-	}
-	void operator delete (void *m) {
-		queueFree(m);
-	}
-
-	bool isEmpty(void) {
-		return head == NULL;
-	}
-
-	BASETYPE first(void) {
-		if (isEmpty()) return 0;
-		else return head->data;
-	}
-
-	BASETYPE get(void) {
-		PublicQueueElement *oldHead = head;
-		BASETYPE r = first();
-		if (isEmpty())  return r;
-		if (NULL == (head = head->next)) tail = NULL;
-		delete oldHead;
-		return r;
-	}
-
-	bool insert(const BASETYPE b) {
-		PublicQueueElement *newElt = new PublicQueueElement(b);
-		if (newElt == NULL)  return false;
-		if (tail)
-			tail->next = newElt;
-		else
-			head = newElt;
-		tail = newElt;
-		return true;
-	}
-};
-
-//
-//  to make a queue of ints do
-//    SimplePtrQueue<int> foo;
-//  this template uses pass-by-value so I'd
-//  recommend using
-//    SimplePtrQueue<HugeStruct *>
-//  instead of
-//    SimplePtrQueue<HugeStruct>
-//
-//  be sure you check the return value on
-//  insert() calls
-//
-
-template <class BASETYPE> class SimplePtrQueue {
-	// Embedded type for member elements
-	struct SimplePtrQueueElement {
-		BASETYPE *data;
-		SimplePtrQueueElement *next;
-
-	public:
-		SimplePtrQueueElement(BASETYPE *b) {
-			next = NULL;
-			data = b;
-		}
-		~SimplePtrQueueElement() {
-			if (data != NULL) delete data;
-			data = NULL;
-		}
-		void *operator new (size_t s) {
-			return queueAlloc(s);
-		}
-		void operator delete (void *m) {
-			queueFree(m);
-		}
-	private:
-		SimplePtrQueueElement();
-	} *head, *tail;
-public:
-
-	SimplePtrQueue() {
-		head = NULL;
-		tail = NULL;
-	}
-	~SimplePtrQueue() {
-		while (head) get();
-	}
-	void *operator new (size_t s) {
-		return queueAlloc(s);
-	}
-	void operator delete (void *m) {
-		queueFree(m);
-	}
-
-	bool isEmpty(void) {
-		return head == NULL;
-	}
-
-	BASETYPE *first(void) {
-		if (isEmpty()) return 0;
-		else return head->data;
-	}
-
-	BASETYPE *get(void) {
-		SimplePtrQueueElement *oldHead = head;
-		BASETYPE *r = first();
-		if (isEmpty())  return r;
-		if (NULL == (head = head->next)) tail = NULL;
-		delete oldHead;
-		return r;
-	}
-
-	bool insert(BASETYPE *b) {
-		SimplePtrQueueElement *newElt = new SimplePtrQueueElement(b);
-		if (newElt == NULL)  return false;
-		if (tail)
-			tail->next = newElt;
-		else
-			head = newElt;
-		tail = newElt;
-		return true;
-	}
-};
-
-//
-//
-// This is a variation where everything is public
-//
-//
-//
-//
-
-
-template <class BASETYPE> class PublicPtrQueue {
-	// Embedded type for member elements
-public:
-	struct PublicPtrQueueElement {
-		BASETYPE *data;
-		PublicPtrQueueElement *next;
-
-	public:
-		PublicPtrQueueElement(BASETYPE *b) {
-			next = NULL;
-			data = b;
-		}
-		~PublicPtrQueueElement() {
-			if (data != NULL) delete data;
-			data = NULL;
-		}
-		void *operator new (size_t s) {
-			return queueAlloc(s);
-		}
-		void operator delete (void *m) {
-			queueFree(m);
-		}
-	private:
-		PublicPtrQueueElement();
-	} *head, *tail;
-
-	PublicPtrQueue() {
-		head = NULL;
-		tail = NULL;
-	}
-	~PublicPtrQueue() {
-		while (head) get();
-	}
-	void *operator new (size_t s) {
-		return queueAlloc(s);
-	}
-	void operator delete (void *m) {
-		queueFree(m);
-	}
-
-	bool isEmpty(void) {
-		return head == NULL;
-	}
-
-	BASETYPE *first(void) {
-		if (isEmpty()) return 0;
-		else return head->data;
-	}
-
-	BASETYPE *get(void) {
-		PublicPtrQueueElement *oldHead = head;
-		BASETYPE *r = first();
-		if (isEmpty())  return r;
-		if (NULL == (head = head->next)) tail = NULL;
-		delete oldHead;
-		return r;
-	}
-
-	bool insert(BASETYPE *b) {
-		PublicPtrQueueElement *newElt = new PublicPtrQueueElement(b);
-		if (newElt == NULL)  return false;
-		if (tail)
-			tail->next = newElt;
-		else
-			head = newElt;
-		tail = newElt;
-		return true;
-	}
-};
-
-} // end of namespace Saga2
-
-#endif




More information about the Scummvm-git-logs mailing list