level object saving; transform and physics objects

This commit is contained in:
2023-10-02 12:58:17 +00:00
parent 39ab236d66
commit ac91e0742a
7 changed files with 145 additions and 143 deletions

View File

@@ -967,6 +967,7 @@ JSValue duk_cmd(JSContext *js, JSValueConst this, int argc, JSValueConst *argv)
case 102:
eye = HMM_AddV3(eye,(HMM_Vec3){0,0,0.01});
break;
case 103:
return num2js(js2go(argv[1])->scale);

View File

@@ -27,7 +27,7 @@ static struct {
struct Texture *tex_default;
struct Texture *texture_notex() {
return texture_pullfromfile("icons/no_tex.png");
return texture_pullfromfile("icons/no_tex.gif");
}
unsigned int next_pow2(unsigned int v)
@@ -83,7 +83,12 @@ struct Texture *texture_pullfromfile(const char *path) {
if (index != -1)
return texhash[index].value;
YughInfo("Loading texture %s.", path);
long rawlen;
unsigned char *raw = slurp_file(path, &rawlen);
if (!raw) return texture_notex();
unsigned char *data;
struct Texture *tex = calloc(1, sizeof(*tex));
tex->opts.sprite = 1;
@@ -94,10 +99,6 @@ struct Texture *texture_pullfromfile(const char *path) {
int n;
long rawlen;
unsigned char *raw = slurp_file(path, &rawlen);
unsigned char *data;
char *ext = strrchr(path, '.');
if (!strcmp(ext, ".qoi")) {