mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-24 10:38:53 +00:00
Merge pull request #63 from felixrg/doomclassic
Add 64-bit and OpenAL support for Doom Classic
This commit is contained in:
commit
223b7ee527
45 changed files with 1150 additions and 188 deletions
|
@ -60,7 +60,7 @@ void DL_InitNetworking( DoomInterface *pdi );
|
|||
extern int PLAYERCOUNT;
|
||||
extern bool globalNetworking;
|
||||
extern bool debugOutput;
|
||||
extern BOOL globalLicenseFullGame;
|
||||
extern bool globalLicenseFullGame;
|
||||
extern int globalRichPresenceState; // values from spa.h X_CONTEXT_PRESENCE
|
||||
extern int globalNeedUpsell;
|
||||
// PS3
|
||||
|
|
|
@ -27,16 +27,17 @@ If you have questions concerning this license or the applicable additional terms
|
|||
*/
|
||||
|
||||
#include "Precompiled.h"
|
||||
#include "globaldata.h"
|
||||
|
||||
// We are referring to sprite numbers.
|
||||
#include "info.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "d_items.h"
|
||||
#endif
|
||||
#include "d_items.h"
|
||||
|
||||
#include "globaldata.h"
|
||||
|
||||
// We are referring to sprite numbers.
|
||||
#include "info.h"
|
||||
|
||||
|
||||
//
|
||||
// PSPRITE ACTIONS for waepons.
|
||||
|
|
|
@ -414,7 +414,7 @@ void D_DoAdvanceDemo (void)
|
|||
::g->pagetic = 8 * TICRATE;
|
||||
|
||||
::g->gamestate = GS_DEMOSCREEN;
|
||||
::g->pagename = "INTERPIC";
|
||||
::g->pagename = (char *)"INTERPIC";
|
||||
|
||||
if ( ::g->gamemode == commercial )
|
||||
S_StartMusic(mus_dm2ttl);
|
||||
|
@ -428,7 +428,7 @@ void D_DoAdvanceDemo (void)
|
|||
case 2:
|
||||
::g->pagetic = 3 * TICRATE;
|
||||
::g->gamestate = GS_DEMOSCREEN;
|
||||
::g->pagename = "INTERPIC";
|
||||
::g->pagename = (char *)"INTERPIC";
|
||||
break;
|
||||
case 3:
|
||||
G_DeferedPlayDemo ("demo2");
|
||||
|
@ -436,7 +436,7 @@ void D_DoAdvanceDemo (void)
|
|||
case 4:
|
||||
::g->pagetic = 3 * TICRATE;
|
||||
::g->gamestate = GS_DEMOSCREEN;
|
||||
::g->pagename = "INTERPIC";
|
||||
::g->pagename = (char *)"INTERPIC";
|
||||
break;
|
||||
case 5:
|
||||
G_DeferedPlayDemo ("demo3");
|
||||
|
@ -445,7 +445,7 @@ void D_DoAdvanceDemo (void)
|
|||
case 6:
|
||||
::g->pagetic = 3 * TICRATE;
|
||||
::g->gamestate = GS_DEMOSCREEN;
|
||||
::g->pagename = "INTERPIC";
|
||||
::g->pagename = (char *)"INTERPIC";
|
||||
break;
|
||||
case 7:
|
||||
G_DeferedPlayDemo ("demo4");
|
||||
|
|
|
@ -74,7 +74,7 @@ extern bool globalNetworking;
|
|||
//
|
||||
int NetbufferSize (void)
|
||||
{
|
||||
int size = (int)&(((doomdata_t *)0)->cmds[::g->netbuffer->numtics]);
|
||||
int size = (intptr_t)&(((doomdata_t *)0)->cmds[::g->netbuffer->numtics]);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ unsigned NetbufferChecksum (void)
|
|||
c = 0x1234567;
|
||||
|
||||
if ( globalNetworking ) {
|
||||
l = (NetbufferSize () - (int)&(((doomdata_t *)0)->retransmitfrom))/4;
|
||||
l = (NetbufferSize () - (intptr_t)&(((doomdata_t *)0)->retransmitfrom))/4;
|
||||
for (i=0 ; i<l ; i++)
|
||||
c += ((unsigned *)&::g->netbuffer->retransmitfrom)[i] * (i+1);
|
||||
}
|
||||
|
|
|
@ -219,7 +219,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#define BFGCELLS 40
|
||||
// p_pspr.defs end //
|
||||
// p_saveg.defs begin //
|
||||
#define PADSAVEP() ::g->save_p += (4 - ((int) ::g->save_p & 3)) & 3
|
||||
#define PADSAVEP() ::g->save_p += (4 - ((intptr_t) ::g->save_p & 3)) & 3
|
||||
// p_saveg.defs end //
|
||||
// p_setup.defs begin //
|
||||
#define MAX_DEATHMATCH_STARTS 10
|
||||
|
|
|
@ -27,14 +27,15 @@ If you have questions concerning this license or the applicable additional terms
|
|||
*/
|
||||
|
||||
#include "Precompiled.h"
|
||||
#include "globaldata.h"
|
||||
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "doomdef.h"
|
||||
#endif
|
||||
#include "doomdef.h"
|
||||
|
||||
#include "globaldata.h"
|
||||
|
||||
|
||||
// Location for any defines turned variables.
|
||||
|
||||
// None.
|
||||
|
|
|
@ -337,6 +337,9 @@ typedef enum
|
|||
//#include "sounds.h"
|
||||
|
||||
|
||||
#ifndef _WIN32
|
||||
#define MAX_PATH 260
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __DOOMDEF__
|
||||
|
|
|
@ -41,7 +41,7 @@ extern void I_SetTime( int );
|
|||
bool waitingForWipe;
|
||||
|
||||
static const int dargc = 7;
|
||||
static char* dargv[4][7] =
|
||||
static const char* dargv[4][7] =
|
||||
{
|
||||
{ "doomlauncher", "-net", "0", "127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1" },
|
||||
{ "doomlauncher", "-net", "1", "127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1" },
|
||||
|
@ -106,7 +106,7 @@ void DoomInterface::Startup( int playerscount, bool multiplayer )
|
|||
printf( "\n" );
|
||||
DoomLib::InitGame(mpArgc[i], mpArgVPtr[i] );
|
||||
} else {
|
||||
DoomLib::InitGame(localdargc, dargv[i] );
|
||||
DoomLib::InitGame(localdargc, (char **)dargv[i] );
|
||||
}
|
||||
|
||||
if( DoomLib::skipToLoad ) {
|
||||
|
|
|
@ -141,9 +141,9 @@ namespace DoomLib
|
|||
|
||||
Globals *globaldata[4];
|
||||
|
||||
RecvFunc Recv;
|
||||
SendFunc Send;
|
||||
SendRemoteFunc SendRemote;
|
||||
//RecvFunc Recv;
|
||||
//SendFunc Send;
|
||||
//SendRemoteFunc SendRemote;
|
||||
|
||||
|
||||
bool Active = true;
|
||||
|
@ -419,12 +419,14 @@ void DoomLib::SetPlayer( int id )
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
void DoomLib::SetNetworking( RecvFunc rf, SendFunc sf, SendRemoteFunc sendRemote )
|
||||
{
|
||||
Recv = rf;
|
||||
Send = sf;
|
||||
SendRemote = sendRemote;
|
||||
}
|
||||
#endif
|
||||
|
||||
int DoomLib::GetPlayer()
|
||||
{
|
||||
|
@ -496,7 +498,7 @@ int DoomLib::PlayerIndexToRemoteNode( int index ) {
|
|||
return indexMap[::g->consoleplayer][index];
|
||||
}
|
||||
|
||||
void I_Error (char *error, ...);
|
||||
void I_Error (const char *error, ...);
|
||||
extern bool useTech5Packets;
|
||||
|
||||
void DoomLib::PollNetwork() {
|
||||
|
@ -544,7 +546,7 @@ void DoomLib::SendNetwork() {
|
|||
if ( !globalNetworking ) {
|
||||
return;
|
||||
}
|
||||
DoomLib::SendRemote();
|
||||
//DoomLib::SendRemote();
|
||||
}
|
||||
|
||||
void DoomLib::RunSound() {
|
||||
|
|
|
@ -93,9 +93,9 @@ struct ExpansionData {
|
|||
|
||||
namespace DoomLib
|
||||
{
|
||||
typedef int ( *RecvFunc)( char* buff, DWORD *numRecv );
|
||||
typedef int ( *SendFunc)( const char* buff, DWORD size, sockaddr_in *target, int toNode );
|
||||
typedef int ( *SendRemoteFunc)();
|
||||
//typedef int ( *RecvFunc)( char* buff, DWORD *numRecv );
|
||||
//typedef int ( *SendFunc)( const char* buff, DWORD size, sockaddr_in *target, int toNode );
|
||||
//typedef int ( *SendRemoteFunc)();
|
||||
|
||||
void InitGlobals( void *ptr = NULL );
|
||||
void InitGame( int argc, char ** argv );
|
||||
|
@ -108,7 +108,7 @@ namespace DoomLib
|
|||
void Draw();
|
||||
void Shutdown();
|
||||
|
||||
void SetNetworking( RecvFunc rf, SendFunc sf, SendRemoteFunc sendRemote );
|
||||
//void SetNetworking( RecvFunc rf, SendFunc sf, SendRemoteFunc sendRemote );
|
||||
|
||||
void SetPlayer( int id );
|
||||
int GetPlayer();
|
||||
|
@ -126,9 +126,9 @@ namespace DoomLib
|
|||
|
||||
void RunSound();
|
||||
|
||||
extern RecvFunc Recv;
|
||||
extern SendFunc Send;
|
||||
extern SendRemoteFunc SendRemote;
|
||||
//extern RecvFunc Recv;
|
||||
//extern SendFunc Send;
|
||||
//extern SendRemoteFunc SendRemote;
|
||||
|
||||
extern void* (*Z_Malloc)( int size, int tag, void* user );
|
||||
extern void (*Z_FreeTag)(int lowtag );
|
||||
|
|
|
@ -27,14 +27,13 @@ If you have questions concerning this license or the applicable additional terms
|
|||
*/
|
||||
|
||||
#include "Precompiled.h"
|
||||
#include "globaldata.h"
|
||||
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dstrings.h"
|
||||
#endif
|
||||
#include "dstrings.h"
|
||||
|
||||
#include "globaldata.h"
|
||||
|
||||
|
||||
const char* endmsg[NUM_QUITMESSAGES+1]=
|
||||
|
|
|
@ -592,9 +592,9 @@ qboolean F_CastResponder (event_t* ev)
|
|||
}
|
||||
|
||||
|
||||
void F_CastPrint (char* text)
|
||||
void F_CastPrint (const char* text)
|
||||
{
|
||||
char* ch;
|
||||
const char* ch;
|
||||
int c;
|
||||
int cx;
|
||||
int w;
|
||||
|
|
|
@ -1421,7 +1421,7 @@ qboolean G_DoLoadGame ()
|
|||
loadingGame = false;
|
||||
waitingForWipe = false;
|
||||
|
||||
return FALSE; // bad version
|
||||
return false; // bad version
|
||||
}
|
||||
|
||||
::g->save_p += VERSIONSIZE;
|
||||
|
@ -1463,7 +1463,7 @@ qboolean G_DoLoadGame ()
|
|||
|
||||
Z_Free(g->savebuffer);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1844,9 +1844,9 @@ void G_BeginRecording (void)
|
|||
//
|
||||
// G_PlayDemo
|
||||
//
|
||||
void G_DeferedPlayDemo (char* name)
|
||||
void G_DeferedPlayDemo (const char* name)
|
||||
{
|
||||
::g->defdemoname = name;
|
||||
::g->defdemoname = (char *)name;
|
||||
::g->gameaction = ga_playdemo;
|
||||
}
|
||||
|
||||
|
@ -1946,14 +1946,14 @@ void G_DoPlayDemo (void)
|
|||
//
|
||||
// G_TimeDemo
|
||||
//
|
||||
void G_TimeDemo (char* name)
|
||||
void G_TimeDemo (const char* name)
|
||||
{
|
||||
::g->nodrawers = M_CheckParm ("-nodraw");
|
||||
::g->noblit = M_CheckParm ("-noblit");
|
||||
::g->timingdemo = true;
|
||||
::g->singletics = true;
|
||||
|
||||
::g->defdemoname = name;
|
||||
::g->defdemoname = (char *)name;
|
||||
::g->gameaction = ga_playdemo;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ void G_InitNew ( skill_t skill, int episode, int map );
|
|||
// but a warp test can start elsewhere
|
||||
void G_DeferedInitNew (skill_t skill, int episode, int map);
|
||||
|
||||
void G_DeferedPlayDemo (char* demo);
|
||||
void G_DeferedPlayDemo (const char* demo);
|
||||
|
||||
// Can be called by the startup code or M_Responder,
|
||||
// calls P_SetupLevel or W_EnterWorld.
|
||||
|
@ -63,7 +63,7 @@ void G_RecordDemo (char* name);
|
|||
void G_BeginRecording (void);
|
||||
|
||||
void G_PlayDemo (char* name);
|
||||
void G_TimeDemo (char* name);
|
||||
void G_TimeDemo (const char* name);
|
||||
qboolean G_CheckDemoStatus (void);
|
||||
|
||||
void G_ExitLevel (void);
|
||||
|
|
|
@ -84,11 +84,11 @@ void M_SetupNextMenu(menu_t *menudef);
|
|||
void M_DrawThermo(int x,int y,int thermWidth,int thermDot);
|
||||
void M_DrawEmptyCell(menu_t *menu,int item);
|
||||
void M_DrawSelCell(menu_t *menu,int item);
|
||||
void M_WriteText(int x, int y, char *string);
|
||||
int M_StringWidth(char *string);
|
||||
int M_StringHeight(char *string);
|
||||
void M_WriteText(int x, int y, const char *string);
|
||||
int M_StringWidth(const char *string);
|
||||
int M_StringHeight(const char *string);
|
||||
void M_StartControlPanel(void);
|
||||
void M_StartMessage(char *string,messageRoutine_t routine,qboolean input);
|
||||
void M_StartMessage(const char *string,messageRoutine_t routine,qboolean input);
|
||||
void M_StopMessage(void);
|
||||
void M_ClearMenus (void);
|
||||
|
||||
|
|
|
@ -84,7 +84,8 @@ int DOOMPORT = 1002; // DHM - Nerve :: On original XBox, ports 1000 - 1255 saved
|
|||
|
||||
|
||||
unsigned long GetServerIP() {
|
||||
return ::g->sendaddress[::g->doomcom.consoleplayer].sin_addr.s_addr;
|
||||
//return ::g->sendaddress[::g->doomcom.consoleplayer].sin_addr.s_addr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void (*netget) (void);
|
||||
|
@ -96,16 +97,17 @@ void (*netsend) (void);
|
|||
//
|
||||
int UDPsocket (void)
|
||||
{
|
||||
int s;
|
||||
//int s;
|
||||
|
||||
// allocate a socket
|
||||
s = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if ( !IsValidSocket( s ) ) {
|
||||
int err = GetLastSocketError();
|
||||
I_Error( "can't create socket, error %d", err );
|
||||
}
|
||||
//s = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
//if ( !IsValidSocket( s ) ) {
|
||||
// int err = GetLastSocketError();
|
||||
// I_Error( "can't create socket, error %d", err );
|
||||
//}
|
||||
|
||||
return s;
|
||||
//return s;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -264,15 +266,15 @@ void I_ShutdownNetwork( void ) {
|
|||
|
||||
void I_NetCmd (void)
|
||||
{
|
||||
if (::g->doomcom.command == CMD_SEND)
|
||||
{
|
||||
netsend ();
|
||||
}
|
||||
else if (::g->doomcom.command == CMD_GET)
|
||||
{
|
||||
netget ();
|
||||
}
|
||||
else
|
||||
I_Error ("Bad net cmd: %i\n",::g->doomcom.command);
|
||||
//if (::g->doomcom.command == CMD_SEND)
|
||||
//{
|
||||
// netsend ();
|
||||
//}
|
||||
//else if (::g->doomcom.command == CMD_GET)
|
||||
//{
|
||||
// netget ();
|
||||
//}
|
||||
//else
|
||||
// I_Error ("Bad net cmd: %i\n",::g->doomcom.command);
|
||||
}
|
||||
|
||||
|
|
954
doomclassic/doom/i_sound_openal.cpp
Normal file
954
doomclassic/doom/i_sound_openal.cpp
Normal file
|
@ -0,0 +1,954 @@
|
|||
/*
|
||||
===========================================================================
|
||||
|
||||
Doom 3 BFG Edition GPL Source Code
|
||||
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 2013 Felix Rueegg
|
||||
|
||||
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
||||
|
||||
Doom 3 BFG Edition Source Code 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Doom 3 BFG Edition Source Code 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 Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
|
||||
|
||||
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
|
||||
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#include "Precompiled.h"
|
||||
#include "globaldata.h"
|
||||
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// System interface for sound.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
// Timer stuff. Experimental.
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
#include "z_zone.h"
|
||||
#include "i_system.h"
|
||||
#include "i_sound.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_misc.h"
|
||||
#include "w_wad.h"
|
||||
#include "d_main.h"
|
||||
#include "doomdef.h"
|
||||
#include "../timidity/timidity.h"
|
||||
#include "../timidity/controls.h"
|
||||
|
||||
#include "sound/snd_local.h"
|
||||
|
||||
#pragma warning ( disable : 4244 )
|
||||
|
||||
#define SFX_RATE 11050
|
||||
#define SFX_SAMPLETYPE AL_FORMAT_MONO8
|
||||
|
||||
#define MIDI_CHANNELS 2
|
||||
#define MIDI_RATE 22050
|
||||
#define MIDI_SAMPLETYPE AL_FORMAT_STEREO8
|
||||
#define MIDI_FORMAT AUDIO_U8
|
||||
#define MIDI_FORMAT_BYTES 1
|
||||
|
||||
ALuint alMusicSourceVoice;
|
||||
ALuint alMusicBuffer;
|
||||
|
||||
MidiSong* doomMusic;
|
||||
byte* musicBuffer;
|
||||
int totalBufferSize;
|
||||
|
||||
bool waitingForMusic;
|
||||
bool musicReady;
|
||||
|
||||
typedef struct {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
} vec3_t;
|
||||
|
||||
typedef struct {
|
||||
vec3_t OrientTop;
|
||||
vec3_t OrientFront;
|
||||
vec3_t Position;
|
||||
} doomListener_t;
|
||||
|
||||
typedef struct tagActiveSound_t {
|
||||
ALuint alSourceVoice;
|
||||
int id;
|
||||
int valid;
|
||||
int start;
|
||||
int player;
|
||||
bool localSound;
|
||||
mobj_t *originator;
|
||||
} activeSound_t;
|
||||
|
||||
// cheap little struct to hold a sound
|
||||
typedef struct {
|
||||
int vol;
|
||||
int player;
|
||||
int pitch;
|
||||
int priority;
|
||||
mobj_t *originator;
|
||||
mobj_t *listener;
|
||||
} soundEvent_t;
|
||||
|
||||
// array of all the possible sounds
|
||||
// in split screen we only process the loudest sound of each type per frame
|
||||
soundEvent_t soundEvents[128];
|
||||
extern int PLAYERCOUNT;
|
||||
|
||||
// Source voice settings for all sound effects
|
||||
const ALfloat SFX_MAX_DISTANCE = 1200.f;
|
||||
const ALfloat SFX_REFERENCE_DISTANCE = 100.f;
|
||||
const ALfloat SFX_ROLLOFF_FACTOR = 0.2f;
|
||||
|
||||
// Real volumes
|
||||
const float GLOBAL_VOLUME_MULTIPLIER = 0.5f;
|
||||
|
||||
float x_SoundVolume = GLOBAL_VOLUME_MULTIPLIER;
|
||||
float x_MusicVolume = GLOBAL_VOLUME_MULTIPLIER;
|
||||
|
||||
// The actual lengths of all sound effects.
|
||||
static int lengths[NUMSFX];
|
||||
ALuint alBuffers[NUMSFX];
|
||||
activeSound_t activeSounds[NUM_SOUNDBUFFERS] = {0};
|
||||
|
||||
int S_initialized = 0;
|
||||
bool Music_initialized = false;
|
||||
static bool soundHardwareInitialized = false;
|
||||
static int numOutputChannels = 0;
|
||||
|
||||
doomListener_t doom_Listener;
|
||||
|
||||
void I_InitSoundChannel( int channel, int numOutputChannels_ );
|
||||
|
||||
/*
|
||||
======================
|
||||
getsfx
|
||||
======================
|
||||
*/
|
||||
// This function loads the sound data from the WAD lump,
|
||||
// for single sound.
|
||||
//
|
||||
void* getsfx ( const char* sfxname, int* len )
|
||||
{
|
||||
unsigned char* sfx;
|
||||
unsigned char* sfxmem;
|
||||
int size;
|
||||
char name[20];
|
||||
int sfxlump;
|
||||
//float scale = 1.0f;
|
||||
|
||||
// Get the sound data from the WAD
|
||||
sprintf( name, "ds%s", sfxname );
|
||||
|
||||
// Scale down the plasma gun, it clips
|
||||
//if ( strcmp( sfxname, "plasma" ) == 0 ) {
|
||||
// scale = 0.75f;
|
||||
//}
|
||||
//if ( strcmp( sfxname, "itemup" ) == 0 ) {
|
||||
// scale = 1.333f;
|
||||
//}
|
||||
|
||||
// If sound requested is not found in current WAD, use pistol as default
|
||||
if ( W_CheckNumForName( name ) == -1 )
|
||||
sfxlump = W_GetNumForName( "dspistol" );
|
||||
else
|
||||
sfxlump = W_GetNumForName( name );
|
||||
|
||||
// Sound lump headers are 8 bytes.
|
||||
const int SOUND_LUMP_HEADER_SIZE_IN_BYTES = 8;
|
||||
|
||||
size = W_LumpLength( sfxlump ) - SOUND_LUMP_HEADER_SIZE_IN_BYTES;
|
||||
|
||||
sfx = (unsigned char*)W_CacheLumpNum( sfxlump, PU_CACHE_SHARED );
|
||||
const unsigned char * sfxSampleStart = sfx + SOUND_LUMP_HEADER_SIZE_IN_BYTES;
|
||||
|
||||
// Allocate from zone memory.
|
||||
//sfxmem = (float*)DoomLib::Z_Malloc( size*(sizeof(float)), PU_SOUND_SHARED, 0 );
|
||||
sfxmem = (unsigned char*)malloc( size * sizeof(unsigned char) );
|
||||
|
||||
// Now copy, and convert to Xbox360 native float samples, do initial volume ramp, and scale
|
||||
for ( int i = 0; i < size; i++ ) {
|
||||
sfxmem[i] = sfxSampleStart[i];// * scale;
|
||||
}
|
||||
|
||||
// Remove the cached lump.
|
||||
Z_Free( sfx );
|
||||
|
||||
// Set length.
|
||||
*len = size;
|
||||
|
||||
// Return allocated padded data.
|
||||
return (void *) (sfxmem);
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_SetChannels
|
||||
======================
|
||||
*/
|
||||
void I_SetChannels()
|
||||
{
|
||||
// Original Doom set up lookup tables here
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_SetSfxVolume
|
||||
======================
|
||||
*/
|
||||
void I_SetSfxVolume( int volume )
|
||||
{
|
||||
x_SoundVolume = ((float)volume / 15.f) * GLOBAL_VOLUME_MULTIPLIER;
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_GetSfxLumpNum
|
||||
======================
|
||||
*/
|
||||
//
|
||||
// Retrieve the raw data lump index
|
||||
// for a given SFX name.
|
||||
//
|
||||
int I_GetSfxLumpNum( sfxinfo_t* sfx )
|
||||
{
|
||||
char namebuf[9];
|
||||
sprintf( namebuf, "ds%s", sfx->name );
|
||||
return W_GetNumForName( namebuf );
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_StartSound2
|
||||
======================
|
||||
*/
|
||||
// Starting a sound means adding it
|
||||
// to the current list of active sounds
|
||||
// in the internal channels.
|
||||
// As the SFX info struct contains
|
||||
// e.g. a pointer to the raw data,
|
||||
// it is ignored.
|
||||
// As our sound handling does not handle
|
||||
// priority, it is ignored.
|
||||
// Pitching (that is, increased speed of playback) is set
|
||||
//
|
||||
int I_StartSound2 ( int id, int player, mobj_t *origin, mobj_t *listener_origin, int pitch, int priority )
|
||||
{
|
||||
if ( !soundHardwareInitialized || id == 0 ) {
|
||||
return id;
|
||||
}
|
||||
|
||||
int i;
|
||||
activeSound_t* sound = 0;
|
||||
int oldest = 0, oldestnum = -1;
|
||||
|
||||
// these id's should not overlap
|
||||
if ( id == sfx_sawup || id == sfx_sawidl || id == sfx_sawful || id == sfx_sawhit || id == sfx_stnmov ) {
|
||||
// Loop all channels, check.
|
||||
for ( i = 0; i < NUM_SOUNDBUFFERS; i++ )
|
||||
{
|
||||
sound = &activeSounds[i];
|
||||
|
||||
if ( sound->valid && ( sound->id == id && sound->player == player ) ) {
|
||||
I_StopSound( sound->id, player );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// find a valid channel, or one that has finished playing
|
||||
for ( i = 0; i < NUM_SOUNDBUFFERS; i++ ) {
|
||||
sound = &activeSounds[i];
|
||||
|
||||
if ( !sound->valid )
|
||||
break;
|
||||
|
||||
if ( !oldest || oldest > sound->start ) {
|
||||
oldestnum = i;
|
||||
oldest = sound->start;
|
||||
}
|
||||
|
||||
ALint sourceState;
|
||||
alGetSourcei( sound->alSourceVoice, AL_SOURCE_STATE, &sourceState );
|
||||
if ( sourceState == AL_STOPPED ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// none found, so use the oldest one
|
||||
if ( i == NUM_SOUNDBUFFERS ) {
|
||||
i = oldestnum;
|
||||
sound = &activeSounds[i];
|
||||
}
|
||||
|
||||
alSourceStop( sound->alSourceVoice );
|
||||
|
||||
// Attach the source voice to the correct buffer
|
||||
if ( sound->id != id ) {
|
||||
alSourcei( sound->alSourceVoice, AL_BUFFER, 0 );
|
||||
alSourcei( sound->alSourceVoice, AL_BUFFER, alBuffers[id] );
|
||||
}
|
||||
|
||||
// Set the source voice volume
|
||||
alSourcef( sound->alSourceVoice, AL_GAIN, x_SoundVolume );
|
||||
|
||||
// Set the source voice pitch
|
||||
alSourcef( sound->alSourceVoice, AL_PITCH, 1 + ((float)pitch-128.f)/95.f );
|
||||
|
||||
// Set the source voice position
|
||||
ALfloat x = 0.f;
|
||||
ALfloat y = 0.f;
|
||||
ALfloat z = 0.f;
|
||||
if ( origin ) {
|
||||
if ( origin == listener_origin ) {
|
||||
sound->localSound = true;
|
||||
} else {
|
||||
sound->localSound = false;
|
||||
x = (ALfloat)(origin->x >> FRACBITS);
|
||||
z = (ALfloat)(origin->y >> FRACBITS);
|
||||
}
|
||||
} else {
|
||||
sound->localSound = true;
|
||||
}
|
||||
if ( sound->localSound ) {
|
||||
x = doom_Listener.Position.x;
|
||||
z = doom_Listener.Position.z;
|
||||
}
|
||||
alSource3f( sound->alSourceVoice, AL_POSITION, x, y, z );
|
||||
|
||||
alSourcePlay( sound->alSourceVoice );
|
||||
|
||||
// Set id, and start time
|
||||
sound->id = id;
|
||||
sound->start = ::g->gametic;
|
||||
sound->valid = 1;
|
||||
sound->player = player;
|
||||
sound->originator = origin;
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_ProcessSoundEvents
|
||||
======================
|
||||
*/
|
||||
void I_ProcessSoundEvents( void )
|
||||
{
|
||||
for( int i = 0; i < 128; i++ ) {
|
||||
if( soundEvents[i].pitch ) {
|
||||
I_StartSound2( i, soundEvents[i].player, soundEvents[i].originator, soundEvents[i].listener,
|
||||
soundEvents[i].pitch, soundEvents[i].priority );
|
||||
}
|
||||
}
|
||||
memset( soundEvents, 0, sizeof( soundEvents ) );
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_StartSound
|
||||
======================
|
||||
*/
|
||||
int I_StartSound ( int id, mobj_t *origin, mobj_t *listener_origin, int vol, int pitch, int priority )
|
||||
{
|
||||
// only allow player 0s sounds in intermission and finale screens
|
||||
if( ::g->gamestate != GS_LEVEL && DoomLib::GetPlayer() != 0 ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// if we're only one player or we're trying to play the chainsaw sound, do it normal
|
||||
// otherwise only allow one sound of each type per frame
|
||||
if( PLAYERCOUNT == 1 || id == sfx_sawup || id == sfx_sawidl || id == sfx_sawful || id == sfx_sawhit ) {
|
||||
return I_StartSound2( id, ::g->consoleplayer, origin, listener_origin, pitch, priority );
|
||||
} else {
|
||||
if( soundEvents[ id ].vol < vol ) {
|
||||
soundEvents[ id ].player = DoomLib::GetPlayer();
|
||||
soundEvents[ id ].pitch = pitch;
|
||||
soundEvents[ id ].priority = priority;
|
||||
soundEvents[ id ].vol = vol;
|
||||
soundEvents[ id ].originator = origin;
|
||||
soundEvents[ id ].listener = listener_origin;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_StopSound
|
||||
======================
|
||||
*/
|
||||
void I_StopSound ( int handle, int player )
|
||||
{
|
||||
// You need the handle returned by StartSound.
|
||||
// Would be looping all channels,
|
||||
// tracking down the handle,
|
||||
// and setting the channel to zero.
|
||||
int i;
|
||||
activeSound_t* sound = 0;
|
||||
|
||||
for ( i = 0; i < NUM_SOUNDBUFFERS; ++i ) {
|
||||
sound = &activeSounds[i];
|
||||
if ( !sound->valid || sound->id != handle || (player >= 0 && sound->player != player) )
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( i == NUM_SOUNDBUFFERS )
|
||||
return;
|
||||
|
||||
// Stop the sound
|
||||
alSourceStop( sound->alSourceVoice );
|
||||
|
||||
sound->valid = 0;
|
||||
sound->player = -1;
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_SoundIsPlaying
|
||||
======================
|
||||
*/
|
||||
int I_SoundIsPlaying( int handle )
|
||||
{
|
||||
if ( !soundHardwareInitialized ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i;
|
||||
activeSound_t* sound;
|
||||
|
||||
for ( i = 0; i < NUM_SOUNDBUFFERS; ++i ) {
|
||||
sound = &activeSounds[i];
|
||||
if ( !sound->valid || sound->id != handle )
|
||||
continue;
|
||||
|
||||
ALint sourceState;
|
||||
alGetSourcei( sound->alSourceVoice, AL_SOURCE_STATE, &sourceState );
|
||||
if ( sourceState == AL_PLAYING ) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_UpdateSound
|
||||
======================
|
||||
*/
|
||||
// Update listener position and go through all the
|
||||
// channels and update sound positions.
|
||||
void I_UpdateSound( void )
|
||||
{
|
||||
if ( !soundHardwareInitialized ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update listener orientation and position
|
||||
mobj_t *playerObj = ::g->players[0].mo;
|
||||
if ( playerObj ) {
|
||||
angle_t pAngle = playerObj->angle;
|
||||
fixed_t fx, fz;
|
||||
|
||||
pAngle >>= ANGLETOFINESHIFT;
|
||||
|
||||
fx = finecosine[pAngle];
|
||||
fz = finesine[pAngle];
|
||||
|
||||
doom_Listener.OrientFront.x = (float)(fx) / 65535.f;
|
||||
doom_Listener.OrientFront.y = 0.f;
|
||||
doom_Listener.OrientFront.z = (float)(fz) / 65535.f;
|
||||
doom_Listener.Position.x = (float)(playerObj->x >> FRACBITS);
|
||||
doom_Listener.Position.y = 0.f;
|
||||
doom_Listener.Position.z = (float)(playerObj->y >> FRACBITS);
|
||||
} else {
|
||||
doom_Listener.OrientFront.x = 0.f;
|
||||
doom_Listener.OrientFront.y = 0.f;
|
||||
doom_Listener.OrientFront.z = 1.f;
|
||||
|
||||
doom_Listener.Position.x = 0.f;
|
||||
doom_Listener.Position.y = 0.f;
|
||||
doom_Listener.Position.z = 0.f;
|
||||
}
|
||||
|
||||
ALfloat listenerOrientation[] = { doom_Listener.OrientFront.x, doom_Listener.OrientFront.y,
|
||||
doom_Listener.OrientFront.z, doom_Listener.OrientTop.x, doom_Listener.OrientTop.y,
|
||||
doom_Listener.OrientTop.z };
|
||||
alListenerfv( AL_ORIENTATION, listenerOrientation );
|
||||
alListener3f( AL_POSITION, doom_Listener.Position.x, doom_Listener.Position.y, doom_Listener.Position.z );
|
||||
|
||||
// Update playing source voice positions
|
||||
int i;
|
||||
activeSound_t* sound;
|
||||
for ( i=0; i < NUM_SOUNDBUFFERS; i++ ) {
|
||||
sound = &activeSounds[i];
|
||||
|
||||
if ( !sound->valid ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ALint sourceState;
|
||||
alGetSourcei( sound->alSourceVoice, AL_SOURCE_STATE, &sourceState );
|
||||
if ( sourceState == AL_PLAYING ) {
|
||||
if ( sound->localSound ) {
|
||||
alSource3f( sound->alSourceVoice, AL_POSITION, doom_Listener.Position.x,
|
||||
doom_Listener.Position.y, doom_Listener.Position.z );
|
||||
} else {
|
||||
ALfloat x = (ALfloat)(sound->originator->x >> FRACBITS);
|
||||
ALfloat y = 0.f;
|
||||
ALfloat z = (ALfloat)(sound->originator->y >> FRACBITS);
|
||||
|
||||
alSource3f( sound->alSourceVoice, AL_POSITION, x, y, z );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_UpdateSoundParams
|
||||
======================
|
||||
*/
|
||||
void I_UpdateSoundParams( int handle, int vol, int sep, int pitch )
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_ShutdownSound
|
||||
======================
|
||||
*/
|
||||
void I_ShutdownSound( void )
|
||||
{
|
||||
int done = 0;
|
||||
int i;
|
||||
|
||||
if ( S_initialized ) {
|
||||
// Stop all sounds
|
||||
for ( i = 0; i < NUM_SOUNDBUFFERS; i++ ) {
|
||||
activeSound_t * sound = &activeSounds[i];
|
||||
|
||||
if ( !sound ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
I_StopSound( sound->id, 0 );
|
||||
}
|
||||
|
||||
// Free allocated sound memory
|
||||
for ( i = 1; i < NUMSFX; i++ ) {
|
||||
if ( S_sfx[i].data && !(S_sfx[i].link) ) {
|
||||
free( S_sfx[i].data );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
I_StopSong( 0 );
|
||||
|
||||
S_initialized = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_InitSoundHardware
|
||||
|
||||
Called from the tech4x initialization code. Sets up Doom classic's
|
||||
sound channels.
|
||||
======================
|
||||
*/
|
||||
void I_InitSoundHardware( int numOutputChannels_, int channelMask )
|
||||
{
|
||||
::numOutputChannels = numOutputChannels_;
|
||||
|
||||
// Initialize source voices
|
||||
for ( int i = 0; i < NUM_SOUNDBUFFERS; i++ ) {
|
||||
I_InitSoundChannel( i, numOutputChannels );
|
||||
}
|
||||
|
||||
// Create OpenAL buffers for all sounds
|
||||
for ( int i = 1; i < NUMSFX; i++ ) {
|
||||
alGenBuffers( (ALuint)1, &alBuffers[i] );
|
||||
}
|
||||
|
||||
I_InitMusic();
|
||||
|
||||
soundHardwareInitialized = true;
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_ShutdownSoundHardware
|
||||
|
||||
Called from the tech4x shutdown code. Tears down Doom classic's
|
||||
sound channels.
|
||||
======================
|
||||
*/
|
||||
void I_ShutdownSoundHardware()
|
||||
{
|
||||
soundHardwareInitialized = false;
|
||||
|
||||
I_ShutdownMusic();
|
||||
|
||||
// Delete all source voices
|
||||
for ( int i = 0; i < NUM_SOUNDBUFFERS; ++i ) {
|
||||
activeSound_t * sound = &activeSounds[i];
|
||||
|
||||
if ( !sound ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( sound->alSourceVoice ) {
|
||||
alSourceStop( sound->alSourceVoice );
|
||||
alSourcei( sound->alSourceVoice, AL_BUFFER, 0 );
|
||||
alDeleteSources( 1, &sound->alSourceVoice );
|
||||
}
|
||||
}
|
||||
|
||||
// Delete OpenAL buffers for all sounds
|
||||
for ( int i = 0; i < NUMSFX; i++ ) {
|
||||
alDeleteBuffers( 1, &alBuffers[i] );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_InitSoundChannel
|
||||
======================
|
||||
*/
|
||||
void I_InitSoundChannel( int channel, int numOutputChannels_ )
|
||||
{
|
||||
activeSound_t *soundchannel = &activeSounds[ channel ];
|
||||
|
||||
alGenSources( (ALuint)1, &soundchannel->alSourceVoice );
|
||||
|
||||
alSource3f( soundchannel->alSourceVoice, AL_VELOCITY, 0.f, 0.f, 0.f );
|
||||
alSourcef( soundchannel->alSourceVoice, AL_LOOPING, AL_FALSE );
|
||||
alSourcef( soundchannel->alSourceVoice, AL_MAX_DISTANCE, SFX_MAX_DISTANCE );
|
||||
alSourcef( soundchannel->alSourceVoice, AL_REFERENCE_DISTANCE, SFX_REFERENCE_DISTANCE );
|
||||
alSourcef( soundchannel->alSourceVoice, AL_ROLLOFF_FACTOR, SFX_ROLLOFF_FACTOR );
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_InitSound
|
||||
======================
|
||||
*/
|
||||
void I_InitSound()
|
||||
{
|
||||
if ( S_initialized == 0 ) {
|
||||
// Set up listener parameters
|
||||
doom_Listener.OrientFront.x = 0.f;
|
||||
doom_Listener.OrientFront.y = 0.f;
|
||||
doom_Listener.OrientFront.z = 1.f;
|
||||
|
||||
doom_Listener.OrientTop.x = 0.f;
|
||||
doom_Listener.OrientTop.y = -1.f;
|
||||
doom_Listener.OrientTop.z = 0.f;
|
||||
|
||||
doom_Listener.Position.x = 0.f;
|
||||
doom_Listener.Position.y = 0.f;
|
||||
doom_Listener.Position.z = 0.f;
|
||||
|
||||
for ( int i = 1; i < NUMSFX; i++ ) {
|
||||
// Alias? Example is the chaingun sound linked to pistol.
|
||||
if ( !S_sfx[i].link ) {
|
||||
// Load data from WAD file.
|
||||
S_sfx[i].data = getsfx( S_sfx[i].name, &lengths[i] );
|
||||
} else {
|
||||
// Previously loaded already?
|
||||
S_sfx[i].data = S_sfx[i].link->data;
|
||||
lengths[i] = lengths[ (S_sfx[i].link-S_sfx) / sizeof(sfxinfo_t) ];
|
||||
}
|
||||
if ( S_sfx[i].data ) {
|
||||
alBufferData( alBuffers[i], SFX_SAMPLETYPE, (byte*)S_sfx[i].data, lengths[i], SFX_RATE );
|
||||
}
|
||||
}
|
||||
|
||||
S_initialized = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_SubmitSound
|
||||
======================
|
||||
*/
|
||||
void I_SubmitSound( void )
|
||||
{
|
||||
// Only do this for player 0, it will still handle positioning
|
||||
// for other players, but it can't be outside the game
|
||||
// frame like the soundEvents are.
|
||||
if ( DoomLib::GetPlayer() == 0 ) {
|
||||
// Do 3D positioning of sounds
|
||||
I_UpdateSound();
|
||||
|
||||
// Change music if required
|
||||
I_UpdateMusic();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// =========================================================
|
||||
// =========================================================
|
||||
// Background Music
|
||||
// =========================================================
|
||||
// =========================================================
|
||||
|
||||
/*
|
||||
======================
|
||||
I_SetMusicVolume
|
||||
======================
|
||||
*/
|
||||
void I_SetMusicVolume( int volume )
|
||||
{
|
||||
x_MusicVolume = (float)volume / 15.f;
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_InitMusic
|
||||
======================
|
||||
*/
|
||||
void I_InitMusic( void )
|
||||
{
|
||||
if ( !Music_initialized ) {
|
||||
// Initialize Timidity
|
||||
Timidity_Init( MIDI_RATE, MIDI_FORMAT, MIDI_CHANNELS, MIDI_RATE, "classicmusic/gravis.cfg" );
|
||||
|
||||
musicBuffer = NULL;
|
||||
totalBufferSize = 0;
|
||||
waitingForMusic = false;
|
||||
musicReady = false;
|
||||
|
||||
alGenSources( (ALuint)1, &alMusicSourceVoice );
|
||||
|
||||
alSourcef( alMusicSourceVoice, AL_PITCH, 1.f );
|
||||
alSourcef( alMusicSourceVoice, AL_LOOPING, AL_TRUE );
|
||||
|
||||
alGenBuffers( (ALuint)1, &alMusicBuffer );
|
||||
|
||||
Music_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_ShutdownMusic
|
||||
======================
|
||||
*/
|
||||
void I_ShutdownMusic( void )
|
||||
{
|
||||
if ( Music_initialized ) {
|
||||
if ( alMusicSourceVoice ) {
|
||||
I_StopSong( 0 );
|
||||
alSourcei( alMusicSourceVoice, AL_BUFFER, 0 );
|
||||
alDeleteSources( 1, &alMusicSourceVoice );
|
||||
}
|
||||
|
||||
if ( alMusicBuffer ) {
|
||||
alDeleteBuffers( 1, &alMusicBuffer );
|
||||
}
|
||||
|
||||
if ( musicBuffer ) {
|
||||
free( musicBuffer );
|
||||
musicBuffer = NULL;
|
||||
}
|
||||
|
||||
Timidity_Shutdown();
|
||||
}
|
||||
|
||||
totalBufferSize = 0;
|
||||
waitingForMusic = false;
|
||||
musicReady = false;
|
||||
|
||||
Music_initialized = false;
|
||||
}
|
||||
|
||||
int Mus2Midi(unsigned char* bytes, unsigned char* out, int* len);
|
||||
|
||||
namespace {
|
||||
const int MaxMidiConversionSize = 1024 * 1024;
|
||||
unsigned char midiConversionBuffer[MaxMidiConversionSize];
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_LoadSong
|
||||
======================
|
||||
*/
|
||||
void I_LoadSong( const char * songname )
|
||||
{
|
||||
idStr lumpName = "d_";
|
||||
lumpName += static_cast< const char * >( songname );
|
||||
|
||||
unsigned char * musFile = static_cast< unsigned char * >( W_CacheLumpName( lumpName.c_str(), PU_STATIC_SHARED ) );
|
||||
|
||||
int length = 0;
|
||||
Mus2Midi( musFile, midiConversionBuffer, &length );
|
||||
|
||||
doomMusic = Timidity_LoadSongMem( midiConversionBuffer, length );
|
||||
|
||||
if ( doomMusic ) {
|
||||
musicBuffer = (byte *)malloc( MIDI_CHANNELS * MIDI_FORMAT_BYTES * doomMusic->samples );
|
||||
totalBufferSize = doomMusic->samples * MIDI_CHANNELS * MIDI_FORMAT_BYTES;
|
||||
Timidity_Start( doomMusic );
|
||||
|
||||
int rc = RC_NO_RETURN_VALUE;
|
||||
int num_bytes = 0;
|
||||
int offset = 0;
|
||||
|
||||
do {
|
||||
rc = Timidity_PlaySome( musicBuffer + offset, MIDI_RATE, &num_bytes );
|
||||
offset += num_bytes;
|
||||
} while ( rc != RC_TUNE_END );
|
||||
|
||||
Timidity_Stop();
|
||||
Timidity_FreeSong( doomMusic );
|
||||
}
|
||||
|
||||
musicReady = true;
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_PlaySong
|
||||
======================
|
||||
*/
|
||||
void I_PlaySong( const char *songname, int looping )
|
||||
{
|
||||
if ( !Music_initialized ) {
|
||||
return;
|
||||
}
|
||||
|
||||
I_StopSong( 0 );
|
||||
|
||||
// Clear old state
|
||||
if ( musicBuffer ) {
|
||||
free( musicBuffer );
|
||||
musicBuffer = 0;
|
||||
}
|
||||
|
||||
musicReady = false;
|
||||
I_LoadSong( songname );
|
||||
waitingForMusic = true;
|
||||
|
||||
if ( DoomLib::GetPlayer() >= 0 ) {
|
||||
::g->mus_looping = looping;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_UpdateMusic
|
||||
======================
|
||||
*/
|
||||
void I_UpdateMusic( void )
|
||||
{
|
||||
if ( !Music_initialized ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( alMusicSourceVoice ) {
|
||||
// Set the volume
|
||||
alSourcef( alMusicSourceVoice, AL_GAIN, x_MusicVolume * GLOBAL_VOLUME_MULTIPLIER );
|
||||
}
|
||||
|
||||
if ( waitingForMusic ) {
|
||||
if ( musicReady && alMusicSourceVoice ) {
|
||||
if ( musicBuffer ) {
|
||||
alSourcei( alMusicSourceVoice, AL_BUFFER, 0 );
|
||||
alBufferData( alMusicBuffer, MIDI_SAMPLETYPE, musicBuffer, totalBufferSize, MIDI_RATE );
|
||||
alSourcei( alMusicSourceVoice, AL_BUFFER, alMusicBuffer );
|
||||
alSourcePlay( alMusicSourceVoice );
|
||||
}
|
||||
|
||||
waitingForMusic = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_PauseSong
|
||||
======================
|
||||
*/
|
||||
void I_PauseSong ( int handle )
|
||||
{
|
||||
if ( !Music_initialized || !alMusicSourceVoice ) {
|
||||
return;
|
||||
}
|
||||
|
||||
alSourcePause( alMusicSourceVoice );
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_ResumeSong
|
||||
======================
|
||||
*/
|
||||
void I_ResumeSong ( int handle )
|
||||
{
|
||||
if ( !Music_initialized || !alMusicSourceVoice ) {
|
||||
return;
|
||||
}
|
||||
|
||||
alSourcePlay( alMusicSourceVoice );
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_StopSong
|
||||
======================
|
||||
*/
|
||||
void I_StopSong( int handle )
|
||||
{
|
||||
if ( !Music_initialized || !alMusicSourceVoice ) {
|
||||
return;
|
||||
}
|
||||
|
||||
alSourceStop( alMusicSourceVoice );
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_UnRegisterSong
|
||||
======================
|
||||
*/
|
||||
void I_UnRegisterSong( int handle )
|
||||
{
|
||||
// does nothing
|
||||
}
|
||||
|
||||
/*
|
||||
======================
|
||||
I_RegisterSong
|
||||
======================
|
||||
*/
|
||||
int I_RegisterSong( void* data, int length )
|
||||
{
|
||||
// does nothing
|
||||
return 0;
|
||||
}
|
|
@ -30,9 +30,6 @@ If you have questions concerning this license or the applicable additional terms
|
|||
// DG: this is a stub implementing the classic doom sound interface so we don't need XAudio to compile
|
||||
// (that doesn't work with MinGW and is only available on Windows)
|
||||
|
||||
// DG: only build this for MSVC. ugly hack, I can't get cmake to delete this file from the list..
|
||||
#ifndef _MSC_VER
|
||||
|
||||
#include "Precompiled.h"
|
||||
#include "i_sound.h"
|
||||
#include "w_wad.h"
|
||||
|
@ -64,6 +61,7 @@ int I_GetSfxLumpNum (sfxinfo_t* sfxinfo )
|
|||
return W_GetNumForName(namebuf);
|
||||
}
|
||||
|
||||
void I_ProcessSoundEvents( void ){}
|
||||
|
||||
// Starts a sound in a particular sound channel.
|
||||
int I_StartSound( int id, mobj_t *origin, mobj_t *listener_origin, int vol, int pitch, int priority )
|
||||
|
@ -117,5 +115,3 @@ void I_UnRegisterSong(int handle){}
|
|||
|
||||
// Update Music (XMP), check for notifications
|
||||
void I_UpdateMusic(void){}
|
||||
|
||||
#endif // _MSC_VER not defined ; DG end
|
||||
|
|
|
@ -26,9 +26,6 @@ If you have questions concerning this license or the applicable additional terms
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
// DG: only build this for MSVC. ugly hack, I can't get cmake to delete this file from the list..
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#include "Precompiled.h"
|
||||
#include "globaldata.h"
|
||||
|
||||
|
@ -161,7 +158,7 @@ getsfx
|
|||
// This function loads the sound data from the WAD lump,
|
||||
// for single sound.
|
||||
//
|
||||
void* getsfx ( char* sfxname, int* len )
|
||||
void* getsfx ( const char* sfxname, int* len )
|
||||
{
|
||||
unsigned char* sfx;
|
||||
unsigned char* sfxmem;
|
||||
|
@ -1107,6 +1104,3 @@ int I_RegisterSong(void* data, int length)
|
|||
// does nothing
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // _MSC_VER
|
||||
// DG end
|
||||
|
|
|
@ -126,7 +126,7 @@ void I_EndRead(void)
|
|||
// I_Error
|
||||
//
|
||||
extern bool debugOutput;
|
||||
void I_Printf(char* msg, ...)
|
||||
void I_Printf(const char* msg, ...)
|
||||
{
|
||||
char pmsg[1024];
|
||||
va_list argptr;
|
||||
|
@ -143,7 +143,7 @@ void I_Printf(char* msg, ...)
|
|||
}
|
||||
|
||||
|
||||
void I_PrintfE(char* msg, ...)
|
||||
void I_PrintfE(const char* msg, ...)
|
||||
{
|
||||
char pmsg[1024];
|
||||
va_list argptr;
|
||||
|
@ -160,7 +160,7 @@ void I_PrintfE(char* msg, ...)
|
|||
}
|
||||
}
|
||||
|
||||
void I_Error(char *error, ...)
|
||||
void I_Error(const char *error, ...)
|
||||
{
|
||||
const int ERROR_MSG_SIZE = 1024;
|
||||
char error_msg[ERROR_MSG_SIZE];
|
||||
|
|
|
@ -79,9 +79,9 @@ ticcmd_t* I_BaseTiccmd (void);
|
|||
void I_Quit (void);
|
||||
|
||||
|
||||
void I_Error (char *error, ...);
|
||||
void I_Printf(char *error, ...);
|
||||
void I_PrintfE(char *error, ...);
|
||||
void I_Error (const char *error, ...);
|
||||
void I_Printf(const char *error, ...);
|
||||
void I_PrintfE(const char *error, ...);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -27,19 +27,21 @@ If you have questions concerning this license or the applicable additional terms
|
|||
*/
|
||||
|
||||
#include "Precompiled.h"
|
||||
#include "globaldata.h"
|
||||
|
||||
// Data.
|
||||
#include "sounds.h"
|
||||
#include "m_fixed.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "info.h"
|
||||
#endif
|
||||
#include "info.h"
|
||||
|
||||
#include "globaldata.h"
|
||||
|
||||
// Data.
|
||||
#include "sounds.h"
|
||||
#include "m_fixed.h"
|
||||
|
||||
#include "p_mobj.h"
|
||||
|
||||
|
||||
// RB: sprnames must be NULL-terminated
|
||||
const char * const sprnames[NUMSPRITES + 1] = {
|
||||
"TROO","SHTG","PUNG","PISG","PISF","SHTF","SHT2","CHGG","CHGF","MISG",
|
||||
|
|
|
@ -42,7 +42,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
// in the program's command line arguments.
|
||||
// Returns the argument number (1 to argc-1)
|
||||
// or 0 if not present
|
||||
int M_CheckParm (char *check)
|
||||
int M_CheckParm (const char *check)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ extern char** myargv;
|
|||
|
||||
// Returns the position of the given parameter
|
||||
// in the arg list (0 if not found).
|
||||
int M_CheckParm (char* check);
|
||||
int M_CheckParm (const char* check);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -27,19 +27,18 @@ If you have questions concerning this license or the applicable additional terms
|
|||
*/
|
||||
|
||||
#include "Precompiled.h"
|
||||
#include "globaldata.h"
|
||||
|
||||
#include "stdlib.h"
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_system.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "m_fixed.h"
|
||||
#endif
|
||||
#include "m_fixed.h"
|
||||
|
||||
#include "globaldata.h"
|
||||
|
||||
#include "stdlib.h"
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_system.h"
|
||||
|
||||
|
||||
// Fixme. __USE_C_FIXED__ or something.
|
||||
|
|
|
@ -183,11 +183,11 @@ void M_SetupNextMenu(menu_t *menudef);
|
|||
void M_DrawThermo(int x,int y,int thermWidth,int thermDot);
|
||||
void M_DrawEmptyCell(menu_t *menu,int item);
|
||||
void M_DrawSelCell(menu_t *menu,int item);
|
||||
void M_WriteText(int x, int y, char *string);
|
||||
int M_StringWidth(char *string);
|
||||
int M_StringHeight(char *string);
|
||||
void M_WriteText(int x, int y, const char *string);
|
||||
int M_StringWidth(const char *string);
|
||||
int M_StringHeight(const char *string);
|
||||
void M_StartControlPanel(void);
|
||||
void M_StartMessage(char *string,messageRoutine_t routine,qboolean input);
|
||||
void M_StartMessage(const char *string,messageRoutine_t routine,qboolean input);
|
||||
void M_StopMessage(void);
|
||||
void M_ClearMenus (void);
|
||||
|
||||
|
@ -1051,13 +1051,13 @@ M_DrawSelCell
|
|||
|
||||
void
|
||||
M_StartMessage
|
||||
( char* string,
|
||||
( const char* string,
|
||||
messageRoutine_t routine,
|
||||
qboolean input )
|
||||
{
|
||||
::g->messageLastMenuActive = ::g->menuactive;
|
||||
::g->messageToPrint = 1;
|
||||
::g->messageString = string;
|
||||
::g->messageString = (char *)string;
|
||||
::g->messageRoutine = (messageRoutine_t)routine;
|
||||
::g->messageNeedsInput = input;
|
||||
::g->menuactive = true;
|
||||
|
@ -1077,7 +1077,7 @@ void M_StopMessage(void)
|
|||
//
|
||||
// Find string width from ::g->hu_font chars
|
||||
//
|
||||
int M_StringWidth(char* string)
|
||||
int M_StringWidth(const char* string)
|
||||
{
|
||||
unsigned int i;
|
||||
int w = 0;
|
||||
|
@ -1100,7 +1100,7 @@ int M_StringWidth(char* string)
|
|||
//
|
||||
// Find string height from ::g->hu_font chars
|
||||
//
|
||||
int M_StringHeight(char* string)
|
||||
int M_StringHeight(const char* string)
|
||||
{
|
||||
unsigned int i;
|
||||
int h;
|
||||
|
@ -1122,10 +1122,10 @@ void
|
|||
M_WriteText
|
||||
( int x,
|
||||
int y,
|
||||
char* string)
|
||||
const char* string)
|
||||
{
|
||||
int w;
|
||||
char* ch;
|
||||
const char* ch;
|
||||
int c;
|
||||
int cx;
|
||||
int cy;
|
||||
|
|
|
@ -105,7 +105,7 @@ M_DrawText
|
|||
//
|
||||
// M_WriteFile
|
||||
//
|
||||
boolean M_WriteFile ( char const* name, void* source, int length ) {
|
||||
bool M_WriteFile ( char const* name, void* source, int length ) {
|
||||
|
||||
idFile * handle = NULL;
|
||||
int count;
|
||||
|
@ -157,7 +157,7 @@ int M_ReadFile ( char const* name, byte** buffer ) {
|
|||
//
|
||||
// Write a save game to the specified device using the specified game name.
|
||||
//
|
||||
static qboolean SaveGame( void* source, DWORD length )
|
||||
static qboolean SaveGame( void* source, int length )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
//
|
||||
// MISC
|
||||
//
|
||||
boolean
|
||||
bool
|
||||
M_WriteFile
|
||||
( char const* name,
|
||||
void* source,
|
||||
|
|
|
@ -104,7 +104,7 @@ void P_UnArchivePlayers (void)
|
|||
if (::g->players[i]. psprites[j].state)
|
||||
{
|
||||
::g->players[i]. psprites[j].state
|
||||
= &::g->states[ (int)::g->players[i].psprites[j].state ];
|
||||
= &::g->states[ (intptr_t)::g->players[i].psprites[j].state ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -622,14 +622,14 @@ void P_UnArchiveThinkers (void)
|
|||
mobj = (mobj_t*)DoomLib::Z_Malloc(sizeof(*mobj), PU_LEVEL, NULL);
|
||||
memcpy (mobj, ::g->save_p, sizeof(*mobj));
|
||||
::g->save_p += sizeof(*mobj);
|
||||
mobj->state = &::g->states[(int)mobj->state];
|
||||
mobj->state = &::g->states[(intptr_t)mobj->state];
|
||||
|
||||
mobj->target = NULL;
|
||||
mobj->tracer = NULL;
|
||||
|
||||
if (mobj->player)
|
||||
{
|
||||
mobj->player = &::g->players[(int)mobj->player-1];
|
||||
mobj->player = &::g->players[(intptr_t)mobj->player-1];
|
||||
mobj->player->mo = mobj;
|
||||
}
|
||||
|
||||
|
@ -693,7 +693,7 @@ void P_UnArchiveThinkers (void)
|
|||
ceiling = (ceiling_t*)DoomLib::Z_Malloc(sizeof(*ceiling), PU_LEVEL, NULL);
|
||||
memcpy (ceiling, ::g->save_p, sizeof(*ceiling));
|
||||
::g->save_p += sizeof(*ceiling);
|
||||
ceiling->sector = &::g->sectors[(int)ceiling->sector];
|
||||
ceiling->sector = &::g->sectors[(intptr_t)ceiling->sector];
|
||||
ceiling->sector->specialdata = ceiling;
|
||||
|
||||
if (ceiling->thinker.function.acp1)
|
||||
|
@ -708,7 +708,7 @@ void P_UnArchiveThinkers (void)
|
|||
door = (vldoor_t*)DoomLib::Z_Malloc(sizeof(*door), PU_LEVEL, NULL);
|
||||
memcpy (door, ::g->save_p, sizeof(*door));
|
||||
::g->save_p += sizeof(*door);
|
||||
door->sector = &::g->sectors[(int)door->sector];
|
||||
door->sector = &::g->sectors[(intptr_t)door->sector];
|
||||
door->sector->specialdata = door;
|
||||
door->thinker.function.acp1 = (actionf_p1)T_VerticalDoor;
|
||||
P_AddThinker (&door->thinker);
|
||||
|
@ -719,7 +719,7 @@ void P_UnArchiveThinkers (void)
|
|||
floor = (floormove_t*)DoomLib::Z_Malloc (sizeof(*floor), PU_LEVEL, NULL);
|
||||
memcpy (floor, ::g->save_p, sizeof(*floor));
|
||||
::g->save_p += sizeof(*floor);
|
||||
floor->sector = &::g->sectors[(int)floor->sector];
|
||||
floor->sector = &::g->sectors[(intptr_t)floor->sector];
|
||||
floor->sector->specialdata = floor;
|
||||
floor->thinker.function.acp1 = (actionf_p1)T_MoveFloor;
|
||||
P_AddThinker (&floor->thinker);
|
||||
|
@ -730,7 +730,7 @@ void P_UnArchiveThinkers (void)
|
|||
plat = (plat_t*)DoomLib::Z_Malloc (sizeof(*plat), PU_LEVEL, NULL);
|
||||
memcpy (plat, ::g->save_p, sizeof(*plat));
|
||||
::g->save_p += sizeof(*plat);
|
||||
plat->sector = &::g->sectors[(int)plat->sector];
|
||||
plat->sector = &::g->sectors[(intptr_t)plat->sector];
|
||||
plat->sector->specialdata = plat;
|
||||
|
||||
if (plat->thinker.function.acp1)
|
||||
|
@ -745,7 +745,7 @@ void P_UnArchiveThinkers (void)
|
|||
fire = (fireflicker_t*)DoomLib::Z_Malloc (sizeof(*fire), PU_LEVEL, NULL);
|
||||
memcpy (fire, ::g->save_p, sizeof(*fire));
|
||||
::g->save_p += sizeof(*fire);
|
||||
fire->sector = &::g->sectors[(int)fire->sector];
|
||||
fire->sector = &::g->sectors[(intptr_t)fire->sector];
|
||||
fire->thinker.function.acp1 = (actionf_p1)T_FireFlicker;
|
||||
P_AddThinker (&fire->thinker);
|
||||
break;
|
||||
|
@ -755,7 +755,7 @@ void P_UnArchiveThinkers (void)
|
|||
flash = (lightflash_t*)DoomLib::Z_Malloc (sizeof(*flash), PU_LEVEL, NULL);
|
||||
memcpy (flash, ::g->save_p, sizeof(*flash));
|
||||
::g->save_p += sizeof(*flash);
|
||||
flash->sector = &::g->sectors[(int)flash->sector];
|
||||
flash->sector = &::g->sectors[(intptr_t)flash->sector];
|
||||
flash->thinker.function.acp1 = (actionf_p1)T_LightFlash;
|
||||
P_AddThinker (&flash->thinker);
|
||||
break;
|
||||
|
@ -765,7 +765,7 @@ void P_UnArchiveThinkers (void)
|
|||
strobe = (strobe_t*)DoomLib::Z_Malloc (sizeof(*strobe), PU_LEVEL, NULL);
|
||||
memcpy (strobe, ::g->save_p, sizeof(*strobe));
|
||||
::g->save_p += sizeof(*strobe);
|
||||
strobe->sector = &::g->sectors[(int)strobe->sector];
|
||||
strobe->sector = &::g->sectors[(intptr_t)strobe->sector];
|
||||
strobe->thinker.function.acp1 = (actionf_p1)T_StrobeFlash;
|
||||
P_AddThinker (&strobe->thinker);
|
||||
break;
|
||||
|
@ -775,7 +775,7 @@ void P_UnArchiveThinkers (void)
|
|||
glow = (glow_t*)DoomLib::Z_Malloc (sizeof(*glow), PU_LEVEL, NULL);
|
||||
memcpy (glow, ::g->save_p, sizeof(*glow));
|
||||
::g->save_p += sizeof(*glow);
|
||||
glow->sector = &::g->sectors[(int)glow->sector];
|
||||
glow->sector = &::g->sectors[(intptr_t)glow->sector];
|
||||
glow->thinker.function.acp1 = (actionf_p1)T_Glow;
|
||||
P_AddThinker (&glow->thinker);
|
||||
break;
|
||||
|
@ -949,7 +949,7 @@ void P_UnArchiveSpecials (void)
|
|||
ceiling = (ceiling_t*)DoomLib::Z_Malloc(sizeof(*ceiling), PU_LEVEL, NULL);
|
||||
memcpy (ceiling, ::g->save_p, sizeof(*ceiling));
|
||||
::g->save_p += sizeof(*ceiling);
|
||||
ceiling->sector = &::g->sectors[(int)ceiling->sector];
|
||||
ceiling->sector = &::g->sectors[(intptr_t)ceiling->sector];
|
||||
ceiling->sector->specialdata = ceiling;
|
||||
|
||||
if (ceiling->thinker.function.acp1)
|
||||
|
@ -964,7 +964,7 @@ void P_UnArchiveSpecials (void)
|
|||
door = (vldoor_t*)DoomLib::Z_Malloc(sizeof(*door), PU_LEVEL, NULL);
|
||||
memcpy (door, ::g->save_p, sizeof(*door));
|
||||
::g->save_p += sizeof(*door);
|
||||
door->sector = &::g->sectors[(int)door->sector];
|
||||
door->sector = &::g->sectors[(intptr_t)door->sector];
|
||||
door->sector->specialdata = door;
|
||||
door->thinker.function.acp1 = (actionf_p1)T_VerticalDoor;
|
||||
P_AddThinker (&door->thinker);
|
||||
|
@ -975,7 +975,7 @@ void P_UnArchiveSpecials (void)
|
|||
floor = (floormove_t*)DoomLib::Z_Malloc (sizeof(*floor), PU_LEVEL, NULL);
|
||||
memcpy (floor, ::g->save_p, sizeof(*floor));
|
||||
::g->save_p += sizeof(*floor);
|
||||
floor->sector = &::g->sectors[(int)floor->sector];
|
||||
floor->sector = &::g->sectors[(intptr_t)floor->sector];
|
||||
floor->sector->specialdata = floor;
|
||||
floor->thinker.function.acp1 = (actionf_p1)T_MoveFloor;
|
||||
P_AddThinker (&floor->thinker);
|
||||
|
@ -986,7 +986,7 @@ void P_UnArchiveSpecials (void)
|
|||
plat = (plat_t*)DoomLib::Z_Malloc (sizeof(*plat), PU_LEVEL, NULL);
|
||||
memcpy (plat, ::g->save_p, sizeof(*plat));
|
||||
::g->save_p += sizeof(*plat);
|
||||
plat->sector = &::g->sectors[(int)plat->sector];
|
||||
plat->sector = &::g->sectors[(intptr_t)plat->sector];
|
||||
plat->sector->specialdata = plat;
|
||||
|
||||
if (plat->thinker.function.acp1)
|
||||
|
@ -1001,7 +1001,7 @@ void P_UnArchiveSpecials (void)
|
|||
flash = (lightflash_t*)DoomLib::Z_Malloc (sizeof(*flash), PU_LEVEL, NULL);
|
||||
memcpy (flash, ::g->save_p, sizeof(*flash));
|
||||
::g->save_p += sizeof(*flash);
|
||||
flash->sector = &::g->sectors[(int)flash->sector];
|
||||
flash->sector = &::g->sectors[(intptr_t)flash->sector];
|
||||
flash->thinker.function.acp1 = (actionf_p1)T_LightFlash;
|
||||
P_AddThinker (&flash->thinker);
|
||||
break;
|
||||
|
@ -1011,7 +1011,7 @@ void P_UnArchiveSpecials (void)
|
|||
strobe = (strobe_t*)DoomLib::Z_Malloc (sizeof(*strobe), PU_LEVEL, NULL);
|
||||
memcpy (strobe, ::g->save_p, sizeof(*strobe));
|
||||
::g->save_p += sizeof(*strobe);
|
||||
strobe->sector = &::g->sectors[(int)strobe->sector];
|
||||
strobe->sector = &::g->sectors[(intptr_t)strobe->sector];
|
||||
strobe->thinker.function.acp1 = (actionf_p1)T_StrobeFlash;
|
||||
P_AddThinker (&strobe->thinker);
|
||||
break;
|
||||
|
@ -1021,7 +1021,7 @@ void P_UnArchiveSpecials (void)
|
|||
glow = (glow_t*)DoomLib::Z_Malloc (sizeof(*glow), PU_LEVEL, NULL);
|
||||
memcpy (glow, ::g->save_p, sizeof(*glow));
|
||||
::g->save_p += sizeof(*glow);
|
||||
glow->sector = &::g->sectors[(int)glow->sector];
|
||||
glow->sector = &::g->sectors[(intptr_t)glow->sector];
|
||||
glow->thinker.function.acp1 = (actionf_p1)T_Glow;
|
||||
P_AddThinker (&glow->thinker);
|
||||
break;
|
||||
|
|
|
@ -559,7 +559,7 @@ void P_GroupLines (void)
|
|||
}
|
||||
|
||||
// build line tables for each sector
|
||||
linebuffer = (line_t**)Z_Malloc (total*4, PU_LEVEL, 0);
|
||||
linebuffer = (line_t**)Z_Malloc (total*sizeof(line_t*), PU_LEVEL, 0);
|
||||
sector = ::g->sectors;
|
||||
for (i=0 ; i < ::g->numsectors ; i++, sector++)
|
||||
{
|
||||
|
|
|
@ -414,12 +414,12 @@ void R_InitTextures (void)
|
|||
|
||||
::g->s_numtextures = numtextures1 + numtextures2;
|
||||
|
||||
::g->s_textures = (texture_t**)DoomLib::Z_Malloc (::g->s_numtextures*4, PU_STATIC_SHARED, 0);
|
||||
::g->s_texturecolumnlump = (short**)DoomLib::Z_Malloc (::g->s_numtextures*4, PU_STATIC_SHARED, 0);
|
||||
::g->s_texturecolumnofs = (unsigned short**)DoomLib::Z_Malloc (::g->s_numtextures*4, PU_STATIC_SHARED, 0);
|
||||
::g->s_textures = (texture_t**)DoomLib::Z_Malloc (::g->s_numtextures*sizeof(texture_t*), PU_STATIC_SHARED, 0);
|
||||
::g->s_texturecolumnlump = (short**)DoomLib::Z_Malloc (::g->s_numtextures*sizeof(short*), PU_STATIC_SHARED, 0);
|
||||
::g->s_texturecolumnofs = (unsigned short**)DoomLib::Z_Malloc (::g->s_numtextures*sizeof(unsigned short*), PU_STATIC_SHARED, 0);
|
||||
::g->s_texturewidthmask = (int*)DoomLib::Z_Malloc (::g->s_numtextures*4, PU_STATIC_SHARED, 0);
|
||||
::g->s_textureheight = (fixed_t*)DoomLib::Z_Malloc (::g->s_numtextures*4, PU_STATIC_SHARED, 0);
|
||||
::g->s_texturecomposite = (byte**)DoomLib::Z_Malloc (::g->s_numtextures*4, PU_STATIC_SHARED, 0);
|
||||
::g->s_texturecomposite = (byte**)DoomLib::Z_Malloc (::g->s_numtextures*sizeof(byte*), PU_STATIC_SHARED, 0);
|
||||
::g->s_texturecompositesize = (int*)DoomLib::Z_Malloc (::g->s_numtextures*4, PU_STATIC_SHARED, 0);
|
||||
|
||||
totalwidth = 0;
|
||||
|
@ -575,7 +575,7 @@ void R_InitColormaps (void)
|
|||
lump = W_GetNumForName("COLORMAP");
|
||||
length = W_LumpLength (lump) + 255;
|
||||
::g->colormaps = (lighttable_t*)DoomLib::Z_Malloc (length, PU_STATIC, 0);
|
||||
::g->colormaps = (byte *)( ((int)::g->colormaps + 255)&~0xff);
|
||||
::g->colormaps = (byte *)( ((intptr_t)::g->colormaps + 255)&~0xff);
|
||||
W_ReadLump (lump,::g->colormaps);
|
||||
}
|
||||
|
||||
|
|
|
@ -434,7 +434,7 @@ void R_InitTranslationTables (void)
|
|||
int i;
|
||||
|
||||
::g->translationtables = (byte*)DoomLib::Z_Malloc (256*3+255, PU_STATIC, 0);
|
||||
::g->translationtables = (byte *)(( (int)::g->translationtables + 255 )& ~255);
|
||||
::g->translationtables = (byte *)(( (intptr_t)::g->translationtables + 255 )& ~255);
|
||||
|
||||
// translate just the 16 green colors
|
||||
for (i=0 ; i<256 ; i++)
|
||||
|
|
|
@ -38,7 +38,7 @@ typedef struct sfxinfo_struct sfxinfo_t;
|
|||
struct sfxinfo_struct
|
||||
{
|
||||
// up to 6-character name
|
||||
char* name;
|
||||
const char* name;
|
||||
|
||||
// Sfx singularity (only one at a time)
|
||||
int singularity;
|
||||
|
|
|
@ -53,7 +53,7 @@ typedef struct
|
|||
// f_finale.structs begin //
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
const char *name;
|
||||
mobjtype_t type;
|
||||
} castinfo_t;
|
||||
// f_finale.structs end //
|
||||
|
@ -212,7 +212,7 @@ typedef enum
|
|||
// m_misc.structs begin //
|
||||
struct default_t
|
||||
{
|
||||
char* name;
|
||||
const char* name;
|
||||
union {
|
||||
int * location;
|
||||
const char * * charLocation;
|
||||
|
@ -232,13 +232,13 @@ struct default_t
|
|||
untranslated( 0 ) {
|
||||
}
|
||||
|
||||
default_t( char * name_, int * location_, int defaultvalue_ ) :
|
||||
default_t( const char * name_, int * location_, int defaultvalue_ ) :
|
||||
name( name_ ),
|
||||
location( location_ ),
|
||||
defaultvalue( defaultvalue_ ) {
|
||||
}
|
||||
|
||||
default_t( char * name_, const char * * charLocation_, const char * charDefault_ ) :
|
||||
default_t( const char * name_, const char * * charLocation_, const char * charDefault_ ) :
|
||||
name( name_ ),
|
||||
charLocation( charLocation_ ),
|
||||
charDefault( charDefault_ ) {
|
||||
|
@ -348,7 +348,10 @@ typedef struct
|
|||
int masked;
|
||||
short width;
|
||||
short height;
|
||||
void **columndirectory; // OBSOLETE
|
||||
|
||||
// FR: Replaced obsolete void **columndirectory with int
|
||||
// for 64-bit compatibility
|
||||
int columndirectory; // OBSOLETE
|
||||
short patchcount;
|
||||
mappatch_t patches[1];
|
||||
} maptexture_t;
|
||||
|
|
|
@ -303,7 +303,7 @@ InputEvent joyEvents[18];
|
|||
// i_net_xbox.vars begin //
|
||||
int sendsocket;
|
||||
int insocket;
|
||||
struct sockaddr_in sendaddress[MAXNETNODES];
|
||||
//struct sockaddr_in sendaddress[MAXNETNODES];
|
||||
// i_net_xbox.vars end //
|
||||
// i_system.vars begin //
|
||||
int mb_used ;
|
||||
|
|
|
@ -27,6 +27,12 @@ If you have questions concerning this license or the applicable additional terms
|
|||
*/
|
||||
|
||||
#include "Precompiled.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "w_wad.h"
|
||||
#endif
|
||||
#include "w_wad.h"
|
||||
|
||||
#include "globaldata.h"
|
||||
|
||||
|
||||
|
@ -44,12 +50,6 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "idlib/precompiled.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "w_wad.h"
|
||||
#endif
|
||||
#include "w_wad.h"
|
||||
|
||||
|
||||
|
||||
//
|
||||
// GLOBALS
|
||||
|
|
|
@ -438,7 +438,7 @@ Z_ChangeTag2
|
|||
if (block->id != ZONEID)
|
||||
I_Error ("Z_ChangeTag: freed a pointer without ZONEID");
|
||||
|
||||
if (tag >= PU_PURGELEVEL && (unsigned)block->user < 0x100)
|
||||
if (tag >= PU_PURGELEVEL && (uintptr_t)block->user < 0x100)
|
||||
I_Error ("Z_ChangeTag: an owner is required for purgable blocks");
|
||||
|
||||
block->tag = tag;
|
||||
|
|
|
@ -709,15 +709,17 @@ file(GLOB EDITOR_SCRIPT_SOURCES tools/script/*.cpp)
|
|||
|
||||
file(GLOB EDITOR_SOUND_INCLUDES tools/sound/*.h)
|
||||
file(GLOB EDITOR_SOUND_SOURCES tools/sound/*.cpp)
|
||||
|
||||
|
||||
file(GLOB DOOMCLASSIC_INCLUDES ../doomclassic/doom/*.h)
|
||||
file(GLOB DOOMCLASSIC_SOURCES ../doomclassic/doom/*.cpp)
|
||||
|
||||
list(REMOVE_ITEM DOOMCLASSIC_SOURCES ../doomclassic/doom/i_net_ps3.cpp)
|
||||
list(REMOVE_ITEM DOOMCLASSIC_SOURCES ../doomclassic/doom/i_net_xbox.cpp)
|
||||
list(REMOVE_ITEM DOOMCLASSIC_SOURCES ../doomclassic/doom/i_video_ps3.cpp)
|
||||
list(REMOVE_ITEM DOOMCLASSIC_SOURCES ../doomclassic/doom/i_video_xbox.cpp)
|
||||
set(DOOMCLASSIC_STUBAUDIO_SOURCES ../doomclassic/doom/i_sound_stub.cpp)
|
||||
set(DOOMCLASSIC_OPENAL_SOURCES ../doomclassic/doom/i_sound_openal.cpp)
|
||||
set(DOOMCLASSIC_XAUDIO2_SOURCES ../doomclassic/doom/i_sound_win32.cpp)
|
||||
|
||||
list(REMOVE_ITEM DOOMCLASSIC_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../doomclassic/doom/i_sound_stub.cpp)
|
||||
list(REMOVE_ITEM DOOMCLASSIC_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../doomclassic/doom/i_sound_openal.cpp)
|
||||
list(REMOVE_ITEM DOOMCLASSIC_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../doomclassic/doom/i_sound_win32.cpp)
|
||||
|
||||
file(GLOB TIMIDITY_INCLUDES libs/timidity/*.h)
|
||||
file(GLOB TIMIDITY_SOURCES libs/timidity/*.cpp)
|
||||
|
@ -906,6 +908,10 @@ source_group("sys" FILES ${SYS_SOURCES})
|
|||
source_group("doomclassic" FILES ${DOOMCLASSIC_INCLUDES})
|
||||
source_group("doomclassic" FILES ${DOOMCLASSIC_SOURCES})
|
||||
|
||||
source_group("doomclassic" FILES ${DOOMCLASSIC_STUBAUDIO_SOURCES})
|
||||
source_group("doomclassic" FILES ${DOOMCLASSIC_OPENAL_SOURCES})
|
||||
source_group("doomclassic" FILES ${DOOMCLASSIC_XAUDIO2_SOURCES})
|
||||
|
||||
source_group("libs\\timidity" FILES ${TIMIDITY_INCLUDES})
|
||||
source_group("libs\\timidity" FILES ${TIMIDITY_SOURCES})
|
||||
|
||||
|
@ -1029,6 +1035,8 @@ set(RBDOOM3_INCLUDES
|
|||
${UI_INCLUDES}
|
||||
${SWF_INCLUDES}
|
||||
${COMMON_INCLUDES}
|
||||
${DOOMCLASSIC_INCLUDES}
|
||||
${TIMIDITY_INCLUDES}
|
||||
|
||||
#${COMPILER_INCLUDES}
|
||||
#${COMPILER_AAS_INCLUDES} ${COMPILER_AAS_SOURCES}
|
||||
|
@ -1062,6 +1070,8 @@ set(RBDOOM3_SOURCES
|
|||
${UI_SOURCES}
|
||||
${SWF_SOURCES}
|
||||
${COMMON_SOURCES}
|
||||
${DOOMCLASSIC_SOURCES}
|
||||
${TIMIDITY_SOURCES}
|
||||
|
||||
#${COMPILER_AAS_SOURCES}
|
||||
#${COMPILER_DMAP_SOURCES}
|
||||
|
@ -1069,6 +1079,8 @@ set(RBDOOM3_SOURCES
|
|||
#${COMPILER_ROQVQ_SOURCES}
|
||||
)
|
||||
|
||||
add_definitions(-DUSE_DOOMCLASSIC)
|
||||
|
||||
add_definitions(-D__DOOM__
|
||||
#-DGLEW_STATIC
|
||||
#-DBUILD_FREETYPE
|
||||
|
@ -1143,7 +1155,9 @@ if(MSVC)
|
|||
endif()
|
||||
|
||||
list(APPEND RBDOOM3_INCLUDES ${OPENAL_INCLUDES})
|
||||
list(APPEND RBDOOM3_SOURCES ${OPENAL_SOURCES})
|
||||
list(APPEND RBDOOM3_SOURCES
|
||||
${OPENAL_SOURCES}
|
||||
${DOOMCLASSIC_OPENAL_SOURCES})
|
||||
|
||||
set(OpenAL_LIBRARIES
|
||||
OpenAL32)
|
||||
|
@ -1155,17 +1169,10 @@ if(MSVC)
|
|||
install(FILES libs/openal-soft/lib/win32/OpenAL32.pdb DESTINATION .)
|
||||
endif()
|
||||
else()
|
||||
add_definitions(-DUSE_DOOMCLASSIC)
|
||||
|
||||
list(APPEND RBDOOM3_INCLUDES
|
||||
${XAUDIO2_INCLUDES}
|
||||
${DOOMCLASSIC_INCLUDES}
|
||||
${TIMIDITY_INCLUDES})
|
||||
|
||||
list(APPEND RBDOOM3_INCLUDES ${XAUDIO2_INCLUDES})
|
||||
list(APPEND RBDOOM3_SOURCES
|
||||
${XAUDIO2_SOURCES}
|
||||
${DOOMCLASSIC_SOURCES}
|
||||
${TIMIDITY_SOURCES})
|
||||
${DOOMCLASSIC_XAUDIO2_SOURCES})
|
||||
endif()
|
||||
|
||||
if(USE_MFC_TOOLS)
|
||||
|
@ -1218,8 +1225,6 @@ if(MSVC)
|
|||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/jobs/staticshadowvolume/StaticShadowVolume.cpp)
|
||||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/jobs/ShadowShared.cpp)
|
||||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/RenderLog.cpp)
|
||||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../doomclassic/doom/i_sound_stub.cpp)
|
||||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../doomclassic/doom/i_sound_win32.cpp)
|
||||
|
||||
foreach( src_file ${RBDOOM3_PRECOMPILED_SOURCES} )
|
||||
#message(STATUS "/Yuprecompiled.h for ${src_file}")
|
||||
|
@ -1276,12 +1281,9 @@ else()
|
|||
${SYS_INCLUDES} ${SYS_SOURCES})
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DUSE_DOOMCLASSIC)
|
||||
|
||||
list(APPEND RBDOOM3_SOURCES
|
||||
${DOOMCLASSIC_INCLUDES} ${DOOMCLASSIC_SOURCES}
|
||||
${TIMIDITY_INCLUDES} ${TIMIDITY_SOURCES}
|
||||
${WIN32_INCLUDES} ${WIN32_SOURCES} ${WIN32_RESOURCES})
|
||||
${WIN32_INCLUDES} ${WIN32_SOURCES} ${WIN32_RESOURCES}
|
||||
${DOOMCLASSIC_STUBAUDIO_SOURCES})
|
||||
|
||||
#list(REMOVE_ITEM WIN32_SOURCES sys/win32/win_cpu.cpp)
|
||||
list(APPEND WIN32_SOURCES sys/sdl/sdl_cpu.cpp)
|
||||
|
@ -1317,10 +1319,14 @@ else()
|
|||
#endif()
|
||||
|
||||
list(APPEND RBDOOM3_INCLUDES ${OPENAL_INCLUDES})
|
||||
list(APPEND RBDOOM3_SOURCES ${OPENAL_SOURCES})
|
||||
list(APPEND RBDOOM3_SOURCES
|
||||
${OPENAL_SOURCES}
|
||||
${DOOMCLASSIC_OPENAL_SOURCES})
|
||||
else()
|
||||
list(APPEND RBDOOM3_INCLUDES ${STUBAUDIO_INCLUDES})
|
||||
list(APPEND RBDOOM3_SOURCES ${STUBAUDIO_SOURCES})
|
||||
list(APPEND RBDOOM3_SOURCES
|
||||
${STUBAUDIO_SOURCES}
|
||||
${DOOMCLASSIC_STUBAUDIO_SOURCES})
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
@ -1338,7 +1344,6 @@ else()
|
|||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/jobs/staticshadowvolume/StaticShadowVolume.cpp)
|
||||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/jobs/ShadowShared.cpp)
|
||||
list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/renderer/RenderLog.cpp)
|
||||
# list(REMOVE_ITEM RBDOOM3_PRECOMPILED_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../doomclassic/doom/i_sound_stub.cpp)
|
||||
|
||||
foreach( src_file ${RBDOOM3_PRECOMPILED_SOURCES} )
|
||||
#message(STATUS "-include precompiled.h for ${src_file}")
|
||||
|
|
|
@ -23,7 +23,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||
#define __WIN32__
|
||||
#endif
|
||||
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
|
|
@ -58,14 +58,14 @@ song if we're less than a second into this one. */
|
|||
#define VERB_DEBUG_SILLY 4
|
||||
|
||||
typedef struct {
|
||||
char *id_name, id_character;
|
||||
const char *id_name, id_character;
|
||||
int verbosity, trace_playing, opened;
|
||||
|
||||
int (*open)(int using_stdin, int using_stdout);
|
||||
void (*pass_playing_list)(int number_of_files, char *list_of_files[]);
|
||||
void (*close)(void);
|
||||
int (*read)(int *valp);
|
||||
int (*cmsg)(int type, int verbosity_level, char *fmt, ...);
|
||||
int (*cmsg)(int type, int verbosity_level, const char *fmt, ...);
|
||||
|
||||
void (*refresh)(void);
|
||||
void (*reset)(void);
|
||||
|
|
|
@ -194,10 +194,10 @@ static Instrument *load_instrument(char *name, int percussion,
|
|||
idFile * fp;
|
||||
uint8_t tmp[1024];
|
||||
int i,j,noluck=0;
|
||||
char *path;
|
||||
const char *path;
|
||||
char filename[1024];
|
||||
#ifdef PATCH_EXT_LIST
|
||||
static char *patch_ext[] = PATCH_EXT_LIST;
|
||||
static const char *patch_ext[] = PATCH_EXT_LIST;
|
||||
#endif
|
||||
|
||||
if (!name) return 0;
|
||||
|
|
|
@ -113,7 +113,7 @@ static int32_t getvl(void)
|
|||
|
||||
/* Print a string from the file, followed by a newline. Any non-ASCII
|
||||
or unprintable characters will be converted to periods. */
|
||||
static int dumpstring( int32_t len, char *label)
|
||||
static int dumpstring( int32_t len, const char *label)
|
||||
{
|
||||
signed char *s=(signed char *)safe_malloc(len+1);
|
||||
if (len != (int32_t)read_local(s, 1, len))
|
||||
|
@ -171,7 +171,7 @@ static MidiEventList *read_midi_event(void)
|
|||
len=getvl();
|
||||
if (type>0 && type<16)
|
||||
{
|
||||
static char *label[]={
|
||||
static const char *label[]={
|
||||
"Text event: ", "Text: ", "Copyright: ", "Track name: ",
|
||||
"Instrument: ", "Lyric: ", "Marker: ", "Cue point: "};
|
||||
dumpstring(len, label[(type>7) ? 0 : type]);
|
||||
|
|
|
@ -51,7 +51,7 @@ static void ctl_reset(void);
|
|||
static int ctl_open(int using_stdin, int using_stdout);
|
||||
static void ctl_close(void);
|
||||
static int ctl_read(int *valp);
|
||||
static int cmsg(int type, int verbosity_level, char *fmt, ...);
|
||||
static int cmsg(int type, int verbosity_level, const char *fmt, ...);
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define safeOutputDebug(x) printf( "%s", x )
|
||||
|
@ -92,7 +92,7 @@ static int ctl_read(int *valp)
|
|||
}
|
||||
extern void SendDebugMsg(const char*);
|
||||
extern bool debugOutput;
|
||||
static int cmsg(int type, int verbosity_level, char *fmt, ...)
|
||||
static int cmsg(int type, int verbosity_level, const char *fmt, ...)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
va_list ap;
|
||||
|
|
|
@ -54,9 +54,9 @@ extern void Real_Tim_Free( void *pt );
|
|||
|
||||
typedef struct {
|
||||
int rate, encoding;
|
||||
char *id_name;
|
||||
const char *id_name;
|
||||
FILE* fp;
|
||||
char *file_name;
|
||||
const char *file_name;
|
||||
|
||||
int (*open_output)(void); /* 0=success, 1=warning, -1=fatal error */
|
||||
void (*close_output)(void);
|
||||
|
|
|
@ -30,7 +30,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#pragma hdrstop
|
||||
#include "precompiled.h"
|
||||
#include "../snd_local.h"
|
||||
//#include "../../../doomclassic/doom/i_sound.h"
|
||||
#include "../../../doomclassic/doom/i_sound.h"
|
||||
|
||||
idCVar s_showLevelMeter( "s_showLevelMeter", "0", CVAR_BOOL | CVAR_ARCHIVE, "Show VU meter" );
|
||||
idCVar s_meterTopTime( "s_meterTopTime", "1000", CVAR_INTEGER | CVAR_ARCHIVE, "How long (in milliseconds) peaks are displayed on the VU meter" );
|
||||
|
@ -199,7 +199,7 @@ void idSoundHardware_OpenAL::Init()
|
|||
// ---------------------
|
||||
// Initialize the Doom classic sound system.
|
||||
// ---------------------
|
||||
//I_InitSoundHardware( outputChannels, channelMask );
|
||||
I_InitSoundHardware( voices.Max(), 0 );
|
||||
|
||||
// ---------------------
|
||||
// Create VU Meter Effect
|
||||
|
@ -278,6 +278,11 @@ void idSoundHardware_OpenAL::Shutdown()
|
|||
freeVoices.Clear();
|
||||
zombieVoices.Clear();
|
||||
|
||||
// ---------------------
|
||||
// Shutdown the Doom classic sound system.
|
||||
// ---------------------
|
||||
I_ShutdownSoundHardware();
|
||||
|
||||
alcMakeContextCurrent( NULL );
|
||||
|
||||
alcDestroyContext( openalContext );
|
||||
|
@ -286,12 +291,6 @@ void idSoundHardware_OpenAL::Shutdown()
|
|||
alcCloseDevice( openalDevice );
|
||||
openalDevice = NULL;
|
||||
|
||||
|
||||
// ---------------------
|
||||
// Shutdown the Doom classic sound system.
|
||||
// ---------------------
|
||||
//I_ShutdownSoundHardware();
|
||||
|
||||
/*
|
||||
if( vuMeterRMS != NULL )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue