mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 05:01:43 +00:00
SAGA2: Reduce header dependency in audio.*
This commit is contained in:
parent
a58fb4ac29
commit
e71207f680
@ -27,16 +27,6 @@
|
||||
#ifndef SAGA2_ANNOY_H
|
||||
#define SAGA2_ANNOY_H
|
||||
|
||||
/* ===================================================================== *
|
||||
Nested includes
|
||||
* ===================================================================== */
|
||||
|
||||
#include "saga2/tcoords.h"
|
||||
|
||||
/* ===================================================================== *
|
||||
Constants
|
||||
* ===================================================================== */
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
@ -27,6 +27,16 @@
|
||||
#include "saga2/std.h"
|
||||
#include "saga2/audio.h"
|
||||
|
||||
#include "saga2/rect.h"
|
||||
#include "saga2/queues.h"
|
||||
#include "saga2/idtypes.h"
|
||||
#include "saga2/audiosmp.h"
|
||||
#include "saga2/audqueue.h"
|
||||
#include "saga2/audiosys.h"
|
||||
|
||||
#include "saga2/audiodec.h"
|
||||
#include "saga2/audiofnc.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
void initAudio() {
|
||||
|
@ -77,14 +77,4 @@ inline void audioFatal(char *msg) {
|
||||
error("Sound error %s", msg);
|
||||
}
|
||||
|
||||
#include "saga2/rect.h"
|
||||
#include "saga2/audiomem.h"
|
||||
#include "saga2/queues.h"
|
||||
#include "saga2/audiobuf.h"
|
||||
#include "saga2/audiodec.h"
|
||||
#include "saga2/audiosmp.h"
|
||||
#include "saga2/audqueue.h"
|
||||
#include "saga2/audiosys.h"
|
||||
#include "saga2/audiofnc.h"
|
||||
|
||||
#endif
|
||||
|
@ -29,6 +29,15 @@
|
||||
#include "saga2/std.h"
|
||||
#include "saga2/audio.h"
|
||||
|
||||
#include "saga2/rect.h"
|
||||
#include "saga2/queues.h"
|
||||
#include "saga2/idtypes.h"
|
||||
#include "saga2/audiosmp.h"
|
||||
#include "saga2/audqueue.h"
|
||||
#include "saga2/audiosys.h"
|
||||
|
||||
#include "saga2/audiobuf.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
extern audioInterface *audio;
|
||||
@ -65,8 +74,7 @@ Buffer::Buffer(size_t newSize) {
|
||||
|
||||
internallyAllocated = TRUE;
|
||||
size = newSize;
|
||||
data[0] = audioAlloc(newSize, "Audio data buffer"); //( void * ) new char[newSize];
|
||||
audio_lock(data[0], size); //musicRes->size( s ));
|
||||
data[0] = malloc(newSize);
|
||||
data[1] = NULL;
|
||||
|
||||
wData = data[0];
|
||||
@ -78,8 +86,7 @@ Buffer::Buffer(size_t newSize) {
|
||||
Buffer::~Buffer(void) {
|
||||
if (internallyAllocated) {
|
||||
assert(data[0]);
|
||||
audio_unlock(data[0], size);
|
||||
audioFree(data[0]); //delete [] data[0];
|
||||
free(data[0]);
|
||||
data[0] = NULL;
|
||||
}
|
||||
}
|
||||
@ -122,13 +129,12 @@ doubleBuffer::doubleBuffer(size_t newSize, audioInterface *sd, int16 newID)
|
||||
targetSated = FALSE;
|
||||
ailSampleHandle = AIL_allocate_sample_handle(sd->dig);
|
||||
if (ailSampleHandle == NULL)
|
||||
audioFatal("Unable to allocate audio handle");
|
||||
error("Unable to allocate audio handle");
|
||||
AIL_init_sample(ailSampleHandle);
|
||||
AILLOCated = -1;
|
||||
audioSet = 0;
|
||||
|
||||
data[1] = audioAlloc(newSize, "audio double buffer"); // ( void * ) new char[newSize];
|
||||
audio_lock(data[1], newSize); //musicRes->size( s ));
|
||||
data[1] = (void *)malloc(newSize);
|
||||
//drain( 1 );
|
||||
}
|
||||
}
|
||||
@ -136,8 +142,7 @@ doubleBuffer::doubleBuffer(size_t newSize, audioInterface *sd, int16 newID)
|
||||
doubleBuffer::~doubleBuffer(void) {
|
||||
assert(ailSampleHandle);
|
||||
if (data[1]) {
|
||||
audio_unlock(data[1], size);
|
||||
audioFree(data[1]); //delete [] data[1];
|
||||
free(data[1]);
|
||||
data[1] = NULL;
|
||||
}
|
||||
if (ailSampleHandle) {
|
||||
@ -223,13 +228,13 @@ void workBuffer::shiftdown(int16 bufNo) {
|
||||
assert(rData);
|
||||
|
||||
if (dif > 0 && rSize > 0) {
|
||||
char *tbuf = (char *) audioAlloc(rSize, "audio work buffer"); //new char[rSize];
|
||||
char *tbuf = (char *)malloc(rSize);
|
||||
memcpy(tbuf, rData, rSize);
|
||||
memcpy(data[bufNo], tbuf, rSize);
|
||||
rData = data[bufNo];
|
||||
wSize += dif;
|
||||
wData = (void *)(((char *) data[bufNo]) + (size - wSize));
|
||||
audioFree(tbuf);
|
||||
free(tbuf);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -78,13 +78,6 @@ public:
|
||||
uint32 rSize; // virtual remaining read size
|
||||
void *rData; // virtual read data buffer
|
||||
|
||||
// Note that buffers do not follow canonical form
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "audio buffer mgr");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
Buffer(size_t newSize);
|
||||
virtual ~Buffer(void);
|
||||
|
||||
@ -125,12 +118,6 @@ public:
|
||||
|
||||
workBuffer(size_t newSize, int16 newID);
|
||||
~workBuffer(void);
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "audio wk bfr mgr");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
uint32 sample_status(void); // gives the status of the buffer as a whole
|
||||
void reset(void); // initialize buffer
|
||||
@ -173,12 +160,6 @@ public:
|
||||
|
||||
doubleBuffer(size_t newSize, audioInterface *sd, int16 newID);
|
||||
~doubleBuffer(void);
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "aud dble buf mgr");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
uint32 sample_status(void); // gives the status of the buffer as a whole
|
||||
void reset(void); // initialize buffer
|
||||
@ -219,12 +200,6 @@ public:
|
||||
|
||||
singleBuffer(size_t newSize, audioInterface *sd, int16 newID);
|
||||
~singleBuffer(void);
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "aud sgl buf mgr");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
uint32 sample_status(void); // gives the status of the buffer as a whole
|
||||
void reset(void); // initialize buffer
|
||||
@ -272,12 +247,6 @@ public:
|
||||
|
||||
musicBuffer(size_t newSize, audioInterface *sd, int16 newID);
|
||||
~musicBuffer(void);
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "aud music buf mgr");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
uint32 sample_status(void); // gives the status of the buffer as a whole
|
||||
void reset(void); // initialize buffer
|
||||
@ -321,12 +290,6 @@ public:
|
||||
|
||||
cacheBuffer(size_t newSize, int16 newID);
|
||||
~cacheBuffer(void);
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "aud cache buf mgr");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
uint32 sample_status(void); // gives the status of the buffer as a whole
|
||||
void reset(void); // initialize buffer
|
||||
|
@ -27,8 +27,6 @@
|
||||
#ifndef SAGA2_AUDIOCMP_H
|
||||
#define SAGA2_AUDIOCMP_H
|
||||
|
||||
#include "saga2/audiogvc.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
/* ===================================================================== *
|
||||
|
@ -29,6 +29,13 @@
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
class Buffer;
|
||||
class audioInterface;
|
||||
class soundDecoder;
|
||||
class soundSample;
|
||||
class workBuffer;
|
||||
class soundQueue;
|
||||
|
||||
/* ===================================================================== *
|
||||
|
||||
Sound Sample Decoders
|
||||
@ -75,12 +82,7 @@ union soundServer {
|
||||
INPLACEDECODER *pDec;
|
||||
BUFFERDECODER *bDec;
|
||||
BUFFERLOADER *lDec;
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "aud snd server");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
soundServer() {
|
||||
pDec = NULL;
|
||||
}
|
||||
@ -149,12 +151,6 @@ public:
|
||||
soundDecoder(BUFFERLOADER, BUFFERLOADER, BUFFERLOADER);
|
||||
#endif
|
||||
~soundDecoder(void);
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "audio decoder");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
soundDecoder &operator=(const soundDecoder &src);
|
||||
soundDecoder(const soundDecoder &src);
|
||||
bool operator==(const soundDecoder &src2) const;
|
||||
@ -194,12 +190,7 @@ public:
|
||||
if (decode) delete decode;
|
||||
decode = NULL;
|
||||
}
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "audio decdr set");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
void addDecoder(soundDecoder *sodec);
|
||||
|
||||
#if DEBUG_AUDIO
|
||||
|
@ -27,8 +27,6 @@
|
||||
#ifndef SAGA2_AUDIOFNC_H
|
||||
#define SAGA2_AUDIOFNC_H
|
||||
|
||||
#include "saga2/audiobuf.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
/* ===================================================================== *
|
||||
|
@ -1,296 +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.
|
||||
*
|
||||
*
|
||||
* Based on the original sources
|
||||
* Faery Tale II -- The Halls of the Dead
|
||||
* (c) 1993-1996 The Wyrmkeep Entertainment Co.
|
||||
*/
|
||||
|
||||
#ifndef SAGA2_AUDIOGVC_H
|
||||
#define SAGA2_AUDIOGVC_H
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
#define BUGFIX_RELEASE "22"
|
||||
|
||||
#define HAVE_STDARG_H 1
|
||||
|
||||
|
||||
# define OLD_MAGIC "ajkg"
|
||||
# define MAGIC "dgvc"
|
||||
|
||||
// file formats
|
||||
|
||||
enum decompFTypes {
|
||||
dft_au, // Unix .AU file
|
||||
dft_ulaw, // mu-law encoding
|
||||
dft_s8, // signed 8 bit PCM
|
||||
dft_u8, // unsigned 8 bit PCM
|
||||
dft_s16, // signed 16 bit PCM
|
||||
dft_u16, // unsigned 16 bit PCM
|
||||
dft_s16x, // signed 16 bit PCM
|
||||
dft_u16x, // unsigned 16 bit PCM
|
||||
dft_s16hl, // signed 16 bit PCM 680x0 ordering
|
||||
dft_u16hl, // unsigned 16 bit PCM 680x0 ordering
|
||||
dft_s16lh, // signed 16 bit PCM 80x86 ordering
|
||||
dft_u16lh, // unsigned 16 bit PCM 80x86 ordering
|
||||
};
|
||||
|
||||
#define DEFAULT_FTYPE ( dft_s16 )
|
||||
|
||||
|
||||
|
||||
|
||||
# define FORMAT_VERSION 1
|
||||
# define MIN_SUPPORTED_VERSION 0
|
||||
# define MAX_SUPPORTED_VERSION 2
|
||||
# define MAX_VERSION 7
|
||||
# define UNDEFINED_UINT -1
|
||||
# define DEFAULT_BLOCK_SIZE 256
|
||||
# define DEFAULT_V0NMEAN 0
|
||||
# define DEFAULT_V2NMEAN 4
|
||||
# define DEFAULT_MAXNLPC 0
|
||||
# define DEFAULT_NCHAN 1
|
||||
# define DEFAULT_NSKIP 0
|
||||
# define DEFAULT_NDISCARD 0
|
||||
# define NBITPERLONG 32
|
||||
# define DEFAULT_MINSNR 99
|
||||
# define DEFAULT_MAXRESNSTR "32.0"
|
||||
# define DEFAULT_QUANTERROR 0
|
||||
# define MINBITRATE 2.5
|
||||
|
||||
# define MAX_LPC_ORDER 64
|
||||
# define CHANSIZE 0
|
||||
# define ENERGYSIZE 3
|
||||
# define BITSHIFTSIZE 2
|
||||
# define NWRAP 3
|
||||
|
||||
# define FNSIZE 2
|
||||
# define FN_DIFF0 0
|
||||
# define FN_DIFF1 1
|
||||
# define FN_DIFF2 2
|
||||
# define FN_DIFF3 3
|
||||
# define FN_QUIT 4
|
||||
# define FN_BLOCKSIZE 5
|
||||
# define FN_BITSHIFT 6
|
||||
# define FN_QLPC 7
|
||||
# define FN_ZERO 8
|
||||
|
||||
# define ULONGSIZE 2
|
||||
# define NSKIPSIZE 1
|
||||
# define LPCQSIZE 2
|
||||
# define LPCQUANT 5
|
||||
# define XBYTESIZE 7
|
||||
|
||||
# define TYPESIZE 4
|
||||
# define TYPE_AU 0
|
||||
# define TYPE_S8 1
|
||||
# define TYPE_U8 2
|
||||
# define TYPE_S16HL 3
|
||||
# define TYPE_U16HL 4
|
||||
# define TYPE_S16LH 5
|
||||
# define TYPE_U16LH 6
|
||||
# define TYPE_ULAW 7
|
||||
# define TYPE_EOF 8
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN( a, b ) ((( a )<( b ))?( a ):( b ))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
# define MAX( a, b ) ((( a )>( b ))?( a ):( b ))
|
||||
#endif
|
||||
|
||||
#if defined( unix ) && !defined( linux )
|
||||
# define labs abs
|
||||
#endif
|
||||
|
||||
# define ROUNDEDSHIFTDOWN( x, n ) ((( n ) == 0 ) ? ( x ) : (( x ) >> (( n ) - 1 )) >> 1 )
|
||||
|
||||
#ifndef M_LN2
|
||||
#define M_LN2 0.69314718055994530942
|
||||
#endif
|
||||
|
||||
/* BUFSIZ must be a multiple of four to contain a whole number of words */
|
||||
#ifndef BUFSIZ
|
||||
# define BUFSIZ 1024
|
||||
#endif
|
||||
|
||||
#define putc_exit( val, stream )\
|
||||
{ char rval;\
|
||||
if(( rval = buffputc(( val ), ( stream ))) != ( char ) ( val ))\
|
||||
SegFatal( serrCompPutFailed );\
|
||||
}
|
||||
//update_exit( 1, "write failed: putc returns EOF\n");
|
||||
|
||||
extern int getc_exit_val;
|
||||
#define getc_exit( stream )\
|
||||
((( getc_exit_val = buffgetc( stream )) == EOF ) ? \
|
||||
update_exit( 1, "read failed: getc returns EOF\n"), 0: getc_exit_val )
|
||||
|
||||
#undef uchar
|
||||
#define uchar unsigned char
|
||||
#undef ushort
|
||||
#define ushort unsigned short
|
||||
#undef ulong
|
||||
#define ulong unsigned long
|
||||
|
||||
#if defined( __STDC__ ) || defined( __GNUC__ ) || defined( sgi ) || !defined( unix )
|
||||
typedef signed char schar;
|
||||
#define PROTO( ARGS ) ARGS
|
||||
#else
|
||||
typedef char schar;
|
||||
#define PROTO( ARGS ) ()
|
||||
#endif
|
||||
|
||||
#ifdef NEED_OLD_PROTOTYPES
|
||||
/*******************************************/
|
||||
/* this should be in string.h or strings.h */
|
||||
extern int strcmp PROTO((const char *, const char *));
|
||||
extern char *strcpy PROTO((char *, const char *));
|
||||
extern char *strcat PROTO((char *, const char *));
|
||||
extern int strlen PROTO((const char *));
|
||||
|
||||
/**************************************/
|
||||
/* defined in stdlib.h if you have it */
|
||||
extern void *malloc PROTO((unsigned long));
|
||||
extern void free PROTO((void *));
|
||||
extern int atoi PROTO((const char *));
|
||||
extern void swab PROTO((char *, char *, int));
|
||||
extern int buffseek PROTO((doubleBuffer *, long, int));
|
||||
|
||||
/***************************/
|
||||
/* other misc system calls */
|
||||
extern int unlink PROTO((const char *));
|
||||
extern void exit PROTO((int));
|
||||
#endif
|
||||
|
||||
/************************/
|
||||
/* defined in shorten.c */
|
||||
extern long init_offset PROTO((long **, int, int, int));
|
||||
|
||||
/*********************/
|
||||
/* defined in ulaw.c */
|
||||
extern uchar linear2ulaw PROTO((long));
|
||||
extern int ulaw2linear PROTO((uchar));
|
||||
|
||||
/********************/
|
||||
/* defined in lpc.c */
|
||||
extern int wav2lpc PROTO((long *, int, long, int *, int, int, float *, float *));
|
||||
|
||||
/*********************/
|
||||
/* defined in poly.c */
|
||||
extern int wav2poly PROTO((long *, int, long, int, float *, float *));
|
||||
|
||||
/*********************/
|
||||
/* defined in exit.c */
|
||||
|
||||
extern void basic_exit PROTO((int));
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
extern void perror_exit PROTO((char *, ...));
|
||||
extern void usage_exit PROTO((int, char *, ...));
|
||||
extern void update_exit PROTO((int, char *, ...));
|
||||
# else
|
||||
extern void perror_exit PROTO(());
|
||||
extern void usage_exit PROTO(());
|
||||
extern void update_exit PROTO(());
|
||||
# endif
|
||||
|
||||
/***********************/
|
||||
/* defined in hsgetopt.c */
|
||||
extern void hs_resetopt PROTO((void));
|
||||
extern int hs_getopt PROTO((int, char **, char *));
|
||||
extern int hs_optind;
|
||||
extern char *hs_optarg;
|
||||
|
||||
/**********************/
|
||||
/* defined in array.c */
|
||||
extern void *pmalloc PROTO((ulong));
|
||||
extern long **long2d PROTO((ulong, ulong));
|
||||
|
||||
/****************************/
|
||||
/* defined in dupfileinfo.c */
|
||||
extern int dupfileinfo PROTO((char *, char *));
|
||||
|
||||
|
||||
// PROTO() is an annoying parameter definition macro to allow compatibility
|
||||
// with the K&R style parameter declarations
|
||||
|
||||
/**********************/
|
||||
/* defined in fixio.c */
|
||||
extern void init_sizeof_sample PROTO((void));
|
||||
extern void fread_type_init PROTO((void));
|
||||
extern void fread_type_quit PROTO((void));
|
||||
extern void fwrite_type_init PROTO((void));
|
||||
extern int fread_type PROTO((long **, int, int, int, Buffer *));
|
||||
extern void fwrite_type PROTO((long **, int, int, int, Buffer *));
|
||||
extern void fwrite_type_quit PROTO((void));
|
||||
extern int find_bitshift PROTO((long *, int, int));
|
||||
extern void fix_bitshift PROTO((long *, int, int, int));
|
||||
|
||||
/**********************/
|
||||
/* defined in vario.c */
|
||||
extern void var_put_init PROTO((void));
|
||||
extern void uvar_put PROTO((ulong, int, Buffer *));
|
||||
extern void var_put PROTO((long, int, Buffer *));
|
||||
extern void ulong_put PROTO((ulong, Buffer *));
|
||||
extern void var_put_quit PROTO((Buffer *));
|
||||
|
||||
extern void var_get_init PROTO((void));
|
||||
extern long uvar_get PROTO((int, Buffer *));
|
||||
extern long var_get PROTO((int, Buffer *));
|
||||
extern ulong ulong_get PROTO((Buffer *));
|
||||
extern void var_get_quit PROTO((void));
|
||||
|
||||
extern int sizeof_uvar PROTO((ulong, int));
|
||||
extern int sizeof_var PROTO((long, int));
|
||||
|
||||
extern void mkmasktab PROTO((void));
|
||||
extern void word_put PROTO((ulong, Buffer *));
|
||||
extern ulong word_get PROTO((Buffer *));
|
||||
|
||||
|
||||
extern int shorten PROTO((Buffer *, Buffer *, int, char **));
|
||||
|
||||
|
||||
long init_offset(long **offset, int nchan, int nblock, int ftype) ;
|
||||
float Satof(char *string) ;
|
||||
float *parseList(char *maxresnstr, int nchan) ;
|
||||
int16 getFType(decompFTypes dft);
|
||||
int unShorten(Buffer *stdi, Buffer *stdo, int, char **);
|
||||
|
||||
# define V2LPCQOFFSET ( 1 << LPCQUANT );
|
||||
|
||||
# define UINT_PUT( val, nbit, file ) \
|
||||
if ( version == 0 ) uvar_put(( unsigned long ) val, nbit, file ); \
|
||||
else ulong_put(( unsigned long ) val, file )
|
||||
|
||||
# define UINT_GET( nbit, file ) \
|
||||
(( version == 0 ) ? uvar_get( nbit, file ) : ulong_get( file ))
|
||||
|
||||
# define VAR_PUT( val, nbit, file ) \
|
||||
if ( version == 0 ) var_put(( unsigned long ) val, nbit - 1, file ); \
|
||||
else var_put(( unsigned long ) val, nbit, file )
|
||||
|
||||
} // end of namespace Saga2
|
||||
|
||||
#endif
|
@ -1,52 +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.
|
||||
*
|
||||
*
|
||||
* Based on the original sources
|
||||
* Faery Tale II -- The Halls of the Dead
|
||||
* (c) 1993-1996 The Wyrmkeep Entertainment Co.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SAGA2_AUDIOMEM_H
|
||||
#define SAGA2_AUDIOMEM_H
|
||||
|
||||
namespace Saga2{
|
||||
|
||||
/* ===================================================================== *
|
||||
Memory alloc/free
|
||||
* ===================================================================== */
|
||||
|
||||
void *audioAlloc(size_t s, const char[]);
|
||||
void audioFree(void *mem);
|
||||
|
||||
#define audionew( s ) (( s* )audioAlloc( sizeof( s )))
|
||||
#define audiodelete( m ) ( audioFree( m ))
|
||||
|
||||
/* ===================================================================== *
|
||||
VMM locking
|
||||
* ===================================================================== */
|
||||
|
||||
bool audio_lock(void *p, size_t s);
|
||||
bool audio_unlock(void *p, size_t s);
|
||||
|
||||
} // end of namespace Saga2
|
||||
|
||||
#endif
|
@ -30,8 +30,14 @@
|
||||
#include "saga2/audio.h"
|
||||
#include "saga2/hresmgr.h"
|
||||
#include "saga2/audiores.h"
|
||||
#include "saga2/audiodec.h"
|
||||
#include "saga2/fta.h"
|
||||
|
||||
#include "saga2/queues.h"
|
||||
#include "saga2/idtypes.h"
|
||||
#include "saga2/audiosmp.h"
|
||||
#include "saga2/audiobuf.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
#define ASYNCH_AUDIO 0
|
||||
|
@ -29,6 +29,9 @@
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
class Buffer;
|
||||
class soundSample;
|
||||
|
||||
int16 hResSeek(Buffer &sb, soundSample &ss, hResContext *hrc, bool Cheksize);
|
||||
int16 hResRead(Buffer &sb, soundSample &ss, hResContext *hrc);
|
||||
int16 hResFlush(Buffer &sb, soundSample &ss, hResContext *hrc);
|
||||
|
@ -28,6 +28,9 @@
|
||||
#define SAGA2_AUDIOSMP_H
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
class decoderSet;
|
||||
|
||||
/* ===================================================================== *
|
||||
|
||||
Sound Sample Attributes
|
||||
@ -47,7 +50,6 @@ namespace Saga2 {
|
||||
#define ENDSAMP 0xFFFFFFFF
|
||||
|
||||
typedef uint32 soundSampleID;
|
||||
typedef uint32 soundSegment;
|
||||
typedef soundSegment *segmentArray;
|
||||
typedef int8 Volume;
|
||||
typedef Point32 sampleLocation;
|
||||
@ -115,12 +117,6 @@ public:
|
||||
soundSample(soundSegment sa[]); //, sampleLocation pos=Point32( 0, 0 ));
|
||||
soundSample(soundSegment seg); //, sampleLocation pos=Point32( 0, 0 ));
|
||||
virtual ~soundSample();
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "audio sample");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
soundSample &operator=(const soundSample &src);
|
||||
soundSample(const soundSample &src);
|
||||
@ -194,12 +190,7 @@ public:
|
||||
movingSample(soundSegment sa[], sampleLocation pos, sampleVelocity vel, sampleAcceleration acc);
|
||||
movingSample(soundSegment seg, sampleLocation pos, sampleVelocity vel, sampleAcceleration acc);
|
||||
~movingSample() {};
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "moving sample");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
Volume getVolume(void);
|
||||
};
|
||||
|
||||
|
@ -27,10 +27,13 @@
|
||||
#ifndef SAGA2_AUDIOSYS_H
|
||||
#define SAGA2_AUDIOSYS_H
|
||||
|
||||
#include "saga2/audiobuf.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
class Buffer;
|
||||
class musicBuffer;
|
||||
class soundQueue;
|
||||
class decoderSet;
|
||||
|
||||
/*******************************************************************/
|
||||
/* DRIVERS subdirectory */
|
||||
|
||||
@ -114,12 +117,7 @@ struct audioInterfaceSettings {
|
||||
soundBufferSize = sbs;
|
||||
loopBufferSize = lbs;
|
||||
}
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "audio settings");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
private:
|
||||
audioInterfaceSettings();
|
||||
};
|
||||
@ -232,13 +230,6 @@ private:
|
||||
#endif
|
||||
|
||||
public:
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "audio interface");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
// ctor, dtor, initialization
|
||||
audioInterface(const char *driver_path = DRIVER_PATH, const char *undriver_path = UNDRIVER_PATH);
|
||||
~audioInterface();
|
||||
|
@ -42,12 +42,6 @@ public:
|
||||
tip = NULL;
|
||||
}
|
||||
~soundQueue(void);
|
||||
void *operator new (size_t s) {
|
||||
return audioAlloc(s, "aud smpl queue");
|
||||
}
|
||||
void operator delete (void *m) {
|
||||
audioFree(m);
|
||||
}
|
||||
|
||||
positionedSample *firstSample(void);
|
||||
positionedSample *nextSample(void);
|
||||
|
@ -27,6 +27,7 @@
|
||||
#define FORBIDDEN_SYMBOL_ALLOW_ALL // FIXME: Remove
|
||||
|
||||
#include "saga2/std.h"
|
||||
#include "saga2/actor.h"
|
||||
#include "saga2/band.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
@ -27,10 +27,11 @@
|
||||
#ifndef SAGA2_BAND_H
|
||||
#define SAGA2_BAND_H
|
||||
|
||||
#include "saga2/actor.h"
|
||||
#include "saga2/idtypes.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
class Actor;
|
||||
class Band;
|
||||
const int maxBandMembers = 32;
|
||||
|
||||
|
@ -27,10 +27,9 @@
|
||||
#ifndef SAGA2_COMBAT_H
|
||||
#define SAGA2_COMBAT_H
|
||||
|
||||
#include "saga2/annoy.h"
|
||||
|
||||
namespace Saga2 {
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
class Location;
|
||||
|
||||
enum weaponHitType {
|
||||
hitMiss = 0,
|
||||
|
@ -41,6 +41,8 @@
|
||||
#include "saga2/spellbuk.h"
|
||||
#include "saga2/imagcach.h"
|
||||
|
||||
#include "saga2/pclass.r"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
// debug
|
||||
|
@ -31,6 +31,9 @@
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
class Actor;
|
||||
class GameObject;
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Effects of spells and other things
|
||||
|
||||
|
@ -217,6 +217,8 @@ typedef int16 SensorID;
|
||||
typedef int16 BandID;
|
||||
const BandID NoBand = -1;
|
||||
|
||||
typedef uint32 soundSegment;
|
||||
|
||||
} // end of namespace Saga2
|
||||
|
||||
#endif
|
||||
|
@ -31,12 +31,19 @@
|
||||
#include "saga2/fta.h"
|
||||
#include "saga2/audio.h"
|
||||
#include "saga2/audiores.h"
|
||||
#include "saga2/audiodec.h"
|
||||
#include "saga2/audiofnc.h"
|
||||
#include "saga2/tcoords.h"
|
||||
#include "saga2/button.h"
|
||||
#include "saga2/annoy.h"
|
||||
#include "saga2/objproto.h"
|
||||
#include "saga2/player.h"
|
||||
|
||||
#include "saga2/queues.h"
|
||||
#include "saga2/audiosmp.h"
|
||||
#include "saga2/audqueue.h"
|
||||
#include "saga2/audiosys.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
//#define AUDIO_DISABLED
|
||||
|
@ -48,8 +48,9 @@
|
||||
#include "saga2/grabinfo.h"
|
||||
#include "saga2/localize.h"
|
||||
#include "saga2/spellbuk.h"
|
||||
#include "saga2/methods.r" // generated by SAGA
|
||||
|
||||
#include "saga2/methods.r" // generated by SAGA
|
||||
#include "saga2/pclass.r"
|
||||
namespace Saga2 {
|
||||
|
||||
APPFUNC(cmdControl);
|
||||
|
@ -28,6 +28,7 @@
|
||||
#define SAGA2_OBJECTS_H
|
||||
|
||||
#include "saga2/objproto.h"
|
||||
#include "saga2/property.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
|
@ -42,7 +42,9 @@
|
||||
#include "saga2/magic.h"
|
||||
#include "saga2/weapons.h"
|
||||
#include "saga2/spellbuk.h"
|
||||
|
||||
#include "saga2/methods.r"
|
||||
#include "saga2/pclass.r"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
|
@ -29,16 +29,16 @@
|
||||
|
||||
#include "saga2/idtypes.h"
|
||||
#include "saga2/sprite.h"
|
||||
#include "saga2/property.h"
|
||||
#include "saga2/savefile.h"
|
||||
#include "saga2/spells.h"
|
||||
#include "saga2/effects.h"
|
||||
#include "saga2/combat.h"
|
||||
|
||||
#include "saga2/pclass.r"
|
||||
#include "saga2/tcoords.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
class Actor;
|
||||
class gameObject;
|
||||
|
||||
/* ===================================================================== *
|
||||
Exports
|
||||
* ===================================================================== */
|
||||
|
@ -31,6 +31,8 @@
|
||||
#include "saga2/tile.h"
|
||||
#include "saga2/property.h"
|
||||
|
||||
#include "saga2/pclass.r"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
// Determine if this object is just an object
|
||||
|
@ -27,8 +27,6 @@
|
||||
#ifndef SAGA2_TCOORDS_H
|
||||
#define SAGA2_TCOORDS_H
|
||||
|
||||
#include "saga2/rect.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
enum facingDirections {
|
||||
|
@ -29,10 +29,8 @@
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
/* ===================================================================== *
|
||||
Constants
|
||||
* ===================================================================== */
|
||||
|
||||
class TilePoint;
|
||||
struct TileRegion;
|
||||
|
||||
// these control the rate of drowning damage
|
||||
// the first two determine the chances of doing damage on a
|
||||
|
@ -30,6 +30,12 @@
|
||||
#include "saga2/fta.h"
|
||||
#include "saga2/audio.h"
|
||||
|
||||
#include "saga2/queues.h"
|
||||
#include "saga2/idtypes.h"
|
||||
#include "saga2/audiosmp.h"
|
||||
#include "saga2/audqueue.h"
|
||||
#include "saga2/audiosys.h"
|
||||
|
||||
namespace Saga2 {
|
||||
|
||||
/* ====================================================================== *
|
||||
|
@ -40,6 +40,12 @@
|
||||
#include "saga2/loadsave.h"
|
||||
#include "saga2/script.h"
|
||||
#include "saga2/audio.h"
|
||||
|
||||
#include "saga2/queues.h"
|
||||
#include "saga2/audiosmp.h"
|
||||
#include "saga2/audqueue.h"
|
||||
#include "saga2/audiosys.h"
|
||||
|
||||
#include "saga2/annoy.h"
|
||||
#include "saga2/uidialog.h"
|
||||
#include "saga2/document.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user