GL-related refactor

This commit is contained in:
MihailRis
2024-03-07 13:09:58 +03:00
parent f8e02e1b3b
commit 87edb1d45e
16 changed files with 224 additions and 111 deletions
+3 -5
View File
@@ -481,18 +481,16 @@ void Hud::draw(const GfxContext& ctx){
// Crosshair
if (!pause && !inventoryOpen && !player->debug) {
GfxContext chctx = ctx.sub();
chctx.blendMode(blendmode::inversion);
chctx.setBlendMode(blendmode::inversion);
auto texture = assets->getTexture("gui/crosshair");
batch->texture(texture);
int chsizex = texture != nullptr ? texture->width : 16;
int chsizey = texture != nullptr ? texture->height : 16;
int chsizex = texture != nullptr ? texture->getWidth() : 16;
int chsizey = texture != nullptr ? texture->getHeight() : 16;
batch->rect(
(width-chsizex)/2, (height-chsizey)/2,
chsizex, chsizey, 0,0, 1,1, 1,1,1,1
);
batch->flush();
}
batch->flush();
}
void Hud::updateElementsPosition(const Viewport& viewport) {