mirror of
https://github.com/rwengine/openrw.git
synced 2024-09-15 15:02:34 +02:00
Removed SFML audio things
This commit is contained in:
parent
14e712f202
commit
fef71de074
@ -67,7 +67,7 @@ ENDIF()
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(OpenAL REQUIRED)
|
||||
find_package(Bullet REQUIRED)
|
||||
find_package(SFML 2 COMPONENTS system window audio graphics network REQUIRED)
|
||||
find_package(SFML 2 COMPONENTS system window graphics network REQUIRED)
|
||||
find_package(MAD REQUIRED)
|
||||
find_package(GLM REQUIRED)
|
||||
find_package(LibSndFile REQUIRED)
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include <SFML/Audio.hpp>
|
||||
#include <stdint.h>
|
||||
#include <iostream>
|
||||
#include <rw/defines.hpp>
|
||||
@ -18,7 +17,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
class MADStream : public sf::SoundStream
|
||||
class MADStream
|
||||
{
|
||||
mad_decoder mDecoder;
|
||||
unsigned int mMadSampleRate;
|
||||
@ -43,10 +42,6 @@ class MADStream : public sf::SoundStream
|
||||
static mad_flow ms_output(void* user, mad_header const* header, mad_pcm* pcm);
|
||||
static mad_flow ms_error(void* user, mad_stream* stream, mad_frame* frame);
|
||||
|
||||
virtual bool onGetData(sf::SoundStream::Chunk& data);
|
||||
|
||||
virtual void onSeek(sf::Time timeOffset);
|
||||
|
||||
public:
|
||||
|
||||
MADStream();
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <SFML/Audio.hpp>
|
||||
|
||||
class MADStream;
|
||||
|
||||
|
@ -309,7 +309,6 @@ public:
|
||||
std::string cutsceneAudio;
|
||||
bool cutsceneAudioLoaded;
|
||||
std::string missionAudio;
|
||||
sf::Sound missionSound;
|
||||
|
||||
/**
|
||||
* @brief loads a model into a special character slot.
|
||||
|
@ -97,24 +97,10 @@ mad_flow MADStream::ms_error(void* user, mad_stream* stream, mad_frame* frame)
|
||||
RW_UNUSED(user);
|
||||
RW_UNUSED(frame);
|
||||
|
||||
sf::err() << "libmad error: " << mad_stream_errorstr(stream);
|
||||
std::cerr << "libmad error: " << mad_stream_errorstr(stream) << std::endl;
|
||||
return MAD_FLOW_BREAK;
|
||||
}
|
||||
|
||||
bool MADStream::onGetData(sf::SoundStream::Chunk& data)
|
||||
{
|
||||
data.samples = mCurrentSamples.data();
|
||||
data.sampleCount = mCurrentSamples.size();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void MADStream::onSeek(sf::Time timeOffset)
|
||||
{
|
||||
RW_UNUSED(timeOffset);
|
||||
/// @todo support seeking.
|
||||
}
|
||||
|
||||
MADStream::MADStream()
|
||||
: mFdm(nullptr)
|
||||
{
|
||||
@ -161,8 +147,6 @@ bool MADStream::openFromFile(const std::string& loc)
|
||||
mad_decoder_run(&mDecoder, MAD_DECODER_MODE_SYNC);
|
||||
});
|
||||
|
||||
this->initialize(2, mMadSampleRate);
|
||||
|
||||
alCheck(alSourcef(alSource, AL_PITCH, 1));
|
||||
alCheck(alSourcef(alSource, AL_GAIN, 1));
|
||||
alCheck(alSource3f(alSource, AL_POSITION, 0, 0, 0));
|
||||
|
@ -2,6 +2,8 @@
|
||||
#include <render/GameRenderer.hpp>
|
||||
#include <engine/GameWorld.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
/// @todo This is very rough
|
||||
int charToIndex(char g)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user