diff options
Diffstat (limited to 'src/lua/modules')
-rw-r--r-- | src/lua/modules/audio/audio.cpp | 6 | ||||
-rw-r--r-- | src/lua/modules/audio/source.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/core/core.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/event/event.cpp | 7 | ||||
-rw-r--r-- | src/lua/modules/filesystem/filesystem.cpp | 8 | ||||
-rw-r--r-- | src/lua/modules/graphics/bitmap.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/graphics/canvas.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/graphics/graphics.cpp | 19 | ||||
-rw-r--r-- | src/lua/modules/graphics/page.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/graphics/shader.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/graphics/text.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/graphics/texture.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/graphics/texture_font.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/graphics/ttf.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/graphics/ttfData.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/mouse/mouse.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/net/Buffer.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/net/net.cpp | 4 | ||||
-rw-r--r-- | src/lua/modules/net/socket.cpp | 2 | ||||
-rw-r--r-- | src/lua/modules/thread/Thread.h | 8 | ||||
-rw-r--r-- | src/lua/modules/time/time.cpp | 2 |
21 files changed, 43 insertions, 39 deletions
diff --git a/src/lua/modules/audio/audio.cpp b/src/lua/modules/audio/audio.cpp index 7590104..becde12 100644 --- a/src/lua/modules/audio/audio.cpp +++ b/src/lua/modules/audio/audio.cpp @@ -8,8 +8,8 @@ namespace jin namespace lua { - using namespace jin::audio; - using namespace jin::filesystem; + using namespace JinEngine::Audio; + using namespace JinEngine::Filesystem; typedef SDLAudio Audio; typedef SDLSource Source; @@ -62,7 +62,7 @@ namespace lua static int l_newSource(lua_State* L) { - Filesystem* fs = Filesystem::get(); + AssetDatabase* fs = AssetDatabase::get(); const char* f = luax_checkstring(L, 1); Buffer b; if (!fs->exists(f)) diff --git a/src/lua/modules/audio/source.cpp b/src/lua/modules/audio/source.cpp index 1953121..a001f92 100644 --- a/src/lua/modules/audio/source.cpp +++ b/src/lua/modules/audio/source.cpp @@ -8,7 +8,7 @@ namespace jin namespace lua { - using namespace jin::audio; + using namespace JinEngine::Audio; typedef Ref<Source>& SourceRef; diff --git a/src/lua/modules/core/core.cpp b/src/lua/modules/core/core.cpp index bfd80b8..b2b5766 100644 --- a/src/lua/modules/core/core.cpp +++ b/src/lua/modules/core/core.cpp @@ -6,7 +6,7 @@ namespace jin namespace lua { - using namespace jin::core; + using namespace JinEngine::Core; static int l_running(lua_State* L) { diff --git a/src/lua/modules/event/event.cpp b/src/lua/modules/event/event.cpp index 71b4a33..510afd7 100644 --- a/src/lua/modules/event/event.cpp +++ b/src/lua/modules/event/event.cpp @@ -9,7 +9,8 @@ namespace jin namespace lua { - using namespace jin::input; + using namespace JinEngine; + using namespace JinEngine::Input; /** * Load event poll, return a iterator(a table). @@ -74,13 +75,13 @@ namespace lua case EventType::JOYBUTTONUP: luax_setfieldstring(L, "type", e.type == EventType::JOYBUTTONDOWN ? "JoyButtonDown" : "JoyButtonUp"); luax_setfieldinteger(L, "which", e.jbutton.which); - luax_setfieldstring(L, "button", input::getJoyButtonName(e.jbutton.button)); + luax_setfieldstring(L, "button", Input::getJoyButtonName(e.jbutton.button)); break; case EventType::JOYAXISMOTION: luax_setfieldstring(L, "type", "JoyAxisMotion"); luax_setfieldinteger(L, "which", e.jaxis.which); - luax_setfieldfstring(L, "axis", input::getJoyAxisName(e.jaxis.axis)); + luax_setfieldfstring(L, "axis", Input::getJoyAxisName(e.jaxis.axis)); break; case EventType::JOYBALLMOTION: diff --git a/src/lua/modules/filesystem/filesystem.cpp b/src/lua/modules/filesystem/filesystem.cpp index e388ae1..3cb413f 100644 --- a/src/lua/modules/filesystem/filesystem.cpp +++ b/src/lua/modules/filesystem/filesystem.cpp @@ -2,7 +2,7 @@ #include "libjin/jin.h" #include <string> -using namespace jin::filesystem; +using namespace JinEngine::Filesystem; namespace jin { @@ -11,12 +11,12 @@ namespace lua static struct { - Filesystem* fs; + AssetDatabase* fs; } context; static int l_init(lua_State* L) { - context.fs = Filesystem::get(); + context.fs = AssetDatabase::get(); return 0; } @@ -109,7 +109,7 @@ namespace lua static int l_read(lua_State* L) { - Filesystem* fs = context.fs; + AssetDatabase* fs = context.fs; const char* file = luax_checkstring(L, 1); unsigned int len; Buffer buffer; diff --git a/src/lua/modules/graphics/bitmap.cpp b/src/lua/modules/graphics/bitmap.cpp index f2ecb5f..9a396fb 100644 --- a/src/lua/modules/graphics/bitmap.cpp +++ b/src/lua/modules/graphics/bitmap.cpp @@ -8,7 +8,7 @@ namespace jin namespace lua { - using namespace jin::graphics; + using namespace JinEngine::Graphics; typedef Ref<Bitmap>& BitmapRef; diff --git a/src/lua/modules/graphics/canvas.cpp b/src/lua/modules/graphics/canvas.cpp index 85ac49a..4639179 100644 --- a/src/lua/modules/graphics/canvas.cpp +++ b/src/lua/modules/graphics/canvas.cpp @@ -8,7 +8,7 @@ namespace jin namespace lua { - using namespace jin::graphics; + using namespace JinEngine::Graphics; typedef Ref<Canvas>& CanvasRef; diff --git a/src/lua/modules/graphics/graphics.cpp b/src/lua/modules/graphics/graphics.cpp index 31f6fba..9322765 100644 --- a/src/lua/modules/graphics/graphics.cpp +++ b/src/lua/modules/graphics/graphics.cpp @@ -11,9 +11,10 @@ namespace jin namespace lua { using namespace std; - using namespace jin::graphics; - using jin::filesystem::Filesystem; - using jin::filesystem::Buffer; + using namespace JinEngine; + using namespace JinEngine::Graphics; + using JinEngine::Filesystem::AssetDatabase; + using JinEngine::Filesystem::Buffer; #include "../../resources/font.ttf.h" @@ -117,7 +118,7 @@ namespace lua else { const char* f = luax_checkstring(L, 1); - Filesystem* fs = Filesystem::get(); + AssetDatabase* fs = AssetDatabase::get(); if (!fs->exists(f)) { error(L, "No such image file %s", f); @@ -186,7 +187,7 @@ namespace lua static int l_newShaderf(lua_State* L) { const char* path = luax_checkstring(L, 1); - Filesystem* fs = Filesystem::get(); + AssetDatabase* fs = AssetDatabase::get(); if (!fs->exists(path)) { error(L, "No such shader file %s\n", path); @@ -346,7 +347,7 @@ namespace lua luax_typerror(L, 2, "table"); return 1; } - math::Quad q; + Math::Quad q; q.x = luax_rawgetnumber(L, 2, 1); q.y = luax_rawgetnumber(L, 2, 2); q.w = luax_rawgetnumber(L, 2, 3); @@ -485,7 +486,7 @@ namespace lua { int x = luax_checknumber(L, 1); int y = luax_checknumber(L, 2); - jin::graphics::point(x, y); + JinEngine::Graphics::point(x, y); return 0; } @@ -496,7 +497,7 @@ namespace lua int y1 = luax_checknumber(L, 2); int x2 = luax_checknumber(L, 3); int y2 = luax_checknumber(L, 4); - jin::graphics::line(x1, y1, x2, y2); + JinEngine::Graphics::line(x1, y1, x2, y2); return 0; } @@ -609,7 +610,7 @@ namespace lua TTFData* fd = nullptr; { const char* path = luax_checkstring(L, 1); - Filesystem* fs = Filesystem::get(); + AssetDatabase* fs = AssetDatabase::get(); if (!fs->exists(path)) { error(L, "No such font %s\n", path); diff --git a/src/lua/modules/graphics/page.cpp b/src/lua/modules/graphics/page.cpp index c0a3184..e4ad829 100644 --- a/src/lua/modules/graphics/page.cpp +++ b/src/lua/modules/graphics/page.cpp @@ -10,7 +10,7 @@ namespace jin namespace lua { - using namespace jin::graphics; + using namespace JinEngine::Graphics; typedef Ref<Font>& FontRef; diff --git a/src/lua/modules/graphics/shader.cpp b/src/lua/modules/graphics/shader.cpp index a9603bc..1ea5447 100644 --- a/src/lua/modules/graphics/shader.cpp +++ b/src/lua/modules/graphics/shader.cpp @@ -8,7 +8,7 @@ namespace jin namespace lua { - using namespace jin::graphics; + using namespace JinEngine::Graphics; typedef Ref<Shader>& ShaderRef; diff --git a/src/lua/modules/graphics/text.cpp b/src/lua/modules/graphics/text.cpp index c0136cc..9940f50 100644 --- a/src/lua/modules/graphics/text.cpp +++ b/src/lua/modules/graphics/text.cpp @@ -8,7 +8,7 @@ namespace jin namespace lua { - using namespace jin::graphics; + using namespace JinEngine::Graphics; static int l_gc(lua_State* L) { diff --git a/src/lua/modules/graphics/texture.cpp b/src/lua/modules/graphics/texture.cpp index 77a93b8..980fe04 100644 --- a/src/lua/modules/graphics/texture.cpp +++ b/src/lua/modules/graphics/texture.cpp @@ -8,7 +8,7 @@ namespace jin namespace lua { - using namespace jin::graphics; + using namespace JinEngine::Graphics; typedef Ref<Texture>& TextureRef; diff --git a/src/lua/modules/graphics/texture_font.cpp b/src/lua/modules/graphics/texture_font.cpp index 4cf5bdd..bbb51cc 100644 --- a/src/lua/modules/graphics/texture_font.cpp +++ b/src/lua/modules/graphics/texture_font.cpp @@ -8,7 +8,7 @@ namespace jin namespace lua { - using namespace jin::graphics; + using namespace JinEngine::Graphics; static int l_gc(lua_State* L) { diff --git a/src/lua/modules/graphics/ttf.cpp b/src/lua/modules/graphics/ttf.cpp index 3d88a62..39383e4 100644 --- a/src/lua/modules/graphics/ttf.cpp +++ b/src/lua/modules/graphics/ttf.cpp @@ -8,7 +8,7 @@ namespace jin namespace lua { - using namespace jin::graphics; + using namespace JinEngine::Graphics; static int l_gc(lua_State* L) { diff --git a/src/lua/modules/graphics/ttfData.cpp b/src/lua/modules/graphics/ttfData.cpp index 5d4d03a..f61680f 100644 --- a/src/lua/modules/graphics/ttfData.cpp +++ b/src/lua/modules/graphics/ttfData.cpp @@ -8,7 +8,7 @@ namespace jin namespace lua { - using namespace jin::graphics; + using namespace JinEngine::Graphics; static int l_newTTF(lua_State* L) { diff --git a/src/lua/modules/mouse/mouse.cpp b/src/lua/modules/mouse/mouse.cpp index 390936c..76bfb77 100644 --- a/src/lua/modules/mouse/mouse.cpp +++ b/src/lua/modules/mouse/mouse.cpp @@ -6,7 +6,7 @@ namespace jin namespace lua { - using namespace jin::input; + using namespace JinEngine::Input; static int l_pos(lua_State* L) { diff --git a/src/lua/modules/net/Buffer.cpp b/src/lua/modules/net/Buffer.cpp index 1a62c9a..d4c687c 100644 --- a/src/lua/modules/net/Buffer.cpp +++ b/src/lua/modules/net/Buffer.cpp @@ -11,6 +11,8 @@ namespace lua namespace net { + using namespace JinEngine; + typedef Ref<Buffer>& BufferRef; static inline BufferRef checkNetBuffer(lua_State* L) diff --git a/src/lua/modules/net/net.cpp b/src/lua/modules/net/net.cpp index 8fb273c..37a5862 100644 --- a/src/lua/modules/net/net.cpp +++ b/src/lua/modules/net/net.cpp @@ -10,11 +10,11 @@ namespace lua { using namespace jin::lua::net; - using namespace jin::net; + using namespace JinEngine::Net; static int l_initNetwork(lua_State* L) { - jin::net::Net::get()->init(); + JinEngine::Net::NetManager::get()->init(); return 1; } diff --git a/src/lua/modules/net/socket.cpp b/src/lua/modules/net/socket.cpp index ef6d4ac..4f67497 100644 --- a/src/lua/modules/net/socket.cpp +++ b/src/lua/modules/net/socket.cpp @@ -9,7 +9,7 @@ namespace jin namespace lua { - using namespace jin::net; + using namespace JinEngine::Net; using namespace lua::net; typedef Ref<Socket>& SocketRef; diff --git a/src/lua/modules/thread/Thread.h b/src/lua/modules/thread/Thread.h index 645d4a1..9c375f0 100644 --- a/src/lua/modules/thread/Thread.h +++ b/src/lua/modules/thread/Thread.h @@ -11,14 +11,14 @@ namespace thread class Thread { public: - typedef jin::thread::Thread::Variant Variant; - typedef jin::thread::Thread::ThreadRunner ThreadRunner; + typedef JinEngine::MultiThread::Thread::Variant Variant; + typedef JinEngine::MultiThread::Thread::ThreadRunner ThreadRunner; Thread(std::string _name, std::string _code, ThreadRunner runner) : name(_name) , code(_code) { - thread = new jin::thread::Thread(_name, runner); + thread = new JinEngine::MultiThread::Thread(_name, runner); } ~Thread() @@ -85,7 +85,7 @@ namespace thread const std::string code; private: - jin::thread::Thread* thread; + JinEngine::MultiThread::Thread* thread; }; diff --git a/src/lua/modules/time/time.cpp b/src/lua/modules/time/time.cpp index 39743b4..982ce0c 100644 --- a/src/lua/modules/time/time.cpp +++ b/src/lua/modules/time/time.cpp @@ -7,7 +7,7 @@ namespace jin namespace lua { - using namespace jin::time; + using namespace JinEngine::Time; static int l_sec(lua_State* L) { |