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.cpp15
-rw-r--r--src/lua/modules/graphics/je_lua_bitmap.h14
-rw-r--r--src/lua/modules/graphics/je_lua_canvas.cpp11
-rw-r--r--src/lua/modules/graphics/je_lua_canvas.h14
-rw-r--r--src/lua/modules/graphics/je_lua_graphics.cpp109
-rw-r--r--src/lua/modules/graphics/je_lua_graphics.h0
-rw-r--r--src/lua/modules/graphics/je_lua_page.cpp10
-rw-r--r--src/lua/modules/graphics/je_lua_page.h2
-rw-r--r--src/lua/modules/graphics/je_lua_particle_system.h0
-rw-r--r--src/lua/modules/graphics/je_lua_shader.cpp18
-rw-r--r--src/lua/modules/graphics/je_lua_shader.h14
-rw-r--r--src/lua/modules/graphics/je_lua_sprite.cpp23
-rw-r--r--src/lua/modules/graphics/je_lua_sprite.h2
-rw-r--r--src/lua/modules/graphics/je_lua_spritesheet.cpp14
-rw-r--r--src/lua/modules/graphics/je_lua_spritesheet.h2
-rw-r--r--src/lua/modules/graphics/je_lua_text.cpp8
-rw-r--r--src/lua/modules/graphics/je_lua_text.h14
-rw-r--r--src/lua/modules/graphics/je_lua_texture.cpp10
-rw-r--r--src/lua/modules/graphics/je_lua_texture.h14
-rw-r--r--src/lua/modules/graphics/je_lua_texture_font.cpp20
-rw-r--r--src/lua/modules/graphics/je_lua_texture_font.h14
-rw-r--r--src/lua/modules/graphics/je_lua_ttf.cpp20
-rw-r--r--src/lua/modules/graphics/je_lua_ttf.h14
-rw-r--r--src/lua/modules/graphics/je_lua_ttf_data.cpp22
-rw-r--r--src/lua/modules/graphics/je_lua_ttf_data.h19
25 files changed, 285 insertions, 118 deletions
diff --git a/src/lua/modules/graphics/je_lua_bitmap.cpp b/src/lua/modules/graphics/je_lua_bitmap.cpp
index 1491bee..4b7c492 100644
--- a/src/lua/modules/graphics/je_lua_bitmap.cpp
+++ b/src/lua/modules/graphics/je_lua_bitmap.cpp
@@ -1,7 +1,8 @@
#include "lua/common/je_lua_common.h"
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "libjin/jin.h"
+#include "je_lua_bitmap.h"
using namespace JinEngine::Graphics;
@@ -10,11 +11,13 @@ namespace JinEngine
namespace Lua
{
+ const char* Jin_Lua_Bitmap = "Bitmap";
+
typedef Shared<Bitmap>& SharedBitmap;
LUA_IMPLEMENT inline SharedBitmap checkBitmap(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_BITMAP);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Bitmap);
return proxy->getShared<Bitmap>();
}
@@ -87,8 +90,8 @@ namespace JinEngine
SharedBitmap shared = checkBitmap(L);
Bitmap* bitmap = shared.getObject();
Bitmap* b = Bitmap::clone(bitmap);
- Proxy* proxy = luax_newinstance(L, JIN_GRAPHICS_BITMAP);
- proxy->bind(new Shared<Bitmap>(b, JIN_GRAPHICS_BITMAP));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Bitmap);
+ proxy->bind(new Shared<Bitmap>(b, Jin_Lua_Bitmap));
return 1;
}
@@ -104,9 +107,9 @@ namespace JinEngine
{ "clone", l_clone },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_BITMAP, f);
+ luax_newtype(L, Jin_Lua_Bitmap, f);
return 0;
}
- } // graphics
+ } // namespace Graphics
} // namespace JinEngine \ No newline at end of file
diff --git a/src/lua/modules/graphics/je_lua_bitmap.h b/src/lua/modules/graphics/je_lua_bitmap.h
new file mode 100644
index 0000000..047766e
--- /dev/null
+++ b/src/lua/modules/graphics/je_lua_bitmap.h
@@ -0,0 +1,14 @@
+#ifndef __JE_LUA_BITMAP_H__
+#define __JE_LUA_BITMAP_H__
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ extern const char* Jin_Lua_Bitmap;
+
+ }
+}
+
+#endif \ No newline at end of file
diff --git a/src/lua/modules/graphics/je_lua_canvas.cpp b/src/lua/modules/graphics/je_lua_canvas.cpp
index 70edfd1..be6bb84 100644
--- a/src/lua/modules/graphics/je_lua_canvas.cpp
+++ b/src/lua/modules/graphics/je_lua_canvas.cpp
@@ -1,7 +1,8 @@
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
#include "libjin/jin.h"
+#include "je_lua_canvas.h"
using namespace JinEngine::Graphics;
@@ -10,11 +11,13 @@ namespace JinEngine
namespace Lua
{
+ const char* Jin_Lua_Canvas = "Canvas";
+
typedef Shared<Canvas>& SharedCanvas;
LUA_IMPLEMENT inline SharedCanvas checkCanvas(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_CANVAS);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Canvas);
return proxy->getShared<Canvas>();
}
@@ -42,7 +45,7 @@ namespace JinEngine
LUA_IMPLEMENT int l_gc(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_CANVAS);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Canvas);
proxy->release();
return 0;
}
@@ -56,7 +59,7 @@ namespace JinEngine
{ "getSize", l_getSize },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_CANVAS, f);
+ luax_newtype(L, Jin_Lua_Canvas, f);
return 0;
}
diff --git a/src/lua/modules/graphics/je_lua_canvas.h b/src/lua/modules/graphics/je_lua_canvas.h
new file mode 100644
index 0000000..c7b8504
--- /dev/null
+++ b/src/lua/modules/graphics/je_lua_canvas.h
@@ -0,0 +1,14 @@
+#ifndef __JE_LUA_CANVAS_H__
+#define __JE_LUA_CANVAS_H__
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ extern const char* Jin_Lua_Canvas;
+
+ }
+}
+
+#endif \ No newline at end of file
diff --git a/src/lua/modules/graphics/je_lua_graphics.cpp b/src/lua/modules/graphics/je_lua_graphics.cpp
index 6b84651..c535216 100644
--- a/src/lua/modules/graphics/je_lua_graphics.cpp
+++ b/src/lua/modules/graphics/je_lua_graphics.cpp
@@ -3,9 +3,20 @@
#include "libjin/jin.h"
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
+
+#include "je_lua_canvas.h"
+#include "je_lua_sprite.h"
#include "je_lua_spritesheet.h"
+#include "je_lua_bitmap.h"
+#include "je_lua_ttf.h"
+#include "je_lua_ttf_data.h"
+#include "je_lua_texture.h"
+#include "je_lua_shader.h"
+#include "je_lua_text.h"
+#include "je_lua_texture_font.h"
+#include "je_lua_page.h"
using namespace std;
using namespace JinEngine;
@@ -165,8 +176,8 @@ namespace JinEngine
return 1;
}
}
- Proxy* proxy = luax_newinstance(L, JIN_GRAPHICS_BITMAP);
- proxy->bind(new Shared<Bitmap>(bitmap, JIN_GRAPHICS_BITMAP));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Bitmap);
+ proxy->bind(new Shared<Bitmap>(bitmap, Jin_Lua_Bitmap));
return 1;
}
@@ -174,9 +185,9 @@ namespace JinEngine
LUA_IMPLEMENT int l_newTexture(lua_State* L)
{
Texture* texture = nullptr;
- if (luax_istype(L, 1, JIN_GRAPHICS_BITMAP))
+ if (luax_istype(L, 1, Jin_Lua_Bitmap))
{
- Proxy* p = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_BITMAP);
+ Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Bitmap);
Shared<Bitmap>& refBitmap = p->getShared<Bitmap>();
Bitmap* bitmap = refBitmap.getObject();
texture = Texture::createTexture(bitmap);
@@ -186,8 +197,8 @@ namespace JinEngine
const char* path = luax_checkstring(L, 1);
texture = Texture::createTexture(path);
}
- Proxy* proxy = luax_newinstance(L, JIN_GRAPHICS_TEXTURE);
- proxy->bind(new Shared<Texture>(texture, JIN_GRAPHICS_TEXTURE));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Texture);
+ proxy->bind(new Shared<Texture>(texture, Jin_Lua_Texture));
return 1;
}
@@ -201,8 +212,8 @@ namespace JinEngine
luax_pushnil(L);
return 1;
}
- Proxy* proxy = luax_newinstance(L, JIN_GRAPHICS_SHADER);
- proxy->bind(new Shared<Shader>(jsl, JIN_GRAPHICS_SHADER));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Shader);
+ proxy->bind(new Shared<Shader>(jsl, Jin_Lua_Shader));
return 1;
}
@@ -225,8 +236,8 @@ namespace JinEngine
luax_pushnil(L);
return 1;
}
- Proxy* proxy = luax_newinstance(L, JIN_GRAPHICS_SHADER);
- proxy->bind(new Shared<Shader>(jsl, JIN_GRAPHICS_SHADER));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Shader);
+ proxy->bind(new Shared<Shader>(jsl, Jin_Lua_Shader));
return 1;
}
@@ -234,9 +245,9 @@ namespace JinEngine
{
int w = luax_checknumber(L, 1);
int h = luax_checknumber(L, 2);
- Proxy* proxy = luax_newinstance(L, JIN_GRAPHICS_CANVAS);
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Canvas);
Canvas* cvs = Canvas::createCanvas(w, h);
- proxy->bind(new Shared<Canvas>(cvs, JIN_GRAPHICS_CANVAS));
+ proxy->bind(new Shared<Canvas>(cvs, Jin_Lua_Canvas));
return 1;
}
@@ -274,7 +285,7 @@ namespace JinEngine
LUA_IMPLEMENT void l_draw_texture(lua_State* L)
{
- if (!luax_istype(L, 1, JIN_GRAPHICS_TEXTURE))
+ if (!luax_istype(L, 1, Jin_Lua_Texture))
return;
int x = luax_optnumber(L, 2, 0);
int y = luax_optnumber(L, 3, 0);
@@ -290,7 +301,7 @@ namespace JinEngine
LUA_IMPLEMENT void l_draw_canvas(lua_State* L)
{
- if (!luax_istype(L, 1, JIN_GRAPHICS_CANVAS))
+ if (!luax_istype(L, 1, Jin_Lua_Canvas))
return;
int x = luax_optnumber(L, 2, 0);
int y = luax_optnumber(L, 3, 0);
@@ -307,7 +318,7 @@ namespace JinEngine
/* jin.graphics.draw(text, font, x, y) */
LUA_IMPLEMENT void l_draw_text(lua_State* L)
{
- if (!luax_istype(L, 1, JIN_GRAPHICS_TEXT))
+ if (!luax_istype(L, 1, Jin_Lua_Text))
return;
Proxy* p = (Proxy*)luax_toudata(L, 1);
Text* text = p->getObject<Text>();
@@ -316,12 +327,12 @@ namespace JinEngine
int spacing = luax_optnumber(L, 6, 0);
Font* font = nullptr;
Proxy* p2 = (Proxy*)luax_toudata(L, 2);
- if (luax_istype(L, 2, JIN_GRAPHICS_TEXTUREFONT))
+ if (luax_istype(L, 2, Jin_Lua_TextureFont))
{
TextureFont* tf = p2->getObject<TextureFont>();
font = tf;
}
- else if (luax_istype(L, 2, JIN_GRAPHICS_TTF))
+ else if (luax_istype(L, 2, Jin_Lua_TTF))
{
TTF* ttf = p2->getObject<TTF>();
font = ttf;
@@ -337,7 +348,7 @@ namespace JinEngine
/* jin.graphics.draw(page, x, y) */
LUA_IMPLEMENT void l_draw_page(lua_State* L)
{
- if (!luax_istype(L, 1, JIN_GRAPHICS_PAGE))
+ if (!luax_istype(L, 1, Jin_Lua_Page))
return;
int x = luax_optnumber(L, 2, 0);
int y = luax_optnumber(L, 3, 0);
@@ -349,13 +360,13 @@ namespace JinEngine
LUA_IMPLEMENT int l_draw(lua_State* L)
{
- if (luax_istype(L, 1, JIN_GRAPHICS_TEXTURE))
+ if (luax_istype(L, 1, Jin_Lua_Texture))
l_draw_texture(L);
- else if (luax_istype(L, 1, JIN_GRAPHICS_CANVAS))
+ else if (luax_istype(L, 1, Jin_Lua_Canvas))
l_draw_canvas(L);
- else if (luax_istype(L, 1, JIN_GRAPHICS_TEXT))
+ else if (luax_istype(L, 1, Jin_Lua_Text))
l_draw_text(L);
- else if (luax_istype(L, 1, JIN_GRAPHICS_PAGE))
+ else if (luax_istype(L, 1, Jin_Lua_Page))
l_draw_page(L);
else
{
@@ -387,13 +398,13 @@ namespace JinEngine
float ox = luax_optnumber(L, 8, 0);
float oy = luax_optnumber(L, 9, 0);
- if (luax_istype(L, 1, JIN_GRAPHICS_TEXTURE))
+ if (luax_istype(L, 1, Jin_Lua_Texture))
{
Proxy* proxy = (Proxy*)luax_toudata(L, 1);
Shared<Texture>& tex = proxy->getShared<Texture>();
tex->render(q, x, y, sx, sy, r, ox, oy);
}
- else if (luax_istype(L, 1, JIN_GRAPHICS_CANVAS))
+ else if (luax_istype(L, 1, Jin_Lua_Canvas))
{
Proxy* proxy = (Proxy*)luax_toudata(L, 1);
Shared<Canvas>& p = proxy->getShared<Canvas>();
@@ -459,7 +470,7 @@ namespace JinEngine
Canvas::unbind();
return 0;
}
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_CANVAS);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Canvas);
Shared<Canvas>& shared = proxy->getShared<Canvas>();
Canvas::bind(shared.getObject());
return 0;
@@ -478,9 +489,9 @@ namespace JinEngine
Shader::unuse();
return 0;
}
- if (luax_istype(L, 1, JIN_GRAPHICS_SHADER))
+ if (luax_istype(L, 1, Jin_Lua_Shader))
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_SHADER);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Shader);
Shared<Shader>& jsl = proxy->getShared<Shader>();
jsl->use();
}
@@ -617,7 +628,7 @@ namespace JinEngine
LUA_IMPLEMENT int l_newTTFData(lua_State* L)
{
- Proxy* proxy = luax_newinstance(L, JIN_GRAPHICS_TTFDATA);
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_TTFData);
TTFData* fd = nullptr;
{
const char* path = luax_checkstring(L, 1);
@@ -632,7 +643,7 @@ namespace JinEngine
fs->read(path, b);
fd = TTFData::createTTFData(&b, b.size());
}
- proxy->bind(new Shared<TTFData>(fd, JIN_GRAPHICS_TTFDATA));
+ proxy->bind(new Shared<TTFData>(fd, Jin_Lua_TTFData));
return 1;
}
@@ -655,30 +666,30 @@ 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_GRAPHICS_TEXT);
- proxy->bind(new Shared<Text>(text, JIN_GRAPHICS_TEXT));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_Text);
+ proxy->bind(new Shared<Text>(text, Jin_Lua_Text));
return 1;
}
LUA_IMPLEMENT int l_newSprite(lua_State* L)
{
- Proxy* p = luax_newinstance(L, JIN_GRAPHICS_SPRITE);
- p->bind(new Shared<Sprite>(new Sprite(), JIN_GRAPHICS_SPRITE));
+ Proxy* p = luax_newinstance(L, Jin_Lua_Sprite);
+ p->bind(new Shared<Sprite>(new Sprite(), Jin_Lua_Sprite));
return 1;
}
LUA_IMPLEMENT int l_newSpriteSheet(lua_State* L)
{
Proxy* pxyGraphic = nullptr;
- if (luax_istype(L, 1, JIN_GRAPHICS_TEXTURE))
- pxyGraphic = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TEXTURE);
- else if(luax_istype(L, 1, JIN_GRAPHICS_CANVAS))
- pxyGraphic = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_CANVAS);
+ if (luax_istype(L, 1, Jin_Lua_Texture))
+ pxyGraphic = (Proxy*)luax_checktype(L, 1, Jin_Lua_Texture);
+ else if(luax_istype(L, 1, Jin_Lua_Canvas))
+ pxyGraphic = (Proxy*)luax_checktype(L, 1, Jin_Lua_Canvas);
if (pxyGraphic != nullptr)
{
- Proxy* pxySSheet = luax_newinstance(L, JIN_GRAPHICS_SPRITESHEET);
+ Proxy* pxySSheet = luax_newinstance(L, Jin_Lua_SpriteSheet);
Graphic* graphic = pxyGraphic->getObject<Graphic>();
- Shared<SpriteSheet>* shrSSheet = new Shared<SpriteSheet>(new SpriteSheet(graphic), JIN_GRAPHICS_SPRITESHEET);
+ Shared<SpriteSheet>* shrSSheet = new Shared<SpriteSheet>(new SpriteSheet(graphic), Jin_Lua_SpriteSheet);
Shared<Graphic>& shrGraphic = pxyGraphic->getShared<Graphic>();
shrSSheet->setDependency((int)SpriteSheetDependency::DEP_GRAPHIC, &shrGraphic);
pxySSheet->bind(shrSSheet);
@@ -691,12 +702,12 @@ namespace JinEngine
/* newTextureFont(bitmap, text, color | cellw, cellh) */
LUA_IMPLEMENT int l_newTextureFont(lua_State* L)
{
- Proxy* p = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_BITMAP);
+ Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Bitmap);
Bitmap* bitmap = p->getObject<Bitmap>();
Text* text;
- if (luax_istype(L, 2, JIN_GRAPHICS_TEXT))
+ if (luax_istype(L, 2, Jin_Lua_Text))
{
- Proxy* pt = (Proxy*)luax_checktype(L, 2, JIN_GRAPHICS_TEXT);
+ Proxy* pt = (Proxy*)luax_checktype(L, 2, Jin_Lua_Text);
text = pt->getObject<Text>();
}
else if (luax_isstring(L, 2))
@@ -735,23 +746,23 @@ namespace JinEngine
// Delete temporary text.
delete text;
}
- Proxy* proxy = luax_newinstance(L, JIN_GRAPHICS_TEXTUREFONT);
- proxy->bind(new Shared<TextureFont>(textureFont, JIN_GRAPHICS_TEXTUREFONT));
+ Proxy* proxy = luax_newinstance(L, Jin_Lua_TextureFont);
+ proxy->bind(new Shared<TextureFont>(textureFont, Jin_Lua_TextureFont));
return 1;
}
/* setFont(font) */
LUA_IMPLEMENT int l_setFont(lua_State* L)
{
- if (luax_istype(L, 1, JIN_GRAPHICS_TTF))
+ if (luax_istype(L, 1, Jin_Lua_TTF))
{
- Proxy* p = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TTF);
+ Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_TTF);
TTF* ttf = p->getObject<TTF>();
context.curFont = ttf;
}
- else if (luax_istype(L, 1, JIN_GRAPHICS_TEXTUREFONT))
+ else if (luax_istype(L, 1, Jin_Lua_TextureFont))
{
- Proxy* p = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TEXTUREFONT);
+ Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_TextureFont);
TextureFont* tf = p->getObject<TextureFont>();
context.curFont = tf;
}
diff --git a/src/lua/modules/graphics/je_lua_graphics.h b/src/lua/modules/graphics/je_lua_graphics.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/lua/modules/graphics/je_lua_graphics.h
diff --git a/src/lua/modules/graphics/je_lua_page.cpp b/src/lua/modules/graphics/je_lua_page.cpp
index 3ebd557..526c2ec 100644
--- a/src/lua/modules/graphics/je_lua_page.cpp
+++ b/src/lua/modules/graphics/je_lua_page.cpp
@@ -1,5 +1,5 @@
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
#include "libjin/jin.h"
@@ -14,17 +14,19 @@ namespace JinEngine
namespace Lua
{
+ const char* Jin_Lua_Page = "Page";
+
typedef Shared<Font>& SharedFont;
Page* getPage(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_PAGE);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Page);
return proxy->getObject<Page>();
}
LUA_IMPLEMENT int l_gc(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_PAGE);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Page);
proxy->release();
return 0;
}
@@ -60,7 +62,7 @@ namespace JinEngine
{ "getHeight", l_getHeight },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_PAGE, f);
+ luax_newtype(L, Jin_Lua_Page, f);
return 0;
}
diff --git a/src/lua/modules/graphics/je_lua_page.h b/src/lua/modules/graphics/je_lua_page.h
index c9775e9..6ebf718 100644
--- a/src/lua/modules/graphics/je_lua_page.h
+++ b/src/lua/modules/graphics/je_lua_page.h
@@ -12,6 +12,8 @@ namespace JinEngine
DEP_TEXTURE_FONT = 2,
};
+ extern const char* Jin_Lua_Page;
+
}
}
diff --git a/src/lua/modules/graphics/je_lua_particle_system.h b/src/lua/modules/graphics/je_lua_particle_system.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/lua/modules/graphics/je_lua_particle_system.h
diff --git a/src/lua/modules/graphics/je_lua_shader.cpp b/src/lua/modules/graphics/je_lua_shader.cpp
index 8c1c2e4..61c8eef 100644
--- a/src/lua/modules/graphics/je_lua_shader.cpp
+++ b/src/lua/modules/graphics/je_lua_shader.cpp
@@ -1,8 +1,12 @@
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
#include "libjin/jin.h"
+#include "je_lua_shader.h"
+#include "je_lua_canvas.h"
+#include "je_lua_texture.h"
+
using namespace JinEngine::Graphics;
using namespace JinEngine::Graphics::Shaders;
@@ -11,11 +15,13 @@ namespace JinEngine
namespace Lua
{
+ const char* Jin_Lua_Shader = "Shader";
+
typedef Shared<Shader>& ShaderRef;
static inline ShaderRef checkShader(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_SHADER);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Shader);
return proxy->getShared<Shader>();
}
@@ -35,7 +41,7 @@ namespace JinEngine
{
ShaderRef shared = checkShader(L);
const char* variable = luax_checkstring(L, 2);
- Proxy* proxy = (Proxy*)luax_checktype(L, 3, JIN_GRAPHICS_TEXTURE);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 3, Jin_Lua_Texture);
Shared<Texture>& tex = proxy->getShared<Texture>();
shared->sendTexture(variable, tex.getObject());
return 0;
@@ -45,7 +51,7 @@ namespace JinEngine
{
ShaderRef shared = checkShader(L);
const char* variable = luax_checkstring(L, 2);
- Proxy* proxy = (Proxy*)luax_checktype(L, 3, JIN_GRAPHICS_CANVAS);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 3, Jin_Lua_Canvas);
Shared<Canvas>& canvas = proxy->getShared<Canvas>();
shared->sendCanvas(variable, canvas.getObject());
return 0;
@@ -106,7 +112,7 @@ namespace JinEngine
LUA_IMPLEMENT int l_gc(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_SHADER);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Shader);
proxy->release();
return 0;
}
@@ -124,7 +130,7 @@ namespace JinEngine
{ "sendColor", l_sendColor },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_SHADER, f);
+ luax_newtype(L, Jin_Lua_Shader, f);
return 0;
}
diff --git a/src/lua/modules/graphics/je_lua_shader.h b/src/lua/modules/graphics/je_lua_shader.h
new file mode 100644
index 0000000..57ad570
--- /dev/null
+++ b/src/lua/modules/graphics/je_lua_shader.h
@@ -0,0 +1,14 @@
+#ifndef __JE_LUA_SHDER_H__
+#define __JE_LUA_SHDER_H__
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ extern const char* Jin_Lua_Shader;
+
+ }
+}
+
+#endif \ No newline at end of file
diff --git a/src/lua/modules/graphics/je_lua_sprite.cpp b/src/lua/modules/graphics/je_lua_sprite.cpp
index 511f877..ec5887c 100644
--- a/src/lua/modules/graphics/je_lua_sprite.cpp
+++ b/src/lua/modules/graphics/je_lua_sprite.cpp
@@ -1,8 +1,12 @@
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
#include "libjin/jin.h"
+
#include "je_lua_sprite.h"
+#include "je_lua_canvas.h"
+#include "je_lua_texture.h"
+#include "je_lua_shader.h"
using namespace JinEngine::Graphics;
using namespace JinEngine::Graphics::Shaders;
@@ -11,18 +15,19 @@ namespace JinEngine
{
namespace Lua
{
+ const char* Jin_Lua_Sprite = "Sprite";
typedef Shared<Sprite>& SharedSprite;
LUA_IMPLEMENT inline SharedSprite checkSprite(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_SPRITE);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Sprite);
return proxy->getShared<Sprite>();
}
LUA_IMPLEMENT int l_gc(lua_State* L)
{
- Proxy* p = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_SPRITE);
+ Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Sprite);
p->release();
return 0;
}
@@ -89,7 +94,7 @@ namespace JinEngine
LUA_IMPLEMENT int l_setShader(lua_State* L)
{
SharedSprite sprite = checkSprite(L);
- Proxy* proxy = (Proxy*)luax_checktype(L, 2, JIN_GRAPHICS_SHADER);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 2, Jin_Lua_Shader);
Shader* shader = proxy->getObject<Shader>();
sprite->setShader(shader);
sprite.setDependency((int)SpriteDependency::DEP_SHADER, &proxy->getShared<Shader>());
@@ -101,10 +106,10 @@ namespace JinEngine
SharedSprite sprite = checkSprite(L);
Graphic* graphic = nullptr;
Proxy* p = nullptr;
- if (luax_istype(L, 2, JIN_GRAPHICS_TEXTURE))
- p = (Proxy*)luax_checktype(L, 2, JIN_GRAPHICS_TEXTURE);
- else if (luax_istype(L, 2, JIN_GRAPHICS_CANVAS))
- p = (Proxy*)luax_checktype(L, 2, JIN_GRAPHICS_CANVAS);
+ if (luax_istype(L, 2, Jin_Lua_Texture))
+ p = (Proxy*)luax_checktype(L, 2, Jin_Lua_Texture);
+ else if (luax_istype(L, 2, Jin_Lua_Canvas))
+ p = (Proxy*)luax_checktype(L, 2, Jin_Lua_Canvas);
if (p != nullptr)
{
sprite->setGraphic(p->getObject<Graphic>());
@@ -214,7 +219,7 @@ namespace JinEngine
{ "getColor", l_getColor },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_SPRITE, methods);
+ luax_newtype(L, Jin_Lua_Sprite, methods);
return 0;
}
diff --git a/src/lua/modules/graphics/je_lua_sprite.h b/src/lua/modules/graphics/je_lua_sprite.h
index cdd3a50..cbadc34 100644
--- a/src/lua/modules/graphics/je_lua_sprite.h
+++ b/src/lua/modules/graphics/je_lua_sprite.h
@@ -14,6 +14,8 @@ namespace JinEngine
DEP_SPRITESHEET = 3
};
+ extern const char* Jin_Lua_Sprite;
+
}
}
diff --git a/src/lua/modules/graphics/je_lua_spritesheet.cpp b/src/lua/modules/graphics/je_lua_spritesheet.cpp
index 7994237..ef1bd85 100644
--- a/src/lua/modules/graphics/je_lua_spritesheet.cpp
+++ b/src/lua/modules/graphics/je_lua_spritesheet.cpp
@@ -1,5 +1,5 @@
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
#include "libjin/jin.h"
#include "je_lua_sprite.h"
@@ -13,16 +13,18 @@ namespace JinEngine
namespace Lua
{
+ const char* Jin_Lua_SpriteSheet = "SpriteSheet";
+
LUA_IMPLEMENT int l_gc(lua_State* L)
{
- Proxy* pxySSheet = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_SPRITESHEET);
+ Proxy* pxySSheet = (Proxy*)luax_checktype(L, 1, Jin_Lua_SpriteSheet);
pxySSheet->release();
return 0;
}
LUA_IMPLEMENT int l_newSprite(lua_State* L)
{
- Proxy* pxySSheet = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_SPRITESHEET);
+ Proxy* pxySSheet = (Proxy*)luax_checktype(L, 1, Jin_Lua_SpriteSheet);
Shared<SpriteSheet>& shrSSheet = pxySSheet->getShared<SpriteSheet>();
SpriteSheet* sheet = pxySSheet->getObject<SpriteSheet>();
Quad quad;
@@ -31,8 +33,8 @@ namespace JinEngine
quad.w = luax_checkinteger(L, 4);
quad.h = luax_checkinteger(L, 5);
Sprite* spr = sheet->createSprite(quad);
- Proxy* pxySprite = luax_newinstance(L, JIN_GRAPHICS_SPRITE);
- Shared<Sprite>* shrSprite = new Shared<Sprite>(spr, JIN_GRAPHICS_SPRITE);
+ Proxy* pxySprite = luax_newinstance(L, Jin_Lua_Sprite);
+ Shared<Sprite>* shrSprite = new Shared<Sprite>(spr, Jin_Lua_Sprite);
shrSprite->setDependency((int)SpriteDependency::DEP_SPRITESHEET, &shrSSheet);
pxySprite->bind(shrSprite);
return 1;
@@ -45,7 +47,7 @@ namespace JinEngine
{ "newSprite", l_newSprite },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_SPRITESHEET, methods);
+ luax_newtype(L, Jin_Lua_SpriteSheet, methods);
return 0;
}
diff --git a/src/lua/modules/graphics/je_lua_spritesheet.h b/src/lua/modules/graphics/je_lua_spritesheet.h
index bedf945..ec94de8 100644
--- a/src/lua/modules/graphics/je_lua_spritesheet.h
+++ b/src/lua/modules/graphics/je_lua_spritesheet.h
@@ -11,6 +11,8 @@ namespace JinEngine
DEP_GRAPHIC = 1
};
+ extern const char* Jin_Lua_SpriteSheet;
+
}
}
diff --git a/src/lua/modules/graphics/je_lua_text.cpp b/src/lua/modules/graphics/je_lua_text.cpp
index 3316a4c..5e12ff8 100644
--- a/src/lua/modules/graphics/je_lua_text.cpp
+++ b/src/lua/modules/graphics/je_lua_text.cpp
@@ -1,5 +1,5 @@
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
#include "libjin/jin.h"
@@ -10,9 +10,11 @@ namespace JinEngine
namespace Lua
{
+ const char* Jin_Lua_Text = "Text";
+
LUA_IMPLEMENT int l_gc(lua_State* L)
{
- Proxy* p = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TEXT);
+ Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_Text);
p->release();
return 0;
}
@@ -23,7 +25,7 @@ namespace JinEngine
{ "__gc", l_gc },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_TEXT, f);
+ luax_newtype(L, Jin_Lua_Text, f);
return 0;
}
diff --git a/src/lua/modules/graphics/je_lua_text.h b/src/lua/modules/graphics/je_lua_text.h
new file mode 100644
index 0000000..bae5913
--- /dev/null
+++ b/src/lua/modules/graphics/je_lua_text.h
@@ -0,0 +1,14 @@
+#ifndef __JE_LUA_TEXT_H__
+#define __JE_LUA_TEXT_H__
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ extern const char* Jin_Lua_Text;
+
+ }
+}
+
+#endif \ No newline at end of file
diff --git a/src/lua/modules/graphics/je_lua_texture.cpp b/src/lua/modules/graphics/je_lua_texture.cpp
index d7571b6..08a98eb 100644
--- a/src/lua/modules/graphics/je_lua_texture.cpp
+++ b/src/lua/modules/graphics/je_lua_texture.cpp
@@ -1,5 +1,5 @@
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
#include "libjin/jin.h"
@@ -9,12 +9,14 @@ namespace JinEngine
{
namespace Lua
{
+
+ const char* Jin_Lua_Texture = "Texture";
typedef Shared<Texture>& SharedTexture;
LUA_IMPLEMENT inline SharedTexture checkTexture(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TEXTURE);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Texture);
return proxy->getShared<Texture>();
}
@@ -42,7 +44,7 @@ namespace JinEngine
LUA_IMPLEMENT int l_gc(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TEXTURE);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_Texture);
proxy->release();
return 0;
}
@@ -56,7 +58,7 @@ namespace JinEngine
{ "getSize", l_getSize },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_TEXTURE, f);
+ luax_newtype(L, Jin_Lua_Texture, f);
return 0;
}
diff --git a/src/lua/modules/graphics/je_lua_texture.h b/src/lua/modules/graphics/je_lua_texture.h
new file mode 100644
index 0000000..48f22ab
--- /dev/null
+++ b/src/lua/modules/graphics/je_lua_texture.h
@@ -0,0 +1,14 @@
+#ifndef __JE_LUA_TEXTURE_H__
+#define __JE_LUA_TEXTURE_H__
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ extern const char* Jin_Lua_Texture;
+
+ }
+}
+
+#endif \ No newline at end of file
diff --git a/src/lua/modules/graphics/je_lua_texture_font.cpp b/src/lua/modules/graphics/je_lua_texture_font.cpp
index 8be9a9d..0c3c4d9 100644
--- a/src/lua/modules/graphics/je_lua_texture_font.cpp
+++ b/src/lua/modules/graphics/je_lua_texture_font.cpp
@@ -1,8 +1,10 @@
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
#include "libjin/jin.h"
+
#include "je_lua_page.h"
+#include "je_lua_text.h"
using namespace JinEngine::Graphics;
using namespace JinEngine::Graphics::Fonts;
@@ -12,9 +14,11 @@ namespace JinEngine
namespace Lua
{
+ const char* Jin_Lua_TextureFont = "TextureFont";
+
LUA_IMPLEMENT int l_gc(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TEXTUREFONT);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_TextureFont);
proxy->release();
return 0;
}
@@ -22,7 +26,7 @@ namespace JinEngine
/* typeset(Text | string, lineheight, spacing) */
LUA_IMPLEMENT int l_typeset(lua_State* L)
{
- Proxy* pxyTexFont = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TEXTUREFONT);
+ Proxy* pxyTexFont = (Proxy*)luax_checktype(L, 1, Jin_Lua_TextureFont);
Shared<TextureFont>& shrTexFont = pxyTexFont->getShared<TextureFont>();
TextureFont* tf = pxyTexFont->getObject<TextureFont>();
int lineheight = luax_checkinteger(L, 3);
@@ -35,14 +39,14 @@ namespace JinEngine
Text text(Encode::UTF8, str, length);
page = tf->typeset(text, lineheight, spacing);
}
- else if (luax_istype(L, 2, JIN_GRAPHICS_TEXT))
+ else if (luax_istype(L, 2, Jin_Lua_Text))
{
- Proxy* p2 = (Proxy*)luax_checktype(L, 2, JIN_GRAPHICS_TEXT);
+ Proxy* p2 = (Proxy*)luax_checktype(L, 2, Jin_Lua_Text);
Text* text = p2->getObject<Text>();
page = tf->typeset(*text, lineheight, spacing);
}
- Proxy* pxyPage = luax_newinstance(L, JIN_GRAPHICS_PAGE);
- Shared<Page>* shrPage = new Shared<Page>(page, JIN_GRAPHICS_PAGE);
+ Proxy* pxyPage = luax_newinstance(L, Jin_Lua_Page);
+ Shared<Page>* shrPage = new Shared<Page>(page, Jin_Lua_Page);
shrPage->setDependency((int)PageDependency::DEP_TEXTURE_FONT, &shrTexFont);
pxyPage->bind(shrPage);
return 1;
@@ -55,7 +59,7 @@ namespace JinEngine
{ "typeset", l_typeset },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_TEXTUREFONT, f);
+ luax_newtype(L, Jin_Lua_TextureFont, f);
return 0;
}
diff --git a/src/lua/modules/graphics/je_lua_texture_font.h b/src/lua/modules/graphics/je_lua_texture_font.h
new file mode 100644
index 0000000..1339221
--- /dev/null
+++ b/src/lua/modules/graphics/je_lua_texture_font.h
@@ -0,0 +1,14 @@
+#ifndef __JE_LUA_TEXTURE_FONT_H__
+#define __JE_LUA_TEXTURE_FONT_H__
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ extern const char* Jin_Lua_TextureFont;
+
+ }
+}
+
+#endif \ No newline at end of file
diff --git a/src/lua/modules/graphics/je_lua_ttf.cpp b/src/lua/modules/graphics/je_lua_ttf.cpp
index 0216a9a..1f5be50 100644
--- a/src/lua/modules/graphics/je_lua_ttf.cpp
+++ b/src/lua/modules/graphics/je_lua_ttf.cpp
@@ -1,8 +1,10 @@
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
#include "libjin/jin.h"
+
#include "je_lua_page.h"
+#include "je_lua_text.h"
using namespace JinEngine::Graphics;
using namespace JinEngine::Graphics::Fonts;
@@ -12,9 +14,11 @@ namespace JinEngine
namespace Lua
{
+ const char* Jin_Lua_TTF = "TTF";
+
LUA_IMPLEMENT int l_gc(lua_State* L)
{
- Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TTF);
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, Jin_Lua_TTF);
proxy->release();
return 0;
}
@@ -22,7 +26,7 @@ namespace JinEngine
/* typeset(Text | string, lineheight, spacing) */
LUA_IMPLEMENT int l_typeset(lua_State* L)
{
- Proxy* pxyTTF = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TTF);
+ Proxy* pxyTTF = (Proxy*)luax_checktype(L, 1, Jin_Lua_TTF);
Shared<TTF>& shrTTF = pxyTTF->getShared<TTF>();
TTF* ttf = pxyTTF->getObject<TTF>();
int lineheight = luax_optnumber(L, 3, ttf->getFontSize());
@@ -35,14 +39,14 @@ namespace JinEngine
Text text(Encode::UTF8, str, length);
page = ttf->typeset(text, lineheight, spacing);
}
- else if (luax_istype(L, 2, JIN_GRAPHICS_TEXT))
+ else if (luax_istype(L, 2, Jin_Lua_Text))
{
- Proxy* pxyText = (Proxy*)luax_checktype(L, 2, JIN_GRAPHICS_TEXT);
+ Proxy* pxyText = (Proxy*)luax_checktype(L, 2, Jin_Lua_Text);
Text* text = pxyText->getObject<Text>();
page = ttf->typeset(*text, lineheight, spacing);
}
- Proxy* pxyPage = luax_newinstance(L, JIN_GRAPHICS_PAGE);
- Shared<Page>* refPage = new Shared<Page>(page, JIN_GRAPHICS_PAGE);
+ Proxy* pxyPage = luax_newinstance(L, Jin_Lua_Page);
+ Shared<Page>* refPage = new Shared<Page>(page, Jin_Lua_Page);
refPage->setDependency((int)PageDependency::DEP_TTF, &shrTTF);
pxyPage->bind(refPage);
return 1;
@@ -55,7 +59,7 @@ namespace JinEngine
{ "typeset", l_typeset },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_TTF, f);
+ luax_newtype(L, Jin_Lua_TTF, f);
return 0;
}
diff --git a/src/lua/modules/graphics/je_lua_ttf.h b/src/lua/modules/graphics/je_lua_ttf.h
new file mode 100644
index 0000000..01f99e6
--- /dev/null
+++ b/src/lua/modules/graphics/je_lua_ttf.h
@@ -0,0 +1,14 @@
+#ifndef __JE_LUA_TTF_H__
+#define __JE_LUA_TTF_H__
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ extern const char* Jin_Lua_TTF;
+
+ }
+}
+
+#endif \ No newline at end of file
diff --git a/src/lua/modules/graphics/je_lua_ttf_data.cpp b/src/lua/modules/graphics/je_lua_ttf_data.cpp
index 4df2f6e..fb43ae4 100644
--- a/src/lua/modules/graphics/je_lua_ttf_data.cpp
+++ b/src/lua/modules/graphics/je_lua_ttf_data.cpp
@@ -1,8 +1,11 @@
#include "lua/modules/luax.h"
-#include "lua/modules/types.h"
+
#include "lua/common/je_lua_common.h"
#include "libjin/jin.h"
+#include "je_lua_ttf.h"
+#include "je_lua_ttf_data.h"
+
using namespace JinEngine::Graphics;
using namespace JinEngine::Graphics::Fonts;
@@ -11,28 +14,25 @@ namespace JinEngine
namespace Lua
{
- enum TTFDependency
- {
- DEP_TTFDATA = 1,
- };
+ const char* Jin_Lua_TTFData = "TTFData";
LUA_IMPLEMENT int l_newTTF(lua_State* L)
{
- Proxy* pxyTTFData = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TTFDATA);
+ Proxy* pxyTTFData = (Proxy*)luax_checktype(L, 1, Jin_Lua_TTFData);
int fontsize = luax_checkinteger(L, 2);
Shared<TTFData>& shrFontData = pxyTTFData->getShared<TTFData>();
TTFData* fontData = shrFontData.getObject();
- Proxy* pxyTTF = luax_newinstance(L, JIN_GRAPHICS_TTF);
+ Proxy* pxyTTF = luax_newinstance(L, Jin_Lua_TTF);
TTF* font = fontData->createTTF(fontsize);
- Shared<TTF>* shrTTF = new Shared<TTF>(font, JIN_GRAPHICS_TTF);
- shrTTF->setDependency(DEP_TTFDATA, &shrFontData);
+ Shared<TTF>* shrTTF = new Shared<TTF>(font, Jin_Lua_TTF);
+ shrTTF->setDependency((int)TTFDependency::DEP_TTFDATA, &shrFontData);
pxyTTF->bind(shrTTF);
return 1;
}
LUA_IMPLEMENT int l_gc(lua_State* L)
{
- Proxy* p = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_TTFDATA);
+ Proxy* p = (Proxy*)luax_checktype(L, 1, Jin_Lua_TTFData);
p->release();
return 0;
}
@@ -44,7 +44,7 @@ namespace JinEngine
{ "newTTF", l_newTTF },
{ 0, 0 }
};
- luax_newtype(L, JIN_GRAPHICS_TTFDATA, f);
+ luax_newtype(L, Jin_Lua_TTFData, f);
return 0;
}
diff --git a/src/lua/modules/graphics/je_lua_ttf_data.h b/src/lua/modules/graphics/je_lua_ttf_data.h
new file mode 100644
index 0000000..f858f1a
--- /dev/null
+++ b/src/lua/modules/graphics/je_lua_ttf_data.h
@@ -0,0 +1,19 @@
+#ifndef __JE_LUA_TTFDATA_H__
+#define __JE_LUA_TTFDATA_H__
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ enum class TTFDependency
+ {
+ DEP_TTFDATA = 1,
+ };
+
+ extern const char* Jin_Lua_TTFData;
+
+ }
+}
+
+#endif \ No newline at end of file