Move some box stuff from scumm.h to new boxes.h

Also move some sound-related items from scumm.h to sound.h

svn-id: r3797
This commit is contained in:
James Brown 2002-03-21 16:12:02 +00:00
parent e141367386
commit f49bbb0fd8
12 changed files with 136 additions and 155 deletions

59
boxes.h Normal file
View File

@ -0,0 +1,59 @@
/* ScummVM - Scumm Interpreter
* Copyright (C) 2001 Ludvig Strigeus
* 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$
*
*/
#define SIZEOF_BOX 20
struct Box { /* Internal walkbox file format */
int16 ulx,uly;
int16 urx,ury;
int16 llx,lly;
int16 lrx,lry;
byte mask;
byte flags;
uint16 scale;
} GCC_PACK;
struct gate_location {
int x;
int y;
};
struct AdjustBoxResult { /* Result type of AdjustBox functions */
int16 x,y;
uint16 dist;
};
struct BoxCoords { /* Box coordinates */
ScummPoint ul;
ScummPoint ur;
ScummPoint ll;
ScummPoint lr;
};
struct PathNode { /* Linked list of walkpath nodes */
uint index;
struct PathNode *left, *right;
};
struct PathVertex { /* Linked list of walkpath nodes */
PathNode *left;
PathNode *right;
};

View File

@ -22,7 +22,6 @@
#include "stdafx.h"
#include "scumm.h"
#include "gui.h"
#include "sound.h"
#ifdef _WIN32_WCE
// Additional variables for Win32 specific GUI

View File

@ -22,7 +22,6 @@
#include "stdafx.h"
#include "scumm.h"
#include "sound.h"
#ifdef _WIN32_WCE
#define _MANAGE_OLD_SAVE

128
scumm.h
View File

@ -39,12 +39,6 @@
class Scumm;
struct Actor;
struct gate_location
{
int x;
int y;
};
#include "smush.h"
typedef void (Scumm::*OpcodeProc)();
@ -61,15 +55,7 @@ enum {
KEY_SET_OPTIONS = 3456 // WinCE
};
/* Sound output type - MIDI */
enum {
MIDI_NULL = 0,
MIDI_WINDOWS = 1,
MIDI_TIMIDITY = 2,
MIDI_SEQ = 3,
MIDI_QTMUSIC = 4,
MIDI_AMIDI = 5
};
/* Script status type (slot.status) */
enum {
@ -78,43 +64,8 @@ enum {
ssRunning = 2
};
const uint16 many_direction_tab[18] = {
4,
8,
71,
109,
251,
530,
0,
0,
0,
0,
22,
72,
107,
157,
202,
252,
287,
337 };
const int16 many_direction_tab_2 [16] = {
0,
90,
180,
270,
-1,
-1,
-1,
-1,
0,
45,
90,
135,
180,
225,
270,
315 };
const uint16 many_direction_tab[18] = {4, 8, 71, 109, 251, 530, 0, 0, 0, 0, 22, 72, 107, 157, 202, 252, 287, 337};
const int16 many_direction_tab_2[16] = {0, 90, 180, 270, -1, -1, -1, -1, 0, 45, 90, 135, 180, 225, 270, 315};
struct ScummPoint {
int x,y;
@ -124,22 +75,10 @@ struct MemBlkHeader {
uint32 size;
};
#if !defined(__GNUC__)
#pragma START_PACK_STRUCTS
#endif
#define SIZEOF_BOX 20
struct Box { /* file format */
int16 ulx,uly;
int16 urx,ury;
int16 llx,lly;
int16 lrx,lry;
byte mask;
byte flags;
uint16 scale;
} GCC_PACK;
struct ResHdr {
uint32 tag, size;
} GCC_PACK;
@ -252,11 +191,6 @@ struct ImageHeader { /* file format */
#pragma END_PACK_STRUCTS
#endif
struct AdjustBoxResult {
int16 x,y;
uint16 dist;
};
struct VerbSlot {
int16 x,y;
int16 right, bottom;
@ -306,16 +240,6 @@ struct EnqueuedObject {
uint16 j,k,l;
};
struct PathNode {
uint index;
struct PathNode *left, *right;
};
struct PathVertex {
PathNode *left;
PathNode *right;
};
struct VirtScreen {
int number;
uint16 unk1;
@ -784,36 +708,6 @@ struct Gdi {
};
};
typedef enum {
MIXER_STANDARD,
MIXER_MP3
} MixerType;
struct MixerChannel {
void *_sfx_sound;
MixerType type;
union {
struct {
uint32 _sfx_pos;
uint32 _sfx_size;
uint32 _sfx_fp_speed;
uint32 _sfx_fp_pos;
} standard;
#ifdef COMPRESSED_SOUND_FILE
struct {
struct mad_stream stream;
struct mad_frame frame;
struct mad_synth synth;
uint32 silence_cut;
uint32 pos_in_frame;
uint32 position;
uint32 size;
} mp3;
#endif
} sound_data;
void mix(int16 *data, uint32 len);
void clear();
};
enum GameId {
GID_TENTACLE = 1,
@ -876,20 +770,8 @@ enum VideoMode {
VIDEO_SUPEREAGLE = 3
};
struct BoxCoords {
ScummPoint ul;
ScummPoint ur;
ScummPoint ll;
ScummPoint lr;
};
struct OffsetTable { /* Compressed Sound (.SO3) */
int org_offset;
int new_offset;
int num_tags;
int compressed_size;
};
#include "boxes.h"
#include "sound.h"
class Scumm {
public:

View File

@ -24,7 +24,6 @@
#include "scumm.h"
#include "gui.h"
#include "string.h"
#include "sound.h"
extern void launcherLoop();
void Scumm::initRandSeeds() {

View File

@ -25,7 +25,6 @@
#include "stdafx.h"
#include "scumm.h"
#include "gui.h"
#include "sound.h"
#include "SDL_thread.h"
#include "cdmusic.h"
@ -883,9 +882,6 @@ void launcherLoop() {
};
int main(int argc, char* argv[]) {
int delta;
int last_time, new_time;
#if defined(MACOS)
/* support for config file on macos */

View File

@ -22,7 +22,6 @@
#include "stdafx.h"
#include "scumm.h"
#include "sound.h"
#include "cdmusic.h"
#ifdef _WIN32_WCE
@ -370,7 +369,7 @@ void Scumm::setupSound() {
_sound_volume_sfx = 100;
_sound_volume_music = se->get_music_volume();
_sound_volume_master = (se->get_master_volume() / 127);
driver->midiSetDriver(se->midiGetDriver());
driver->midiSetDriver(_midi_driver);
}
_sfxFile = openSfxFile();
}

48
sound.h
View File

@ -17,6 +17,10 @@
*
* Change Log:
* $Log$
* Revision 1.9 2002/03/21 16:12:02 ender
* Move some box stuff from scumm.h to new boxes.h
* Also move some sound-related items from scumm.h to sound.h
*
* Revision 1.8 2002/03/16 18:58:51 ender
* MorphOS port (sdl version) + endian fixes for big endian machines.
*
@ -48,8 +52,50 @@
*
*/
#include "gmidi.h" /* General Midi */
struct OffsetTable { /* Compressed Sound (.SO3) */
int org_offset;
int new_offset;
int num_tags;
int compressed_size;
};
typedef enum { /* Mixer types */
MIXER_STANDARD,
MIXER_MP3
} MixerType;
struct MixerChannel { /* Mixer Channel */
void *_sfx_sound;
MixerType type;
union {
struct {
uint32 _sfx_pos;
uint32 _sfx_size;
uint32 _sfx_fp_speed;
uint32 _sfx_fp_pos;
} standard;
#ifdef COMPRESSED_SOUND_FILE
struct {
struct mad_stream stream;
struct mad_frame frame;
struct mad_synth synth;
uint32 silence_cut;
uint32 pos_in_frame;
uint32 position;
uint32 size;
} mp3;
#endif
} sound_data;
void mix(int16 *data, uint32 len);
void clear();
};
int clamp(int val, int min, int max);
struct FM_OPL;
struct Part;
struct MidiChannel;
@ -585,8 +631,6 @@ public:
void setBase(byte **base) { _base_sounds = base; }
SOUND_DRIVER_TYPE *driver() { return _driver; }
int midiGetDriver() {return _s->_midi_driver;}
void midiSetDriver(int devicetype);
bool _mt32emulate;
};

View File

@ -21,7 +21,6 @@
#include "stdafx.h"
#include "scumm.h"
#include "sound.h"
#include "fmopl.h"
#if defined USE_ADLIB

View File

@ -33,7 +33,6 @@
#include "stdafx.h"
#include "scumm.h"
#include "sound.h"
#include "gmidi.h"
void MidiSoundDriver::midiSetDriver(int devicetype) {

View File

@ -2,11 +2,34 @@
#define gmidi_h
/* General Midi header file */
#define SEQ_MIDIPUTC 5 /* For timidity */
#define SEQ_MIDIPUTC 5
#define SPECIAL_CHANNEL 9
#define DEVICE_NUM 0
/* Sound output type - MIDI */
enum {
MIDI_NULL = 0,
MIDI_WINDOWS = 1,
MIDI_TIMIDITY = 2,
MIDI_SEQ = 3,
MIDI_QTMUSIC = 4,
MIDI_AMIDI = 5
};
/* Roland to General Midi patch table. Still needs much work. */
static const byte mt32_to_gmidi[128] = {
0, 1, 2, 4, 4, 5, 5, 3, 16, 17, 18, 18, 19,
19, 20, 21, 6, 6, 6, 7, 7, 7, 8, 8, 62, 63,
62, 63, 38, 39, 38, 39, 88, 89, 52, 113, 97, 96, 91,
85, 14, 101, 68, 95, 86, 103, 88, 80, 48, 49, 51, 45,
40, 40, 42, 42, 43, 46, 46, 24, 25, 26, 27, 104, 32,
33, 34, 39, 36, 37, 38, 35, 79, 73, 72, 72, 74, 75,
64, 65, 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57,
63, 60, 60, 58, 61, 61, 11, 11, 12, 88, 9, 14, 13,
12, 107, 111, 77, 78, 78, 76, 121, 47, 117, 127, 115, 118,
116, 118, 94, 115, 9, 55, 124, 123, 125, 126, 127
};
#ifdef __APPLE__CW
#include <QuickTimeComponents.h>
#include "QuickTimeMusic.h"
@ -41,20 +64,4 @@
extern struct IOMidiRequest *ScummMidiRequest;
#endif
/* Roland to General Midi patch table. Still needs much work. */
static const byte mt32_to_gmidi[128] = {
0, 1, 2, 4, 4, 5, 5, 3, 16, 17, 18, 18, 19,
19, 20, 21, 6, 6, 6, 7, 7, 7, 8, 8, 62, 63,
62, 63, 38, 39, 38, 39, 88, 89, 52, 113, 97, 96, 91,
85, 14, 101, 68, 95, 86, 103, 88, 80, 48, 49, 51, 45,
40, 40, 42, 42, 43, 46, 46, 24, 25, 26, 27, 104, 32,
33, 34, 39, 36, 37, 38, 35, 79, 73, 72, 72, 74, 75,
64, 65, 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57,
63, 60, 60, 58, 61, 61, 11, 11, 12, 88, 9, 14, 13,
12, 107, 111, 77, 78, 78, 76, 121, 47, 117, 127, 115, 118,
116, 118, 94, 115, 9, 55, 124, 123, 125, 126, 127
};
#endif /* defined(gmidi_h) */

View File

@ -22,7 +22,6 @@
#include "stdafx.h"
#include "scumm.h"
#include "sound.h"
int num_mix;