diff options
111 files changed, 488 insertions, 481 deletions
diff --git a/bin/Jin.exe b/bin/Jin.exe Binary files differindex 43a10b2..f1284dd 100644 --- a/bin/Jin.exe +++ b/bin/Jin.exe diff --git a/bin/jin.exe b/bin/jin.exe Binary files differindex 43a10b2..f1284dd 100644 --- a/bin/jin.exe +++ b/bin/jin.exe diff --git a/build/vc++/libjin/libjin.vcxproj b/build/vc++/libjin/libjin.vcxproj index 6fca2e9..9df06b8 100644 --- a/build/vc++/libjin/libjin.vcxproj +++ b/build/vc++/libjin/libjin.vcxproj @@ -139,7 +139,7 @@ <ClInclude Include="..\..\..\src\libjin\3rdparty\stb\stb_truetype.h" /> <ClInclude Include="..\..\..\src\libjin\3rdparty\tekcos\tekcos.h" /> <ClInclude Include="..\..\..\src\libjin\3rdparty\wav\wav.h" /> - <ClInclude Include="..\..\..\src\libjin\Audio\je_audio.h" /> + <ClInclude Include="..\..\..\src\libjin\Audio\je_audio_manager.h" /> <ClInclude Include="..\..\..\src\libjin\Audio\SDL\je_sdl_audio.h" /> <ClInclude Include="..\..\..\src\libjin\Audio\SDL\je_sdl_source.h" /> <ClInclude Include="..\..\..\src\libjin\Audio\je_source.h" /> @@ -155,7 +155,7 @@ <ClInclude Include="..\..\..\src\libjin\core\je_configuration.h" /> <ClInclude Include="..\..\..\src\libjin\core\je_types.h" /> <ClInclude Include="..\..\..\src\libjin\Filesystem\je_buffer.h" /> - <ClInclude Include="..\..\..\src\libjin\Filesystem\je_filesystem.h" /> + <ClInclude Include="..\..\..\src\libjin\Filesystem\je_asset_database.h" /> <ClInclude Include="..\..\..\src\libjin\Game\je_game.h" /> <ClInclude Include="..\..\..\src\libjin\Graphics\je_bitmap.h" /> <ClInclude Include="..\..\..\src\libjin\Graphics\je_canvas.h" /> @@ -193,7 +193,7 @@ <ClInclude Include="..\..\..\src\libjin\Math\je_vector2.hpp" /> <ClInclude Include="..\..\..\src\libjin\Math\je_vector3.hpp" /> <ClInclude Include="..\..\..\src\libjin\Math\je_vector4.hpp" /> - <ClInclude Include="..\..\..\src\libjin\Net\je_net.h" /> + <ClInclude Include="..\..\..\src\libjin\Net\je_net_manager.h" /> <ClInclude Include="..\..\..\src\libjin\Net\je_socket.h" /> <ClInclude Include="..\..\..\src\libjin\Thread\je_thread.h" /> <ClInclude Include="..\..\..\src\libjin\Time\je_timer.h" /> @@ -211,14 +211,14 @@ <ClCompile Include="..\..\..\src\libjin\3rdparty\stb\stb_vorbis.c" /> <ClCompile Include="..\..\..\src\libjin\3rdparty\tekcos\tekcos.c" /> <ClCompile Include="..\..\..\src\libjin\3rdparty\wav\wav.c" /> - <ClCompile Include="..\..\..\src\libjin\Audio\je_audio.cpp" /> + <ClCompile Include="..\..\..\src\libjin\Audio\je_audio_manager.cpp" /> <ClCompile Include="..\..\..\src\libjin\Audio\SDL\je_sdl_audio.cpp" /> <ClCompile Include="..\..\..\src\libjin\Audio\SDL\je_sdl_source.cpp" /> <ClCompile Include="..\..\..\src\libjin\Audio\je_source.cpp" /> <ClCompile Include="..\..\..\src\libjin\Common\je_exception.cpp" /> <ClCompile Include="..\..\..\src\libjin\Common\je_object.cpp" /> <ClCompile Include="..\..\..\src\libjin\Common\je_utf8.cpp" /> - <ClCompile Include="..\..\..\src\libjin\Filesystem\je_filesystem.cpp" /> + <ClCompile Include="..\..\..\src\libjin\Filesystem\je_asset_database.cpp" /> <ClCompile Include="..\..\..\src\libjin\Game\je_game.cpp" /> <ClCompile Include="..\..\..\src\libjin\Graphics\je_bitmap.cpp" /> <ClCompile Include="..\..\..\src\libjin\Graphics\je_canvas.cpp" /> @@ -241,7 +241,7 @@ <ClCompile Include="..\..\..\src\libjin\Input\je_keyboard.cpp" /> <ClCompile Include="..\..\..\src\libjin\Input\je_mouse.cpp" /> <ClCompile Include="..\..\..\src\libjin\Math\je_matrix.cpp" /> - <ClCompile Include="..\..\..\src\libjin\Net\je_net.cpp" /> + <ClCompile Include="..\..\..\src\libjin\Net\je_net_manager.cpp" /> <ClCompile Include="..\..\..\src\libjin\Net\je_socket.cpp" /> <ClCompile Include="..\..\..\src\libjin\Thread\je_thread.cpp" /> <ClCompile Include="..\..\..\src\libjin\Time\je_timer.cpp" /> diff --git a/build/vc++/libjin/libjin.vcxproj.filters b/build/vc++/libjin/libjin.vcxproj.filters index dc49cd4..523d49d 100644 --- a/build/vc++/libjin/libjin.vcxproj.filters +++ b/build/vc++/libjin/libjin.vcxproj.filters @@ -34,9 +34,6 @@ <Filter Include="Source\time"> <UniqueIdentifier>{492364c7-464b-488e-aae0-15aca7824f32}</UniqueIdentifier> </Filter> - <Filter Include="Source\thread"> - <UniqueIdentifier>{5d5c96c3-1065-4e74-9521-f4d756d4057f}</UniqueIdentifier> - </Filter> <Filter Include="Source\net"> <UniqueIdentifier>{125ecddc-2a19-4da8-9e81-da40ccfb1be7}</UniqueIdentifier> </Filter> @@ -73,6 +70,9 @@ <Filter Include="Source\core"> <UniqueIdentifier>{410ae074-3f19-4ca1-bbf4-380f2ba67500}</UniqueIdentifier> </Filter> + <Filter Include="Source\multithread"> + <UniqueIdentifier>{5d5c96c3-1065-4e74-9521-f4d756d4057f}</UniqueIdentifier> + </Filter> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\..\src\libjin\3rdparty\GLee\GLee.h"> @@ -187,14 +187,11 @@ <Filter>Source\time</Filter> </ClInclude> <ClInclude Include="..\..\..\src\libjin\Thread\je_thread.h"> - <Filter>Source\thread</Filter> + <Filter>Source\multithread</Filter> </ClInclude> <ClInclude Include="..\..\..\src\libjin\Net\je_socket.h"> <Filter>Source\net</Filter> </ClInclude> - <ClInclude Include="..\..\..\src\libjin\Net\je_net.h"> - <Filter>Source\net</Filter> - </ClInclude> <ClInclude Include="..\..\..\src\libjin\Math\je_vector4.hpp"> <Filter>Source\math</Filter> </ClInclude> @@ -237,9 +234,6 @@ <ClInclude Include="..\..\..\src\libjin\Filesystem\je_buffer.h"> <Filter>Source\filesystem</Filter> </ClInclude> - <ClInclude Include="..\..\..\src\libjin\Filesystem\je_filesystem.h"> - <Filter>Source\filesystem</Filter> - </ClInclude> <ClInclude Include="..\..\..\src\libjin\Common\je_array.hpp"> <Filter>Source\common</Filter> </ClInclude> @@ -270,9 +264,6 @@ <ClInclude Include="..\..\..\src\libjin\Audio\je_source.h"> <Filter>Source\audio</Filter> </ClInclude> - <ClInclude Include="..\..\..\src\libjin\Audio\je_audio.h"> - <Filter>Source\audio</Filter> - </ClInclude> <ClInclude Include="..\..\..\src\libjin\Audio\SDL\je_sdl_source.h"> <Filter>Source\audio\sdl</Filter> </ClInclude> @@ -288,6 +279,15 @@ <ClInclude Include="..\..\..\src\libjin\core\je_types.h"> <Filter>Source\core</Filter> </ClInclude> + <ClInclude Include="..\..\..\src\libjin\Filesystem\je_asset_database.h"> + <Filter>Source\filesystem</Filter> + </ClInclude> + <ClInclude Include="..\..\..\src\libjin\Net\je_net_manager.h"> + <Filter>Source\net</Filter> + </ClInclude> + <ClInclude Include="..\..\..\src\libjin\Audio\je_audio_manager.h"> + <Filter>Source\audio</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="..\..\..\src\libjin\README.md"> @@ -368,14 +368,11 @@ <Filter>Source\time</Filter> </ClCompile> <ClCompile Include="..\..\..\src\libjin\Thread\je_thread.cpp"> - <Filter>Source\thread</Filter> + <Filter>Source\multithread</Filter> </ClCompile> <ClCompile Include="..\..\..\src\libjin\Net\je_socket.cpp"> <Filter>Source\net</Filter> </ClCompile> - <ClCompile Include="..\..\..\src\libjin\Net\je_net.cpp"> - <Filter>Source\net</Filter> - </ClCompile> <ClCompile Include="..\..\..\src\libjin\Math\je_matrix.cpp"> <Filter>Source\math</Filter> </ClCompile> @@ -394,9 +391,6 @@ <ClCompile Include="..\..\..\src\libjin\Game\je_game.cpp"> <Filter>Source\game</Filter> </ClCompile> - <ClCompile Include="..\..\..\src\libjin\Filesystem\je_filesystem.cpp"> - <Filter>Source\filesystem</Filter> - </ClCompile> <ClCompile Include="..\..\..\src\libjin\Common\je_exception.cpp"> <Filter>Source\common</Filter> </ClCompile> @@ -409,14 +403,20 @@ <ClCompile Include="..\..\..\src\libjin\Audio\je_source.cpp"> <Filter>Source\audio</Filter> </ClCompile> - <ClCompile Include="..\..\..\src\libjin\Audio\je_audio.cpp"> - <Filter>Source\audio</Filter> - </ClCompile> <ClCompile Include="..\..\..\src\libjin\Audio\SDL\je_sdl_source.cpp"> <Filter>Source\audio\sdl</Filter> </ClCompile> <ClCompile Include="..\..\..\src\libjin\Audio\SDL\je_sdl_audio.cpp"> <Filter>Source\audio\sdl</Filter> </ClCompile> + <ClCompile Include="..\..\..\src\libjin\Filesystem\je_asset_database.cpp"> + <Filter>Source\filesystem</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\libjin\Net\je_net_manager.cpp"> + <Filter>Source\net</Filter> + </ClCompile> + <ClCompile Include="..\..\..\src\libjin\Audio\je_audio_manager.cpp"> + <Filter>Source\audio</Filter> + </ClCompile> </ItemGroup> </Project>
\ No newline at end of file diff --git a/src/libjin/3rdparty/GLee/GLee.c b/src/libjin/3rdparty/GLee/GLee.c index 02dc670..0f32273 100644 --- a/src/libjin/3rdparty/GLee/GLee.c +++ b/src/libjin/3rdparty/GLee/GLee.c @@ -14082,10 +14082,10 @@ int __GLeeGLXNumExtensions=51; /* GLX_SGIX_hyperpipe */ #ifdef __GLEE_GLX_SGIX_hyperpipe -#ifndef GLEE_C_DEFINED_glXQueryHyperpipeNetworkSGIX -#define GLEE_C_DEFINED_glXQueryHyperpipeNetworkSGIX - GLXHyperpipeNetworkSGIX * __stdcall GLee_Lazy_glXQueryHyperpipeNetworkSGIX(Display * dpy, int * npipes) {if (GLeeInit()) return glXQueryHyperpipeNetworkSGIX(dpy, npipes); return (GLXHyperpipeNetworkSGIX *)0;} - GLEEPFNGLXQUERYHYPERPIPENETWORKSGIXPROC GLeeFuncPtr_glXQueryHyperpipeNetworkSGIX=GLee_Lazy_glXQueryHyperpipeNetworkSGIX; +#ifndef GLEE_C_DEFINED_glXQueryHyperpipeNetManagerworkSGIX +#define GLEE_C_DEFINED_glXQueryHyperpipeNetManagerworkSGIX + GLXHyperpipeNetManagerworkSGIX * __stdcall GLee_Lazy_glXQueryHyperpipeNetManagerworkSGIX(Display * dpy, int * npipes) {if (GLeeInit()) return glXQueryHyperpipeNetManagerworkSGIX(dpy, npipes); return (GLXHyperpipeNetManagerworkSGIX *)0;} + GLEEPFNGLXQUERYHYPERPIPENETWORKSGIXPROC GLeeFuncPtr_glXQueryHyperpipeNetManagerworkSGIX=GLee_Lazy_glXQueryHyperpipeNetManagerworkSGIX; #endif #ifndef GLEE_C_DEFINED_glXHyperpipeConfigSGIX #define GLEE_C_DEFINED_glXHyperpipeConfigSGIX @@ -19976,7 +19976,7 @@ GLuint __GLeeLink_GLX_SGIX_hyperpipe(void) { GLint nLinked=0; #ifdef __GLEE_GLX_SGIX_hyperpipe - if ((GLeeFuncPtr_glXQueryHyperpipeNetworkSGIX = (GLEEPFNGLXQUERYHYPERPIPENETWORKSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeNetworkSGIX"))!=0) nLinked++; + if ((GLeeFuncPtr_glXQueryHyperpipeNetManagerworkSGIX = (GLEEPFNGLXQUERYHYPERPIPENETWORKSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeNetManagerworkSGIX"))!=0) nLinked++; if ((GLeeFuncPtr_glXHyperpipeConfigSGIX = (GLEEPFNGLXHYPERPIPECONFIGSGIXPROC) __GLeeGetProcAddress("glXHyperpipeConfigSGIX"))!=0) nLinked++; if ((GLeeFuncPtr_glXQueryHyperpipeConfigSGIX = (GLEEPFNGLXQUERYHYPERPIPECONFIGSGIXPROC) __GLeeGetProcAddress("glXQueryHyperpipeConfigSGIX"))!=0) nLinked++; if ((GLeeFuncPtr_glXDestroyHyperpipeConfigSGIX = (GLEEPFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) __GLeeGetProcAddress("glXDestroyHyperpipeConfigSGIX"))!=0) nLinked++; diff --git a/src/libjin/3rdparty/GLee/GLee.h b/src/libjin/3rdparty/GLee/GLee.h index 97c98ab..1e9a297 100644 --- a/src/libjin/3rdparty/GLee/GLee.h +++ b/src/libjin/3rdparty/GLee/GLee.h @@ -1090,7 +1090,7 @@ GLEE_EXTERN GLboolean _GLEE_IBM_static_data; { char pipeName[_GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int networkId; - } GLXHyperpipeNetworkSGIX; + } GLXHyperpipeNetManagerworkSGIX; typedef struct { @@ -21851,11 +21851,11 @@ GLEE_EXTERN GLboolean _GLEE_GLX_EXT_scene_marker; #define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 #define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 #define GLX_HYPERPIPE_ID_SGIX 0x8030 -#ifndef GLEE_H_DEFINED_glXQueryHyperpipeNetworkSGIX -#define GLEE_H_DEFINED_glXQueryHyperpipeNetworkSGIX - typedef GLXHyperpipeNetworkSGIX * (APIENTRYP GLEEPFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display * dpy, int * npipes); - GLEE_EXTERN GLEEPFNGLXQUERYHYPERPIPENETWORKSGIXPROC GLeeFuncPtr_glXQueryHyperpipeNetworkSGIX; - #define glXQueryHyperpipeNetworkSGIX GLeeFuncPtr_glXQueryHyperpipeNetworkSGIX +#ifndef GLEE_H_DEFINED_glXQueryHyperpipeNetManagerworkSGIX +#define GLEE_H_DEFINED_glXQueryHyperpipeNetManagerworkSGIX + typedef GLXHyperpipeNetManagerworkSGIX * (APIENTRYP GLEEPFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display * dpy, int * npipes); + GLEE_EXTERN GLEEPFNGLXQUERYHYPERPIPENETWORKSGIXPROC GLeeFuncPtr_glXQueryHyperpipeNetManagerworkSGIX; + #define glXQueryHyperpipeNetManagerworkSGIX GLeeFuncPtr_glXQueryHyperpipeNetManagerworkSGIX #endif #ifndef GLEE_H_DEFINED_glXHyperpipeConfigSGIX #define GLEE_H_DEFINED_glXHyperpipeConfigSGIX diff --git a/src/libjin/3rdparty/stb/stb_image.h b/src/libjin/3rdparty/stb/stb_image.h index 9938309..4df317a 100644 --- a/src/libjin/3rdparty/stb/stb_image.h +++ b/src/libjin/3rdparty/stb/stb_image.h @@ -79,7 +79,7 @@ RECENT REVISION HISTORY: github:urraka (animated gif) Junggon Kim (PNM comments) Daniel Gibson (16-bit TGA) socks-the-fox (16-bit PNG) - Jeremy Sawicki (handle all ImageNet JPGs) + Jeremy Sawicki (handle all ImageNetManager JPGs) Optimizations & bugfixes Fabian "ryg" Giesen Arseny Kapoulkine diff --git a/src/libjin/Audio/SDL/je_sdl_audio.cpp b/src/libjin/Audio/SDL/je_sdl_audio.cpp index 0cc8380..cd79bed 100644 --- a/src/libjin/Audio/SDL/je_sdl_audio.cpp +++ b/src/libjin/Audio/SDL/je_sdl_audio.cpp @@ -9,12 +9,12 @@ #include "je_sdl_audio.h" #include "je_sdl_source.h" -namespace jin +namespace JinEngine { - namespace audio + namespace Audio { - using namespace jin::math; + using namespace JinEngine::Math; /* עcallbackƵ̵߳ */ static void defaultCallback(void *userdata, Uint8 *stream, int size) @@ -32,7 +32,7 @@ namespace jin /*call only once*/ bool SDLAudio::initSystem(const SettingBase* s) { #if LIBJIN_DEBUG - Loghelper::log(Loglevel::LV_INFO, "Init Audio System"); + Loghelper::log(Loglevel::LV_INFO, "Init AudioManager System"); #endif if (SDL_Init(SDL_INIT_AUDIO) < 0) @@ -137,7 +137,7 @@ namespace jin this->volume = clamp(volume, 0.0f, 1.0f); } - } // namespace audio -} // namespace jin + } // namespace Audio +} // namespace JinEngine #endif // LIBJIN_MODULES_AUDIO && LIBJIN_AUDIO_SDLAUDIO diff --git a/src/libjin/Audio/SDL/je_sdl_audio.h b/src/libjin/Audio/SDL/je_sdl_audio.h index 4ce3756..01da7b3 100644 --- a/src/libjin/Audio/SDL/je_sdl_audio.h +++ b/src/libjin/Audio/SDL/je_sdl_audio.h @@ -5,20 +5,20 @@ #include <vector> -#include "../je_audio.h" +#include "../je_audio_manager.h" #include "je_sdl_source.h" -namespace jin +namespace JinEngine { - namespace audio + namespace Audio { #define SDLAUDIO_BITDEPTH 16 #define SDLAUDIO_BYTEDEPTH (SDLAUDIO_BITDEPTH >> 3) #define SDLAUDIO_CHANNELS 2 - class SDLAudio : public Audio<SDLAudio> + class SDLAudio : public AudioManager<SDLAudio> { public: struct Setting : SettingBase @@ -55,8 +55,8 @@ namespace jin }; - } // namespace audio -} // namespace jin + } // namespace Audio +} // namespace JinEngine #endif // LIBJIN_MODULES_AUDIO && LIBJIN_AUDIO_SDLAUDIO #endif // __JE_AUDIO_SDL_H diff --git a/src/libjin/Audio/SDL/je_sdl_source.cpp b/src/libjin/Audio/SDL/je_sdl_source.cpp index 5fbce49..210d058 100644 --- a/src/libjin/Audio/SDL/je_sdl_source.cpp +++ b/src/libjin/Audio/SDL/je_sdl_source.cpp @@ -14,12 +14,12 @@ #include "je_sdl_audio.h" #include "je_sdl_source.h" -namespace jin +namespace JinEngine { - namespace audio + namespace Audio { - using namespace jin::math; + using namespace JinEngine::Math; #define BITS 8 @@ -395,7 +395,7 @@ namespace jin } - } // namespace audio -} // namespace jin + } // namespace Audio +} // namespace JinEngine #endif // LIBJIN_MODULES_AUDIO && LIBJIN_AUDIO_SDLAUDIO diff --git a/src/libjin/Audio/SDL/je_sdl_source.h b/src/libjin/Audio/SDL/je_sdl_source.h index 1d055bf..b32ecce 100644 --- a/src/libjin/Audio/SDL/je_sdl_source.h +++ b/src/libjin/Audio/SDL/je_sdl_source.h @@ -10,9 +10,9 @@ #include "../je_source.h" -namespace jin +namespace JinEngine { - namespace audio + namespace Audio { typedef struct SDLSourceCommand; @@ -100,8 +100,8 @@ namespace jin } }; - } // namespace audio -} // namespace jin + } // namespace Audio +} // namespace JinEngine #endif // LIBJIN_MODULES_AUDIO && LIBJIN_AUDIO_SDLAUDIO #endif // __JE_SOURCE_SDL_H diff --git a/src/libjin/Audio/je_audio.cpp b/src/libjin/Audio/je_audio_manager.cpp index 81201b7..4b56132 100644 --- a/src/libjin/Audio/je_audio.cpp +++ b/src/libjin/Audio/je_audio_manager.cpp @@ -2,14 +2,14 @@ #if LIBJIN_MODULES_AUDIO #include "SDL2/SDL.h" -#include "je_audio.h" +#include "je_audio_manager.h" -namespace jin +namespace JinEngine { - namespace audio + namespace Audio { - } // namespace audio -} // namespace jin + } // namespace Audio +} // namespace JinEngine #endif // LIBJIN_MODULES_AUDIO diff --git a/src/libjin/Audio/je_audio.h b/src/libjin/Audio/je_audio_manager.h index 4dd8007..86716ef 100644 --- a/src/libjin/Audio/je_audio.h +++ b/src/libjin/Audio/je_audio_manager.h @@ -9,15 +9,15 @@ #include "SDL2/SDL.h" -namespace jin +namespace JinEngine { - namespace audio + namespace Audio { class Source; template<class SubAudio> - class Audio : public Subsystem<SubAudio> + class AudioManager : public Subsystem<SubAudio> { public: enum State @@ -34,20 +34,22 @@ namespace jin virtual void setVolume(float volume) = 0; protected: - Audio() + singleton(AudioManager); + + AudioManager() : volume(1) , state(State::PLAY) {}; - virtual ~Audio() {}; - singleton(Audio); + virtual ~AudioManager() {}; float volume; State state; }; - } // namespace audio -} // namespace jin + } // namespace Audio +} // namespace JinEngine #endif // LIBJIN_MODULES_AUDIO + #endif // __JE_AUDIO_H diff --git a/src/libjin/Audio/je_source.cpp b/src/libjin/Audio/je_source.cpp index e20cd69..573366d 100644 --- a/src/libjin/Audio/je_source.cpp +++ b/src/libjin/Audio/je_source.cpp @@ -5,9 +5,9 @@ #include "je_source.h" -namespace jin +namespace JinEngine { - namespace audio + namespace Audio { static int check_header(const void *data, int size, const char *str, int offset) { @@ -24,7 +24,7 @@ namespace jin return SourceType::INVALID; } - } // namespace audio -} // namespace jin + } // namespace Audio +} // namespace JinEngine #endif // LIBJIN_MODULES_AUDIO diff --git a/src/libjin/Audio/je_source.h b/src/libjin/Audio/je_source.h index 07cfee5..9ef0b46 100644 --- a/src/libjin/Audio/je_source.h +++ b/src/libjin/Audio/je_source.h @@ -5,9 +5,9 @@ #include "SDL2/SDL.h" -namespace jin +namespace JinEngine { - namespace audio + namespace Audio { enum SourceType @@ -40,8 +40,8 @@ namespace jin }; - } // namespace audio -} // namespace jin + } // namespace Audio +} // namespace JinEngine #endif // LIBJIN_MODULES_AUDIO #endif // __JE_AUDIO_SOURCE_H diff --git a/src/libjin/Common/je_array.hpp b/src/libjin/Common/je_array.hpp index 6708378..473bae8 100644 --- a/src/libjin/Common/je_array.hpp +++ b/src/libjin/Common/je_array.hpp @@ -1,7 +1,7 @@ #ifndef __JE_COMMON_ARRAY_H #define __JE_COMMON_ARRAY_H -namespace jin +namespace JinEngine { /* ԶͷŶڴջϴĶ̬ */ template<typename T> @@ -81,6 +81,6 @@ namespace jin }; -} // namespace jin +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Common/je_object.cpp b/src/libjin/Common/je_object.cpp index e3b4ca5..69e4a56 100644 --- a/src/libjin/Common/je_object.cpp +++ b/src/libjin/Common/je_object.cpp @@ -1,7 +1,7 @@ // LOVE #include "je_object.h" -namespace jin +namespace JinEngine { Object::Object() diff --git a/src/libjin/Common/je_object.h b/src/libjin/Common/je_object.h index 1f11936..ca17586 100644 --- a/src/libjin/Common/je_object.h +++ b/src/libjin/Common/je_object.h @@ -1,7 +1,7 @@ #ifndef __JE_COMMON_OBJECT_H #define __JE_COMMON_OBJECT_H -namespace jin +namespace JinEngine { class Object @@ -44,6 +44,6 @@ namespace jin }; // Object -} // namespace jin +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Common/je_singleton.hpp b/src/libjin/Common/je_singleton.hpp index c49184b..f37f3af 100644 --- a/src/libjin/Common/je_singleton.hpp +++ b/src/libjin/Common/je_singleton.hpp @@ -1,7 +1,7 @@ #ifndef __JE_SINGLETON_H #define __JE_SINGLETON_H -namespace jin +namespace JinEngine { template<class T> @@ -32,6 +32,6 @@ namespace jin #define singleton(T) friend Singleton<T> -} // namespace jin +} // namespace JinEngine #endif // __JE_SINGLETON_H
\ No newline at end of file diff --git a/src/libjin/Common/je_stringmap.hpp b/src/libjin/Common/je_stringmap.hpp index a4c24a9..43e3e9b 100644 --- a/src/libjin/Common/je_stringmap.hpp +++ b/src/libjin/Common/je_stringmap.hpp @@ -1,7 +1,7 @@ #ifndef __JE_COMMON_SREINGMAP_H #define __JE_COMMON_SREINGMAP_H -namespace jin +namespace JinEngine { template<typename T, unsigned SIZE> @@ -138,6 +138,6 @@ namespace jin }; // StringMap -} // namespace jin +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Common/je_subsystem.hpp b/src/libjin/Common/je_subsystem.hpp index ecfab20..4966a9d 100644 --- a/src/libjin/Common/je_subsystem.hpp +++ b/src/libjin/Common/je_subsystem.hpp @@ -5,7 +5,7 @@ #include "je_singleton.hpp" -namespace jin +namespace JinEngine { template<class System> @@ -39,6 +39,6 @@ namespace jin }; -} // namespace jin +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Common/je_types.h b/src/libjin/Common/je_types.h index fb11181..7e7ad21 100644 --- a/src/libjin/Common/je_types.h +++ b/src/libjin/Common/je_types.h @@ -2,7 +2,7 @@ #define __JE_TYPES_H #include <stdint.h> -namespace jin +namespace JinEngine { namespace common { diff --git a/src/libjin/Common/je_utf8.cpp b/src/libjin/Common/je_utf8.cpp index de539c7..b2c1d31 100644 --- a/src/libjin/Common/je_utf8.cpp +++ b/src/libjin/Common/je_utf8.cpp @@ -3,7 +3,7 @@ #include "je_utf8.h" -namespace jin +namespace JinEngine { std::string to_utf8(LPCWSTR wstr) @@ -37,6 +37,6 @@ namespace jin } } -} // namespace jin +} // namespace JinEngine #endif // LIBJIN_OS == LIBJIN_WINDOWS diff --git a/src/libjin/Common/je_utf8.h b/src/libjin/Common/je_utf8.h index 00eaab5..9fdff10 100644 --- a/src/libjin/Common/je_utf8.h +++ b/src/libjin/Common/je_utf8.h @@ -7,7 +7,7 @@ #include <string> #include <windows.h> -namespace jin +namespace JinEngine { /** @@ -25,7 +25,7 @@ namespace jin **/ void replace_char(std::string & str, char find, char replace); -} // namespace jin +} // namespace JinEngine #endif // LIBJIN_OS == LIBJIN_WINDOWS #endif // __JE_COMMON_UTF8_H diff --git a/src/libjin/Filesystem/je_asset_database.cpp b/src/libjin/Filesystem/je_asset_database.cpp new file mode 100644 index 0000000..c945d6a --- /dev/null +++ b/src/libjin/Filesystem/je_asset_database.cpp @@ -0,0 +1,68 @@ +#include <string.h> +#include <stdlib.h> +#include <stdio.h> /* defines FILENAME_MAX */ + +#include "je_asset_database.h" + +namespace JinEngine +{ + namespace Filesystem + { + + AssetDatabase* AssetDatabase::fs = 0; + + AssetDatabase::AssetDatabase() + { + S = smtnewshared(); + } + + AssetDatabase* AssetDatabase::get() + { + return fs ? fs : (fs = new AssetDatabase()); + } + + void AssetDatabase::mount(const char * path) + { + int err = smtmount(S, path); + if (err) + { + printf("%s mounted path %s", smterrstr(err), path); + exit(1); + } + } + + int AssetDatabase::read(const char* path, Buffer* buffer) + { + buffer->data = smtread(S, path, &buffer->size); + if (buffer->data == 0) + return 0; + return 1; + } + + void* AssetDatabase::read(const char* path, unsigned int* len) + { + return smtread(S, path, len); + } + + const char* AssetDatabase::getFull(const char* path) + { + return smtfullpath(S, path); + } + + bool AssetDatabase::isDir(const char* path) + { + return smtisdir(S, path); + } + + bool AssetDatabase::isFile(const char* path) + { + return smtisreg(S, path); + } + + bool AssetDatabase::exists(const char* path) + { + return smtexists(S, path) == 0; + } + + } // namespace Filesystem +} // namespace JinEngine
\ No newline at end of file diff --git a/src/libjin/Filesystem/je_filesystem.h b/src/libjin/Filesystem/je_asset_database.h index 5d65fea..ef16263 100644 --- a/src/libjin/Filesystem/je_filesystem.h +++ b/src/libjin/Filesystem/je_asset_database.h @@ -1,17 +1,17 @@ #include "je_buffer.h" #include "../3rdparty/smount/smount.h" -namespace jin +namespace JinEngine { - namespace filesystem + namespace Filesystem { /* Դ */ - class Filesystem + class AssetDatabase { public: - static Filesystem* get(); + static AssetDatabase* get(); - Filesystem(); + AssetDatabase(); bool isDir(const char* path); bool isFile(const char* path); @@ -22,10 +22,10 @@ namespace jin const char* getFull(const char* path); private: - static Filesystem* fs; + static AssetDatabase* fs; smtShared* S; }; - } // namespace filesystem -} // namespace jin
\ No newline at end of file + } // namespace Filesystem +} // namespace JinEngine
\ No newline at end of file diff --git a/src/libjin/Filesystem/je_buffer.h b/src/libjin/Filesystem/je_buffer.h index 6ac9f4a..11faf79 100644 --- a/src/libjin/Filesystem/je_buffer.h +++ b/src/libjin/Filesystem/je_buffer.h @@ -4,9 +4,9 @@ #include <string.h> #include <stdlib.h> -namespace jin +namespace JinEngine { - namespace filesystem + namespace Filesystem { /** @@ -61,7 +61,7 @@ namespace jin }; - } // namespace filesystem -} // namespace jin + } // namespace Filesystem +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Filesystem/je_filesystem.cpp b/src/libjin/Filesystem/je_filesystem.cpp deleted file mode 100644 index 339d470..0000000 --- a/src/libjin/Filesystem/je_filesystem.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include <string.h> -#include <stdlib.h> -#include <stdio.h> /* defines FILENAME_MAX */ - -#include "je_filesystem.h" - -namespace jin -{ - namespace filesystem - { - - Filesystem* Filesystem::fs = 0; - - Filesystem::Filesystem() - { - S = smtnewshared(); - } - - Filesystem* Filesystem::get() - { - return fs ? fs : (fs = new Filesystem()); - } - - void Filesystem::mount(const char * path) - { - int err = smtmount(S, path); - if (err) - { - printf("%s mounted path %s", smterrstr(err), path); - exit(1); - } - } - - int Filesystem::read(const char* path, Buffer* buffer) - { - buffer->data = smtread(S, path, &buffer->size); - if (buffer->data == 0) - return 0; - return 1; - } - - void* Filesystem::read(const char* path, unsigned int* len) - { - return smtread(S, path, len); - } - - const char* Filesystem::getFull(const char* path) - { - return smtfullpath(S, path); - } - - bool Filesystem::isDir(const char* path) - { - return smtisdir(S, path); - } - - bool Filesystem::isFile(const char* path) - { - return smtisreg(S, path); - } - - bool Filesystem::exists(const char* path) - { - return smtexists(S, path) == 0; - } - - } // namespace filesystem -} // namespace jin
\ No newline at end of file diff --git a/src/libjin/Game/je_game.cpp b/src/libjin/Game/je_game.cpp index 10e9e44..3052bc2 100644 --- a/src/libjin/Game/je_game.cpp +++ b/src/libjin/Game/je_game.cpp @@ -7,15 +7,15 @@ #include "je_game.h" -namespace jin +namespace JinEngine { - namespace core + namespace Core { - using namespace jin::graphics; - using namespace jin::input; - using namespace jin::time; - using namespace jin::math; + using namespace JinEngine::Graphics; + using namespace JinEngine::Input; + using namespace JinEngine::Time; + using namespace JinEngine::Math; Game::Game() :_running(true) {}; @@ -34,7 +34,7 @@ namespace jin int dt = 0; while (_running) { - while (jin::input::pollEvent(&e)) + while (JinEngine::Input::pollEvent(&e)) { if (_onEvent != nullptr) _onEvent(&e); @@ -70,5 +70,5 @@ namespace jin { } - } // namespace core -} // namespace jin
\ No newline at end of file + } // namespace Core +} // namespace JinEngine
\ No newline at end of file diff --git a/src/libjin/Game/je_game.h b/src/libjin/Game/je_game.h index 5225ed7..8fe4b51 100644 --- a/src/libjin/Game/je_game.h +++ b/src/libjin/Game/je_game.h @@ -7,9 +7,9 @@ #include "SDL2/SDL.h" -namespace jin +namespace JinEngine { - namespace core + namespace Core { class Game : public Subsystem<Game> @@ -17,7 +17,7 @@ namespace jin public: typedef void(*onLoad)(); - typedef void(*onEvent)(jin::input::Event* e); + typedef void(*onEvent)(JinEngine::Input::Event* e); typedef void(*onUpdate)(int dt); typedef void(*onDraw)(); @@ -52,7 +52,7 @@ namespace jin }; - } // namespace core -} // namespace jin + } // namespace Core +} // namespace JinEngine #endif // __JE_CORE_GAME_H diff --git a/src/libjin/Graphics/Font/je_decoder.cpp b/src/libjin/Graphics/Font/je_decoder.cpp index 20695e7..01e1990 100644 --- a/src/libjin/Graphics/Font/je_decoder.cpp +++ b/src/libjin/Graphics/Font/je_decoder.cpp @@ -2,9 +2,9 @@ #include <string.h> #include "je_decoder.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /* utf8 byte string to unicode codepoint */ @@ -89,5 +89,5 @@ namespace jin return p + 1; } - } // namespace graphics -} // namespace jin
\ No newline at end of file + } // namespace Graphics +} // namespace JinEngine
\ No newline at end of file diff --git a/src/libjin/Graphics/Font/je_decoder.h b/src/libjin/Graphics/Font/je_decoder.h index 6a69c21..162f22e 100644 --- a/src/libjin/Graphics/Font/je_decoder.h +++ b/src/libjin/Graphics/Font/je_decoder.h @@ -5,9 +5,9 @@ #include "je_text.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /// @@ -82,7 +82,7 @@ namespace jin const void* next(const void* data) const override; }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Graphics/Font/je_font.h b/src/libjin/Graphics/Font/je_font.h index 0601713..ec60c21 100644 --- a/src/libjin/Graphics/Font/je_font.h +++ b/src/libjin/Graphics/Font/je_font.h @@ -4,9 +4,9 @@ #include <vector> #include "je_text.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { struct Page; @@ -93,7 +93,7 @@ namespace jin }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Graphics/Font/je_page.h b/src/libjin/Graphics/Font/je_page.h index 569780e..7df2784 100644 --- a/src/libjin/Graphics/Font/je_page.h +++ b/src/libjin/Graphics/Font/je_page.h @@ -5,9 +5,9 @@ #include "je_font.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { class Font; @@ -42,10 +42,10 @@ namespace jin Font* font; std::vector<GlyphArrayDrawInfo> glyphinfolist; std::vector<GlyphVertex> glyphvertices; - math::Vector2<int> size; + Math::Vector2<int> size; }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Graphics/Font/je_text.cpp b/src/libjin/Graphics/Font/je_text.cpp index aa5cbda..beba94f 100644 --- a/src/libjin/Graphics/Font/je_text.cpp +++ b/src/libjin/Graphics/Font/je_text.cpp @@ -3,9 +3,9 @@ #include "je_text.h" #include "je_decoder.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { ///////////////////////////////////////////////////////////////////////////// @@ -152,5 +152,5 @@ namespace jin return content; } - } // namespace graphics -} // namespace jin
\ No newline at end of file + } // namespace Graphics +} // namespace JinEngine
\ No newline at end of file diff --git a/src/libjin/Graphics/Font/je_text.h b/src/libjin/Graphics/Font/je_text.h index 9d2dd95..af40993 100644 --- a/src/libjin/Graphics/Font/je_text.h +++ b/src/libjin/Graphics/Font/je_text.h @@ -3,9 +3,9 @@ #include <vector> -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { typedef unsigned int Codepoint; @@ -73,7 +73,7 @@ namespace jin }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Graphics/Font/je_texture_font.cpp b/src/libjin/Graphics/Font/je_texture_font.cpp index 3df77e5..81ac343 100644 --- a/src/libjin/Graphics/Font/je_texture_font.cpp +++ b/src/libjin/Graphics/Font/je_texture_font.cpp @@ -6,13 +6,13 @@ #include "je_texture_font.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { using namespace std; - using namespace math; + using namespace Math; TextureFont * TextureFont::createTextureFont(const Bitmap* bitmap, const Content& codepoints, int cellw, int cellh) { diff --git a/src/libjin/Graphics/Font/je_texture_font.h b/src/libjin/Graphics/Font/je_texture_font.h index bfa4815..9805cda 100644 --- a/src/libjin/Graphics/Font/je_texture_font.h +++ b/src/libjin/Graphics/Font/je_texture_font.h @@ -13,9 +13,9 @@ #include "je_font.h" #include "je_text.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /// @@ -59,7 +59,7 @@ namespace jin }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Graphics/Font/je_ttf.cpp b/src/libjin/Graphics/Font/je_ttf.cpp index d44b2c7..0ee02ab 100644 --- a/src/libjin/Graphics/Font/je_ttf.cpp +++ b/src/libjin/Graphics/Font/je_ttf.cpp @@ -15,9 +15,9 @@ #define STB_TRUETYPE_IMPLEMENTATION #include "../../3rdparty/stb/stb_truetype.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { ///////////////////////////////////////////////////////////////////////////// @@ -147,7 +147,7 @@ namespace jin #include "../shader/je_font.shader.h" using namespace std; - using namespace jin::math; + using namespace JinEngine::Math; const int TTF::TEXTURE_WIDTHS[] = { 128, 256, 256, 512, 512, 1024, 1024 }; const int TTF::TEXTURE_HEIGHTS[] = { 128, 128, 256, 256, 512, 512, 1024 }; @@ -450,7 +450,7 @@ namespace jin return bakeGlyph(character); } - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER
\ No newline at end of file diff --git a/src/libjin/Graphics/Font/je_ttf.h b/src/libjin/Graphics/Font/je_ttf.h index 5c44d26..e4314fe 100644 --- a/src/libjin/Graphics/Font/je_ttf.h +++ b/src/libjin/Graphics/Font/je_ttf.h @@ -16,9 +16,9 @@ #include "je_font.h" #include "je_text.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { class TTF; @@ -122,12 +122,12 @@ namespace jin int descent; /* cursor helped render to texture */ - math::Vector2<float> cursor; + Math::Vector2<float> cursor; }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER diff --git a/src/libjin/Graphics/Shader/je_shader.cpp b/src/libjin/Graphics/Shader/je_shader.cpp index 686f2b9..19485b9 100644 --- a/src/libjin/Graphics/Shader/je_shader.cpp +++ b/src/libjin/Graphics/Shader/je_shader.cpp @@ -9,12 +9,12 @@ #include "je_shader.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { - using namespace jin::filesystem; + using namespace JinEngine::Filesystem; using namespace std; // @@ -258,7 +258,7 @@ namespace jin ); } - void Shader::sendMatrix4(const char* name, const math::Matrix* mat4) + void Shader::sendMatrix4(const char* name, const Math::Matrix* mat4) { int loc = glGetUniformLocation(mPID, name); glUniformMatrix4fv(loc, 1, GL_FALSE, mat4->getElements()); @@ -278,7 +278,7 @@ namespace jin glVertexAttribPointer(loc, n, type, GL_FALSE, stride, pointers); } - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // jin_graphics_shader
\ No newline at end of file diff --git a/src/libjin/Graphics/Shader/je_shader.h b/src/libjin/Graphics/Shader/je_shader.h index 5145f85..69746de 100644 --- a/src/libjin/Graphics/Shader/je_shader.h +++ b/src/libjin/Graphics/Shader/je_shader.h @@ -15,9 +15,9 @@ #include "je_base.shader.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /// @@ -135,7 +135,7 @@ namespace jin /// @param name Name of the uniform variable to be assigned. /// @param mat4 Matrix to be sent. /// - void sendMatrix4(const char* name, const math::Matrix* mat4); + void sendMatrix4(const char* name, const Math::Matrix* mat4); /// /// Set vertices value. @@ -192,8 +192,8 @@ namespace jin }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // jin_graphics && jin_graphics_shader diff --git a/src/libjin/Graphics/je_bitmap.cpp b/src/libjin/Graphics/je_bitmap.cpp index 2a619ac..c284d2a 100644 --- a/src/libjin/Graphics/je_bitmap.cpp +++ b/src/libjin/Graphics/je_bitmap.cpp @@ -4,11 +4,11 @@ #include "je_bitmap.h" -using namespace jin::math; +using namespace JinEngine::Math; -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /* pixelbitmap */ diff --git a/src/libjin/Graphics/je_bitmap.h b/src/libjin/Graphics/je_bitmap.h index 92ab836..eeb065e 100644 --- a/src/libjin/Graphics/je_bitmap.h +++ b/src/libjin/Graphics/je_bitmap.h @@ -7,9 +7,9 @@ #include "../math/je_vector2.hpp" #include "je_color.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /// /// A RGBA32 bitmap. @@ -145,7 +145,7 @@ namespace jin /// /// @return Size of bitmap. /// - inline math::Vector2<int> getSize() const { return math::Vector2<int>(width, height); } + inline Math::Vector2<int> getSize() const { return Math::Vector2<int>(width, height); } protected: /// @@ -166,8 +166,8 @@ namespace jin }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif #endif
\ No newline at end of file diff --git a/src/libjin/Graphics/je_canvas.cpp b/src/libjin/Graphics/je_canvas.cpp index af9868b..b8553b5 100644 --- a/src/libjin/Graphics/je_canvas.cpp +++ b/src/libjin/Graphics/je_canvas.cpp @@ -5,9 +5,9 @@ #include "je_canvas.h" #include "je_window.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /*class member*/ const Canvas* Canvas::current = nullptr; @@ -96,7 +96,7 @@ namespace jin } - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER
\ No newline at end of file diff --git a/src/libjin/Graphics/je_canvas.h b/src/libjin/Graphics/je_canvas.h index 5a44e87..321cd32 100644 --- a/src/libjin/Graphics/je_canvas.h +++ b/src/libjin/Graphics/je_canvas.h @@ -4,9 +4,10 @@ #if LIBJIN_MODULES_RENDER #include "je_drawable.h" -namespace jin + +namespace JinEngine { - namespace graphics + namespace Graphics { /// /// Renderable canvas. @@ -59,8 +60,8 @@ namespace jin }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER #endif // __JE_CANVAS_H
\ No newline at end of file diff --git a/src/libjin/Graphics/je_color.cpp b/src/libjin/Graphics/je_color.cpp index 821f19e..da48162 100644 --- a/src/libjin/Graphics/je_color.cpp +++ b/src/libjin/Graphics/je_color.cpp @@ -1,8 +1,8 @@ #include "je_color.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { const Color Color::WHITE = Color(255, 255, 255); diff --git a/src/libjin/Graphics/je_color.h b/src/libjin/Graphics/je_color.h index 675d25e..01484ff 100644 --- a/src/libjin/Graphics/je_color.h +++ b/src/libjin/Graphics/je_color.h @@ -8,9 +8,9 @@ #include "../utils/je_endian.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { typedef unsigned char Channel; @@ -78,8 +78,8 @@ namespace jin }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER #endif // __JE_COLOR_H
\ No newline at end of file diff --git a/src/libjin/Graphics/je_drawable.cpp b/src/libjin/Graphics/je_drawable.cpp index 9b5746a..00ff739 100644 --- a/src/libjin/Graphics/je_drawable.cpp +++ b/src/libjin/Graphics/je_drawable.cpp @@ -8,9 +8,9 @@ #include "shader/je_shader.h" #include "je_drawable.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { Drawable::Drawable(int w, int h) @@ -82,7 +82,7 @@ namespace jin gl.bindTexture(0); } - void Drawable::draw(const math::Quad& slice, int x, int y, float sx, float sy, float r, float ax, float ay) + void Drawable::draw(const Math::Quad& slice, int x, int y, float sx, float sy, float r, float ax, float ay) { float vertCoords[8] = { 0, 0, @@ -119,7 +119,7 @@ namespace jin // glTexParameteri(GL_) //} - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER
\ No newline at end of file diff --git a/src/libjin/Graphics/je_drawable.h b/src/libjin/Graphics/je_drawable.h index f31f3d7..28fd28b 100644 --- a/src/libjin/Graphics/je_drawable.h +++ b/src/libjin/Graphics/je_drawable.h @@ -9,9 +9,9 @@ #include "je_gl.h" #include "je_bitmap.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /// /// @@ -47,7 +47,7 @@ namespace jin /// /// /// - void draw(const math::Quad& slice, int x, int y, float sx = 1, float sy = 1, float r = 0, float ax = 0, float ay = 0); + void draw(const Math::Quad& slice, int x, int y, float sx = 1, float sy = 1, float r = 0, float ax = 0, float ay = 0); /// /// @@ -76,15 +76,15 @@ namespace jin GLuint vbo; /* TODO: vertex buffer object */ /* GLuint vbo; */ - jin::math::Vector2<unsigned int> size; - jin::math::Vector2<int> anchor; + JinEngine::Math::Vector2<unsigned int> size; + JinEngine::Math::Vector2<int> anchor; float vertex_coords[DRAWABLE_V_SIZE]; float texture_coords[DRAWABLE_V_SIZE]; }; } // namespace render -} // namespace jin +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER #endif // __JE_DRAWABLE
\ No newline at end of file diff --git a/src/libjin/Graphics/je_gl.cpp b/src/libjin/Graphics/je_gl.cpp index d228bb5..f27f7ba 100644 --- a/src/libjin/Graphics/je_gl.cpp +++ b/src/libjin/Graphics/je_gl.cpp @@ -1,9 +1,9 @@ #define OGL2D_IMPLEMENT #include "je_gl.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { OpenGL gl; diff --git a/src/libjin/Graphics/je_gl.h b/src/libjin/Graphics/je_gl.h index 2b76162..e0bc81f 100644 --- a/src/libjin/Graphics/je_gl.h +++ b/src/libjin/Graphics/je_gl.h @@ -5,16 +5,16 @@ #include "../3rdparty/ogl/OpenGL.h" #include "../math/je_matrix.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { class OpenGL : public ogl2d::OpenGL { public: - math::Matrix ProjectionMatrix; - math::Matrix ModelMatrix; + Math::Matrix ProjectionMatrix; + Math::Matrix ModelMatrix; OpenGL() : ogl2d::OpenGL() { diff --git a/src/libjin/Graphics/je_image.cpp b/src/libjin/Graphics/je_image.cpp index cca78a3..9c6f2ad 100644 --- a/src/libjin/Graphics/je_image.cpp +++ b/src/libjin/Graphics/je_image.cpp @@ -1,14 +1,14 @@ #include "../3rdparty/stb/stb_image.h" -#include "../filesystem/je_filesystem.h" +#include "../filesystem/je_asset_database.h" #include "je_image.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { - using namespace filesystem; + using namespace Filesystem; /*static*/ Image* Image::createImage(const void* imgData, size_t size) { @@ -27,7 +27,7 @@ namespace jin Image* Image::createImage(const char* path) { - Filesystem* fs = Filesystem::get(); + AssetDatabase* fs = AssetDatabase::get(); Buffer buffer; fs->read(path, &buffer); return createImage(buffer.data, buffer.size); @@ -42,5 +42,5 @@ namespace jin { } - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine diff --git a/src/libjin/Graphics/je_image.h b/src/libjin/Graphics/je_image.h index adb9cde..04ee4d2 100644 --- a/src/libjin/Graphics/je_image.h +++ b/src/libjin/Graphics/je_image.h @@ -3,9 +3,9 @@ #include "je_bitmap.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /// @@ -54,7 +54,7 @@ namespace jin }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Graphics/je_mesh.cpp b/src/libjin/Graphics/je_mesh.cpp index 1047e7e..de810e7 100644 --- a/src/libjin/Graphics/je_mesh.cpp +++ b/src/libjin/Graphics/je_mesh.cpp @@ -1,8 +1,8 @@ #include "je_mesh.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { diff --git a/src/libjin/Graphics/je_mesh.h b/src/libjin/Graphics/je_mesh.h index e85344c..29c8916 100644 --- a/src/libjin/Graphics/je_mesh.h +++ b/src/libjin/Graphics/je_mesh.h @@ -1,9 +1,9 @@ #ifndef __JE_MESH_H #define __JE_MESH_H -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { class Mesh diff --git a/src/libjin/Graphics/je_shapes.cpp b/src/libjin/Graphics/je_shapes.cpp index 31c793f..5a6dee8 100644 --- a/src/libjin/Graphics/je_shapes.cpp +++ b/src/libjin/Graphics/je_shapes.cpp @@ -9,12 +9,12 @@ #include "shader/je_shader.h" #include "je_shapes.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { - using namespace math; + using namespace Math; void point(int x, int y) { @@ -122,7 +122,7 @@ namespace jin } } - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER
\ No newline at end of file diff --git a/src/libjin/Graphics/je_shapes.h b/src/libjin/Graphics/je_shapes.h index bb2da25..ea010be 100644 --- a/src/libjin/Graphics/je_shapes.h +++ b/src/libjin/Graphics/je_shapes.h @@ -7,9 +7,9 @@ #include "je_canvas.h" #include "je_texture.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { typedef enum { @@ -30,8 +30,8 @@ namespace jin extern void points(int n, GLshort* p, GLubyte* c); extern void polygon(RenderMode mode, float* p, int count); - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER #endif // __JE_GEOMETRY_H
\ No newline at end of file diff --git a/src/libjin/Graphics/je_sprite.h b/src/libjin/Graphics/je_sprite.h index e0bf6fa..9c3f7a2 100644 --- a/src/libjin/Graphics/je_sprite.h +++ b/src/libjin/Graphics/je_sprite.h @@ -1,9 +1,9 @@ #ifndef __JE_SPRITE_H #define __JE_SPRITE_H -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /// /// A sprite is a transformable texture. diff --git a/src/libjin/Graphics/je_texture.cpp b/src/libjin/Graphics/je_texture.cpp index d2e53e2..da56047 100644 --- a/src/libjin/Graphics/je_texture.cpp +++ b/src/libjin/Graphics/je_texture.cpp @@ -8,12 +8,12 @@ #include "je_texture.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { - using namespace jin::math; + using namespace JinEngine::Math; /*static*/ Texture* Texture::createTexture(Bitmap* bitmap) { @@ -30,7 +30,7 @@ namespace jin { } - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER
\ No newline at end of file diff --git a/src/libjin/Graphics/je_texture.h b/src/libjin/Graphics/je_texture.h index a58f1db..e5c9cff 100644 --- a/src/libjin/Graphics/je_texture.h +++ b/src/libjin/Graphics/je_texture.h @@ -9,9 +9,9 @@ #include "je_drawable.h" #include "je_bitmap.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /// /// @@ -37,8 +37,8 @@ namespace jin }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // jin_graphics diff --git a/src/libjin/Graphics/je_window.cpp b/src/libjin/Graphics/je_window.cpp index 680dd0e..bdcb00a 100644 --- a/src/libjin/Graphics/je_window.cpp +++ b/src/libjin/Graphics/je_window.cpp @@ -12,9 +12,9 @@ #include "je_gl.h" #include "je_canvas.h" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { bool Window::initSystem(const SettingBase* s) @@ -105,7 +105,7 @@ namespace jin SDL_SetWindowTitle(wnd, title); }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // LIBJIN_MODULES_RENDER
\ No newline at end of file diff --git a/src/libjin/Graphics/je_window.h b/src/libjin/Graphics/je_window.h index 08a9c59..f7d265f 100644 --- a/src/libjin/Graphics/je_window.h +++ b/src/libjin/Graphics/je_window.h @@ -9,9 +9,9 @@ #include "../math/je_vector2.hpp" #include "../common/je_subsystem.hpp" -namespace jin +namespace JinEngine { - namespace graphics + namespace Graphics { /// /// @@ -83,13 +83,13 @@ namespace jin void quitSystem() override; SDL_Window* wnd; - jin::math::Vector2<unsigned int> size; + JinEngine::Math::Vector2<unsigned int> size; int fps; }; - } // namespace graphics -} // namespace jin + } // namespace Graphics +} // namespace JinEngine #endif // jin_graphics diff --git a/src/libjin/Input/je_event.cpp b/src/libjin/Input/je_event.cpp index 4f55839..318ce59 100644 --- a/src/libjin/Input/je_event.cpp +++ b/src/libjin/Input/je_event.cpp @@ -2,7 +2,7 @@ #include "je_event.h" -namespace jin +namespace JinEngine { -} // namespace jin
\ No newline at end of file +} // namespace JinEngine
\ No newline at end of file diff --git a/src/libjin/Input/je_event.h b/src/libjin/Input/je_event.h index e39032e..ca5dab7 100644 --- a/src/libjin/Input/je_event.h +++ b/src/libjin/Input/je_event.h @@ -3,9 +3,9 @@ #include "../core/je_configuration.h" #if LIBJIN_MODULES_INPUT -namespace jin +namespace JinEngine { - namespace input + namespace Input { #if LIBJIN_INPUT_SDL #include "SDL.h" @@ -98,8 +98,8 @@ namespace jin */ #endif // LIBJIN_INPUT_SDL - } // namespace input -} // namespace jin + } // namespace Input +} // namespace JinEngine #endif // LIBJIN_MODULES_INPUT #endif
\ No newline at end of file diff --git a/src/libjin/Input/je_joypad.h b/src/libjin/Input/je_joypad.h index a163dca..49cd2d8 100644 --- a/src/libjin/Input/je_joypad.h +++ b/src/libjin/Input/je_joypad.h @@ -3,9 +3,9 @@ #include <SDL2/SDL.h> -namespace jin +namespace JinEngine { - namespace input + namespace Input { inline const char* getJoyButtonName(int button) @@ -44,7 +44,7 @@ namespace jin } } - } // namespace input -} // namespace jin + } // namespace Input +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Input/je_keyboard.h b/src/libjin/Input/je_keyboard.h index 2b9ea38..85b6267 100644 --- a/src/libjin/Input/je_keyboard.h +++ b/src/libjin/Input/je_keyboard.h @@ -1,9 +1,9 @@ #ifndef __JE_KEYBOARD_H #define __JE_KEYBOARD_H -namespace jin +namespace JinEngine { - namespace input + namespace Input { class Keyboard @@ -11,7 +11,7 @@ namespace jin }; - } // namespace input -} // namespace jin + } // namespace Input +} // namespace JinEngine #endif // __JE_KEYBOARD_H
\ No newline at end of file diff --git a/src/libjin/Input/je_mouse.cpp b/src/libjin/Input/je_mouse.cpp index 21e59fb..45fb8df 100644 --- a/src/libjin/Input/je_mouse.cpp +++ b/src/libjin/Input/je_mouse.cpp @@ -5,9 +5,9 @@ #include "je_mouse.h" -namespace jin +namespace JinEngine { - namespace input + namespace Input { void Mouse::getState(int* x, int* y) @@ -22,7 +22,7 @@ namespace jin SDL_ShowCursor(visible ? SDL_ENABLE : SDL_DISABLE); } - } // namespace input -} // namespace jin + } // namespace Input +} // namespace JinEngine #endif // LIBJIN_MODULES_INPUT
\ No newline at end of file diff --git a/src/libjin/Input/je_mouse.h b/src/libjin/Input/je_mouse.h index f229ed1..6f01993 100644 --- a/src/libjin/Input/je_mouse.h +++ b/src/libjin/Input/je_mouse.h @@ -5,9 +5,9 @@ #include "../common/je_singleton.hpp" -namespace jin +namespace JinEngine { - namespace input + namespace Input { class Mouse : public Singleton<Mouse> @@ -24,8 +24,8 @@ namespace jin }; - } // namespace input -} // namespace jin + } // namespace Input +} // namespace JinEngine #endif // LIBJIN_MODULES_INPUT #endif // __JE_MOUSE_H
\ No newline at end of file diff --git a/src/libjin/Math/je_math.h b/src/libjin/Math/je_math.h index 66cb2d6..adbe2f4 100644 --- a/src/libjin/Math/je_math.h +++ b/src/libjin/Math/je_math.h @@ -5,9 +5,9 @@ #include "je_matrix.h" #include "je_quad.h" -namespace jin +namespace JinEngine { - namespace math + namespace Math { #ifdef min @@ -71,7 +71,7 @@ namespace jin return a + t * (b - a); } - } // namespace math -} // namespace jin + } // namespace Math +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Math/je_matrix.cpp b/src/libjin/Math/je_matrix.cpp index 3a878a0..bc1fcea 100644 --- a/src/libjin/Math/je_matrix.cpp +++ b/src/libjin/Math/je_matrix.cpp @@ -3,9 +3,9 @@ #include <cstring> // memcpy #include <cmath> -namespace jin +namespace JinEngine { - namespace math + namespace Math { const Matrix Matrix::Identity; @@ -190,5 +190,5 @@ namespace jin } } - } // namespace math -} // namespace jin
\ No newline at end of file + } // namespace Math +} // namespace JinEngine
\ No newline at end of file diff --git a/src/libjin/Math/je_matrix.h b/src/libjin/Math/je_matrix.h index f478d70..1ab9371 100644 --- a/src/libjin/Math/je_matrix.h +++ b/src/libjin/Math/je_matrix.h @@ -1,9 +1,9 @@ #ifndef __JE_MATRIX_H #define __JE_MATRIX_H -namespace jin +namespace JinEngine { - namespace math + namespace Math { struct vertex @@ -153,7 +153,7 @@ namespace jin }; - } // namespace math -} // namespace jin + } // namespace Math +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Math/je_quad.h b/src/libjin/Math/je_quad.h index 3f6c26d..4121eab 100644 --- a/src/libjin/Math/je_quad.h +++ b/src/libjin/Math/je_quad.h @@ -1,9 +1,9 @@ #ifndef __JE_QUAD_H #define __JE_QUAD_H -namespace jin +namespace JinEngine { - namespace math + namespace Math { struct Quad @@ -11,7 +11,7 @@ namespace jin float x, y, w, h; }; - } // namespace math -} // namespace jin + } // namespace Math +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Math/je_vector2.hpp b/src/libjin/Math/je_vector2.hpp index 7ebe307..a2b3371 100644 --- a/src/libjin/Math/je_vector2.hpp +++ b/src/libjin/Math/je_vector2.hpp @@ -1,9 +1,9 @@ #ifndef __JE_VECTOR_H #define __JE_VECTOR_H -namespace jin +namespace JinEngine { - namespace math + namespace Math { template<typename T> @@ -34,7 +34,7 @@ namespace jin }; - } // namespace math -} // namespace jin + } // namespace Math +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Math/je_vector3.hpp b/src/libjin/Math/je_vector3.hpp index d200898..0f9448d 100644 --- a/src/libjin/Math/je_vector3.hpp +++ b/src/libjin/Math/je_vector3.hpp @@ -1,9 +1,9 @@ #ifndef __JE_VECTOR3_H #define __JE_VECTOR3_H -namespace jin +namespace JinEngine { - namespace math + namespace Math { template<typename T> @@ -35,7 +35,7 @@ namespace jin }; - } // namespace math -} // namespace jin + } // namespace Math +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Math/je_vector4.hpp b/src/libjin/Math/je_vector4.hpp index 81b343f..20353eb 100644 --- a/src/libjin/Math/je_vector4.hpp +++ b/src/libjin/Math/je_vector4.hpp @@ -1,9 +1,9 @@ #ifndef __JE_VECTOR4_H #define __JE_VECTOR4_H -namespace jin +namespace JinEngine { - namespace math + namespace Math { template<typename T> @@ -39,7 +39,7 @@ namespace jin }; - } // namespace math -} // namespace jin + } // namespace Math +} // namespace JinEngine #endif
\ No newline at end of file diff --git a/src/libjin/Net/je_net.cpp b/src/libjin/Net/je_net.cpp deleted file mode 100644 index c417108..0000000 --- a/src/libjin/Net/je_net.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "je_net.h" - -namespace jin -{ - namespace net - { - - bool Net::initSystem(const SettingBase* setting) - { - #ifdef _WIN32 - #if LIBJIN_NET_TEKCOS - tk_init(); - #endif - #endif - return true; - } - - void Net::quitSystem() - { - - } - - } // namespace net -} // namespace jin
\ No newline at end of file diff --git a/src/libjin/Net/je_net_manager.cpp b/src/libjin/Net/je_net_manager.cpp new file mode 100644 index 0000000..36021f1 --- /dev/null +++ b/src/libjin/Net/je_net_manager.cpp @@ -0,0 +1,24 @@ +#include "je_net_manager.h" + +namespace JinEngine +{ + namespace Net + { + + bool NetManager::initSystem(const SettingBase* setting) + { + #ifdef _WIN32 + #if LIBJIN_NET_TEKCOS + tk_init(); + #endif + #endif + return true; + } + + void NetManager::quitSystem() + { + + } + + } // namespace Net +} // namespace JinEngine
\ No newline at end of file diff --git a/src/libjin/Net/je_net.h b/src/libjin/Net/je_net_manager.h index 6ed018a..31c4d04 100644 --- a/src/libjin/Net/je_net.h +++ b/src/libjin/Net/je_net_manager.h @@ -7,26 +7,26 @@ #include "je_socket.h" -namespace jin +namespace JinEngine { - namespace net + namespace Net { - class Net : public Subsystem<Net> + class NetManager : public Subsystem<NetManager> { public: protected: - singleton(Net); - Net() {}; - ~Net() {}; + singleton(NetManager); + NetManager() {}; + ~NetManager() {}; bool initSystem(const SettingBase* setting) override; void quitSystem() override; }; - } // namespace net -} // namespace jin + } // namespace Net +} // namespace JinEngine #endif // LIBJIN_MODULES_NET #endif // __JE_NET_H diff --git a/src/libjin/Net/je_socket.cpp b/src/libjin/Net/je_socket.cpp index 3a8be7f..0137df2 100644 --- a/src/libjin/Net/je_socket.cpp +++ b/src/libjin/Net/je_socket.cpp @@ -1,8 +1,8 @@ #include "je_socket.h" -namespace jin +namespace JinEngine { - namespace net + namespace Net { Socket::Socket(const Socket& socket) : handle(socket.handle) @@ -186,5 +186,5 @@ namespace jin } } - } // namespace net -} // namespace jin
\ No newline at end of file + } // namespace Net +} // namespace JinEngine
\ No newline at end of file diff --git a/src/libjin/Net/je_socket.h b/src/libjin/Net/je_socket.h index e360d72..5a31683 100644 --- a/src/libjin/Net/je_socket.h +++ b/src/libjin/Net/je_socket.h @@ -5,9 +5,9 @@ #include "../3rdparty/tekcos/tekcos.h" -namespace jin +namespace JinEngine { - namespace net + namespace Net { enum SocketType @@ -55,8 +55,8 @@ namespace jin }; - } // namespace net -} // namespace jin + } // namespace Net +} // namespace JinEngine #endif // LIBJIN_MODULES_NET #endif // __JE_NET_SOCKET_H diff --git a/src/libjin/Thread/je_thread.cpp b/src/libjin/Thread/je_thread.cpp index 6bf6f46..3c18657 100644 --- a/src/libjin/Thread/je_thread.cpp +++ b/src/libjin/Thread/je_thread.cpp @@ -3,9 +3,9 @@ #include "je_thread.h" -namespace jin +namespace JinEngine { - namespace thread + namespace MultiThread { class Mutex @@ -295,7 +295,7 @@ namespace jin unlock(); } - } // namespace thread -} // namespace jin + } // namespace MultiThread +} // namespace JinEngine #endif // LIBJIN_MODULES_THREAD
\ No newline at end of file diff --git a/src/libjin/Thread/je_thread.h b/src/libjin/Thread/je_thread.h index ddba541..b39e4e2 100644 --- a/src/libjin/Thread/je_thread.h +++ b/src/libjin/Thread/je_thread.h @@ -13,9 +13,9 @@ #include <condition_variable> #endif -namespace jin +namespace JinEngine { - namespace thread + namespace MultiThread { /** * ӢӢMutual exclusionд Mutexһڶ̱߳Уֹ߳ͬʱͬһԴ @@ -159,8 +159,8 @@ namespace jin }; - } // namespace thread -} // namespace jin + } // namespace MultiThread +} // namespace JinEngine #endif // LIBJIN_MODULES_THREAD #endif // __JE_THREAD_H
\ No newline at end of file diff --git a/src/libjin/Time/je_timer.cpp b/src/libjin/Time/je_timer.cpp index ac66de1..6e8350b 100644 --- a/src/libjin/Time/je_timer.cpp +++ b/src/libjin/Time/je_timer.cpp @@ -3,9 +3,9 @@ #include "je_timer.h" -namespace jin +namespace JinEngine { - namespace time + namespace Time { @@ -94,7 +94,7 @@ namespace jin return true; } - } // namespace time -} // namespace jin + } // namespace Time +} // namespace JinEngine #endif // LIBJIN_MODULES_TIME diff --git a/src/libjin/Time/je_timer.h b/src/libjin/Time/je_timer.h index 12d3101..e5488cc 100644 --- a/src/libjin/Time/je_timer.h +++ b/src/libjin/Time/je_timer.h @@ -6,9 +6,9 @@ #include <vector> #include "SDL2/SDL.h" -namespace jin +namespace JinEngine { - namespace time + namespace Time { class Timers @@ -70,8 +70,8 @@ namespace jin #endif } - } // namespace time -} // namespace jin + } // namespace Time +} // namespace JinEngine #endif // LIBJIN_MODULES_TIME #endif // __JE_TIMER_H diff --git a/src/libjin/Utils/je_unittest.cpp b/src/libjin/Utils/je_unittest.cpp index 65dbaad..294351b 100644 --- a/src/libjin/Utils/je_unittest.cpp +++ b/src/libjin/Utils/je_unittest.cpp @@ -7,7 +7,7 @@ #include "../audio/sdl/source.h" #include "../audio/sdl/audio.h" -using namespace jin::audio; +using namespace JinEngine::audio; using namespace std; int main(int argc, char* argv[]) diff --git a/src/libjin/core/je_types.h b/src/libjin/core/je_types.h index 3c902cc..5fd6c12 100644 --- a/src/libjin/core/je_types.h +++ b/src/libjin/core/je_types.h @@ -3,9 +3,9 @@ #include <stdint.h> -namespace jin +namespace JinEngine { - namespace core + namespace Core { typedef int8_t int8; ///< Signed integer with a size of 8 bits. Supports values from -128 to 127 diff --git a/src/libjin/jin.h b/src/libjin/jin.h index ad328d4..443fbed 100644 --- a/src/libjin/jin.h +++ b/src/libjin/jin.h @@ -8,10 +8,10 @@ #include "audio/sdl/je_sdl_audio.h" #endif // LIBJIN_MODULES_AUDIO && LIBJIN_AUDIO_SDLAUDIO #include "game/je_game.h" -#include "filesystem/je_filesystem.h" +#include "filesystem/je_asset_database.h" #include "filesystem/je_buffer.h" #include "input/je_input.h" -#include "net/je_net.h" +#include "net/je_net_manager.h" #include "graphics/je_graphics.h" #include "time/je_timer.h" #include "thread/je_thread.h" diff --git a/src/lua/main.cpp b/src/lua/main.cpp index f7a5c06..1010b47 100644 --- a/src/lua/main.cpp +++ b/src/lua/main.cpp @@ -9,7 +9,7 @@ #include <Windows.h> using namespace jin::lua; -using namespace jin::filesystem; +using namespace JinEngine::Filesystem; int main(int argc, char* argv[]) { 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) { diff --git a/src/lua/resources/font.ttf.h b/src/lua/resources/font.ttf.h index 00fdaca..419adc5 100644 --- a/src/lua/resources/font.ttf.h +++ b/src/lua/resources/font.ttf.h @@ -328,4 +328,4 @@ static const char* default_charset = R"( abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLM #include "libjin/jin.h" -static const jin::graphics::Color default_font_split(255, 0, 255, 255); +static const JinEngine::Graphics::Color default_font_split(255, 0, 255, 255); |