Fixed the way scene updates, but it's still not connecting the ticks to the updates in animation.
This commit is contained in:
parent
32e9c65331
commit
0c798c9e0d
3 changed files with 4 additions and 13 deletions
11
scene.cpp
11
scene.cpp
|
|
@ -1,6 +1,5 @@
|
|||
#include "scene.hpp"
|
||||
#include "animate2.hpp"
|
||||
#include <ranges>
|
||||
#include "shaders.hpp"
|
||||
#include <fmt/core.h>
|
||||
#include "dbc.hpp"
|
||||
|
|
@ -132,6 +131,7 @@ namespace scene {
|
|||
inline void this_is_stupid_refactor(std::vector<Element>& elements) {
|
||||
for(auto& element : elements) {
|
||||
if(element.anim.playing) {
|
||||
auto [ticks, alpha] = element.anim.commit();
|
||||
element.anim.update();
|
||||
element.anim.motion(*element.st.sprite, element.pos, element.scale);
|
||||
element.anim.apply(*element.st.sprite);
|
||||
|
|
@ -140,7 +140,7 @@ namespace scene {
|
|||
}
|
||||
}
|
||||
|
||||
void Engine::play_animations() {
|
||||
void Engine::update() {
|
||||
this_is_stupid_refactor($fixtures);
|
||||
this_is_stupid_refactor($actors);
|
||||
}
|
||||
|
|
@ -187,11 +187,4 @@ namespace scene {
|
|||
void Engine::reset(sf::RenderTexture& view) {
|
||||
$camera.reset(view);
|
||||
}
|
||||
|
||||
void Engine::tick() {
|
||||
for(auto& actor : $actors) {
|
||||
dbc::log("IDIOT! you need to use the ticks to all update ticks number of times");
|
||||
auto [ticks, alpha] = actor.anim.commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue