From 342e3647f00c7c277217bc97a4dcbc0b79f23016 Mon Sep 17 00:00:00 2001 From: Sander Mertens Date: Wed, 29 Jan 2020 17:08:30 +0000 Subject: [PATCH] #144 fix mismatching returntypes for get/set target_fps --- include/flecs.h | 2 +- include/flecs/flecs.hpp | 4 ++-- src/world.c | 12 +++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/flecs.h b/include/flecs.h index e6debdc47..108db3fb9 100644 --- a/include/flecs.h +++ b/include/flecs.h @@ -494,7 +494,7 @@ void ecs_set_target_fps( * @param return The current target FPS. */ FLECS_EXPORT -uint32_t ecs_get_target_fps( +float ecs_get_target_fps( ecs_world_t *world); /** Get last delta time from world. diff --git a/include/flecs/flecs.hpp b/include/flecs/flecs.hpp index 020286c5e..1bc5fce53 100644 --- a/include/flecs/flecs.hpp +++ b/include/flecs/flecs.hpp @@ -362,11 +362,11 @@ class world final { } /* Time management */ - void set_target_fps(std::uint32_t target_fps) const { + void set_target_fps(float target_fps) const { ecs_set_target_fps(m_world, target_fps); } - std::uint32_t get_target_fps() const { + float get_target_fps() const { return ecs_get_target_fps(m_world); } diff --git a/src/world.c b/src/world.c index 85bac2e22..e47d26428 100644 --- a/src/world.c +++ b/src/world.c @@ -1384,6 +1384,13 @@ void ecs_set_target_fps( } } +float ecs_get_target_fps( + ecs_world_t *world) +{ + return world->target_fps; +} + + /* Mock types so we don't have to depend on them. * TODO: Need a better workaround */ typedef uint16_t EcsAdmin; @@ -1652,8 +1659,3 @@ uint32_t ecs_get_threads( return ecs_vector_count(world->worker_threads); } -uint32_t ecs_get_target_fps( - ecs_world_t *world) -{ - return world->target_fps; -}