From 3e4edf1ea3a57987ef9a894459466bb7a8e2384a Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Tue, 10 Jan 2023 21:41:43 +0000 Subject: [PATCH] java --- source/engine/ffi.c | 9 ++++----- source/engine/script.c | 4 +--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/source/engine/ffi.c b/source/engine/ffi.c index b1e3cf7..42b1b06 100644 --- a/source/engine/ffi.c +++ b/source/engine/ffi.c @@ -15,6 +15,7 @@ #include "anim.h" #include "yugine.h" #include "nuke.h" +#include "font.h" cpVect duk2vec2(duk_context *duk, int p) { cpVect pos; @@ -31,13 +32,11 @@ cpVect duk2vec2(duk_context *duk, int p) { duk_ret_t duk_gui_text(duk_context *duk) { const char *s = duk_to_string(duk, 0); cpVect pos = duk2vec2(duk, 1); - duk_get_prop_index(duk, 1, 0); float fpos[2] = {pos.x, pos.y}; float size = duk_to_number(duk, 2); const float white[3] = {1.f, 1.f, 1.f}; renderText(s, fpos, size, white, 1800); - return 0; } @@ -142,8 +141,8 @@ duk_ret_t duk_make_gameobject(duk_context *duk) { go->mass = duk_to_number(duk, 2); go->f = duk_to_number(duk, 3); go->e = duk_to_number(duk, 4); - go->flipx = duk_to_boolean(duk, 5); - go->flipy = duk_to_boolean(duk, 6); + go->flipx = duk_to_boolean(duk, 5) ? -1 : 1; + go->flipy = duk_to_boolean(duk, 6) ? -1 : 1; gameobject_apply(go); @@ -246,4 +245,4 @@ void ffi_load() DUK_FUNC(gui_text, 3); DUK_FUNC(make_sprite, 3); DUK_FUNC(cmd, 2); -} \ No newline at end of file +} diff --git a/source/engine/script.c b/source/engine/script.c index d99c167..608e8d8 100644 --- a/source/engine/script.c +++ b/source/engine/script.c @@ -89,8 +89,6 @@ void script_eval_w_env(const char *s, void *env) { duk_push_heapptr(duk, env); duk_push_string(duk, s); - YughInfo("pressed %s", s); - if (!duk_has_prop(duk, -2)) { duk_pop(duk); return; @@ -168,4 +166,4 @@ void call_physics(double dt) { duk_push_number(duk, dt); duk_call(duk, 1); } -} \ No newline at end of file +}