aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/Jin.exebin552448 -> 552960 bytes
-rw-r--r--bin/jin.exebin552448 -> 552960 bytes
-rw-r--r--src/lua/modules/graphics/shader.cpp33
3 files changed, 24 insertions, 9 deletions
diff --git a/bin/Jin.exe b/bin/Jin.exe
index 64c211d..992aa75 100644
--- a/bin/Jin.exe
+++ b/bin/Jin.exe
Binary files differ
diff --git a/bin/jin.exe b/bin/jin.exe
index 64c211d..992aa75 100644
--- a/bin/jin.exe
+++ b/bin/jin.exe
Binary files differ
diff --git a/src/lua/modules/graphics/shader.cpp b/src/lua/modules/graphics/shader.cpp
index c2808ca..db78c4d 100644
--- a/src/lua/modules/graphics/shader.cpp
+++ b/src/lua/modules/graphics/shader.cpp
@@ -54,8 +54,13 @@ namespace lua
{
JSLRef ref = checkJSLProgram(L);
const char* variable = luax_checkstring(L, 2);
- float x = luax_checknumber(L, 3);
- float y = luax_checknumber(L, 4);
+ if (!luax_istable(L, 3))
+ {
+ luax_typerror(L, 3, "table");
+ return 1;
+ }
+ float x = luax_rawgetnumber(L, 3, 1);
+ float y = luax_rawgetnumber(L, 3, 2);
ref->sendVec2(variable, x, y);
return 0;
}
@@ -64,9 +69,14 @@ namespace lua
{
JSLRef ref = checkJSLProgram(L);
const char* variable = luax_checkstring(L, 2);
- float x = luax_checknumber(L, 3);
- float y = luax_checknumber(L, 4);
- float z = luax_checknumber(L, 5);
+ if (!luax_istable(L, 3))
+ {
+ luax_typerror(L, 3, "table");
+ return 1;
+ }
+ float x = luax_rawgetnumber(L, 3, 1);
+ float y = luax_rawgetnumber(L, 3, 2);
+ float z = luax_rawgetnumber(L, 3, 3);
ref->sendVec3(variable, x, y, z);
return 0;
}
@@ -75,10 +85,15 @@ namespace lua
{
JSLRef ref = checkJSLProgram(L);
const char* variable = luax_checkstring(L, 2);
- float x = luax_checknumber(L, 3);
- float y = luax_checknumber(L, 4);
- float z = luax_checknumber(L, 5);
- float w = luax_checknumber(L, 6);
+ if (!luax_istable(L, 3))
+ {
+ luax_typerror(L, 3, "table");
+ return 1;
+ }
+ float x = luax_rawgetnumber(L, 3, 1);
+ float y = luax_rawgetnumber(L, 3, 2);
+ float z = luax_rawgetnumber(L, 3, 3);
+ float w = luax_rawgetnumber(L, 3, 4);
ref->sendVec4(variable, x, y, z, w);
return 0;
}