@@ -760,7 +760,7 @@ void CatShaderData::SetupShaderDatas(mat4 const &model) | |||||
int main(int argc, char **argv) | int main(int argc, char **argv) | ||||
{ | { | ||||
System::Init(argc, argv); | |||||
sys::init(argc, argv); | |||||
Application app("BtPhysTest", ivec2(1280, 960), 60.0f); | Application app("BtPhysTest", ivec2(1280, 960), 60.0f); | ||||
@@ -395,7 +395,7 @@ void MeshViewer::TickDraw(float seconds, Scene &scene) | |||||
//The basic main -------------------------------------------------------------- | //The basic main -------------------------------------------------------------- | ||||
int main(int argc, char **argv) | 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); | Application app("MeshViewer", ivec2((int)DEFAULT_WIDTH, (int)DEFAULT_HEIGHT), 60.0f); | ||||
if (argc > 1) | if (argc > 1) | ||||
@@ -112,7 +112,7 @@ Nacl_PhysTest::~Nacl_PhysTest() | |||||
int main(int argc, char **argv) | int main(int argc, char **argv) | ||||
{ | { | ||||
System::Init(argc, argv); | |||||
sys::init(argc, argv); | |||||
Application app("Nacl_PhysTest", ivec2(1280, 960), 60.0f); | Application app("Nacl_PhysTest", ivec2(1280, 960), 60.0f); | ||||
@@ -71,7 +71,7 @@ private: | |||||
int main(int argc, char **argv) | int main(int argc, char **argv) | ||||
{ | { | ||||
System::Init(argc, argv); | |||||
sys::init(argc, argv); | |||||
Application app("Tutorial 1: Triangle", ivec2(640, 480), 60.0f); | Application app("Tutorial 1: Triangle", ivec2(640, 480), 60.0f); | ||||
@@ -134,7 +134,7 @@ private: | |||||
int main(int argc, char **argv) | int main(int argc, char **argv) | ||||
{ | { | ||||
System::Init(argc, argv); | |||||
sys::init(argc, argv); | |||||
Application app("Tutorial 2: Cube", ivec2(640, 480), 60.0f); | Application app("Tutorial 2: Cube", ivec2(640, 480), 60.0f); | ||||
@@ -81,7 +81,7 @@ private: | |||||
int main(int argc, char **argv) | int main(int argc, char **argv) | ||||
{ | { | ||||
System::Init(argc, argv); | |||||
sys::init(argc, argv); | |||||
Application app("Tutorial 3: Noise", ivec2(1280, 720), 60.0f); | Application app("Tutorial 3: Noise", ivec2(1280, 720), 60.0f); | ||||
@@ -111,7 +111,7 @@ private: | |||||
int main(int argc, char **argv) | int main(int argc, char **argv) | ||||
{ | { | ||||
System::Init(argc, argv); | |||||
sys::init(argc, argv); | |||||
Application app("Tutorial 4: Texture", ivec2(1280, 720), 60.0f); | Application app("Tutorial 4: Texture", ivec2(1280, 720), 60.0f); | ||||
@@ -165,7 +165,7 @@ private: | |||||
int main(int argc, char **argv) | int main(int argc, char **argv) | ||||
{ | { | ||||
System::Init(argc, argv); | |||||
sys::init(argc, argv); | |||||
Application app("Tutorial 5: EasyMesh", ivec2(960, 600), 60.0f); | Application app("Tutorial 5: EasyMesh", ivec2(960, 600), 60.0f); | ||||
new EasyMeshTutorial(); | new EasyMeshTutorial(); | ||||
@@ -98,7 +98,7 @@ private: | |||||
int main(int argc, char **argv) | int main(int argc, char **argv) | ||||
{ | { | ||||
System::Init(argc, argv); | |||||
sys::init(argc, argv); | |||||
Application app("Tutorial 6: Sprite", ivec2(640, 480), 60.0f); | Application app("Tutorial 6: Sprite", ivec2(640, 480), 60.0f); | ||||
new SpriteTutorial(); | new SpriteTutorial(); | ||||
@@ -253,7 +253,7 @@ private: | |||||
int main(int argc, char **argv) | int main(int argc, char **argv) | ||||
{ | { | ||||
System::Init(argc, argv); | |||||
sys::init(argc, argv); | |||||
Application app("Tutorial 7: Input", ivec2(640, 480), 60.0f); | Application app("Tutorial 7: Input", ivec2(640, 480), 60.0f); | ||||
@@ -131,7 +131,7 @@ private: | |||||
int main(int argc, char **argv) | 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); | Application app("Tutorial 08: Framebuffer Object", ivec2(512, 512), 60.0f); | ||||
@@ -547,7 +547,7 @@ int main(int argc, char **argv) | |||||
{ | { | ||||
ivec2 window_size(640, 480); | ivec2 window_size(640, 480); | ||||
System::Init(argc, argv); | |||||
sys::init(argc, argv); | |||||
Application app("Tutorial 3: Fractal", window_size, 60.0f); | Application app("Tutorial 3: Fractal", window_size, 60.0f); | ||||
new DebugFps(5, 5); | new DebugFps(5, 5); | ||||
@@ -404,7 +404,7 @@ private: | |||||
int main(int argc, char **argv) | 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); | Application app("Tutorial 12: Jump Flooding Algorithm & Voronoi", ivec2(512, 512), 60.0f); | ||||
@@ -122,7 +122,7 @@ public: | |||||
int main(int argc, char **argv) | 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); | Application app("Tutorial 13: Shader Builder", ivec2(1280, 720), 60.0f); | ||||
@@ -193,7 +193,7 @@ public: | |||||
//----------------------------------------------------------------------------- | //----------------------------------------------------------------------------- | ||||
int main(int argc, char **argv) | 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); | Application app("Tutorial 14: Lolua Demo", ivec2(800, 600), 60.0f); | ||||
@@ -61,7 +61,7 @@ bool GdiPlusImageCodec::Load(Image *image, char const *path) | |||||
return false; | return false; | ||||
} | } | ||||
array<String> pathlist = System::GetPathList(path); | |||||
array<String> pathlist = sys::get_path_list(path); | |||||
Gdiplus::Bitmap *bitmap = nullptr; | Gdiplus::Bitmap *bitmap = nullptr; | ||||
for (auto fullpath : pathlist) | for (auto fullpath : pathlist) | ||||
{ | { | ||||
@@ -45,7 +45,7 @@ bool Imlib2ImageCodec::Load(Image *image, char const *path) | |||||
{ | { | ||||
Imlib_Image im = nullptr; | Imlib_Image im = nullptr; | ||||
for (auto candidate : System::GetPathList(path)) | |||||
for (auto candidate : sys::get_path_list(path)) | |||||
{ | { | ||||
im = imlib_load_image(candidate.C()); | im = imlib_load_image(candidate.C()); | ||||
if (im) | if (im) | ||||
@@ -50,7 +50,7 @@ bool SdlImageCodec::Load(Image *image, char const *path) | |||||
{ | { | ||||
SDL_Surface *surface = nullptr; | SDL_Surface *surface = nullptr; | ||||
for (auto candidate : System::GetPathList(path)) | |||||
for (auto candidate : sys::get_path_list(path)) | |||||
{ | { | ||||
surface = IMG_Load(candidate.C()); | surface = IMG_Load(candidate.C()); | ||||
if (surface) | if (surface) | ||||
@@ -42,18 +42,18 @@ namespace lol | |||||
* not as clean as the rest of the framework. | * 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 &projectdir = LOL_CONFIG_PROJECTDIR, | ||||
String const &solutiondir = LOL_CONFIG_SOLUTIONDIR, | String const &solutiondir = LOL_CONFIG_SOLUTIONDIR, | ||||
String const &sourcesubdir = LOL_CONFIG_SOURCESUBDIR); | String const &sourcesubdir = LOL_CONFIG_SOURCESUBDIR); | ||||
extern void AddDataDir(String const &dir); | |||||
extern array<String> GetPathList(String const &file); | |||||
extern void add_data_dir(String const &dir); | |||||
extern array<String> get_path_list(String const &file); | |||||
} /* namespace System */ | |||||
} /* namespace sys */ | |||||
} /* namespace lol */ | } /* namespace lol */ | ||||
@@ -58,7 +58,7 @@ class LuaBaseData | |||||
int status = LUA_ERRFILE; | int status = LUA_ERRFILE; | ||||
File f; | File f; | ||||
for (auto candidate : System::GetPathList(filename)) | |||||
for (auto candidate : sys::get_path_list(filename)) | |||||
{ | { | ||||
f.Open(candidate, FileAccess::Read); | f.Open(candidate, FileAccess::Read); | ||||
if (f.IsValid()) | if (f.IsValid()) | ||||
@@ -58,7 +58,7 @@ Sample::Sample(char const *path) | |||||
data->m_name = String("<sample> ") + path; | data->m_name = String("<sample> ") + path; | ||||
#if defined LOL_USE_SDL_MIXER | #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()); | data->m_chunk = Mix_LoadWAV(candidate.C()); | ||||
if (data->m_chunk) | if (data->m_chunk) | ||||
@@ -27,7 +27,7 @@ | |||||
namespace lol | namespace lol | ||||
{ | { | ||||
namespace System | |||||
namespace sys | |||||
{ | { | ||||
#if _WIN32 | #if _WIN32 | ||||
@@ -38,7 +38,7 @@ namespace System | |||||
static array<String> data_dir; | static array<String> data_dir; | ||||
void Init(int argc, char *argv[], | |||||
void init(int argc, char *argv[], | |||||
String const &projectdir, | String const &projectdir, | ||||
String const &solutiondir, | String const &solutiondir, | ||||
String const &sourcesubdir) | String const &sourcesubdir) | ||||
@@ -95,20 +95,20 @@ void Init(int argc, char *argv[], | |||||
String rootdir = binarydir; | String rootdir = binarydir; | ||||
if (rootdir.count() && rootdir.last() != SEPARATOR) | if (rootdir.count() && rootdir.last() != SEPARATOR) | ||||
rootdir += SEPARATOR; | rootdir += SEPARATOR; | ||||
AddDataDir(rootdir); | |||||
add_data_dir(rootdir); | |||||
/* This data dir is for engine stuff */ | /* This data dir is for engine stuff */ | ||||
rootdir = solutiondir; | rootdir = solutiondir; | ||||
if (rootdir.count() && rootdir.last() != SEPARATOR) | if (rootdir.count() && rootdir.last() != SEPARATOR) | ||||
rootdir += SEPARATOR; | rootdir += SEPARATOR; | ||||
rootdir += "../src/"; /* FIXME: use SEPARATOR? */ | rootdir += "../src/"; /* FIXME: use SEPARATOR? */ | ||||
AddDataDir(rootdir); | |||||
add_data_dir(rootdir); | |||||
/* This data dir is for project-specific stuff */ | /* This data dir is for project-specific stuff */ | ||||
rootdir = projectdir; | rootdir = projectdir; | ||||
if (rootdir.count() && rootdir.last() != SEPARATOR) | if (rootdir.count() && rootdir.last() != SEPARATOR) | ||||
rootdir += SEPARATOR; | rootdir += SEPARATOR; | ||||
AddDataDir(rootdir); | |||||
add_data_dir(rootdir); | |||||
got_rootdir = true; | got_rootdir = true; | ||||
} | } | ||||
@@ -132,11 +132,11 @@ void Init(int argc, char *argv[], | |||||
rootdir += "../"; | rootdir += "../"; | ||||
} | } | ||||
rootdir += "src/"; | rootdir += "src/"; | ||||
AddDataDir(rootdir); | |||||
add_data_dir(rootdir); | |||||
/* This data dir is for project-specific stuff */ | /* This data dir is for project-specific stuff */ | ||||
rootdir = binarydir; | rootdir = binarydir; | ||||
AddDataDir(rootdir); | |||||
add_data_dir(rootdir); | |||||
got_rootdir = true; | got_rootdir = true; | ||||
} | } | ||||
@@ -151,12 +151,12 @@ void Init(int argc, char *argv[], | |||||
* Data directory handling | * Data directory handling | ||||
*/ | */ | ||||
void AddDataDir(String const &dir) | |||||
void add_data_dir(String const &dir) | |||||
{ | { | ||||
data_dir << dir; | data_dir << dir; | ||||
} | } | ||||
array<String> GetPathList(String const &file) | |||||
array<String> get_path_list(String const &file) | |||||
{ | { | ||||
array<String> ret; | array<String> ret; | ||||
@@ -172,7 +172,7 @@ array<String> GetPathList(String const &file) | |||||
return ret; | return ret; | ||||
} | } | ||||
} /* namespace System */ | |||||
} /* namespace sys */ | |||||
} /* namespace lol */ | } /* namespace lol */ | ||||
@@ -52,7 +52,7 @@ public: | |||||
protected: | protected: | ||||
virtual bool DoWork() | virtual bool DoWork() | ||||
{ | { | ||||
array<String> pathlist = System::GetPathList(m_path); | |||||
array<String> pathlist = sys::get_path_list(m_path); | |||||
File f; | File f; | ||||
for (String path : pathlist) | for (String path : pathlist) | ||||
{ | { | ||||