Files
anm2ed/src/asset_store.h
T
shweet 7afdf709c3 Format like smack-a-brother, and write comments as sentences
Four-space indents, braces on their own lines, and one-statement bodies without braces.
Semicolons in comments became full stops.
Designated initializers may leave fields out without a warning.
2026-11-22 17:30:03 -05:00

22 lines
600 B
C++

#pragma once
#include <cstdint>
#include <unordered_map>
#include "audio_data.h"
#include "image.h"
// 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;
};