-#include <assert.h>
+#include "system/stacktrace.h"
#include "ebisp/gc.h"
#include "ebisp/interpreter.h"
#include "level_script.h"
#include "system/log.h"
-static struct EvalResult
-hide_goal(void *param, Gc *gc, struct Scope *scope, struct Expr args)
-{
- assert(param);
- assert(gc);
- assert(scope);
-
- Level * const level = (Level*)param;
- char * goal_id = NULL;
-
- struct EvalResult result = match_list(gc, "s", args, &goal_id);
- if (result.is_error) {
- return result;
- }
-
- level_hide_goal(level, goal_id);
-
- return eval_success(NIL(gc));
-}
-
-static struct EvalResult
-show_goal(void *param, Gc *gc, struct Scope *scope, struct Expr args)
-{
- assert(param);
- assert(gc);
- assert(scope);
-
- Level * const level = (Level*)param;
- const char *goal_id = NULL;
-
- struct EvalResult result = match_list(gc, "s", args, &goal_id);
- if (result.is_error) {
- return result;
- }
-
- level_show_goal(level, goal_id);
-
- return eval_success(NIL(gc));
-}
-
static struct EvalResult
rect_apply_force(void *param, Gc *gc, struct Scope *scope, struct Expr args)
{
- assert(gc);
- assert(scope);
- assert(param);
+ trace_assert(gc);
+ trace_assert(scope);
+ trace_assert(param);
Level *level = (Level*) param;
static struct EvalResult
hide_label(void *param, Gc *gc, struct Scope *scope, struct Expr args)
{
- assert(param);
- assert(gc);
- assert(scope);
+ trace_assert(param);
+ trace_assert(gc);
+ trace_assert(scope);
Level *level = (Level*) param;
const char *label_id = NULL;
scope,
SYMBOL(gc, "rect-apply-force"),
NATIVE(gc, rect_apply_force, level));
- set_scope_value(
- gc,
- scope,
- SYMBOL(gc, "hide-goal"),
- NATIVE(gc, hide_goal, level));
- set_scope_value(
- gc,
- scope,
- SYMBOL(gc, "show-goal"),
- NATIVE(gc, show_goal, level));
set_scope_value(
gc,
scope,