mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-29 15:32:54 +00:00
- changed MIDI sources so that they do not have to include i_musicinterns.h anymore.
They were already clean of unwanted external references, but including this file made it hard to keep it that way. This also moves a few useful definitions around to less 'dirty' headers.
This commit is contained in:
parent
b8824b572f
commit
c3f26422df
13 changed files with 60 additions and 57 deletions
|
@ -372,12 +372,4 @@ enum
|
|||
|
||||
#define BLINKTHRESHOLD (4*32)
|
||||
|
||||
#ifndef MAKE_ID
|
||||
#ifndef __BIG_ENDIAN__
|
||||
#define MAKE_ID(a,b,c,d) ((uint32_t)((a)|((b)<<8)|((c)<<16)|((d)<<24)))
|
||||
#else
|
||||
#define MAKE_ID(a,b,c,d) ((uint32_t)((d)|((c)<<8)|((b)<<16)|((a)<<24)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // __DOOMDEF_H__
|
||||
|
|
|
@ -232,11 +232,6 @@ inline float RAD2DEG(float deg)
|
|||
}
|
||||
|
||||
|
||||
template <typename T, size_t N>
|
||||
char ( &_ArraySizeHelper( T (&array)[N] ))[N];
|
||||
|
||||
#define countof( array ) (sizeof( _ArraySizeHelper( array ) ))
|
||||
|
||||
// Auto-registration sections for GCC.
|
||||
// Apparently, you cannot do string concatenation inside section attributes.
|
||||
#ifdef __MACH__
|
||||
|
|
|
@ -67,8 +67,8 @@ const uint32_t *FWarpTexture::GetPixelsBgra()
|
|||
resizeMult = 1;
|
||||
|
||||
auto otherpix = FSoftwareTexture::GetPixelsBgra();
|
||||
WarpedPixelsRgba.Resize(GetWidth() * GetHeight() * resizeMult * resizeMult * 4 / 3 + 1);
|
||||
WarpBuffer(WarpedPixelsRgba.Data(), otherpix, GetWidth() * resizeMult, GetHeight() * resizeMult, WidthOffsetMultiplier, HeightOffsetMultiplier, time, mTexture->shaderspeed, bWarped);
|
||||
WarpedPixelsRgba.Resize(unsigned(GetWidth() * GetHeight() * resizeMult * resizeMult * 4 / 3 + 1));
|
||||
WarpBuffer(WarpedPixelsRgba.Data(), otherpix, int(GetWidth() * resizeMult), int(GetHeight() * resizeMult), WidthOffsetMultiplier, HeightOffsetMultiplier, time, mTexture->shaderspeed, bWarped);
|
||||
GenerateBgraMipmapsFast();
|
||||
FreeAllSpans();
|
||||
GenTime[2] = time;
|
||||
|
@ -88,8 +88,8 @@ const uint8_t *FWarpTexture::GetPixels(int index)
|
|||
resizeMult = 1;
|
||||
|
||||
const uint8_t *otherpix = FSoftwareTexture::GetPixels(index);
|
||||
WarpedPixels[index].Resize(GetWidth() * GetHeight() * resizeMult * resizeMult);
|
||||
WarpBuffer(WarpedPixels[index].Data(), otherpix, GetWidth() * resizeMult, GetHeight() * resizeMult, WidthOffsetMultiplier, HeightOffsetMultiplier, time, mTexture->shaderspeed, bWarped);
|
||||
WarpedPixels[index].Resize(unsigned(GetWidth() * GetHeight() * resizeMult * resizeMult));
|
||||
WarpBuffer(WarpedPixels[index].Data(), otherpix, int(GetWidth() * resizeMult), int(GetHeight() * resizeMult), WidthOffsetMultiplier, HeightOffsetMultiplier, time, mTexture->shaderspeed, bWarped);
|
||||
FreeAllSpans();
|
||||
GenTime[index] = time;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "i_musicinterns.h"
|
||||
#include "midisource.h"
|
||||
|
||||
|
||||
char MIDI_EventLengths[7] = { 2, 2, 2, 2, 1, 1, 2 };
|
||||
|
|
|
@ -10,10 +10,14 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <functional>
|
||||
#include "files.h"
|
||||
#include "mus2midi.h"
|
||||
#include "mididefs.h"
|
||||
|
||||
extern char MIDI_EventLengths[7];
|
||||
extern char MIDI_CommonLengths[15];
|
||||
|
||||
|
||||
// base class for the different MIDI sources --------------------------------------
|
||||
|
||||
class MIDISource
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
|
||||
// HEADER FILES ------------------------------------------------------------
|
||||
|
||||
#include "i_musicinterns.h"
|
||||
#include "midisource.h"
|
||||
#include "basictypes.h"
|
||||
#include "templates.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
// HEADER FILES ------------------------------------------------------------
|
||||
|
||||
#include "i_musicinterns.h"
|
||||
#include "midisource.h"
|
||||
#include "templates.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
// HEADER FILES ------------------------------------------------------------
|
||||
|
||||
#include "i_musicinterns.h"
|
||||
#include "midisource.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
|
||||
// HEADER FILES ------------------------------------------------------------
|
||||
|
||||
#include "i_musicinterns.h"
|
||||
#include "midisource.h"
|
||||
#include "basictypes.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
|
@ -128,7 +129,7 @@ XMISong::XMISong (FileReader &reader)
|
|||
memset(Songs, 0, sizeof(*Songs) * NumSongs);
|
||||
FindXMIDforms(&MusHeader[0], MusHeader.Size(), Songs);
|
||||
CurrSong = Songs;
|
||||
DPrintf(DMSG_SPAMMY, "XMI song count: %d\n", NumSongs);
|
||||
//DPrintf(DMSG_SPAMMY, "XMI song count: %d\n", NumSongs);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -26,29 +26,6 @@ struct MidiHeader
|
|||
MidiHeader *lpNext;
|
||||
};
|
||||
|
||||
// These constants must match the corresponding values of the Windows headers
|
||||
// to avoid readjustment in the native Windows device's playback functions
|
||||
// and should not be changed.
|
||||
enum
|
||||
{
|
||||
MIDIDEV_MIDIPORT = 1,
|
||||
MIDIDEV_SYNTH,
|
||||
MIDIDEV_SQSYNTH,
|
||||
MIDIDEV_FMSYNTH,
|
||||
MIDIDEV_MAPPER,
|
||||
MIDIDEV_WAVETABLE,
|
||||
MIDIDEV_SWSYNTH
|
||||
};
|
||||
|
||||
enum : uint8_t
|
||||
{
|
||||
MEVENT_TEMPO = 1,
|
||||
MEVENT_NOP = 2,
|
||||
MEVENT_LONGMSG = 128,
|
||||
};
|
||||
|
||||
#define MEVENT_EVENTTYPE(x) ((uint8_t)((x) >> 24))
|
||||
#define MEVENT_EVENTPARM(x) ((x) & 0xffffff)
|
||||
|
||||
class MIDIStreamer;
|
||||
|
||||
|
@ -205,11 +182,6 @@ protected:
|
|||
|
||||
// Base class for streaming MUS and MIDI files ------------------------------
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_MIDI_EVENTS = 128
|
||||
};
|
||||
|
||||
class MIDIStreamer : public MusInfo
|
||||
{
|
||||
public:
|
||||
|
|
31
src/sound/music/mididefs.h
Normal file
31
src/sound/music/mididefs.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_MIDI_EVENTS = 128
|
||||
};
|
||||
|
||||
inline constexpr uint8_t MEVENT_EVENTTYPE(uint32_t x) { return ((uint8_t)((x) >> 24)); }
|
||||
inline constexpr uint32_t MEVENT_EVENTPARM(uint32_t x) { return ((x) & 0xffffff); }
|
||||
|
||||
// These constants must match the corresponding values of the Windows headers
|
||||
// to avoid readjustment in the native Windows device's playback functions
|
||||
// and should not be changed.
|
||||
enum
|
||||
{
|
||||
MIDIDEV_MIDIPORT = 1,
|
||||
MIDIDEV_SYNTH,
|
||||
MIDIDEV_SQSYNTH,
|
||||
MIDIDEV_FMSYNTH,
|
||||
MIDIDEV_MAPPER,
|
||||
MIDIDEV_WAVETABLE,
|
||||
MIDIDEV_SWSYNTH
|
||||
};
|
||||
|
||||
enum : uint8_t
|
||||
{
|
||||
MEVENT_TEMPO = 1,
|
||||
MEVENT_NOP = 2,
|
||||
MEVENT_LONGMSG = 128,
|
||||
};
|
||||
|
|
@ -36,5 +36,18 @@ typedef uint32_t angle_t;
|
|||
#define GCCNOWARN
|
||||
#endif
|
||||
|
||||
template <typename T, size_t N>
|
||||
char(&_ArraySizeHelper(T(&array)[N]))[N];
|
||||
|
||||
#define countof( array ) (sizeof( _ArraySizeHelper( array ) ))
|
||||
|
||||
|
||||
#ifndef MAKE_ID
|
||||
#ifndef __BIG_ENDIAN__
|
||||
#define MAKE_ID(a,b,c,d) ((uint32_t)((a)|((b)<<8)|((c)<<16)|((d)<<24)))
|
||||
#else
|
||||
#define MAKE_ID(a,b,c,d) ((uint32_t)((d)|((c)<<8)|((b)<<16)|((a)<<24)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -68,12 +68,6 @@
|
|||
// Maximum number of files that might appear in a crash report.
|
||||
#define MAX_FILES 5
|
||||
|
||||
#ifndef __BIG_ENDIAN__
|
||||
#define MAKE_ID(a,b,c,d) ((a)|((b)<<8)|((c)<<16)|((d)<<24))
|
||||
#else
|
||||
#define MAKE_ID(a,b,c,d) ((d)|((c)<<8)|((b)<<16)|((a)<<24))
|
||||
#endif
|
||||
|
||||
#define ZIP_LOCALFILE MAKE_ID('P','K',3,4)
|
||||
#define ZIP_CENTRALFILE MAKE_ID('P','K',1,2)
|
||||
#define ZIP_ENDOFDIR MAKE_ID('P','K',5,6)
|
||||
|
|
Loading…
Reference in a new issue