mirror of
https://github.com/haya3218/SDfmL.git
synced 2024-08-14 23:57:09 +00:00
Fix openMPT implementation
lmao
This commit is contained in:
parent
033de55ddf
commit
06fcac4c34
4 changed files with 17 additions and 5 deletions
13
src/Main.cpp
13
src/Main.cpp
|
@ -19,11 +19,16 @@
|
|||
#include <stdlib.h>
|
||||
#include "argh.h"
|
||||
#include "guicon.h"
|
||||
#include <random>
|
||||
|
||||
using namespace std;
|
||||
using namespace Render;
|
||||
using namespace argh;
|
||||
|
||||
bool randomBool() {
|
||||
return rand() % 2;
|
||||
}
|
||||
|
||||
class MainState : public State {
|
||||
AnimatedObject objs;
|
||||
TextObject text;
|
||||
|
@ -38,7 +43,13 @@ class MainState : public State {
|
|||
// before it
|
||||
virtual void Create() {
|
||||
// SPEAK("eyeyeyayeyayeyaeyaeyayeayeyaeyaeyayeyaeyayeyayeyayeyayeaye", 3000.0f, 5.0f);
|
||||
playModPlug("data/canyon.mid");
|
||||
srand(time(0));
|
||||
if (randomBool())
|
||||
playModPlug("data/canyon.mid");
|
||||
else
|
||||
{
|
||||
playModPlug("data/solarbeams.xm");
|
||||
}
|
||||
// i know that this isnt the best idea to do this
|
||||
// yeah, im just lazy
|
||||
title.create(0, 0, "data/bg.png");
|
||||
|
|
|
@ -425,7 +425,9 @@ bool Render::playModPlug(string path) {
|
|||
return true;
|
||||
}
|
||||
log("", "Played mod tracker from " + path, NORMAL, __FILENAME__, __LINE__);
|
||||
modLoader.load(path.c_str());
|
||||
if (modLoader.load(path.c_str()) != SoLoud::SO_NO_ERROR) {
|
||||
log("", "Could not play " + path, NORMAL, __FILENAME__, __LINE__);
|
||||
}
|
||||
modLoader.setLooping(true);
|
||||
music.play(modLoader);
|
||||
currentMusic = path;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue