before anim rewrite
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#include "internal/engine_internal.h"
|
||||
#include "internal/util/error.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
bool
|
||||
engine_sdl_init_state(
|
||||
engine_sdl_state_t **state,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
void
|
||||
anim_rect_pos(
|
||||
framebuffer_e framebuffer,
|
||||
uint32_t x0,
|
||||
uint32_t y0,
|
||||
uint32_t x1,
|
||||
@@ -10,13 +11,28 @@ anim_rect_pos(
|
||||
uint32_t h,
|
||||
uint32_t color
|
||||
) {
|
||||
// TODO: I THINK I NEED LAYERED BUFFERS
|
||||
// there's nowhere to move
|
||||
if (x0 == x1 && y0 == y1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// one step is one pixel
|
||||
uint32_t stepsx = x1 - x0;
|
||||
uint32_t stepsy = y1 - y0;
|
||||
uint32_t dirx = (x1 - x0 > 0) ? 1 : -1;
|
||||
uint32_t diry = (y1 - y0 > 0) ? 1 : -1;
|
||||
|
||||
if (x0 == x1) {
|
||||
dirx = 0;
|
||||
}
|
||||
|
||||
if (y0 == y1) {
|
||||
diry = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. get the row / column in the direction of the movement
|
||||
* 1. shift the rectangle by one pixel in the direction of movement
|
||||
* 2. remove the trailing row / column left
|
||||
*/
|
||||
|
||||
if (true) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user