Remove duplicate code
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
// facing out of the screen, the body turned a little toward the mouse and the head turned and tilted more, with what
|
||||
// they wear, like their curios. the gui has no depth buffer, so the faces are drawn back to front with the ones facing
|
||||
// away left out, like 3d items in slots
|
||||
import { flush_batch, get_current_texture, push_vertex, set_current_texture, type Texture } from "../renderer/mod.ts";
|
||||
import { push_vertex, type Texture, use_texture } from "../renderer/mod.ts";
|
||||
import type { ItemStack } from "$/common/inventory.ts";
|
||||
import { AssetManager } from "../assets.ts";
|
||||
import { rotation_around } from "./model_math.ts";
|
||||
@@ -102,10 +102,7 @@ export function draw_gui_player(
|
||||
// blocks to skin pixels to the screen, y down
|
||||
const scale = 16 * pixel;
|
||||
for (const { vertices, texture } of faces) {
|
||||
if (get_current_texture() !== texture.tex) {
|
||||
flush_batch();
|
||||
set_current_texture(texture.tex);
|
||||
}
|
||||
use_texture(texture.tex);
|
||||
for (const [vx, vy, , u, v, r, g, b] of vertices) {
|
||||
push_vertex(x + vx * scale, feet_y - vy * scale, 0, u, v, r, g, b, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user