Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
BitmapRuntime.hpp
Go to the documentation of this file.
1#pragma once
2#include "LegacyBitmap.hpp"
4#include <memory>
5#include <array>
6#include <optional>
7#include <unordered_map>
8
9namespace monopoly::data
10{
12 {
17 // Opt-in presentation artwork. Retail and runtime text retain nearest sampling.
19 // Qualified presentation-only rectangle; original CNK bounds remain untouched.
20 std::optional<std::array<float, 4>> presentationRect;
21 };
22 // Immutable payload identity prevents DataId reuse across snapshots from
23 // returning stale pixels. Consumers retain their old asset after replacement.
25 {
26 public:
27 [[nodiscard]] std::expected<std::shared_ptr<const BitmapRuntimeAsset>, BitmapError>
29 // Called after render publication retires the previous consumers.
30 // Keep active immutable assets; unused entries must not pin DAT leases.
31 [[nodiscard]] std::size_t releaseUnused() noexcept;
32 void clear() noexcept { assets_.clear(); }
33 [[nodiscard]] std::size_t size() const noexcept { return assets_.size(); }
34 private:
35 std::unordered_map<DataId, std::shared_ptr<const BitmapRuntimeAsset>> assets_;
36 };
37}
std::vector< std::byte > bytes
unsigned index
std::size_t size() const noexcept
std::size_t releaseUnused() noexcept
std::expected< std::shared_ptr< const BitmapRuntimeAsset >, BitmapError > resolve(DataId id, LegacyDataType sourceType, SharedDataBytes bytes)
std::uint32_t DataId
Definition DataBanks.hpp:10
std::shared_ptr< const DataBytes > SharedDataBytes
std::optional< std::array< float, 4 > > presentationRect