Allow for textures that aren't 16x16
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// the immediate mode drawing mods' client scripts get (Graphics in common/mod_api/client.ts), on top of the renderer.
|
||||
// one per screen, so text inputs keep their text and focus while it's open
|
||||
import { SLOT_SIZE, TEXTURE_SIZE } from "$/common/constants.ts";
|
||||
import { SLOT_SIZE } from "$/common/constants.ts";
|
||||
import { EverythingRegistry, type ItemRegistry } from "$/common/everything_registry.ts";
|
||||
import { ItemStack } from "$/common/inventory.ts";
|
||||
import type { Color, Graphics } from "$/common/mod_api/client.ts";
|
||||
@@ -102,10 +102,10 @@ export class ModGraphics implements Graphics {
|
||||
const region = get_sprite_region(id);
|
||||
draw_texture_region(
|
||||
atlas,
|
||||
region.x * TEXTURE_SIZE,
|
||||
region.y * TEXTURE_SIZE,
|
||||
TEXTURE_SIZE,
|
||||
TEXTURE_SIZE,
|
||||
region.x,
|
||||
region.y,
|
||||
region.width,
|
||||
region.height,
|
||||
x,
|
||||
y,
|
||||
w,
|
||||
|
||||
Reference in New Issue
Block a user