mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
refactor
This commit is contained in:
parent
167388aefb
commit
ef28a368cb
12 changed files with 54 additions and 51 deletions
|
|
@ -15,9 +15,12 @@ LevelFrontend::LevelFrontend(LevelController* controller, Assets* assets)
|
|||
: level(controller->getLevel()),
|
||||
controller(controller),
|
||||
assets(assets),
|
||||
contentCache(std::make_unique<ContentGfxCache>(level->content, assets)),
|
||||
blocksAtlas(BlocksPreview::build(contentCache.get(), assets, level->content))
|
||||
contentCache(std::make_unique<ContentGfxCache>(level->content, assets))
|
||||
{
|
||||
assets->store(
|
||||
BlocksPreview::build(contentCache.get(), assets, level->content).release(),
|
||||
"block-previews"
|
||||
);
|
||||
controller->getPlayerController()->listenBlockInteraction(
|
||||
[=](Player*, glm::ivec3 pos, const Block* def, BlockInteraction type) {
|
||||
auto material = level->content->findBlockMaterial(def->material);
|
||||
|
|
@ -79,10 +82,6 @@ ContentGfxCache* LevelFrontend::getContentGfxCache() const {
|
|||
return contentCache.get();
|
||||
}
|
||||
|
||||
Atlas* LevelFrontend::getBlocksAtlas() const {
|
||||
return blocksAtlas.get();
|
||||
}
|
||||
|
||||
LevelController* LevelFrontend::getController() const {
|
||||
return controller;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue