aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-09-07 21:20:15 +0800
committerchai <chaifix@163.com>2018-09-07 21:20:15 +0800
commit36f7e3e5542f3cfee11b34ce497fcb877b3462bf (patch)
tree596d9fd6a12058b9c2781f529551b0ebefa72f75
parente72188433348c270a54879da9f086f1b527b580f (diff)
*update
-rw-r--r--bin/Jin.exebin1414144 -> 1416192 bytes
-rw-r--r--bin/jin.exebin1414144 -> 1416192 bytes
-rw-r--r--bin/main.lua10
-rw-r--r--src/libjin/Graphics/Bitmap.cpp6
-rw-r--r--src/lua/modules/net/net.cpp1
5 files changed, 9 insertions, 8 deletions
diff --git a/bin/Jin.exe b/bin/Jin.exe
index 635f03a..9651439 100644
--- a/bin/Jin.exe
+++ b/bin/Jin.exe
Binary files differ
diff --git a/bin/jin.exe b/bin/jin.exe
index 635f03a..9651439 100644
--- a/bin/jin.exe
+++ b/bin/jin.exe
Binary files differ
diff --git a/bin/main.lua b/bin/main.lua
index 4e57500..2ff6563 100644
--- a/bin/main.lua
+++ b/bin/main.lua
@@ -40,12 +40,12 @@ local dt = 0
function jin.core.onDraw()
dt = dt + 0.1
jin.graphics.bindCanvas(canvas)
- -- jin.graphics.useShader(shader)
- -- shader:sendNumber("iGlobalTime", dt )
- -- shader:sendVec3("iResolution", sw, sh, 1)
- -- shader:sendVec4("iMouse", mx, my, mx, my)
+ jin.graphics.useShader(shader)
+ shader:sendNumber("iGlobalTime", dt )
+ shader:sendVec3("iResolution", sw, sh, 1)
+ shader:sendVec4("iMouse", mx, my, mx, my)
jin.graphics.draw(img, 0, 0, 1, 1)
- -- jin.graphics.unuseShader()
+ jin.graphics.unuseShader()
jin.graphics.unbindCanvas()
jin.graphics.draw(canvas, 0, 0, 1, 1)
end \ No newline at end of file
diff --git a/src/libjin/Graphics/Bitmap.cpp b/src/libjin/Graphics/Bitmap.cpp
index c2acff4..28b59af 100644
--- a/src/libjin/Graphics/Bitmap.cpp
+++ b/src/libjin/Graphics/Bitmap.cpp
@@ -52,7 +52,7 @@ namespace graphics
{
width = w;
height = h;
- pixels = (Color*)calloc(1, w*h*sizeof(Color));
+ pixels = new Color[w*h];
}
Bitmap::~Bitmap()
@@ -73,8 +73,8 @@ namespace graphics
{
if (pixels != nullptr)
delete[] pixels;
+ pixels = new Color[w*h];
size_t s = w * h * sizeof(Color);
- pixels = (Color*)calloc(1, s);
memcpy(pixels, p, s);
width = w;
height = h;
@@ -93,8 +93,8 @@ namespace graphics
{
if (pixels != nullptr)
delete[] pixels;
+ pixels = new Color[w*h];
size_t s = w * h * sizeof(Color);
- pixels = (Color*)calloc(1, s);
width = w;
height = h;
for (int x = 0; x < w; ++x)
diff --git a/src/lua/modules/net/net.cpp b/src/lua/modules/net/net.cpp
index a984920..8fb273c 100644
--- a/src/lua/modules/net/net.cpp
+++ b/src/lua/modules/net/net.cpp
@@ -8,6 +8,7 @@ namespace jin
{
namespace lua
{
+
using namespace jin::lua::net;
using namespace jin::net;