diff options
Diffstat (limited to 'src/lua/modules/graphics/je_lua_graphics.cpp')
-rw-r--r-- | src/lua/modules/graphics/je_lua_graphics.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lua/modules/graphics/je_lua_graphics.cpp b/src/lua/modules/graphics/je_lua_graphics.cpp index 7175309..05231c2 100644 --- a/src/lua/modules/graphics/je_lua_graphics.cpp +++ b/src/lua/modules/graphics/je_lua_graphics.cpp @@ -69,8 +69,8 @@ namespace JinEngine } /* load default font */ - Bitmap* bitmap = Bitmap::createBitmap(default_font_bitmap, sizeof(default_font_bitmap)); - TextureFont* tf = TextureFont::createTextureFont(bitmap, Text(Encode::UTF8, default_charset), default_font_split, bitmap->getHeight()); + Bitmap* bitmap = new Bitmap(default_font_bitmap, sizeof(default_font_bitmap)); + TextureFont* tf = new TextureFont(bitmap, Text(Encode::UTF8, default_charset), default_font_split, bitmap->getHeight()); delete bitmap; context.defaultFont = tf; gl.setFont(tf); @@ -137,7 +137,7 @@ namespace JinEngine { int w = luax_checkinteger(L, 1); int h = luax_checkinteger(L, 2); - bitmap = Bitmap::createBitmap(w, h); + bitmap = new Bitmap(w, h); } else if (luax_gettop(L) == 3) { @@ -149,7 +149,7 @@ namespace JinEngine unsigned int g = luax_rawgetnumber(L, 3, 2); unsigned int b = luax_rawgetnumber(L, 3, 3); unsigned int a = luax_rawgetnumber(L, 3, 4); - bitmap = Bitmap::createBitmap(w, h, Color(r, g, b, a)); + bitmap = new Bitmap(w, h, Color(r, g, b, a)); } else if (luax_isfunction(L, 3)) { @@ -173,7 +173,7 @@ namespace JinEngine luax_pop(L, 1); return c; }; - bitmap = Bitmap::createBitmap(w, h, drawer); + bitmap = new Bitmap(w, h, drawer); } else { @@ -198,7 +198,7 @@ namespace JinEngine luax_pushnil(L); return 1; } - bitmap = Bitmap::createBitmap(&b, b.size()); + bitmap = new Bitmap(&b, b.size()); if (bitmap == nullptr) { error(L, "Failed to decode image file %s", f); @@ -219,12 +219,12 @@ namespace JinEngine LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Bitmap); Shared<Bitmap>& refBitmap = p->getShared<Bitmap>(); Bitmap* bitmap = refBitmap.getObject(); - texture = Texture::createTexture(bitmap); + texture = new Texture(bitmap); } else if (luax_isstring(L, 1)) { const char* path = luax_checkstring(L, 1); - texture = Texture::createTexture(path); + texture = new Texture(path); } LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Texture, new Shared<Texture>(texture, Jin_Lua_Texture)); return 1; @@ -233,7 +233,7 @@ namespace JinEngine LUA_IMPLEMENT int l_newShader(lua_State* L) { const char* program = luax_checkstring(L, 1); - Shader* jsl = Shader::createShader(program); + Shader* jsl = new Shader(program); if (jsl == nullptr) { error(L, "Failed to compile shader"); @@ -256,7 +256,7 @@ namespace JinEngine } Buffer b; fs->read(path, b); - Shader* jsl = Shader::createShader((char*)&b); + Shader* jsl = new Shader((char*)&b); if (jsl == nullptr) { error(L, "Failed to compile shader"); @@ -271,7 +271,7 @@ namespace JinEngine { int w = luax_checknumber(L, 1); int h = luax_checknumber(L, 2); - Canvas* cvs = Canvas::createCanvas(w, h); + Canvas* cvs = new Canvas(w, h); LuaObject* luaObj = luax_newinstance(L, Jin_Lua_Canvas, new Shared<Canvas>(cvs, Jin_Lua_Canvas)); return 1; } @@ -681,7 +681,7 @@ namespace JinEngine } Buffer b; fs->read(path, b); - fd = TTFData::createTTFData(&b, b.size()); + fd = new TTFData(&b, b.size()); } LuaObject* luaObj = luax_newinstance(L, Jin_Lua_TTFData, new Shared<TTFData>(fd, Jin_Lua_TTFData)); return 1; @@ -869,12 +869,12 @@ namespace JinEngine unsigned int g = luax_rawgetnumber(L, 3, 2); unsigned int b = luax_rawgetnumber(L, 3, 3); unsigned int a = luax_rawgetnumber(L, 3, 4); - textureFont = TextureFont::createTextureFont(bitmap, *text, Color(r, g, b, a), cellh); + textureFont = new TextureFont(bitmap, *text, Color(r, g, b, a), cellh); } else if (luax_isnumber(L, 3)) { float cellw = luax_checknumber(L, 3); - textureFont = TextureFont::createTextureFont(bitmap, *text, cellw, cellh); + textureFont = new TextureFont(bitmap, *text, cellw, cellh); } else { |