This commit is contained in:
John Alanbrook 2022-09-07 15:34:45 +00:00
parent 81986d6bad
commit ca0419ab46
2 changed files with 5 additions and 0 deletions

View file

@ -45,6 +45,7 @@ void sprite_io(struct mSprite *sprite, FILE *f, int read)
fgets(path,100, f); fgets(path,100, f);
fread(sprite, sizeof(*sprite), 1, f); fread(sprite, sizeof(*sprite), 1, f);
sprite_loadtex(sprite, path); sprite_loadtex(sprite, path);
printf("Tex was %s.\n", path);
} else { } else {
fputs(tex_get_path(sprite->tex), f); fputs(tex_get_path(sprite->tex), f);
fwrite(sprite, sizeof(*sprite), 1, f); fwrite(sprite, sizeof(*sprite), 1, f);

View file

@ -53,6 +53,10 @@ struct Texture *texture_loadfromfile(const char *path)
{ {
struct Texture *new = texture_pullfromfile(path); struct Texture *new = texture_pullfromfile(path);
if (new == NULL) {
YughInfo("Texture not loaded!", 0);
}
glGenTextures(1, &new->id); glGenTextures(1, &new->id);
tex_gpu_load(new); tex_gpu_load(new);