aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/modules/graphics')
-rw-r--r--src/lua/modules/graphics/je_lua_bitmap.cpp2
-rw-r--r--src/lua/modules/graphics/je_lua_graphics.cpp30
-rw-r--r--src/lua/modules/graphics/je_lua_spritesheet.cpp4
-rw-r--r--src/lua/modules/graphics/je_lua_texture_font.cpp2
-rw-r--r--src/lua/modules/graphics/je_lua_ttf.cpp2
-rw-r--r--src/lua/modules/graphics/je_lua_ttf_data.cpp2
6 files changed, 21 insertions, 21 deletions
diff --git a/src/lua/modules/graphics/je_lua_bitmap.cpp b/src/lua/modules/graphics/je_lua_bitmap.cpp
index 2495fb3..056ed70 100644
--- a/src/lua/modules/graphics/je_lua_bitmap.cpp
+++ b/src/lua/modules/graphics/je_lua_bitmap.cpp
@@ -90,7 +90,7 @@ namespace JinEngine
SharedBitmap shared = checkBitmap(L);
Bitmap* bitmap = shared.getObject();
Bitmap* b = Bitmap::clone(bitmap);
- Proxy* proxy = luax_newinstance(L, Jin_Lua_Bitmap, new Shared<Bitmap>(b, Jin_Lua_Bitmap));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Bitmap, new Shared<Bitmap>(L, b, Jin_Lua_Bitmap));
return 1;
}
diff --git a/src/lua/modules/graphics/je_lua_graphics.cpp b/src/lua/modules/graphics/je_lua_graphics.cpp
index 82793be..36829ab 100644
--- a/src/lua/modules/graphics/je_lua_graphics.cpp
+++ b/src/lua/modules/graphics/je_lua_graphics.cpp
@@ -207,7 +207,7 @@ namespace JinEngine
return 1;
}
}
- Proxy* proxy = luax_newinstance(L, Jin_Lua_Bitmap, new Shared<Bitmap>(bitmap, Jin_Lua_Bitmap));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Bitmap, new Shared<Bitmap>(L, bitmap, Jin_Lua_Bitmap));
return 1;
}
@@ -227,7 +227,7 @@ namespace JinEngine
const char* path = luax_checkstring(L, 1);
texture = Texture::createTexture(path);
}
- Proxy* proxy = luax_newinstance(L, Jin_Lua_Texture, new Shared<Texture>(texture, Jin_Lua_Texture));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Texture, new Shared<Texture>(L, texture, Jin_Lua_Texture));
return 1;
}
@@ -241,7 +241,7 @@ namespace JinEngine
luax_pushnil(L);
return 1;
}
- Proxy* proxy = luax_newinstance(L, Jin_Lua_Shader, new Shared<Shader>(jsl, Jin_Lua_Shader));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Shader, new Shared<Shader>(L, jsl, Jin_Lua_Shader));
return 1;
}
@@ -264,7 +264,7 @@ namespace JinEngine
luax_pushnil(L);
return 1;
}
- Proxy* proxy = luax_newinstance(L, Jin_Lua_Shader, new Shared<Shader>(jsl, Jin_Lua_Shader));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Shader, new Shared<Shader>(L, jsl, Jin_Lua_Shader));
return 1;
}
@@ -273,7 +273,7 @@ namespace JinEngine
int w = luax_checknumber(L, 1);
int h = luax_checknumber(L, 2);
Canvas* cvs = Canvas::createCanvas(w, h);
- Proxy* proxy = luax_newinstance(L, Jin_Lua_Canvas, new Shared<Canvas>(cvs, Jin_Lua_Canvas));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Canvas, new Shared<Canvas>(L, cvs, Jin_Lua_Canvas));
return 1;
}
@@ -684,7 +684,7 @@ namespace JinEngine
fs->read(path, b);
fd = TTFData::createTTFData(&b, b.size());
}
- Proxy* proxy = luax_newinstance(L, Jin_Lua_TTFData, new Shared<TTFData>(fd, Jin_Lua_TTFData));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_TTFData, new Shared<TTFData>(L, fd, Jin_Lua_TTFData));
return 1;
}
@@ -707,7 +707,7 @@ namespace JinEngine
unsigned length;
const char* data = luax_checklstring(L, 1, &length);
Text* text = new Text(encode, data, length);
- Proxy* proxy = luax_newinstance(L, Jin_Lua_Text, new Shared<Text>(text, Jin_Lua_Text));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Text, new Shared<Text>(L, text, Jin_Lua_Text));
return 1;
}
@@ -735,7 +735,7 @@ namespace JinEngine
quad.h = luax_rawgetnumberthenpop(L, 2, 4);
int o = luax_checkinteger(L, 3);
Origin origin = static_cast<Origin>(o);
- Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(new Sprite(graphic, quad, origin), Jin_Lua_Sprite));
+ Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, quad, origin), Jin_Lua_Sprite));
}
else if (n == 4)
{
@@ -746,19 +746,19 @@ namespace JinEngine
quad.h = luax_rawgetnumberthenpop(L, 2, 4);
int ox = luax_checkinteger(L, 3);
int oy = luax_checkinteger(L, 4);
- Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(new Sprite(graphic, quad, ox, oy), Jin_Lua_Sprite));
+ Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, quad, ox, oy), Jin_Lua_Sprite));
}
else if (n == 2)
{
int o = luax_checkinteger(L, 2);
Origin origin = static_cast<Origin>(o);
- Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(new Sprite(graphic, origin), Jin_Lua_Sprite));
+ Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, origin), Jin_Lua_Sprite));
}
else if (n == 3)
{
int ox = luax_checkinteger(L, 2);
int oy = luax_checkinteger(L, 3);
- Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(new Sprite(graphic, ox, oy), Jin_Lua_Sprite));
+ Proxy* p = luax_newinstance(L, Jin_Lua_Sprite, new Shared<Sprite>(L, new Sprite(graphic, ox, oy), Jin_Lua_Sprite));
}
else
{
@@ -780,7 +780,7 @@ namespace JinEngine
if (pxyGraphic != nullptr)
{
Graphic* graphic = pxyGraphic->getObject<Graphic>();
- Shared<SpriteSheet>* shrSSheet = new Shared<SpriteSheet>(new SpriteSheet(graphic), Jin_Lua_SpriteSheet);
+ Shared<SpriteSheet>* shrSSheet = new Shared<SpriteSheet>(L, new SpriteSheet(graphic), Jin_Lua_SpriteSheet);
Shared<Graphic>& shrGraphic = pxyGraphic->getShared<Graphic>();
shrSSheet->setDependency((int)SpriteSheetDependency::DEP_GRAPHIC, &shrGraphic);
Proxy* pxySSheet = luax_newinstance(L, Jin_Lua_SpriteSheet, shrSSheet);
@@ -794,7 +794,7 @@ namespace JinEngine
LUA_IMPLEMENT int l_newAnimation(lua_State* L)
{
int argc = luax_gettop(L);
- Shared<Animation>* shrAnimation = new Shared<Animation>(new Animation(), Jin_Lua_Animation);
+ Shared<Animation>* shrAnimation = new Shared<Animation>(L, new Animation(), Jin_Lua_Animation);
if (argc >= 3)
{
if (!luax_istable(L, 1))
@@ -825,7 +825,7 @@ namespace JinEngine
LUA_IMPLEMENT int l_newAnimator(lua_State* L)
{
int argc = luax_gettop(L);
- Shared<Animator>* shrAniamtor = new Shared<Animator>(new Animator(), Jin_Lua_Animator);
+ Shared<Animator>* shrAniamtor = new Shared<Animator>(L, new Animator(), Jin_Lua_Animator);
if (argc >= 1)
{
Proxy* pxyAnimation = (Proxy*)luax_checktype(L, 1, Jin_Lua_Animation);
@@ -884,7 +884,7 @@ namespace JinEngine
// Delete temporary text.
delete text;
}
- Proxy* proxy = luax_newinstance(L, Jin_Lua_TextureFont, new Shared<TextureFont>(textureFont, Jin_Lua_TextureFont));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_TextureFont, new Shared<TextureFont>(L, textureFont, Jin_Lua_TextureFont));
return 1;
}
diff --git a/src/lua/modules/graphics/je_lua_spritesheet.cpp b/src/lua/modules/graphics/je_lua_spritesheet.cpp
index 362a78d..3f22319 100644
--- a/src/lua/modules/graphics/je_lua_spritesheet.cpp
+++ b/src/lua/modules/graphics/je_lua_spritesheet.cpp
@@ -48,7 +48,7 @@ namespace JinEngine
origin = static_cast<Origin>(o);
spr = sheet->createSprite(quad, origin);
}
- Shared<Sprite>* shrSprite = new Shared<Sprite>(spr, Jin_Lua_Sprite);
+ Shared<Sprite>* shrSprite = new Shared<Sprite>(L, spr, Jin_Lua_Sprite);
shrSprite->setDependency((int)SpriteDependency::DEP_SPRITESHEET, &shrSSheet);
Proxy* pxySprite = luax_newinstance(L, Jin_Lua_Sprite, shrSprite);
return 1;
@@ -97,7 +97,7 @@ namespace JinEngine
for (int i = 0; i < sprs.size(); ++i)
{
Sprite* spr = sprs[i];
- Shared<Sprite>* shrSpr = new Shared<Sprite>(spr, Jin_Lua_Sprite);
+ Shared<Sprite>* shrSpr = new Shared<Sprite>(L, spr, Jin_Lua_Sprite);
shrSpr->setDependency((int)SpriteDependency::DEP_GRAPHIC, shrGraphic);
Proxy* pxys = (Proxy*)luax_newinstance(L, Jin_Lua_Sprite, shrSpr);
luax_rawseti(L, -2, i + 1);
diff --git a/src/lua/modules/graphics/je_lua_texture_font.cpp b/src/lua/modules/graphics/je_lua_texture_font.cpp
index 6c62ee2..58677eb 100644
--- a/src/lua/modules/graphics/je_lua_texture_font.cpp
+++ b/src/lua/modules/graphics/je_lua_texture_font.cpp
@@ -44,7 +44,7 @@ namespace JinEngine
Text* text = p2->getObject<Text>();
page = tf->typeset(*text, lineheight, spacing);
}
- Shared<Page>* shrPage = new Shared<Page>(page, Jin_Lua_Page);
+ Shared<Page>* shrPage = new Shared<Page>(L, page, Jin_Lua_Page);
shrPage->setDependency((int)PageDependency::DEP_TEXTURE_FONT, &shrTexFont);
Proxy* pxyPage = luax_newinstance(L, Jin_Lua_Page, shrPage);
return 1;
diff --git a/src/lua/modules/graphics/je_lua_ttf.cpp b/src/lua/modules/graphics/je_lua_ttf.cpp
index fb4b0df..c3d9aae 100644
--- a/src/lua/modules/graphics/je_lua_ttf.cpp
+++ b/src/lua/modules/graphics/je_lua_ttf.cpp
@@ -44,7 +44,7 @@ namespace JinEngine
Text* text = pxyText->getObject<Text>();
page = ttf->typeset(*text, lineheight, spacing);
}
- Shared<Page>* refPage = new Shared<Page>(page, Jin_Lua_Page);
+ Shared<Page>* refPage = new Shared<Page>(L, page, Jin_Lua_Page);
refPage->setDependency((int)PageDependency::DEP_TTF, &shrTTF);
Proxy* pxyPage = luax_newinstance(L, Jin_Lua_Page, refPage);
return 1;
diff --git a/src/lua/modules/graphics/je_lua_ttf_data.cpp b/src/lua/modules/graphics/je_lua_ttf_data.cpp
index 8042d69..7fcadcd 100644
--- a/src/lua/modules/graphics/je_lua_ttf_data.cpp
+++ b/src/lua/modules/graphics/je_lua_ttf_data.cpp
@@ -22,7 +22,7 @@ namespace JinEngine
Shared<TTFData>& shrFontData = pxyTTFData->getShared<TTFData>();
TTFData* fontData = shrFontData.getObject();
TTF* font = fontData->createTTF(fontsize);
- Shared<TTF>* shrTTF = new Shared<TTF>(font, Jin_Lua_TTF);
+ Shared<TTF>* shrTTF = new Shared<TTF>(L, font, Jin_Lua_TTF);
shrTTF->setDependency((int)TTFDependency::DEP_TTFDATA, &shrFontData);
Proxy* pxyTTF = luax_newinstance(L, Jin_Lua_TTF, shrTTF);
return 1;