// This file is part of the 64k demo project. // It defines the core structures and interface for asset management. // Used for efficient retrieval of embedded binary resources. #pragma once #include #include enum class AssetId : uint16_t; // Forward declaration // Type for procedural generation functions: (buffer, width, height, params, num_params) typedef void (*ProcGenFunc)(uint8_t*, int, int, const float*, int); struct AssetRecord { const uint8_t* data; // Pointer to asset data (static or dynamic) size_t size; // Size of the asset data bool is_procedural; // True if data was dynamically allocated by a procedural generator const char* proc_func_name_str; // Name of procedural generation function (string literal) const float* proc_params; // Parameters for procedural generation (static, from assets.txt) int num_proc_params; // Number of procedural parameters }; // Generic interface const uint8_t* GetAsset(AssetId asset_id, size_t* out_size = nullptr); void DropAsset(AssetId asset_id, const uint8_t* asset);