image generation

This commit is contained in:
John Alanbrook 2024-06-19 11:45:34 -05:00
parent ebfa801560
commit 35deec52ae
2 changed files with 2 additions and 2 deletions

View file

@ -61,7 +61,8 @@ var sprite = {
this._p = p; this._p = p;
this.del_anim?.(); this.del_anim?.();
this.texture = game.texture(p); this.texture = game.texture(p);
this.diffuse = this.texture;
this.diffuse = this.texture;
this.rect = [0,0,1,1]; this.rect = [0,0,1,1];
var anim = SpriteAnim.make(p); var anim = SpriteAnim.make(p);

View file

@ -284,7 +284,6 @@ double grad (int hash, double x, double y, double z)
void texture_save(texture *tex, const char *file) void texture_save(texture *tex, const char *file)
{ {
char *ext = strrchr(file, '.'); char *ext = strrchr(file, '.');
printf("SAVING TO %s with ext %s\n", file, ext);
if (!strcmp(ext, ".png")) if (!strcmp(ext, ".png"))
stbi_write_png(file, tex->width, tex->height, 4, tex->data, 4*tex->width); stbi_write_png(file, tex->width, tex->height, 4, tex->data, 4*tex->width);
else if (!strcmp(ext, ".bmp")) else if (!strcmp(ext, ".bmp"))