mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-06-04 11:10:48 +00:00
Update to ZDoom r910:
- Fixed a few bugs in the parser for composite textures. - Changed: When loading Zips all patches in the patches/ directory should be loaded, not only those used by a texture in TEXTUREx. - Changed FMOD_INIT_ENABLE_DSPNET use to its replacement from 4.14.00, FMOD_INIT_ENABLE_PROFILE. Renamed the corresponding cvar to snd_profile. - Removed the normalize parameter from SoundStream::Play(). - Disabled the chorus and reverb effects added to SDL_mixer's Timidity, because they were probably never tested well, either. Thanks to the bug in vc_alloc(), they were never even activated. - Restored the exact frequency range search that was missing from SDL_mixer's verion of select_sample(). - Fixed: vc_alloc(), kill_others(), and note_on() treated Voice::status as a bit mask, when it's not. These were changes made to SDL_mixer's Timidity. - Restored the original Timidity volume equation. The other louder one was put in when I didn't realize all channels were mono and many notes sounded too quiet because they never completed their attack phase. - Fixed: FileReader::Gets() acted as if fgets() always read the maximum number of characters. - Fixed: FileReader::Open() did not set FilePos and StartPos to 0. - Replaced use of stdio in Timidity with FileReader and added the option to read from the lump directory. If the main config file is inside the lump directory it will assume that everything else is as well. If it is a real file it will be assumed that the rest is real files as well. - Fixed: None of the error returns in read_config_file closed the file being read. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@91 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
f5930d3fb5
commit
40f1ceddf7
18 changed files with 171 additions and 102 deletions
|
@ -46,7 +46,7 @@
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
FileReader::FileReader ()
|
FileReader::FileReader ()
|
||||||
: File(NULL), Length(0), CloseOnDestruct(false)
|
: File(NULL), Length(0), StartPos(0), CloseOnDestruct(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,13 +59,10 @@ FileReader::FileReader (const FileReader &other, long length)
|
||||||
FileReader::FileReader (const char *filename)
|
FileReader::FileReader (const char *filename)
|
||||||
: File(NULL), Length(0), StartPos(0), FilePos(0), CloseOnDestruct(false)
|
: File(NULL), Length(0), StartPos(0), FilePos(0), CloseOnDestruct(false)
|
||||||
{
|
{
|
||||||
File = fopen (filename, "rb");
|
if (!Open(filename))
|
||||||
if (File == NULL)
|
|
||||||
{
|
{
|
||||||
I_Error ("Could not open %s", filename);
|
I_Error ("Could not open %s", filename);
|
||||||
}
|
}
|
||||||
CloseOnDestruct = true;
|
|
||||||
Length = CalcFileLen();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReader::FileReader (FILE *file)
|
FileReader::FileReader (FILE *file)
|
||||||
|
@ -89,6 +86,18 @@ FileReader::~FileReader ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FileReader::Open (const char *filename)
|
||||||
|
{
|
||||||
|
File = fopen (filename, "rb");
|
||||||
|
if (File == NULL) return false;
|
||||||
|
FilePos = 0;
|
||||||
|
StartPos = 0;
|
||||||
|
CloseOnDestruct = true;
|
||||||
|
Length = CalcFileLen();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void FileReader::ResetFilePtr ()
|
void FileReader::ResetFilePtr ()
|
||||||
{
|
{
|
||||||
FilePos = ftell (File);
|
FilePos = ftell (File);
|
||||||
|
@ -134,13 +143,12 @@ long FileReader::Read (void *buffer, long len)
|
||||||
|
|
||||||
char *FileReader::Gets(char *strbuf, int len)
|
char *FileReader::Gets(char *strbuf, int len)
|
||||||
{
|
{
|
||||||
if (FilePos + len > StartPos + Length)
|
|
||||||
{
|
|
||||||
len = Length - FilePos + StartPos;
|
|
||||||
}
|
|
||||||
if (len <= 0) return 0;
|
if (len <= 0) return 0;
|
||||||
char *p = fgets(strbuf, len, File);
|
char *p = fgets(strbuf, len, File);
|
||||||
FilePos += len;
|
if (p != NULL)
|
||||||
|
{
|
||||||
|
FilePos = ftell(File) - StartPos;
|
||||||
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,16 +158,26 @@ char *FileReader::GetsFromBuffer(const char * bufptr, char *strbuf, int len)
|
||||||
if (len <= 0) return NULL;
|
if (len <= 0) return NULL;
|
||||||
|
|
||||||
char *p = strbuf;
|
char *p = strbuf;
|
||||||
while (len > 1 && bufptr[FilePos] != 0)
|
while (len > 1)
|
||||||
{
|
{
|
||||||
|
if (bufptr[FilePos] == 0)
|
||||||
|
{
|
||||||
|
FilePos++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (bufptr[FilePos] != '\r')
|
if (bufptr[FilePos] != '\r')
|
||||||
{
|
{
|
||||||
*p++ = bufptr[FilePos];
|
*p++ = bufptr[FilePos];
|
||||||
len--;
|
len--;
|
||||||
if (bufptr[FilePos] == '\n') break;
|
if (bufptr[FilePos] == '\n')
|
||||||
|
{
|
||||||
|
FilePos++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FilePos++;
|
FilePos++;
|
||||||
}
|
}
|
||||||
|
if (p==strbuf) return NULL;
|
||||||
*p++=0;
|
*p++=0;
|
||||||
return strbuf;
|
return strbuf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,11 @@
|
||||||
class FileReader
|
class FileReader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
FileReader ();
|
||||||
FileReader (const char *filename);
|
FileReader (const char *filename);
|
||||||
FileReader (FILE *file);
|
FileReader (FILE *file);
|
||||||
FileReader (FILE *file, long length);
|
FileReader (FILE *file, long length);
|
||||||
|
bool Open (const char *filename);
|
||||||
virtual ~FileReader ();
|
virtual ~FileReader ();
|
||||||
|
|
||||||
virtual long Tell () const;
|
virtual long Tell () const;
|
||||||
|
@ -62,7 +64,6 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
FileReader (const FileReader &other, long length);
|
FileReader (const FileReader &other, long length);
|
||||||
FileReader ();
|
|
||||||
|
|
||||||
char *GetsFromBuffer(const char * bufptr, char *strbuf, int len);
|
char *GetsFromBuffer(const char * bufptr, char *strbuf, int len);
|
||||||
|
|
||||||
|
|
|
@ -559,24 +559,6 @@ void OpenGLFrameBuffer::CopyPixelData(BYTE * buffer, int texpitch, int texheight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//===========================================================================
|
|
||||||
//
|
|
||||||
// FMultipatchTexture::UseBasePalette
|
|
||||||
//
|
|
||||||
// returns true if all patches in the texture use the unmodified base
|
|
||||||
// palette.
|
|
||||||
//
|
|
||||||
//===========================================================================
|
|
||||||
|
|
||||||
bool FMultiPatchTexture::UseBasePalette()
|
|
||||||
{
|
|
||||||
for(int i=0;i<NumParts;i++)
|
|
||||||
{
|
|
||||||
if (Parts[i].Texture->UseBasePalette()) return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// FWarpTexture::CopyTrueColorPixels
|
// FWarpTexture::CopyTrueColorPixels
|
||||||
|
|
|
@ -223,7 +223,7 @@ int OPLMIDIDevice::Resume()
|
||||||
{
|
{
|
||||||
if (!Started)
|
if (!Started)
|
||||||
{
|
{
|
||||||
if (Stream->Play(true, 1, false))
|
if (Stream->Play(true, 1))
|
||||||
{
|
{
|
||||||
Started = true;
|
Started = true;
|
||||||
BlockForStats = this;
|
BlockForStats = this;
|
||||||
|
|
|
@ -89,12 +89,12 @@ public:
|
||||||
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
|
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
|
||||||
const BYTE *GetPixels ();
|
const BYTE *GetPixels ();
|
||||||
FTextureFormat GetFormat();
|
FTextureFormat GetFormat();
|
||||||
|
bool UseBasePalette() ;
|
||||||
void Unload ();
|
void Unload ();
|
||||||
virtual void SetFrontSkyLayer ();
|
virtual void SetFrontSkyLayer ();
|
||||||
|
|
||||||
int CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y);
|
int CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y);
|
||||||
int GetSourceLump() { return DefinitionLump; }
|
int GetSourceLump() { return DefinitionLump; }
|
||||||
bool UseBasePalette() ;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BYTE *Pixels;
|
BYTE *Pixels;
|
||||||
|
|
|
@ -789,6 +789,9 @@ public:
|
||||||
BYTE bHasCanvas:1; // Texture is based off FCanvasTexture
|
BYTE bHasCanvas:1; // Texture is based off FCanvasTexture
|
||||||
BYTE bWarped:2; // This is a warped texture. Used to avoid multiple warps on one texture
|
BYTE bWarped:2; // This is a warped texture. Used to avoid multiple warps on one texture
|
||||||
BYTE bIsPatch:1; // 1 if an FPatchTexture. Required to fix FMultipatchTexture::CheckForHacks
|
BYTE bIsPatch:1; // 1 if an FPatchTexture. Required to fix FMultipatchTexture::CheckForHacks
|
||||||
|
BYTE bComplex:1; // Will be used to mark extended MultipatchTextures that have to be
|
||||||
|
// fully composited before subjected to any kinf of postprocessing instead of
|
||||||
|
// doing it per patch.
|
||||||
|
|
||||||
WORD Rotations;
|
WORD Rotations;
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ CVAR (String, snd_resampler, "Linear", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
CVAR (String, snd_speakermode, "Auto", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
CVAR (String, snd_speakermode, "Auto", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
CVAR (String, snd_output_format, "PCM-16", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
CVAR (String, snd_output_format, "PCM-16", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
CVAR (String, snd_midipatchset, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
CVAR (String, snd_midipatchset, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
CVAR (Bool, snd_dspnet, false, 0)
|
CVAR (Bool, snd_profile, false, 0)
|
||||||
|
|
||||||
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Play(bool looping, float volume, bool normalize)
|
bool Play(bool looping, float volume)
|
||||||
{
|
{
|
||||||
FMOD_RESULT result;
|
FMOD_RESULT result;
|
||||||
|
|
||||||
|
@ -322,14 +322,6 @@ public:
|
||||||
reverb.Room = -10000;
|
reverb.Room = -10000;
|
||||||
Channel->setReverbProperties(&reverb);
|
Channel->setReverbProperties(&reverb);
|
||||||
}
|
}
|
||||||
if (normalize)
|
|
||||||
{ // Attach a normalizer DSP unit to the channel.
|
|
||||||
result = Owner->Sys->createDSPByType(FMOD_DSP_TYPE_NORMALIZE, &DSP);
|
|
||||||
if (result == FMOD_OK)
|
|
||||||
{
|
|
||||||
Channel->addDSP(DSP);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Channel->setPaused(false);
|
Channel->setPaused(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -636,9 +628,9 @@ bool FMODSoundRenderer::Init()
|
||||||
{
|
{
|
||||||
initflags |= FMOD_INIT_SOFTWARE_HRTF;
|
initflags |= FMOD_INIT_SOFTWARE_HRTF;
|
||||||
}
|
}
|
||||||
if (snd_dspnet)
|
if (snd_profile)
|
||||||
{
|
{
|
||||||
initflags |= FMOD_INIT_ENABLE_DSPNET;
|
initflags |= FMOD_INIT_ENABLE_PROFILE;
|
||||||
}
|
}
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,6 +26,9 @@ void I_ShutdownMusicWin32 ();
|
||||||
|
|
||||||
extern float relative_volume;
|
extern float relative_volume;
|
||||||
|
|
||||||
|
EXTERN_CVAR (Float, timidity_mastervolume)
|
||||||
|
|
||||||
|
|
||||||
// The base music class. Everything is derived from this --------------------
|
// The base music class. Everything is derived from this --------------------
|
||||||
|
|
||||||
class MusInfo
|
class MusInfo
|
||||||
|
@ -119,6 +122,7 @@ public:
|
||||||
virtual bool Pause(bool paused) = 0;
|
virtual bool Pause(bool paused) = 0;
|
||||||
virtual bool NeedThreadedCallback() = 0;
|
virtual bool NeedThreadedCallback() = 0;
|
||||||
virtual void PrecacheInstruments(const WORD *instruments, int count);
|
virtual void PrecacheInstruments(const WORD *instruments, int count);
|
||||||
|
virtual void TimidityVolumeChanged() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// WinMM implementation of a MIDI output device -----------------------------
|
// WinMM implementation of a MIDI output device -----------------------------
|
||||||
|
@ -237,6 +241,7 @@ public:
|
||||||
bool Pause(bool paused);
|
bool Pause(bool paused);
|
||||||
bool NeedThreadedCallback();
|
bool NeedThreadedCallback();
|
||||||
void PrecacheInstruments(const WORD *instruments, int count);
|
void PrecacheInstruments(const WORD *instruments, int count);
|
||||||
|
void TimidityVolumeChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static bool FillStream(SoundStream *stream, void *buff, int len, void *userdata);
|
static bool FillStream(SoundStream *stream, void *buff, int len, void *userdata);
|
||||||
|
@ -277,6 +282,7 @@ public:
|
||||||
~MIDIStreamer();
|
~MIDIStreamer();
|
||||||
|
|
||||||
void MusicVolumeChanged();
|
void MusicVolumeChanged();
|
||||||
|
void TimidityVolumeChanged();
|
||||||
void Play(bool looping);
|
void Play(bool looping);
|
||||||
void Pause();
|
void Pause();
|
||||||
void Resume();
|
void Resume();
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
Loop = 16
|
Loop = 16
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual bool Play (bool looping, float volume, bool normalize) = 0;
|
virtual bool Play (bool looping, float volume) = 0;
|
||||||
virtual void Stop () = 0;
|
virtual void Stop () = 0;
|
||||||
virtual void SetVolume (float volume) = 0;
|
virtual void SetVolume (float volume) = 0;
|
||||||
virtual bool SetPaused (bool paused) = 0;
|
virtual bool SetPaused (bool paused) = 0;
|
||||||
|
|
|
@ -94,7 +94,7 @@ void TimiditySong::Play (bool looping)
|
||||||
{
|
{
|
||||||
if (m_Stream != NULL)
|
if (m_Stream != NULL)
|
||||||
{
|
{
|
||||||
if (m_Stream->Play (true, timidity_mastervolume, false))
|
if (m_Stream->Play (true, timidity_mastervolume))
|
||||||
{
|
{
|
||||||
m_Status = STATE_Playing;
|
m_Status = STATE_Playing;
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ TimiditySong::TimiditySong (FILE *file, char * musiccache, int len)
|
||||||
void TimiditySong::PrepTimidity ()
|
void TimiditySong::PrepTimidity ()
|
||||||
{
|
{
|
||||||
int pipeSize;
|
int pipeSize;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static SECURITY_ATTRIBUTES inheritable = { sizeof(inheritable), NULL, TRUE };
|
static SECURITY_ATTRIBUTES inheritable = { sizeof(inheritable), NULL, TRUE };
|
||||||
|
|
||||||
|
@ -268,11 +268,11 @@ void TimiditySong::PrepTimidity ()
|
||||||
|
|
||||||
pipeSize = (timidity_pipe * timidity_frequency / 1000)
|
pipeSize = (timidity_pipe * timidity_frequency / 1000)
|
||||||
<< (timidity_stereo + !timidity_8bit);
|
<< (timidity_stereo + !timidity_8bit);
|
||||||
|
|
||||||
if (GSnd == NULL)
|
if (GSnd == NULL)
|
||||||
{ // Can't pipe if using no sound.
|
{ // Can't pipe if using no sound.
|
||||||
pipeSize = 0;
|
pipeSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pipeSize != 0)
|
if (pipeSize != 0)
|
||||||
{
|
{
|
||||||
|
@ -529,7 +529,7 @@ bool TimiditySong::LaunchTimidity ()
|
||||||
// freopen ("/dev/null", "w", stderr);
|
// freopen ("/dev/null", "w", stderr);
|
||||||
close (WavePipe[1]);
|
close (WavePipe[1]);
|
||||||
|
|
||||||
execvp (words.we_wordv[0], words.we_wordv);
|
execvp (words.we_wordv[0], words.we_wordv);
|
||||||
fprintf(stderr,"execvp failed\n");
|
fprintf(stderr,"execvp failed\n");
|
||||||
exit (0); // if execvp succeeds, we never get here
|
exit (0); // if execvp succeeds, we never get here
|
||||||
}
|
}
|
||||||
|
@ -542,11 +542,11 @@ bool TimiditySong::LaunchTimidity ()
|
||||||
// printf ("child is %d\n", forkres);
|
// printf ("child is %d\n", forkres);
|
||||||
ChildProcess = forkres;
|
ChildProcess = forkres;
|
||||||
close (WavePipe[1]);
|
close (WavePipe[1]);
|
||||||
WavePipe[1] = -1;
|
WavePipe[1] = -1;
|
||||||
/* usleep(1000000);
|
/* usleep(1000000);
|
||||||
if (waitpid(ChildProcess, NULL, WNOHANG) == ChildProcess)
|
if (waitpid(ChildProcess, NULL, WNOHANG) == ChildProcess)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Launching timidity failed\n");
|
fprintf(stderr,"Launching timidity failed\n");
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -586,10 +586,10 @@ bool TimiditySong::FillStream (SoundStream *stream, void *buff, int len, void *u
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
ssize_t got;
|
ssize_t got;
|
||||||
fd_set rfds;
|
fd_set rfds;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
if (ChildQuit == song->ChildProcess)
|
if (ChildQuit == song->ChildProcess)
|
||||||
{
|
{
|
||||||
ChildQuit = 0;
|
ChildQuit = 0;
|
||||||
|
@ -597,18 +597,18 @@ bool TimiditySong::FillStream (SoundStream *stream, void *buff, int len, void *u
|
||||||
song->ChildProcess = -1;
|
song->ChildProcess = -1;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FD_ZERO(&rfds);
|
FD_ZERO(&rfds);
|
||||||
FD_SET(song->WavePipe[0], &rfds);
|
FD_SET(song->WavePipe[0], &rfds);
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = 50;
|
tv.tv_usec = 50;
|
||||||
// fprintf(stderr,"select\n");
|
// fprintf(stderr,"select\n");
|
||||||
if (select(1, &rfds, NULL, NULL, &tv) <= 0 && 0)
|
if (select(1, &rfds, NULL, NULL, &tv) <= 0 && 0)
|
||||||
{ // Nothing available, so play silence.
|
{ // Nothing available, so play silence.
|
||||||
// fprintf(stderr,"nothing\n");
|
// fprintf(stderr,"nothing\n");
|
||||||
// memset(buff, 0, len);
|
// memset(buff, 0, len);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// fprintf(stderr,"something\n");
|
// fprintf(stderr,"something\n");
|
||||||
|
|
||||||
got = read (song->WavePipe[0], (BYTE *)buff, len);
|
got = read (song->WavePipe[0], (BYTE *)buff, len);
|
||||||
|
|
|
@ -419,6 +419,15 @@ void MIDIStreamer::MusicVolumeChanged()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MIDIStreamer::TimidityVolumeChanged()
|
||||||
|
{
|
||||||
|
if (MIDI != NULL)
|
||||||
|
{
|
||||||
|
MIDI->TimidityVolumeChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// MIDIStreamer :: OutputVolume
|
// MIDIStreamer :: OutputVolume
|
||||||
|
|
|
@ -60,7 +60,7 @@ void OPLMUSSong::Play (bool looping)
|
||||||
Music->SetLooping (looping);
|
Music->SetLooping (looping);
|
||||||
Music->Restart ();
|
Music->Restart ();
|
||||||
|
|
||||||
if (m_Stream == NULL || m_Stream->Play (true, snd_musicvolume, false))
|
if (m_Stream == NULL || m_Stream->Play (true, snd_musicvolume))
|
||||||
{
|
{
|
||||||
m_Status = STATE_Playing;
|
m_Status = STATE_Playing;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ void StreamSong::Play (bool looping)
|
||||||
m_Status = STATE_Stopped;
|
m_Status = STATE_Stopped;
|
||||||
m_Looping = looping;
|
m_Looping = looping;
|
||||||
|
|
||||||
if (m_Stream->Play (m_Looping, 1, false))
|
if (m_Stream->Play (m_Looping, 1))
|
||||||
{
|
{
|
||||||
m_Status = STATE_Playing;
|
m_Status = STATE_Playing;
|
||||||
m_LastPos = 0;
|
m_LastPos = 0;
|
||||||
|
@ -50,14 +50,14 @@ StreamSong::~StreamSong ()
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamSong::StreamSong (const char *filename_or_data, int offset, int len)
|
StreamSong::StreamSong (const char *filename_or_data, int offset, int len)
|
||||||
{
|
{
|
||||||
if (GSnd != NULL)
|
if (GSnd != NULL)
|
||||||
{
|
{
|
||||||
m_Stream = GSnd->OpenStream (filename_or_data, SoundStream::Loop, offset, len);
|
m_Stream = GSnd->OpenStream (filename_or_data, SoundStream::Loop, offset, len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_Stream = NULL;
|
m_Stream = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@ int TimidityMIDIDevice::Resume()
|
||||||
{
|
{
|
||||||
if (!Started)
|
if (!Started)
|
||||||
{
|
{
|
||||||
if (Stream->Play(true, 1, false))
|
if (Stream->Play(true, 1/*timidity_mastervolume*/))
|
||||||
{
|
{
|
||||||
Started = true;
|
Started = true;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -326,6 +326,23 @@ bool TimidityMIDIDevice::NeedThreadedCallback()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// TimidityMIDIDevice :: TimidityVolumeChanged
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
void TimidityMIDIDevice::TimidityVolumeChanged()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
if (Stream != NULL)
|
||||||
|
{
|
||||||
|
Stream->SetVolume(timidity_mastervolume);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// TimidityMIDIDevice :: Pause
|
// TimidityMIDIDevice :: Pause
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
// This file was automatically generated by the
|
// This file was automatically generated by the
|
||||||
// updaterevision tool. Do not edit by hand.
|
// updaterevision tool. Do not edit by hand.
|
||||||
|
|
||||||
#define ZD_SVN_REVISION_STRING "905"
|
#define ZD_SVN_REVISION_STRING "910"
|
||||||
#define ZD_SVN_REVISION_NUMBER 905
|
#define ZD_SVN_REVISION_NUMBER 910
|
||||||
|
|
|
@ -457,15 +457,28 @@ int FMultiPatchTexture::CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf
|
||||||
FTextureFormat FMultiPatchTexture::GetFormat()
|
FTextureFormat FMultiPatchTexture::GetFormat()
|
||||||
{
|
{
|
||||||
if (NumParts == 1) return Parts[0].Texture->GetFormat();
|
if (NumParts == 1) return Parts[0].Texture->GetFormat();
|
||||||
|
return UseBasePalette() ? TEX_Pal : TEX_RGB;
|
||||||
for(int i=0;i<NumParts;i++)
|
|
||||||
{
|
|
||||||
if (!Parts[i].Texture->UseBasePalette()) return TEX_RGB;
|
|
||||||
}
|
|
||||||
return TEX_Pal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//===========================================================================
|
||||||
|
//
|
||||||
|
// FMultipatchTexture::UseBasePalette
|
||||||
|
//
|
||||||
|
// returns true if all patches in the texture use the unmodified base
|
||||||
|
// palette.
|
||||||
|
//
|
||||||
|
//===========================================================================
|
||||||
|
|
||||||
|
bool FMultiPatchTexture::UseBasePalette()
|
||||||
|
{
|
||||||
|
for(int i=0;i<NumParts;i++)
|
||||||
|
{
|
||||||
|
if (!Parts[i].Texture->UseBasePalette()) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// FMultiPatchTexture :: TexPart :: TexPart
|
// FMultiPatchTexture :: TexPart :: TexPart
|
||||||
|
@ -701,11 +714,11 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part)
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
if (sc.Compare("flipx"))
|
if (sc.Compare("flipx"))
|
||||||
{
|
{
|
||||||
part.Mirror = 1;
|
part.Mirror |= 1;
|
||||||
}
|
}
|
||||||
else if (sc.Compare("flipy"))
|
else if (sc.Compare("flipy"))
|
||||||
{
|
{
|
||||||
part.Mirror = 2;
|
part.Mirror |= 2;
|
||||||
}
|
}
|
||||||
else if (sc.Compare("rotate"))
|
else if (sc.Compare("rotate"))
|
||||||
{
|
{
|
||||||
|
@ -718,22 +731,31 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (part.Mirror & 2)
|
||||||
|
{
|
||||||
|
part.Rotate = (part.Rotate + 180) % 360;
|
||||||
|
part.Mirror &= 1;
|
||||||
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
|
FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
|
||||||
|
: Pixels (0), Spans(0), Parts(0), bRedirect(false)
|
||||||
{
|
{
|
||||||
TArray<TexPart> parts;
|
TArray<TexPart> parts;
|
||||||
|
|
||||||
|
sc.SetCMode(true);
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
uppercopy(Name, sc.String);
|
uppercopy(Name, sc.String);
|
||||||
|
Name[8] = 0;
|
||||||
sc.MustGetStringName(",");
|
sc.MustGetStringName(",");
|
||||||
sc.MustGetNumber();
|
sc.MustGetNumber();
|
||||||
Width = sc.Number;
|
Width = sc.Number;
|
||||||
sc.MustGetStringName(",");
|
sc.MustGetStringName(",");
|
||||||
sc.MustGetNumber();
|
sc.MustGetNumber();
|
||||||
Height = sc.Number;
|
Height = sc.Number;
|
||||||
|
UseType = FTexture::TEX_Override;
|
||||||
|
|
||||||
if (sc.CheckString("{"))
|
if (sc.CheckString("{"))
|
||||||
{
|
{
|
||||||
|
@ -754,6 +776,10 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
|
||||||
{
|
{
|
||||||
bWorldPanning = true;
|
bWorldPanning = true;
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("NullTexture"))
|
||||||
|
{
|
||||||
|
UseType = FTexture::TEX_Null;
|
||||||
|
}
|
||||||
else if (sc.Compare("NoDecals"))
|
else if (sc.Compare("NoDecals"))
|
||||||
{
|
{
|
||||||
bNoDecals = true;
|
bNoDecals = true;
|
||||||
|
@ -767,7 +793,6 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
|
||||||
}
|
}
|
||||||
|
|
||||||
NumParts = parts.Size();
|
NumParts = parts.Size();
|
||||||
UseType = FTexture::TEX_Override;
|
|
||||||
Parts = new TexPart[NumParts];
|
Parts = new TexPart[NumParts];
|
||||||
memcpy(Parts, &parts[0], NumParts * sizeof(*Parts));
|
memcpy(Parts, &parts[0], NumParts * sizeof(*Parts));
|
||||||
|
|
||||||
|
@ -787,9 +812,7 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype)
|
||||||
}
|
}
|
||||||
//DefinitionLump = sc.G deflumpnum;
|
//DefinitionLump = sc.G deflumpnum;
|
||||||
}
|
}
|
||||||
|
sc.SetCMode(false);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -386,8 +386,21 @@ int FTextureManager::AddPatch (const char *patchname, int namespc, bool tryany)
|
||||||
|
|
||||||
void FTextureManager::AddGroup(int wadnum, const char * startlump, const char * endlump, int ns, int usetype)
|
void FTextureManager::AddGroup(int wadnum, const char * startlump, const char * endlump, int ns, int usetype)
|
||||||
{
|
{
|
||||||
int firsttx = Wads.CheckNumForName (startlump);
|
int firsttx;
|
||||||
int lasttx = Wads.CheckNumForName (endlump);
|
int lasttx;
|
||||||
|
|
||||||
|
if (startlump && endlump)
|
||||||
|
{
|
||||||
|
firsttx = Wads.CheckNumForName (startlump);
|
||||||
|
lasttx = Wads.CheckNumForName (endlump);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If there are no markers we have to search the entire lump directory... :(
|
||||||
|
firsttx = 0;
|
||||||
|
lasttx = Wads.GetNumLumps() - 1;
|
||||||
|
}
|
||||||
|
|
||||||
char name[9];
|
char name[9];
|
||||||
|
|
||||||
if (firsttx == -1 || lasttx == -1)
|
if (firsttx == -1 || lasttx == -1)
|
||||||
|
@ -404,7 +417,7 @@ void FTextureManager::AddGroup(int wadnum, const char * startlump, const char *
|
||||||
|
|
||||||
for (firsttx += 1; firsttx < lasttx; ++firsttx)
|
for (firsttx += 1; firsttx < lasttx; ++firsttx)
|
||||||
{
|
{
|
||||||
if (Wads.GetLumpFile(firsttx) == wadnum)
|
if (Wads.GetLumpFile(firsttx) == wadnum && Wads.GetLumpNamespace(firsttx) == ns)
|
||||||
{
|
{
|
||||||
Wads.GetLumpName (name, firsttx);
|
Wads.GetLumpName (name, firsttx);
|
||||||
|
|
||||||
|
@ -696,6 +709,10 @@ void FTextureManager::AddTexturesForWad(int wadnum)
|
||||||
// First step: Load sprites
|
// First step: Load sprites
|
||||||
AddGroup(wadnum, "S_START", "S_END", ns_sprites, FTexture::TEX_Sprite);
|
AddGroup(wadnum, "S_START", "S_END", ns_sprites, FTexture::TEX_Sprite);
|
||||||
|
|
||||||
|
// When loading a Zip, all graphics in the patches/ directory should be
|
||||||
|
// added as well.
|
||||||
|
AddGroup(wadnum, NULL, NULL, ns_patches, FTexture::TEX_WallPatch);
|
||||||
|
|
||||||
// Second step: TEXTUREx lumps
|
// Second step: TEXTUREx lumps
|
||||||
LoadTextureX(wadnum);
|
LoadTextureX(wadnum);
|
||||||
|
|
||||||
|
|
|
@ -305,6 +305,7 @@ FFont::FFont (const char *name, const char *nametemplate, int first, int count,
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
charlumps[i] = -1;
|
||||||
sprintf (buffer, nametemplate, i + start);
|
sprintf (buffer, nametemplate, i + start);
|
||||||
lump = Wads.CheckNumForName (buffer, ns_graphics);
|
lump = Wads.CheckNumForName (buffer, ns_graphics);
|
||||||
if (doomtemplate && lump >= 0 && i + start == 121)
|
if (doomtemplate && lump >= 0 && i + start == 121)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue