minor refactor
This commit is contained in:
@@ -35,7 +35,8 @@ ImageData* BlocksPreview::draw(
|
|||||||
// something went wrong...
|
// something went wrong...
|
||||||
break;
|
break;
|
||||||
case BlockModel::block:
|
case BlockModel::block:
|
||||||
batch->blockCube(glm::vec3(size * 0.63f), texfaces, glm::vec4(1.0f), !def->rt.emissive);
|
batch->blockCube(glm::vec3(size * 0.63f), texfaces,
|
||||||
|
glm::vec4(1.0f), !def->rt.emissive);
|
||||||
break;
|
break;
|
||||||
case BlockModel::aabb:
|
case BlockModel::aabb:
|
||||||
batch->blockCube(def->hitbox.size() * glm::vec3(size * 0.63f),
|
batch->blockCube(def->hitbox.size() * glm::vec3(size * 0.63f),
|
||||||
|
|||||||
@@ -153,9 +153,6 @@ void SlotView::draw(Batch2D* batch, Assets* assets) {
|
|||||||
|
|
||||||
batch->color = glm::vec4(1.0f);
|
batch->color = glm::vec4(1.0f);
|
||||||
|
|
||||||
Viewport viewport(Window::width, Window::height);
|
|
||||||
GfxContext ctx(nullptr, viewport, batch);
|
|
||||||
|
|
||||||
auto previews = frontend->getBlocksAtlas();
|
auto previews = frontend->getBlocksAtlas();
|
||||||
auto indices = content->getIndices();
|
auto indices = content->getIndices();
|
||||||
|
|
||||||
|
|||||||
@@ -8,19 +8,19 @@ class ImageData;
|
|||||||
|
|
||||||
class Texture {
|
class Texture {
|
||||||
public:
|
public:
|
||||||
uint id;
|
uint id;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
Texture(uint id, int width, int height);
|
Texture(uint id, int width, int height);
|
||||||
Texture(ubyte* data, int width, int height, uint format);
|
Texture(ubyte* data, int width, int height, uint format);
|
||||||
~Texture();
|
~Texture();
|
||||||
|
|
||||||
void bind();
|
void bind();
|
||||||
void reload(ubyte* data);
|
void reload(ubyte* data);
|
||||||
|
|
||||||
ImageData* readData();
|
ImageData* readData();
|
||||||
|
|
||||||
static Texture* from(const ImageData* image);
|
static Texture* from(const ImageData* image);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* GRAPHICS_TEXTURE_H_ */
|
#endif /* GRAPHICS_TEXTURE_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user