the whole game

This commit is contained in:
Kolyah35
2026-03-02 22:04:18 +03:00
parent 816e9060b4
commit f0617a5d22
2069 changed files with 581500 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
#ifndef SoundSystemAL_H__
#define SoundSystemAL_H__
#include "SoundSystem.h"
#include <AL/al.h>
#include <AL/alc.h>
#include <vector>
#include <list>
//
// NOTE: This class is only the core OpenAL part of the sound engine.
// Some audio setup code can still be managed from respective app
// setup code (e.g. the main app delegate for iOS).
//
class SoundSystemAL: public SoundSystem
{
//typedef std::list<SLObjectItf> SoundList;
public:
SoundSystemAL();
~SoundSystemAL();
virtual void init();
virtual void destroy();
virtual void enable(bool status);
virtual void setListenerPos(float x, float y, float z);
virtual void setListenerAngle(float deg);
virtual void load(const std::string& name){}
virtual void play(const std::string& name){}
virtual void pause(const std::string& name){}
virtual void stop(const std::string& name){}
virtual void playAt(const SoundDesc& sound, float x, float y, float z, float volume, float pitch);
private:
class Buffer {
public:
Buffer()
: inited(false)
{}
bool inited;
ALuint bufferID;
char* framePtr;
};
void removeStoppedSounds();
static const int MaxNumSources = 12;
//SoundList playingBuffers;
Vec3 _listenerPos;
float _rotation;
bool available;
ALCcontext* context;
ALCdevice* device;
ALuint _sources[MaxNumSources];
std::vector<Buffer> _buffers;
bool getFreeSourceIndex(int* src);
bool getBufferId(const SoundDesc& sound, ALuint* buf);
public:
};
#endif /*SoundSystemAL_H__ */