PROTO
This commit is contained in:
parent
a2c9d1163a
commit
248456fd9e
|
@ -292,6 +292,8 @@ s7_pointer s7_register(s7_scheme *sc, s7_pointer args) {
|
||||||
int hook = s7_integer(s7_car(args));
|
int hook = s7_integer(s7_car(args));
|
||||||
s7_pointer sym = s7_cadr(args);
|
s7_pointer sym = s7_cadr(args);
|
||||||
|
|
||||||
|
s7_gc_protect(sc, sym);
|
||||||
|
|
||||||
/* 0 : update */
|
/* 0 : update */
|
||||||
/* 1 : gui */
|
/* 1 : gui */
|
||||||
/* 2 : physics */
|
/* 2 : physics */
|
||||||
|
@ -318,11 +320,15 @@ s7_pointer s7_obregister(s7_scheme *sc, s7_pointer args) {
|
||||||
s7_pointer sym = s7_cadr(args);
|
s7_pointer sym = s7_cadr(args);
|
||||||
s7_pointer env = s7_caddr(args);
|
s7_pointer env = s7_caddr(args);
|
||||||
|
|
||||||
|
s7_gc_protect(sc, sym);
|
||||||
|
s7_gc_protect(sc, env);
|
||||||
|
|
||||||
register_obupdate(env, sym);
|
register_obupdate(env, sym);
|
||||||
}
|
}
|
||||||
|
|
||||||
s7_pointer s7_set_pawn(s7_scheme *sc, s7_pointer args) {
|
s7_pointer s7_set_pawn(s7_scheme *sc, s7_pointer args) {
|
||||||
s7_pointer pawn = s7_car(args);
|
s7_pointer pawn = s7_car(args);
|
||||||
|
s7_gc_protect(sc, pawn);
|
||||||
set_pawn(pawn);
|
set_pawn(pawn);
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,13 @@ void script_eval_w_env(const char *s, s7_pointer env) {
|
||||||
snprintf(buffer, 512-1, "(%s)", s);
|
snprintf(buffer, 512-1, "(%s)", s);
|
||||||
|
|
||||||
s7_set_current_error_port(s7, s7_open_output_function(s7, null_port));
|
s7_set_current_error_port(s7, s7_open_output_function(s7, null_port));
|
||||||
s7_eval_c_string_with_environment(s7, buffer, env);
|
|
||||||
|
s7_pointer oldenv = s7_curlet(s7);
|
||||||
|
s7_set_curlet(s7, env);
|
||||||
|
s7_eval_c_string(s7, buffer);
|
||||||
|
s7_set_curlet(s7, oldenv);
|
||||||
|
|
||||||
|
|
||||||
s7_set_current_error_port(s7, s7_open_output_function(s7, my_err));
|
s7_set_current_error_port(s7, s7_open_output_function(s7, my_err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,8 +159,10 @@ void call_updates(double dt) {
|
||||||
s7_call(s7, updates[i], s7_cons(s7, s7_make_real(s7, dt), s7_nil(s7)));
|
s7_call(s7, updates[i], s7_cons(s7, s7_make_real(s7, dt), s7_nil(s7)));
|
||||||
|
|
||||||
for (int i = 0; i < arrlen(obupdates); i++) {
|
for (int i = 0; i < arrlen(obupdates); i++) {
|
||||||
|
s7_pointer curlet = s7_curlet(s7);
|
||||||
s7_set_curlet(s7, obupdates[i].obj);
|
s7_set_curlet(s7, obupdates[i].obj);
|
||||||
s7_call(s7, obupdates[i].sym, s7_cons(s7, s7_make_real(s7, dt), s7_nil(s7)));
|
s7_call(s7, obupdates[i].sym, s7_cons(s7, s7_make_real(s7, dt), s7_nil(s7)));
|
||||||
|
s7_set_curlet(s7, curlet);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue