1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-05 02:39:41 +01:00

SDL_mixer is now entirely contained in Music.cpp.

This meant making the track vectors static, but that's kind of what we do with musicclass anyway?

In any case, this will make the transition to FAudio MUCH less invasive.
This commit is contained in:
Ethan Lee 2021-12-26 08:57:38 -05:00
parent 1eda3647ff
commit 81aa02e29b
2 changed files with 21 additions and 24 deletions

View file

@ -15,6 +15,24 @@
/* Begin SDL_mixer wrapper */
#include <SDL_mixer.h>
#include <vector>
class MusicTrack
{
public:
MusicTrack(SDL_RWops *rw);
Mix_Music *m_music;
bool m_isValid;
};
class SoundTrack
{
public:
SoundTrack(const char* fileName);
Mix_Chunk *sound;
};
MusicTrack::MusicTrack(SDL_RWops *rw)
{
m_music = Mix_LoadMUS_RW(rw, 1);
@ -50,6 +68,9 @@ SoundTrack::SoundTrack(const char* fileName)
}
}
static std::vector<MusicTrack> musicTracks;
static std::vector<SoundTrack> soundTracks;
/* End SDL_mixer wrapper */
musicclass::musicclass(void)

View file

@ -1,29 +1,7 @@
#ifndef MUSIC_H
#define MUSIC_H
#include <vector>
#include "BinaryBlob.h"
#include <SDL_mixer.h>
/* SDL_mixer object wrappers, do NOT reference these!!! */
class MusicTrack
{
public:
MusicTrack(SDL_RWops *rw);
Mix_Music *m_music;
bool m_isValid;
};
class SoundTrack
{
public:
SoundTrack(const char* fileName);
Mix_Chunk *sound;
};
/* End SDL_mixer object wrappers */
#define musicroom(rx, ry) ((rx) + ((ry) * 20))
@ -66,8 +44,6 @@ public:
bool halted(void);
void updatemutestate(void);
std::vector<SoundTrack> soundTracks;
std::vector<MusicTrack> musicTracks;
bool safeToProcessMusic;
int nicechange; // -1 if no song queued