diff --git a/libfxengine.a b/libfxengine.a index 4c76cfa..a7e0268 100644 Binary files a/libfxengine.a and b/libfxengine.a differ diff --git a/src/fxengine.c b/src/fxengine.c index c72723d..d111c08 100644 --- a/src/fxengine.c +++ b/src/fxengine.c @@ -1,24 +1,36 @@ #define GINT_NEED_VRAM + #include #include #include -#ifdef USE_LIBPROF -#include -#endif #include #include #include #include #include +#ifdef USE_LIBLOG +#include +#endif + // FPS count #ifdef USE_LIBPROF + +#include + static uint32_t frame_interval_min=1000000; + static uint32_t frame_interval_max=1; + static uint32_t fps=0; -#endif + uint32_t fe_get_fps() -{return fps;} +{ + return fps; +} + +#endif + // Triple buffering #define BUFFER_SIZE 256 @@ -36,7 +48,6 @@ static void check_vram() void fe_callback_start() { vram=gint_vram; - memcpy(gint_vram, temp_buffers[1-working_buffer], sizeof(uint32_t)*BUFFER_SIZE); } void fe_callback_end() @@ -60,16 +71,36 @@ static volatile bool quit=true; void fe_load() { + #ifdef USE_LIBLOG + ll_send("fxEngine loader :\n"); + #endif check_vram(); + #ifdef USE_LIBLOG + ll_send(">> Got vram\n"); + #endif + fe_callback_end(); + #ifdef USE_LIBLOG + ll_send(">> Started triple \n buffering\n"); + #endif + quit=false; + #ifdef USE_LIBLOG + ll_send("run fxEng. thread\n"); + #endif while (1) { fe_clear_zbuffer(); fe_render(); + #ifdef USE_LIBLOG + ll_send("Frame rendered.\n"); + #endif switch_frame(); if (quit) break; } + #ifdef USE_LIBLOG + ll_send("ended fxEngine.\n"); + #endif // Free some malloc //// as object list }