-updated tests:

*updated build scripts
 *removed tls variables from code (needed to support WebAssembly)
 *some mmutils tweaks
 *some fixes
 *pthread TLS thread ID implementation
-added Atomic file (reimplementation of atomics templates for emscripten)
-added emscripten support to ecs.std
This commit is contained in:
Mergul 2019-11-25 20:06:16 +00:00
parent 46de0f6adb
commit 946fbf2934
18 changed files with 443 additions and 229 deletions

View file

@ -160,14 +160,14 @@ struct CleanSystem
void mainLoop(void* arg)
{
static double time = 0;
__gshared double time = 0;
launcher.delta_time = launcher.getTime() - time;
time = launcher.getTime();
if(launcher.delta_time > 1000)launcher.delta_time = 1000;
static uint temp_fps = 0;
static double fps_time = 0;
__gshared uint temp_fps = 0;
__gshared double fps_time = 0;
temp_fps++;
fps_time += launcher.delta_time;
while(fps_time > 1000)
@ -295,7 +295,7 @@ void mainLoop(void* arg)
{
launcher.setStyle(2);
}
else if(igMenuItemBool("Super",null,launcher.style == 3,true))
else if(igMenuItemBool("Default",null,launcher.style == 3,true))
{
launcher.setStyle(3);
}
@ -466,8 +466,8 @@ void mainLoop(void* arg)
launcher.renderer.present();
draw_time = launcher.getTime() - draw_time;
static float plot_time = 0;
static uint plot_samples = 0;
__gshared float plot_time = 0;
__gshared uint plot_samples = 0;
plot_time += launcher.delta_time;
plot_samples++;
launcher.plot_values[100].delta_time += launcher.delta_time;
@ -602,14 +602,15 @@ int main(int argc, char** argv)
setStyle(3);
launcher.job_updater = Mallocator.make!ECSJobUpdater(8);
launcher.job_updater = Mallocator.make!ECSJobUpdater(12);
//launcher.job_updater.onCreate();
EntityManager.initialize(8);
EntityManager.initialize(12);
launcher.manager = EntityManager.instance;
launcher.manager.m_thread_id_func = &launcher.job_updater.getThreadID;
launcher.manager.setJobDispachFunc(&launcher.job_updater.dispatch);
//launcher.manager.m_thread_id_func = &launcher.job_updater.getThreadID;
//launcher.manager.setJobDispachFunc(&launcher.job_updater.dispatch);
launcher.manager.setMultithreadingCallbacks(&launcher.job_updater.dispatch, &launcher.job_updater.getThreadID);
launcher.manager.beginRegister();
@ -645,7 +646,7 @@ int main(int argc, char** argv)
//int result = emscripten_request_fullscreen_strategy(null, true, &strategy);
//emscripten_enter_soft_fullscreen(null, &strategy);
//printf("Fullscreen request: %s.\n", emscripten_result_to_string(result));
emscripten_set_main_loop_arg(&mainLoop, null, -1, 1);
emscripten_set_main_loop_arg(&mainLoop, null, 0, 1);
}
else
{