1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 23:48:30 +02:00
VVVVVV/desktop_version/src/Music.h
Misa cbceeccf78 Clean up and prevent unnecessary qualifiers to self
By "unnecessary qualifiers to self", I mean something like using the
'game.' qualifier for a variable on the Game class when you're inside a
function on the Game class itself. This patch is to enforce consistency
as most of the code doesn't have these unnecessary qualifiers.

To prevent further unnecessary qualifiers to self, I made it so the
extern in each header file can be omitted by using a define. That way,
if someone writes something referring to 'game.' on a Game function,
there will be a compile error.

However, if you really need to have a reference to the global name, and
you're within the same .cpp file as the implementation of that object,
you can just do the extern at the function-level. A good example of this
is editorinput()/editorrender()/editorlogic() in editor.cpp. In my
opinion, they should probably be split off into their own separate file
because editor.cpp is getting way too big, but this will do for now.
2020-09-28 01:34:40 -04:00

66 lines
1.1 KiB
C++

#ifndef MUSIC_H
#define MUSIC_H
#include <vector>
#include "BinaryBlob.h"
#include "SoundSystem.h"
#define musicroom(rx, ry) ((rx) + ((ry) * 20))
class musicclass
{
public:
void init();
void play(int t, const double position_sec = 0.0, const int fadein_ms = 3000);
void resume(const int fadein_ms = 0);
void haltdasmusik();
void silencedasmusik();
void fadeMusicVolumeIn(int ms);
void fadeout();
void fadein();
void processmusicfadein();
void processmusic();
void niceplay(int t);
void changemusicarea(int x, int y);
int currentsong;
int resumesong;
void playef(int t);
std::vector<SoundTrack> soundTracks;
std::vector<MusicTrack> musicTracks;
SoundSystem soundSystem;
bool safeToProcessMusic;
int nicechange;
int nicefade;
bool m_doFadeInVol;
int FadeVolAmountPerFrame;
int musicVolume;
int fadeoutqueuesong; // -1 if no song queued
bool dontquickfade;
// MMMMMM mod settings
bool mmmmmm;
bool usingmmmmmm;
binaryBlob musicReadBlob;
int num_pppppp_tracks;
int num_mmmmmm_tracks;
Uint64 songStart;
Uint64 songEnd;
};
#ifndef MUSIC_DEFINITION
extern musicclass music;
#endif
#endif /* MUSIC_H */