Remove duplicate code
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2026 Paula Wisnievski
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import { flush_batch, get_current_texture, push_quad, push_vertex, set_current_texture, white_tex } from "./core.ts";
|
||||
import { push_quad, push_vertex, use_texture, white_tex } from "./core.ts";
|
||||
|
||||
export function draw_rect(
|
||||
x: number,
|
||||
@@ -10,10 +10,7 @@ export function draw_rect(
|
||||
h: number,
|
||||
color: [number, number, number, number] = [1, 1, 1, 1],
|
||||
) {
|
||||
if (get_current_texture() !== white_tex) {
|
||||
flush_batch();
|
||||
set_current_texture(white_tex!);
|
||||
}
|
||||
use_texture(white_tex!);
|
||||
|
||||
push_quad(x, y, w, h, 0, 0, 1, 1, color[0], color[1], color[2], color[3]);
|
||||
}
|
||||
@@ -89,9 +86,6 @@ export function draw_rect_3d(
|
||||
h: number,
|
||||
color: readonly number[] = [1, 1, 1, 1],
|
||||
) {
|
||||
if (get_current_texture() !== white_tex) {
|
||||
flush_batch();
|
||||
set_current_texture(white_tex!);
|
||||
}
|
||||
use_texture(white_tex!);
|
||||
push_plane_quad(plane, x, y, w, h, 0, 0, 1, 1, color);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user