diff options
| author | Physcik <mynameisgennadiy@vk.com> | 2026-01-11 20:43:46 +0500 |
|---|---|---|
| committer | Physcik <mynameisgennadiy@vk.com> | 2026-01-11 20:43:46 +0500 |
| commit | 4c614ef14ebf4c3cd16c1e96283dc3763b9b0d0a (patch) | |
| tree | 2e82a07e2b5f782b0991ee824109295784308b59 /engine/Components/ResourceManager.go | |
| parent | 754c860540660f004d09f1634ff62a56c481972e (diff) | |
World rendering
Diffstat (limited to 'engine/Components/ResourceManager.go')
| -rw-r--r-- | engine/Components/ResourceManager.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/engine/Components/ResourceManager.go b/engine/Components/ResourceManager.go new file mode 100644 index 0000000..19f0315 --- /dev/null +++ b/engine/Components/ResourceManager.go @@ -0,0 +1,36 @@ +package components + +import ( + "encoding/json" + "fmt" + + settings "github.com/DegustatorPonos/RuinesOfRafdolon/Settings" + rl "github.com/gen2brain/raylib-go/raylib" +) + +var Resources ResourceManager + +type ResourceManager struct { + LoadedPackages map[string]*settings.AppVersion + Textures TextrueManager + Worlds map[string]*World +} + +func InitManager() { + Resources = ResourceManager{ + LoadedPackages: make(map[string]*settings.AppVersion), + Worlds: make(map[string]*World), + Textures: TextrueManager{ + Textures: make([]*rl.Texture2D, 0), + NameToId: make(map[string]uint64), + }, + } +} + +func (base *ResourceManager) String() string { + var outp, jsonErr = json.Marshal(base) + if jsonErr != nil { + return fmt.Sprintf("Failed to parse settings: %s", jsonErr.Error()) + } + return string(outp) +} |
