mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
'ifnot' template property + hpp
This commit is contained in:
parent
8b1c102cfe
commit
9ea67deb13
59 changed files with 204 additions and 201 deletions
27
src/frontend/ContentGfxCache.hpp
Normal file
27
src/frontend/ContentGfxCache.hpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef FRONTEND_BLOCKS_GFX_CACHE_HPP_
|
||||
#define FRONTEND_BLOCKS_GFX_CACHE_HPP_
|
||||
|
||||
#include "../typedefs.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class Content;
|
||||
class Assets;
|
||||
struct UVRegion;
|
||||
|
||||
class ContentGfxCache {
|
||||
const Content* content;
|
||||
// array of block sides uv regions (6 per block)
|
||||
std::unique_ptr<UVRegion[]> sideregions;
|
||||
public:
|
||||
ContentGfxCache(const Content* content, Assets* assets);
|
||||
~ContentGfxCache();
|
||||
|
||||
inline const UVRegion& getRegion(blockid_t id, int side) const {
|
||||
return sideregions[id * 6 + side];
|
||||
}
|
||||
|
||||
const Content* getContent() const;
|
||||
};
|
||||
|
||||
#endif // FRONTEND_BLOCKS_GFX_CACHE_HPP_
|
||||
Loading…
Add table
Add a link
Reference in a new issue