diff --git a/doc/samples/btphystest.cpp b/doc/samples/btphystest.cpp index 0f5ce39b..43f8f0fd 100644 --- a/doc/samples/btphystest.cpp +++ b/doc/samples/btphystest.cpp @@ -760,7 +760,7 @@ void CatShaderData::SetupShaderDatas(mat4 const &model) int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("BtPhysTest", ivec2(1280, 960), 60.0f); diff --git a/doc/samples/meshviewer/meshviewer.cpp b/doc/samples/meshviewer/meshviewer.cpp index f90cba87..6db6cfdb 100644 --- a/doc/samples/meshviewer/meshviewer.cpp +++ b/doc/samples/meshviewer/meshviewer.cpp @@ -395,7 +395,7 @@ void MeshViewer::TickDraw(float seconds, Scene &scene) //The basic main -------------------------------------------------------------- int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("MeshViewer", ivec2((int)DEFAULT_WIDTH, (int)DEFAULT_HEIGHT), 60.0f); if (argc > 1) diff --git a/doc/samples/nacl_phystest.cpp b/doc/samples/nacl_phystest.cpp index 946b74f3..ded95181 100644 --- a/doc/samples/nacl_phystest.cpp +++ b/doc/samples/nacl_phystest.cpp @@ -112,7 +112,7 @@ Nacl_PhysTest::~Nacl_PhysTest() int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Nacl_PhysTest", ivec2(1280, 960), 60.0f); diff --git a/doc/tutorial/01_triangle.cpp b/doc/tutorial/01_triangle.cpp index a03f8929..6c637d44 100644 --- a/doc/tutorial/01_triangle.cpp +++ b/doc/tutorial/01_triangle.cpp @@ -71,7 +71,7 @@ private: int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 1: Triangle", ivec2(640, 480), 60.0f); diff --git a/doc/tutorial/02_cube.cpp b/doc/tutorial/02_cube.cpp index 347adedb..d795e8cb 100644 --- a/doc/tutorial/02_cube.cpp +++ b/doc/tutorial/02_cube.cpp @@ -134,7 +134,7 @@ private: int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 2: Cube", ivec2(640, 480), 60.0f); diff --git a/doc/tutorial/03_noise.cpp b/doc/tutorial/03_noise.cpp index ae058d09..4ed7b177 100644 --- a/doc/tutorial/03_noise.cpp +++ b/doc/tutorial/03_noise.cpp @@ -81,7 +81,7 @@ private: int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 3: Noise", ivec2(1280, 720), 60.0f); diff --git a/doc/tutorial/04_texture.cpp b/doc/tutorial/04_texture.cpp index af859502..ad61d54c 100644 --- a/doc/tutorial/04_texture.cpp +++ b/doc/tutorial/04_texture.cpp @@ -111,7 +111,7 @@ private: int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 4: Texture", ivec2(1280, 720), 60.0f); diff --git a/doc/tutorial/05_easymesh.cpp b/doc/tutorial/05_easymesh.cpp index 44986f7b..1b09c35e 100644 --- a/doc/tutorial/05_easymesh.cpp +++ b/doc/tutorial/05_easymesh.cpp @@ -165,7 +165,7 @@ private: int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 5: EasyMesh", ivec2(960, 600), 60.0f); new EasyMeshTutorial(); diff --git a/doc/tutorial/06_sprite.cpp b/doc/tutorial/06_sprite.cpp index 695fcf5a..fbfd4a55 100644 --- a/doc/tutorial/06_sprite.cpp +++ b/doc/tutorial/06_sprite.cpp @@ -98,7 +98,7 @@ private: int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 6: Sprite", ivec2(640, 480), 60.0f); new SpriteTutorial(); diff --git a/doc/tutorial/07_input.cpp b/doc/tutorial/07_input.cpp index 5e810a45..82e8f09e 100644 --- a/doc/tutorial/07_input.cpp +++ b/doc/tutorial/07_input.cpp @@ -253,7 +253,7 @@ private: int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 7: Input", ivec2(640, 480), 60.0f); diff --git a/doc/tutorial/08_fbo.cpp b/doc/tutorial/08_fbo.cpp index 75fd45f0..a9dee87b 100644 --- a/doc/tutorial/08_fbo.cpp +++ b/doc/tutorial/08_fbo.cpp @@ -131,7 +131,7 @@ private: int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 08: Framebuffer Object", ivec2(512, 512), 60.0f); diff --git a/doc/tutorial/11_fractal.cpp b/doc/tutorial/11_fractal.cpp index 13e4cc16..1002f9fc 100644 --- a/doc/tutorial/11_fractal.cpp +++ b/doc/tutorial/11_fractal.cpp @@ -547,7 +547,7 @@ int main(int argc, char **argv) { ivec2 window_size(640, 480); - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 3: Fractal", window_size, 60.0f); new DebugFps(5, 5); diff --git a/doc/tutorial/12_voronoi.cpp b/doc/tutorial/12_voronoi.cpp index a16cf387..0a278ad1 100644 --- a/doc/tutorial/12_voronoi.cpp +++ b/doc/tutorial/12_voronoi.cpp @@ -404,7 +404,7 @@ private: int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 12: Jump Flooding Algorithm & Voronoi", ivec2(512, 512), 60.0f); diff --git a/doc/tutorial/13_shader_builder.cpp b/doc/tutorial/13_shader_builder.cpp index 3fb3108d..59912af5 100644 --- a/doc/tutorial/13_shader_builder.cpp +++ b/doc/tutorial/13_shader_builder.cpp @@ -122,7 +122,7 @@ public: int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 13: Shader Builder", ivec2(1280, 720), 60.0f); diff --git a/doc/tutorial/14_lol_lua.cpp b/doc/tutorial/14_lol_lua.cpp index 926bfad6..b9034cf7 100644 --- a/doc/tutorial/14_lol_lua.cpp +++ b/doc/tutorial/14_lol_lua.cpp @@ -193,7 +193,7 @@ public: //----------------------------------------------------------------------------- int main(int argc, char **argv) { - System::Init(argc, argv); + sys::init(argc, argv); Application app("Tutorial 14: Lolua Demo", ivec2(800, 600), 60.0f); diff --git a/src/image/codec/gdiplus-image.cpp b/src/image/codec/gdiplus-image.cpp index d263a105..d94b86f3 100644 --- a/src/image/codec/gdiplus-image.cpp +++ b/src/image/codec/gdiplus-image.cpp @@ -61,7 +61,7 @@ bool GdiPlusImageCodec::Load(Image *image, char const *path) return false; } - array pathlist = System::GetPathList(path); + array pathlist = sys::get_path_list(path); Gdiplus::Bitmap *bitmap = nullptr; for (auto fullpath : pathlist) { diff --git a/src/image/codec/imlib2-image.cpp b/src/image/codec/imlib2-image.cpp index 0e699a4e..674ae622 100644 --- a/src/image/codec/imlib2-image.cpp +++ b/src/image/codec/imlib2-image.cpp @@ -45,7 +45,7 @@ bool Imlib2ImageCodec::Load(Image *image, char const *path) { Imlib_Image im = nullptr; - for (auto candidate : System::GetPathList(path)) + for (auto candidate : sys::get_path_list(path)) { im = imlib_load_image(candidate.C()); if (im) diff --git a/src/image/codec/sdl-image.cpp b/src/image/codec/sdl-image.cpp index 6c7cbfbd..abdbc324 100644 --- a/src/image/codec/sdl-image.cpp +++ b/src/image/codec/sdl-image.cpp @@ -50,7 +50,7 @@ bool SdlImageCodec::Load(Image *image, char const *path) { SDL_Surface *surface = nullptr; - for (auto candidate : System::GetPathList(path)) + for (auto candidate : sys::get_path_list(path)) { surface = IMG_Load(candidate.C()); if (surface) diff --git a/src/lol/sys/init.h b/src/lol/sys/init.h index e5f975f1..8a444c19 100644 --- a/src/lol/sys/init.h +++ b/src/lol/sys/init.h @@ -42,18 +42,18 @@ namespace lol * not as clean as the rest of the framework. */ -namespace System +namespace sys { -extern void Init(int argc, char *argv[], +extern void init(int argc, char *argv[], String const &projectdir = LOL_CONFIG_PROJECTDIR, String const &solutiondir = LOL_CONFIG_SOLUTIONDIR, String const &sourcesubdir = LOL_CONFIG_SOURCESUBDIR); -extern void AddDataDir(String const &dir); -extern array GetPathList(String const &file); +extern void add_data_dir(String const &dir); +extern array get_path_list(String const &file); -} /* namespace System */ +} /* namespace sys */ } /* namespace lol */ diff --git a/src/lolua/baselua.cpp b/src/lolua/baselua.cpp index 223959d5..6021e46d 100644 --- a/src/lolua/baselua.cpp +++ b/src/lolua/baselua.cpp @@ -58,7 +58,7 @@ class LuaBaseData int status = LUA_ERRFILE; File f; - for (auto candidate : System::GetPathList(filename)) + for (auto candidate : sys::get_path_list(filename)) { f.Open(candidate, FileAccess::Read); if (f.IsValid()) diff --git a/src/sample.cpp b/src/sample.cpp index 9ae3a51b..3fba9277 100644 --- a/src/sample.cpp +++ b/src/sample.cpp @@ -58,7 +58,7 @@ Sample::Sample(char const *path) data->m_name = String(" ") + path; #if defined LOL_USE_SDL_MIXER - for (auto candidate : System::GetPathList(path)) + for (auto candidate : sys::get_path_list(path)) { data->m_chunk = Mix_LoadWAV(candidate.C()); if (data->m_chunk) diff --git a/src/sys/init.cpp b/src/sys/init.cpp index 037bdaa7..6600dbdd 100644 --- a/src/sys/init.cpp +++ b/src/sys/init.cpp @@ -27,7 +27,7 @@ namespace lol { -namespace System +namespace sys { #if _WIN32 @@ -38,7 +38,7 @@ namespace System static array data_dir; -void Init(int argc, char *argv[], +void init(int argc, char *argv[], String const &projectdir, String const &solutiondir, String const &sourcesubdir) @@ -95,20 +95,20 @@ void Init(int argc, char *argv[], String rootdir = binarydir; if (rootdir.count() && rootdir.last() != SEPARATOR) rootdir += SEPARATOR; - AddDataDir(rootdir); + add_data_dir(rootdir); /* This data dir is for engine stuff */ rootdir = solutiondir; if (rootdir.count() && rootdir.last() != SEPARATOR) rootdir += SEPARATOR; rootdir += "../src/"; /* FIXME: use SEPARATOR? */ - AddDataDir(rootdir); + add_data_dir(rootdir); /* This data dir is for project-specific stuff */ rootdir = projectdir; if (rootdir.count() && rootdir.last() != SEPARATOR) rootdir += SEPARATOR; - AddDataDir(rootdir); + add_data_dir(rootdir); got_rootdir = true; } @@ -132,11 +132,11 @@ void Init(int argc, char *argv[], rootdir += "../"; } rootdir += "src/"; - AddDataDir(rootdir); + add_data_dir(rootdir); /* This data dir is for project-specific stuff */ rootdir = binarydir; - AddDataDir(rootdir); + add_data_dir(rootdir); got_rootdir = true; } @@ -151,12 +151,12 @@ void Init(int argc, char *argv[], * Data directory handling */ -void AddDataDir(String const &dir) +void add_data_dir(String const &dir) { data_dir << dir; } -array GetPathList(String const &file) +array get_path_list(String const &file) { array ret; @@ -172,7 +172,7 @@ array GetPathList(String const &file) return ret; } -} /* namespace System */ +} /* namespace sys */ } /* namespace lol */ diff --git a/src/sys/threadtypes.cpp b/src/sys/threadtypes.cpp index 320b5557..fb729fc5 100644 --- a/src/sys/threadtypes.cpp +++ b/src/sys/threadtypes.cpp @@ -52,7 +52,7 @@ public: protected: virtual bool DoWork() { - array pathlist = System::GetPathList(m_path); + array pathlist = sys::get_path_list(m_path); File f; for (String path : pathlist) {