From 611d12bdd245dd43b7434661d3e24f2b435378cb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Nov 2018 21:21:54 +0800 Subject: =?UTF-8?q?*=E6=9B=B4=E6=96=B0=E6=B8=B2=E6=9F=93=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/modules/graphics/je_lua_graphics.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/lua/modules/graphics/je_lua_graphics.cpp') diff --git a/src/lua/modules/graphics/je_lua_graphics.cpp b/src/lua/modules/graphics/je_lua_graphics.cpp index d129e6a..6b84651 100644 --- a/src/lua/modules/graphics/je_lua_graphics.cpp +++ b/src/lua/modules/graphics/je_lua_graphics.cpp @@ -678,10 +678,10 @@ namespace JinEngine { Proxy* pxySSheet = luax_newinstance(L, JIN_GRAPHICS_SPRITESHEET); Graphic* graphic = pxyGraphic->getObject(); - Shared& shrSSheet = pxySSheet->getShared(); + Shared* shrSSheet = new Shared(new SpriteSheet(graphic), JIN_GRAPHICS_SPRITESHEET); Shared& shrGraphic = pxyGraphic->getShared(); - shrSSheet.setDependency(SpriteSheetDependency::DEP_GRAPHIC, &shrGraphic); - pxySSheet->bind(new Shared(new SpriteSheet(graphic), JIN_GRAPHICS_SPRITESHEET)); + shrSSheet->setDependency((int)SpriteSheetDependency::DEP_GRAPHIC, &shrGraphic); + pxySSheet->bind(shrSSheet); return 1; } else @@ -776,6 +776,7 @@ namespace JinEngine luax_newclass(L, luaopen_Page); luax_newclass(L, luaopen_JSL); luax_newclass(L, luaopen_Sprite); + luax_newclass(L, luaopen_SpriteSheet); luaL_Reg f[] = { /* window */ -- cgit v1.1-26-g67d0