level object saving; transform and physics objects
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
Reference in New Issue
Block a user