Files
anm2ed/src/asset_store.h
T
shweet 7fb2c607c2 Flatten src into model, edit and ui, with .h headers
Resources and utilities sit directly in src. The ImGui windows, wizards, popups and helpers are in ui.
Headers that would shadow system ones are renamed: math_util, timestamp, subprocess, localization.
Includes are written from src.
2026-11-22 17:12:05 -05:00

25 lines
647 B
C++

#pragma once
#include <cstdint>
#include <unordered_map>
#include "audio_data.h"
#include "image.h"
namespace anm2ed::resource
{
// Immutable images and sounds keyed by content hash. Undo history records keys, never pixels or bytes, and
// entries live until the document closes so any step can be restored.
class AssetStore
{
std::unordered_map<std::uint64_t, Image> images{};
std::unordered_map<std::uint64_t, AudioData> audio{};
public:
std::uint64_t image_add(Image);
std::uint64_t audio_add(AudioData);
const Image* image_get(std::uint64_t) const;
const AudioData* audio_get(std::uint64_t) const;
};
}