fix item render

efd/v1
Dominik Madarász 2022-10-16 02:27:25 +02:00
parent 2d09fd90cd
commit fe497ae71b
1 changed files with 2 additions and 2 deletions

View File

@ -139,8 +139,8 @@ void renderer_draw_entry(uint64_t key, entity_view *data, game_world_render_entr
}break;
case EKIND_ITEM: {
Texture2D tex = GetSpriteTexture2D(assets_find(data->asset));
float x = data->x - (tex.width/2);
float y = data->y - (tex.height/4);
float x = data->x - (WORLD_BLOCK_SIZE/2.0F);
float y = data->y - (WORLD_BLOCK_SIZE/2.0F);
float aspect = tex.width/(float)tex.height;
float size = WORLD_BLOCK_SIZE/2.0f * aspect;
float ofs_x = (WORLD_BLOCK_SIZE-size)/2.0f;