#include "ebisp/scope.h"
#include "ebisp/std.h"
#include "game/level.h"
-#include "game/level/player/rigid_rect.h"
-#include "game/level_script.h"
#include "sdl/renderer.h"
#include "system/log.h"
#include "system/log_script.h"
struct Console
{
- Lt *lt;
+ Lt lt;
Gc *gc;
struct Scope scope;
Edit_field *edit_field;
Console *create_console(Broadcast *broadcast,
const Sprite_font *font)
{
- Lt *lt = create_lt();
+ Lt lt = {0};
if (lt == NULL) {
return NULL;
}
- Console *console = PUSH_LT(lt, nth_alloc(sizeof(Console)), free);
+ Console *console = PUSH_LT(lt, nth_calloc(1, sizeof(Console)), free);
if (console == NULL) {
RETURN_LT(lt, NULL);
}
load_std_library(console->gc, &console->scope);
load_log_library(console->gc, &console->scope);
+ /* TODO(#669): how to report EvalResult error from create_console? */
broadcast_load_library(broadcast, console->gc, &console->scope);
console->edit_field = PUSH_LT(
console->eval_result = PUSH_LT(
lt,
- nth_alloc(sizeof(char) * CONSOLE_EVAL_RESULT_SIZE),
+ nth_calloc(1, sizeof(char) * CONSOLE_EVAL_RESULT_SIZE),
free);
if (console->eval_result == NULL) {
RETURN_LT(lt, NULL);