mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
add blockSprite
This commit is contained in:
parent
420ae4e993
commit
0711cb07f0
5 changed files with 82 additions and 5 deletions
|
|
@ -145,8 +145,15 @@ void draw_hud(World* world, Level* level, Assets* assets, bool devdata, int fps)
|
|||
batch->sprite(16, 640, 64, 64, 16, 0, vec4(1.0f));
|
||||
|
||||
batch->texture(blocks);
|
||||
int texid = Block::blocks[player->choosenBlock]->textureFaces[3]; // face-3 is top face of block
|
||||
batch->sprite(24, 648, 48, 48, 16, texid, vec4(1.0f));
|
||||
Block* cblock = Block::blocks[player->choosenBlock];
|
||||
// int texid = Block::blocks[player->choosenBlock]->textureFaces[3]; // face-3 is top face of block
|
||||
cblock->textureFaces;
|
||||
if (cblock->type == 1){
|
||||
batch->blockSprite(24, 648, 48, 48, 16, cblock->textureFaces, vec4(1.0f));
|
||||
} else if (cblock->type == 2){
|
||||
batch->sprite(24, 648, 48, 48, 16, cblock->textureFaces[3], vec4(1.0f));
|
||||
}
|
||||
|
||||
batch->render();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue