diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libjin/audio/audio.h | 9 | ||||
-rw-r--r-- | src/libjin/render/window.cpp | 3 | ||||
-rw-r--r-- | src/script/embed/boot.lua.h | 15 | ||||
-rw-r--r-- | src/script/embed/path.lua.h | 3 | ||||
-rw-r--r-- | src/script/graphics/luaopen_JSL.cpp | 1 | ||||
-rw-r--r-- | src/script/graphics/luaopen_Tilemap.cpp | 9 | ||||
-rw-r--r-- | src/script/graphics/luaopen_graphics.cpp | 7 |
7 files changed, 21 insertions, 26 deletions
diff --git a/src/libjin/audio/audio.h b/src/libjin/audio/audio.h index 652e7a8..9356c8a 100644 --- a/src/libjin/audio/audio.h +++ b/src/libjin/audio/audio.h @@ -7,7 +7,16 @@ namespace jin namespace audio { + class Audio + { + public: + struct Setting + { + }; + + void init(const Setting& setting); + }; } } diff --git a/src/libjin/render/window.cpp b/src/libjin/render/window.cpp index d481793..70e7e2d 100644 --- a/src/libjin/render/window.cpp +++ b/src/libjin/render/window.cpp @@ -61,6 +61,9 @@ namespace render glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glColor4f(1, 1, 1, 1); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + Canvas::unbind(); swapBuffers(); } diff --git a/src/script/embed/boot.lua.h b/src/script/embed/boot.lua.h index ee1cbd3..afe352a 100644 --- a/src/script/embed/boot.lua.h +++ b/src/script/embed/boot.lua.h @@ -33,8 +33,9 @@ conf.fps = conf.fps or 60 conf.vsync = conf.vsync or false conf.title = conf.title or ("jin v" .. jin.version()) --- init video subsystem +-- initialize subsystems jin.graphics.init(conf) +--jin.audio.init(conf) -- open debug mode, must after jin.graphics.init if jin._argv[3] == '-d' then @@ -73,8 +74,10 @@ function jin.core.run() -- frame controle last = now now = second() - if (now - last) < fsec then - sleep(fsec - now + last) + dt = now - last + if dt < fsec then + sleep(fsec - dt) + dt = fsec end -- handle events @@ -85,10 +88,6 @@ function jin.core.run() end -- update - dt = now - last - if dt < fsec then - dt = fsec - end if onUpdate then onUpdate(dt) end @@ -101,7 +100,7 @@ function jin.core.run() -- custom drawing if onDraw then - onDraw() + onDraw() end -- render debug window diff --git a/src/script/embed/path.lua.h b/src/script/embed/path.lua.h index 3ebeab1..b398c99 100644 --- a/src/script/embed/path.lua.h +++ b/src/script/embed/path.lua.h @@ -15,5 +15,4 @@ function jin.path.full(path) return root .. '/' .. path end - -)"; +)";
\ No newline at end of file diff --git a/src/script/graphics/luaopen_JSL.cpp b/src/script/graphics/luaopen_JSL.cpp index 919949c..adb109c 100644 --- a/src/script/graphics/luaopen_JSL.cpp +++ b/src/script/graphics/luaopen_JSL.cpp @@ -141,5 +141,6 @@ namespace lua luax_newtype(L, TYPE_JSL, f); return 0; } + } }
\ No newline at end of file diff --git a/src/script/graphics/luaopen_Tilemap.cpp b/src/script/graphics/luaopen_Tilemap.cpp deleted file mode 100644 index 983193e..0000000 --- a/src/script/graphics/luaopen_Tilemap.cpp +++ /dev/null @@ -1,9 +0,0 @@ -namespace jin -{ -namespace lua -{ - - - -} -} diff --git a/src/script/graphics/luaopen_graphics.cpp b/src/script/graphics/luaopen_graphics.cpp index 50b1921..6e78e36 100644 --- a/src/script/graphics/luaopen_graphics.cpp +++ b/src/script/graphics/luaopen_graphics.cpp @@ -19,11 +19,8 @@ namespace lua static struct { color curRenderColor; - Font* curFont = 0; - Font* defaultFont = 0; - } context; /** @@ -40,10 +37,6 @@ namespace lua setting.vsync = luax_getfield_bool(L, 1, "vsync"); wnd->init(setting); - // set default blend method - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - // init success luax_pushboolean(L, true); return 1; |