fix sprite render

This commit is contained in:
John Alanbrook 2024-06-19 18:52:41 -05:00
parent 35deec52ae
commit 7e851756de
3 changed files with 4 additions and 5 deletions

View file

@ -260,7 +260,7 @@ SpriteAnim.aseprite = function(path) {
var anims = {}; var anims = {};
var frames = Array.isArray(data.frames) ? data.frames : Object.values(data.frames); var frames = Array.isArray(data.frames) ? data.frames : Object.values(data.frames);
var f = 0; var f = 0;
if (data.meta.frameTags.length === 0) { if (!data.meta.frameTags || data.meta.frameTags.length === 0) {
anims[0] = aseframeset2anim(frames, data.meta); anims[0] = aseframeset2anim(frames, data.meta);
return anims; return anims;
} }

View file

@ -275,6 +275,7 @@ render.shader_apply_material = function(shader, material = {})
var s = shader.fs.unimap[p]; var s = shader.fs.unimap[p];
shader_unisize[s.size](1, s.slot, material[p]); shader_unisize[s.size](1, s.slot, material[p]);
} }
if (!material.diffuse) return;
if ("diffuse_size" in shader.fs.unimap) if ("diffuse_size" in shader.fs.unimap)
render.setuniv2(1, shader.fs.unimap.diffuse_size.slot, [material.diffuse.width, material.diffuse.height]); render.setuniv2(1, shader.fs.unimap.diffuse_size.slot, [material.diffuse.width, material.diffuse.height]);

View file

@ -1,8 +1,6 @@
@block vert @block vert
uniform vec4 mixcolor;
uniform vec4 emissive; uniform vec4 emissive;
uniform vec4 rect; uniform vec4 rect;
uniform vec2 offset;
uniform vec2 diffuse_size; uniform vec2 diffuse_size;
void vert() void vert()
{ {