very wonky movement implementation
This commit is contained in:
parent
d2155bf27e
commit
0fc07ac95e
6 changed files with 74 additions and 13 deletions
17
sdl.c
Normal file
17
sdl.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include <SDL3/SDL.h>
|
||||
|
||||
#include "dat.h"
|
||||
#include "fns.h"
|
||||
|
||||
int
|
||||
in_bounds(Image *i, int x, int y, SDL_Rect *bounds)
|
||||
{
|
||||
SDL_Rect r;
|
||||
SDL_Rect irect = { x, y, i->w, i->h };
|
||||
|
||||
if (SDL_GetRectUnion(&irect, bounds, &r) == false) {
|
||||
shit("rect union math fail: %s", SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
return SDL_RectsEqual(&irect, &r);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue