Ported services and sound, now just GUI left

This commit is contained in:
Vulpovile
2023-11-06 18:28:57 -08:00
parent b58161cf81
commit d8a2fe7495
7 changed files with 282 additions and 29 deletions

View File

@@ -11,7 +11,7 @@ using namespace B3D;
//#include "GuiRootInstance.h"
//#include "ThumbnailGeneratorInstance.h"
#include "XplicitNgine/XplicitNgine.h"
//#include "SoundService.h"
#include "SoundService.h"
#include "LightingInstance.h"
// Libraries
@@ -32,7 +32,7 @@ namespace B3D {
LevelInstance* getLevel();
XplicitNgine* getEngine();
// ThumbnailGeneratorInstance* getThumbnailGenerator();
// SoundService* getSoundService();
SoundService* getSoundService();
LightingInstance* getLighting();
std::string message;
@@ -55,7 +55,7 @@ namespace B3D {
SelectionService* selectionService;
// ThumbnailGeneratorInstance* thumbnailGenerator;
XplicitNgine* xplicitNgine;
// SoundService* soundService;
SoundService* soundService;
LightingInstance* lightingInstance;
bool running;

View File

@@ -0,0 +1,30 @@
#pragma once
#include "Instance.h"
namespace B3D{
class SoundInstance : public Instance
{
public:
SoundInstance(void);
~SoundInstance(void);
// Getters
float getSoundVolume();
std::string getSoundId();
bool isPlayedOnRemove();
bool isLooped();
// Setters
void setSoundVolume(float newVolume);
void setSoundId(std::string newSoundId);
void setIsPlayedOnRemove(bool isPlayed);
void setIsLooped(bool isLooped);
// Functions
void play();
private:
float soundVolume;
std::string soundId;
bool playOnRemove;
bool looped;
};
}

View File

@@ -0,0 +1,17 @@
#pragma once
#include "Instance.h"
#include "SoundInstance.h"
namespace B3D
{
class SoundService : public Instance
{
public:
SoundService(void);
~SoundService(void);
float getMusicVolume();
void playSound(Instance* sound);
private:
float musicVolume;
};
}