big asset rework
This commit is contained in:
@@ -8,4 +8,18 @@ typedef struct {
|
||||
float rotation;
|
||||
} TextureAsset;
|
||||
|
||||
typedef struct {
|
||||
const char* path;
|
||||
} ShaderAsset;
|
||||
|
||||
typedef struct {
|
||||
const char* path;
|
||||
} SoundtrackAsset;
|
||||
|
||||
typedef struct {
|
||||
const TextureAsset *textureAssets;
|
||||
const ShaderAsset *shaderAssets;
|
||||
const SoundtrackAsset *soundtrackAssets;
|
||||
} Assets;
|
||||
|
||||
#endif // ASSET_H
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifndef MUSICMANAGER_H
|
||||
#define MUSICMANAGER_H
|
||||
|
||||
typedef struct {
|
||||
Music music;
|
||||
bool playing;
|
||||
} MyMusic;
|
||||
|
||||
MyMusic CreateMusic(char* musicPath){
|
||||
MyMusic music = {
|
||||
.music = LoadMusicStream(musicPath),
|
||||
.playing = 0
|
||||
};
|
||||
PlayMusicStream(music.music);
|
||||
return music;
|
||||
}
|
||||
|
||||
void UpdateMusic(MyMusic* music){
|
||||
UpdateMusicStream(music->music);
|
||||
}
|
||||
|
||||
#endif // MUSICMANAGER_H
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ typedef struct {
|
||||
float strength;
|
||||
} PostProcessing;
|
||||
|
||||
PostProcessing CreatePostFX(const char* shaderPath, float strength){
|
||||
PostProcessing CreatePostFX(const char* shaderPath){
|
||||
PostProcessing postFX = {0};
|
||||
postFX.shader = LoadShader(NULL, shaderPath);
|
||||
|
||||
@@ -17,7 +17,7 @@ PostProcessing CreatePostFX(const char* shaderPath, float strength){
|
||||
return postFX;
|
||||
}
|
||||
|
||||
postFX.strength = strength;
|
||||
postFX.strength = 0.3f;
|
||||
postFX.resolutionLoc = GetShaderLocation(postFX.shader, "resolution");
|
||||
postFX.strengthLoc = GetShaderLocation(postFX.shader, "strength");
|
||||
Vector2 resolution = { (float)GetScreenWidth(), (float)GetScreenHeight() };
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef SOUNDTRACK_H
|
||||
#define SOUNDTRACK_H
|
||||
|
||||
typedef struct {
|
||||
Music music;
|
||||
bool playing;
|
||||
} Soundtrack;
|
||||
|
||||
Soundtrack LoadSoundtrack(const char* musicPath){
|
||||
Soundtrack soundtrack = {
|
||||
.music = LoadMusicStream(musicPath),
|
||||
.playing = 0
|
||||
};
|
||||
PlayMusicStream(soundtrack.music);
|
||||
return soundtrack;
|
||||
}
|
||||
|
||||
void UpdateSoundtrack(Soundtrack *soundtrack){
|
||||
UpdateMusicStream(soundtrack->music);
|
||||
}
|
||||
|
||||
#endif // SOUNDTRACK_H
|
||||
|
||||
Reference in New Issue
Block a user