From 2a8b975d44661db15a566a57e7d6fbe428082aef Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 1 Nov 2018 08:40:29 +0800 Subject: =?UTF-8?q?*=E6=9B=B4=E6=96=B0=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/embed/embed.h | 12 +++++------- src/lua/embed/graphics.lua.h | 2 +- src/lua/jin.cpp | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/lua') diff --git a/src/lua/embed/embed.h b/src/lua/embed/embed.h index e343dcd..1efbc95 100644 --- a/src/lua/embed/embed.h +++ b/src/lua/embed/embed.h @@ -4,28 +4,26 @@ namespace JinEngine { - namespace embed + namespace Embed { #define embed(L, script, name)\ if(luax_loadbuffer(L, script, strlen(script), name) == 0)\ lua_call(L, 0, 0); - /** - * embed structure. - */ + // Embed structure. struct jin_Embed { const char* file, *source; }; - // embed scripts + // Embed scripts. #include "graphics.lua.h" #include "keyboard.lua.h" #include "mouse.lua.h" #include "boot.lua.h" - // in order + // In order. const jin_Embed scripts[] = { { "graphics.lua", graphics_lua }, { "keyboard.lua", keyboard_lua }, @@ -40,7 +38,7 @@ namespace JinEngine embed(L, scripts[i].source, scripts[i].file); } - } // embed + } // namespace Embed } // namespace JinEngine #endif \ No newline at end of file diff --git a/src/lua/embed/graphics.lua.h b/src/lua/embed/graphics.lua.h index 671cacd..b2a19b5 100644 --- a/src/lua/embed/graphics.lua.h +++ b/src/lua/embed/graphics.lua.h @@ -17,7 +17,7 @@ Vertex vert(Vertex v) Color frag(Color col, Texture tex, Vertex v) { - return col; + return col * texel(tex, v.uv); } #END_FRAGMENT_SHADER diff --git a/src/lua/jin.cpp b/src/lua/jin.cpp index 10b60b6..26b5f04 100644 --- a/src/lua/jin.cpp +++ b/src/lua/jin.cpp @@ -104,7 +104,7 @@ namespace JinEngine LUA_EXPORT void boot(lua_State* L) { - JinEngine::embed::boot(L); + JinEngine::Embed::boot(L); } } // namespace Lua -- cgit v1.1-26-g67d0