Skip to content

Commit

Permalink
#144 fix mismatching returntypes for get/set target_fps
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Jan 29, 2020
1 parent cfbf877 commit 342e364
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/flecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions include/flecs/flecs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
12 changes: 7 additions & 5 deletions src/world.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

0 comments on commit 342e364

Please sign in to comment.