#include "client/pch.hh" #include "client/world/voxel_anims.hh" #include "core/config/number.hh" #include "core/io/config_map.hh" #include "core/math/constexpr.hh" #include "client/globals.hh" static config::Unsigned base_framerate(16U, 1U, 16U); std::uint64_t voxel_anims::nextframe = 0U; std::uint32_t voxel_anims::frame = 0U; void voxel_anims::init(void) { globals::client_config.add_value("voxel_anims.base_framerate", base_framerate); voxel_anims::nextframe = 0U; voxel_anims::frame = 0U; } void voxel_anims::update(void) { if(globals::curtime >= voxel_anims::nextframe) { voxel_anims::nextframe = globals::curtime + static_cast(1000000.0 / static_cast(base_framerate.get_value())); voxel_anims::frame += 1U; } }