From 9ab25f7518ef4718254c2d8e843910104127683d Mon Sep 17 00:00:00 2001 From: Reuh Date: Thu, 20 Aug 2015 10:45:18 +0200 Subject: [PATCH] TABS. TABS EVERYWHERE. Please. Also, gfx.set3D now accept any value (not only boolean), like on Lua. Because why not (Also changed the ctrulib gfxSet3D function to the sf2dlib one). --- source/ctr.c | 8 ++++---- source/gfx.c | 8 +++----- source/main.c | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/source/ctr.c b/source/ctr.c index b3ca2dd..a917fd3 100644 --- a/source/ctr.c +++ b/source/ctr.c @@ -11,14 +11,14 @@ int load_ptm_lib(lua_State *L); int load_hid_lib(lua_State *L); static int ctr_time(lua_State *L) { - lua_pushinteger(L, osGetTime()); - - return 1; + lua_pushinteger(L, osGetTime()); + + return 1; } // Functions static const struct luaL_Reg ctr_lib[] = { - { "time", ctr_time}, + { "time", ctr_time}, { NULL, NULL } }; diff --git a/source/gfx.c b/source/gfx.c index f47e205..d59c442 100644 --- a/source/gfx.c +++ b/source/gfx.c @@ -40,13 +40,11 @@ static int gfx_getFPS(lua_State *L) { } static int gfx_set3D(lua_State *L) { - bool enable = false; - if (lua_isboolean(L, 1)) - enable = lua_toboolean(L, 1); + bool enable = lua_toboolean(L, 1); - gfxSet3D(enable); + sf2d_set_3d(enable); - return 1; + return 0; } static int gfx_line(lua_State *L) { diff --git a/source/main.c b/source/main.c index b4bba44..5ca2fae 100644 --- a/source/main.c +++ b/source/main.c @@ -52,7 +52,7 @@ int main() { // Init GFX sf2d_init(); sftd_init(); - //sf2d_set_3d(true); + gfxinit = true; // Init accel/gyro