Compare commits

..

No commits in common. "b63a67eb84262ea6e9883089cfc622d0a67f74cf" and "af462380762093bee9e471799c7ce31732a4b248" have entirely different histories.

5 changed files with 7 additions and 13 deletions

View File

@ -62,7 +62,7 @@ inline int display_init(void)
return EXIT_FAILURE;
}
if(!SDL_SetDefaultTextureScaleMode(renderer, SDL_SCALEMODE_NEAREST))
if(!SDL_SetDefaultTextureScaleMode(renderer, SDL_SCALEMODE_PIXELART))
{
error_printf("Failed to set default texture scale mode : %s", SDL_GetError());
return EXIT_FAILURE;
@ -133,12 +133,13 @@ inline void display_update(void)
#endif // DEBUG >= 1
}
int display_draw_texture(texture_t *texture, rect_t *src_rect, frect_t *dst_frect, bool flip)
int display_draw_texture(texture_t *texture, rect_t *src_rect, rect_t *dst_rect, bool flip)
{
frect_t src_frect;
frect_t src_frect, dst_frect;
rect_to_frect(src_rect, &src_frect);
rect_to_frect(dst_rect, &dst_frect);
if(!SDL_RenderTextureRotated(renderer, texture, &src_frect, dst_frect, 0, NULL, flip))
if(!SDL_RenderTextureRotated(renderer, texture, &src_frect, &dst_frect, 0, NULL, flip))
{
error_printf("Failed to copy texture to renderer : %s", SDL_GetError());
return EXIT_FAILURE;

View File

@ -91,7 +91,7 @@ component_t *entity_new_component(entity_t *entity, component_type_t component_t
if(component->component_init(component)) return NULL;
if(linked_list_push_front(&entity->components, component_elem)) return NULL;
if(linked_list_push_back(&entity->components, component_elem)) return NULL;
return component;
}

View File

@ -27,7 +27,7 @@ void display_exit(void);
int display_clear(void);
void display_update(void);
int display_draw_texture(texture_t *texture, rect_t *src_rect, frect_t *dst_frect, bool flip);
int display_draw_texture(texture_t *texture, rect_t *src_rect, rect_t *dst_rect, bool flip);
int display_draw_frect(frect_t *frect, unsigned int r, unsigned int g, unsigned int b, unsigned int a);
#endif // DISPLAY_H

View File

@ -131,6 +131,4 @@ void frect_to_rect(const frect_t *frect, rect_t *rect);
*/
#define intersect_frect(A, B, result) SDL_IntersectFRect(A, B, result)
float lerp(float a, float b, float t);
#endif // VECTOR2D_H

View File

@ -15,8 +15,3 @@ void frect_to_rect(const frect_t *frect, rect_t *rect)
rect->w = (int)frect->w;
rect->h = (int)frect->h;
}
float lerp(float a, float b, float t)
{
return a * (1 - t) + b * t;
}