move infos to spam
This commit is contained in:
parent
845fc5d4b8
commit
5e3fb73398
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -21,4 +21,5 @@ primum.exe
|
||||||
core.cdb.h
|
core.cdb.h
|
||||||
jsc
|
jsc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
primum.html
|
primum.html
|
||||||
|
.vscode
|
|
@ -99,7 +99,6 @@ globalThis.global = globalThis;
|
||||||
function use(file, env, script)
|
function use(file, env, script)
|
||||||
{
|
{
|
||||||
file = Resources.find_script(file);
|
file = Resources.find_script(file);
|
||||||
console.info(`loading up ${file}`);
|
|
||||||
var st = profile.now();
|
var st = profile.now();
|
||||||
env ??= {};
|
env ??= {};
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ var gameobject = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.info(`Creating entity of type ${ent.ur}`);
|
console.spam(`Creating entity of type ${ent.ur}`);
|
||||||
|
|
||||||
ent.warp_layer = [true];
|
ent.warp_layer = [true];
|
||||||
ent.components = {};
|
ent.components = {};
|
||||||
|
@ -543,12 +543,9 @@ var gameobject = {
|
||||||
kill() {
|
kill() {
|
||||||
if (this.__kill) return;
|
if (this.__kill) return;
|
||||||
this.__kill = true;
|
this.__kill = true;
|
||||||
console.info(`Killing entity of type ${this.ur}`);
|
console.spam(`Killing entity of type ${this.ur}`);
|
||||||
|
|
||||||
console.info(`killing ${this.timers.length} timers.`);
|
|
||||||
this.timers.forEach(t => t());
|
this.timers.forEach(t => t());
|
||||||
console.info(`now there are ${this.timers.length}`);
|
|
||||||
for (var i of this.timers) console.info(i);
|
|
||||||
this.timers = [];
|
this.timers = [];
|
||||||
Event.rm_obj(this);
|
Event.rm_obj(this);
|
||||||
Player.do_uncontrol(this);
|
Player.do_uncontrol(this);
|
||||||
|
|
|
@ -641,7 +641,6 @@ JSValue arb2js(cpArbiter *arb)
|
||||||
|
|
||||||
void phys_run_post(cpSpace *space, JSValue *fn, JSValue *hit)
|
void phys_run_post(cpSpace *space, JSValue *fn, JSValue *hit)
|
||||||
{
|
{
|
||||||
YughInfo("Run post for %p", fn);
|
|
||||||
JSValue hh = *hit;
|
JSValue hh = *hit;
|
||||||
script_call_sym(*fn, 1, &hh);
|
script_call_sym(*fn, 1, &hh);
|
||||||
JS_FreeValue(js, hh);
|
JS_FreeValue(js, hh);
|
||||||
|
@ -651,10 +650,10 @@ void phys_run_post(cpSpace *space, JSValue *fn, JSValue *hit)
|
||||||
int script_phys_cb_begin(cpArbiter *arb, cpSpace *space, gameobject *go)
|
int script_phys_cb_begin(cpArbiter *arb, cpSpace *space, gameobject *go)
|
||||||
{
|
{
|
||||||
if (!arb_valid(arb)) return 1;
|
if (!arb_valid(arb)) return 1;
|
||||||
YughInfo("Adding begin callbacks for go %p", go);
|
YughSpam("Adding begin callbacks for go %p", go);
|
||||||
|
|
||||||
if (!JS_IsUndefined(go->cbs.begin) && cpSpaceAddPostStepCallback(space, phys_run_post, &go->cbs.begin, &go->cbs.bhit)) {
|
if (!JS_IsUndefined(go->cbs.begin) && cpSpaceAddPostStepCallback(space, phys_run_post, &go->cbs.begin, &go->cbs.bhit)) {
|
||||||
YughInfo("Added begin for %p", &go->cbs.begin);
|
YughSpam("Added begin for %p", &go->cbs.begin);
|
||||||
go->cbs.bhit = arb2js(arb);
|
go->cbs.bhit = arb2js(arb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ void go_shape_moi(cpBody *body, cpShape *shape, gameobject *go) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameobject_apply(gameobject *go) {
|
void gameobject_apply(gameobject *go) {
|
||||||
YughInfo("Applying gameobject %p", go);
|
YughSpam("Applying gameobject %p", go);
|
||||||
cpBodySetType(go->body, go->phys);
|
cpBodySetType(go->body, go->phys);
|
||||||
cpBodyEachShape(go->body, go_shape_apply, go);
|
cpBodyEachShape(go->body, go_shape_apply, go);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue