Fixed the tilemap loading and rendering. Added a bunch more error checking and tests. Fixed actors not rendering with their layers in the dist.

This commit is contained in:
2025-01-01 13:56:15 -05:00
parent e4d47b0be8
commit 01d75072b9
36 changed files with 1456 additions and 656 deletions

View File

@@ -18,8 +18,12 @@ typedef struct RectanglePoints {
#define COLLIDE_RECTANGLES(r1x, r1y, r1w, r1h, r2x, r2y, r2w, r2h) ((r1x < (r2x + r2w)) || ((r1x + r1w) > r2x)
ErrorContext *rectangle_points(RectanglePoints *dest, SDL_FRect *rect);
ErrorContext *collide_point_rectangle(point *p, RectanglePoints *r, bool *collide);
ErrorContext *collide_rectangles(SDL_FRect *r1, SDL_FRect *r2, bool *collide);
ErrorContext ERROR_NOIGNORE *rectangle_points(RectanglePoints *dest, SDL_FRect *rect);
ErrorContext ERROR_NOIGNORE *collide_point_rectangle(point *p, RectanglePoints *r, bool *collide);
ErrorContext ERROR_NOIGNORE *collide_rectangles(SDL_FRect *r1, SDL_FRect *r2, bool *collide);
// These are REALLY slow routines that are only useful in testing harnesses
ErrorContext ERROR_NOIGNORE *compare_sdl_surfaces(SDL_Surface *s1, SDL_Surface *s2);
ErrorContext ERROR_NOIGNORE *render_and_compare(SDL_Texture *t1, SDL_Texture *t2, int x, int y, int w, int h, char *writeout);
#endif // _UTIL_H_