Fixed block preview texture selection
This commit is contained in:
parent
81d246f3d0
commit
bb7c63394b
@ -61,7 +61,6 @@ int initialize_assets(Assets* assets) {
|
||||
LOAD_SHADER("res/ui.glslv", "res/ui.glslf", "ui");
|
||||
|
||||
LOAD_TEXTURE("res/block.png", "block");
|
||||
LOAD_TEXTURE("res/block_select.png", "block_select");
|
||||
|
||||
LOAD_FONT("res/font.png", "normal");
|
||||
return 0;
|
||||
|
||||
@ -132,10 +132,12 @@ void draw_hud(Player* player, Assets* assets, bool devdata, int fps){
|
||||
batch->render();
|
||||
|
||||
// choosen block preview
|
||||
Texture* blocks = assets->getTexture("block_select");
|
||||
Texture* blocks = assets->getTexture("block");
|
||||
batch->texture(blocks);
|
||||
batch->sprite(14, 278, 68, 68, 16, player->choosenBlock, vec4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
batch->sprite(16, 280, 64, 64, 16, player->choosenBlock, vec4(1.0f));
|
||||
|
||||
int texid = Block::blocks[player->choosenBlock]->textureFaces[3]; // face-3 is top face of block
|
||||
batch->sprite(14, 278, 68, 68, 16, texid, vec4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
batch->sprite(16, 280, 64, 64, 16, texid, vec4(1.0f));
|
||||
batch->render();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user