DSC Engine
Loading...
Searching...
No Matches
obj_allocator.hpp
1#pragma once
2
3#include "DSCEngine/resources/asset_data.hpp"
5#include "DSCEngine/types/hash_map.hpp"
6#include "DSCEngine/types/hash_set.hpp"
9#include "DSCEngine/video/palette_loader.hpp"
10
11namespace DSC
12{
13 class ObjFrame;
14
16 {
17 private:
19
20 Allocator* allocator;
21 PaletteLoader* palette_loader;
22
23 int bytes_per_entry = 32;
24
25 void remove(const AssetData* asset, Point<short> metatile);
26
27 void on_frame_unload(void* sender, void* args);
28 public:
33 ObjAllocator(Allocator* allocator, PaletteLoader* palette_loader, int bytes_per_entry = 32);
34
38 bool allocate(ObjFrame* frame);
39
43 void deallocate(ObjFrame* frame);
44
45 ~ObjAllocator() = default;
46 };
47}
flexible VRAM manager
Definition: allocator.hpp:11
Definition: asset_data.hpp:8
Generic hash map.
Definition: hash_map.hpp:18
Definition: obj_allocator.hpp:16
ObjAllocator(Allocator *allocator, PaletteLoader *palette_loader, int bytes_per_entry=32)
creates a new ObjAllocator instance
void deallocate(ObjFrame *frame)
deallocates new block for the specified frame
bool allocate(ObjFrame *frame)
allocates new block for the specified frame
Definition: obj_frame.hpp:14
Definition: palette_loader.hpp:10
Generic point definition.
Generic point of two coordinates.
Definition: point.hpp:15