aboutsummaryrefslogtreecommitdiff
path: root/src/lua/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/graphics')
-rw-r--r--src/lua/graphics/luaopen_Canvas.cpp10
-rw-r--r--src/lua/graphics/luaopen_Font.cpp2
-rw-r--r--src/lua/graphics/luaopen_Image.cpp12
-rw-r--r--src/lua/graphics/luaopen_JSL.cpp14
-rw-r--r--src/lua/graphics/luaopen_graphics.cpp8
5 files changed, 23 insertions, 23 deletions
diff --git a/src/lua/graphics/luaopen_Canvas.cpp b/src/lua/graphics/luaopen_Canvas.cpp
index d686a88..ca1270c 100644
--- a/src/lua/graphics/luaopen_Canvas.cpp
+++ b/src/lua/graphics/luaopen_Canvas.cpp
@@ -18,22 +18,22 @@ namespace lua
static int l_getWidth(lua_State* L)
{
Ref<Canvas>& ref = checkCanvas(L);
- luax_pushnumber(L, (*ref).getWidth());
+ luax_pushnumber(L, ref->getWidth());
return 1;
}
static int l_getHeight(lua_State* L)
{
Ref<Canvas>& ref = checkCanvas(L);
- luax_pushnumber(L, (*ref).getHeight());
+ luax_pushnumber(L, ref->getHeight());
return 1;
}
static int l_getSize(lua_State* L)
{
Ref<Canvas>& ref = checkCanvas(L);
- luax_pushnumber(L, (*ref).getWidth());
- luax_pushnumber(L, (*ref).getHeight());
+ luax_pushnumber(L, ref->getWidth());
+ luax_pushnumber(L, ref->getHeight());
return 2;
}
@@ -42,7 +42,7 @@ namespace lua
Ref<Canvas>& ref = checkCanvas(L);
int x = luax_checknumber(L, 1);
int y = luax_checknumber(L, 2);
- (*ref).setAnchor(x, y);
+ ref->setAnchor(x, y);
return 0;
}
diff --git a/src/lua/graphics/luaopen_Font.cpp b/src/lua/graphics/luaopen_Font.cpp
index 341af87..dc891b0 100644
--- a/src/lua/graphics/luaopen_Font.cpp
+++ b/src/lua/graphics/luaopen_Font.cpp
@@ -25,7 +25,7 @@ namespace lua
int spacing = luax_checknumber(L, 4);
int lheight = luax_checknumber(L, 5);
int w, h;
- (*ref).box(text, fheight, lheight, spacing, &w, &h);
+ ref->box(text, fheight, lheight, spacing, &w, &h);
luax_pushnumber(L, w);
luax_pushnumber(L, h);
return 2;
diff --git a/src/lua/graphics/luaopen_Image.cpp b/src/lua/graphics/luaopen_Image.cpp
index b1672d5..47cb4c6 100644
--- a/src/lua/graphics/luaopen_Image.cpp
+++ b/src/lua/graphics/luaopen_Image.cpp
@@ -20,14 +20,14 @@ namespace lua
static int l_getWidth(lua_State* L)
{
Ref<Image>& ref = checkImage(L);
- luax_pushnumber(L, (*ref).getWidth());
+ luax_pushnumber(L, ref->getWidth());
return 1;
}
static int l_getHeight(lua_State *L)
{
Ref<Image>& ref = checkImage(L);
- luax_pushnumber(L, (*ref).getHeight());
+ luax_pushnumber(L, ref->getHeight());
return 1;
}
@@ -36,7 +36,7 @@ namespace lua
Ref<Image>& ref = checkImage(L);
int x = luax_checknumber(L, 2);
int y = luax_checknumber(L, 3);
- color c = (*ref).getPixel(x, y);
+ color c = ref->getPixel(x, y);
luax_pushnumber(L, c.rgba.r);
luax_pushnumber(L, c.rgba.g);
luax_pushnumber(L, c.rgba.b);
@@ -49,15 +49,15 @@ namespace lua
Ref<Image>& ref = checkImage(L);
int x = luax_checknumber(L, 2);
int y = luax_checknumber(L, 3);
- (*ref).setAnchor(x, y);
+ ref->setAnchor(x, y);
return 0;
}
static int l_getSize(lua_State* L)
{
Ref<Image>& ref = checkImage(L);
- luax_pushnumber(L, (*ref).getWidth());
- luax_pushnumber(L, (*ref).getHeight());
+ luax_pushnumber(L, ref->getWidth());
+ luax_pushnumber(L, ref->getHeight());
return 2;
}
diff --git a/src/lua/graphics/luaopen_JSL.cpp b/src/lua/graphics/luaopen_JSL.cpp
index e644c35..30b109a 100644
--- a/src/lua/graphics/luaopen_JSL.cpp
+++ b/src/lua/graphics/luaopen_JSL.cpp
@@ -61,28 +61,28 @@ namespace lua
case NUMBER:
{
float number = luax_checknumber(L, 4);
- (*ref).sendFloat(variable, number);
+ ref->sendFloat(variable, number);
break;
}
case IMAGE:
{
Proxy* proxy = (Proxy*)luax_checktype(L, 4, JIN_GRAPHICS_IMAGE);
Ref<Image>& tex = proxy->getRef<Image>();
- (*ref).sendTexture(variable, &(*tex));
+ ref->sendTexture(variable, tex.getObject());
break;
}
case CANVAS:
{
Proxy* proxy = (Proxy*)luax_checktype(L, 4, JIN_GRAPHICS_CANVAS);
Ref<Canvas>& canvas = proxy->getRef<Canvas>();
- (*ref).sendCanvas(variable, &(*canvas));
+ ref->sendCanvas(variable, canvas.getObject());
break;
}
case VEC2:
{
float x = luax_checknumber(L, 4);
float y = luax_checknumber(L, 5);
- (*ref).sendVec2(variable, x, y);
+ ref->sendVec2(variable, x, y);
break;
}
case VEC3:
@@ -90,7 +90,7 @@ namespace lua
float x = luax_checknumber(L, 4);
float y = luax_checknumber(L, 5);
float z = luax_checknumber(L, 6);
- (*ref).sendVec3(variable, x, y, z);
+ ref->sendVec3(variable, x, y, z);
break;
}
case VEC4:
@@ -99,7 +99,7 @@ namespace lua
float y = luax_checknumber(L, 5);
float z = luax_checknumber(L, 6);
float w = luax_checknumber(L, 7);
- (*ref).sendVec4(variable, x, y, z, w);
+ ref->sendVec4(variable, x, y, z, w);
break;
}
case COLOR:
@@ -109,7 +109,7 @@ namespace lua
col.rgba.g = luax_checkinteger(L, 5);
col.rgba.b = luax_checkinteger(L, 6);
col.rgba.a = luax_checkinteger(L, 7);
- (*ref).sendColor(variable, &col);
+ ref->sendColor(variable, &col);
break;
}
default:
diff --git a/src/lua/graphics/luaopen_graphics.cpp b/src/lua/graphics/luaopen_graphics.cpp
index dc8c9a1..14449a4 100644
--- a/src/lua/graphics/luaopen_graphics.cpp
+++ b/src/lua/graphics/luaopen_graphics.cpp
@@ -152,13 +152,13 @@ namespace lua
if (luax_istype(L, 1, JIN_GRAPHICS_IMAGE))
{
Proxy* proxy = (Proxy*)luax_toudata(L, 1);
- Image* tex = &*proxy->getRef<Image>();
+ Ref<Image>& tex = proxy->getRef<Image>();
tex->draw(x, y, sx, sy, r);
}
else if (luax_istype(L, 1, JIN_GRAPHICS_CANVAS))
{
Proxy* proxy = (Proxy*)luax_toudata(L, 1);
- Canvas* p = &*proxy->getRef<Canvas>();
+ Ref<Canvas>& p = proxy->getRef<Canvas>();
p->draw(x, y, sx, sy, r);
}
else
@@ -210,7 +210,7 @@ namespace lua
}
Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_CANVAS);
Ref<Canvas>& ref = proxy->getRef<Canvas>();
- (*ref).bind();
+ ref->bind();
return 0;
}
@@ -230,7 +230,7 @@ namespace lua
if (luax_istype(L, 1, JIN_GRAPHICS_SHADER))
{
Proxy* proxy = (Proxy*)luax_toudata(L, 1);
- JSLProgram* jsl = &*proxy->getRef<JSLProgram>();
+ Ref<JSLProgram>& jsl = proxy->getRef<JSLProgram>();
jsl->use();
}
else