diff --git a/src/character.c b/src/character.c index 82962b6..83e7f22 100644 --- a/src/character.c +++ b/src/character.c @@ -472,6 +472,12 @@ SYMBOL_EXPORT void DrawCharacter(struct Game* game, struct Character* character) al_use_transform(&transform); al_draw_tinted_bitmap(character->frame->bitmap, character->tint, 0, 0, 0); + /* al_hold_bitmap_drawing(false); + al_draw_filled_rectangle(character->spritesheet->width * character->spritesheet->pivotX - 5, + character->spritesheet->height * character->spritesheet->pivotY - 5, + character->spritesheet->width * character->spritesheet->pivotX + 5, + character->spritesheet->height * character->spritesheet->pivotY + 5, + al_map_rgb(255, 255, 0));*/ al_use_transform(¤t); } diff --git a/src/utils.c b/src/utils.c index 074841d..47defef 100644 --- a/src/utils.c +++ b/src/utils.c @@ -121,6 +121,11 @@ SYMBOL_EXPORT void DrawCentered(ALLEGRO_BITMAP* bitmap, int x, int y, int flags) al_draw_bitmap(bitmap, x - al_get_bitmap_width(bitmap) / 2.0, y - al_get_bitmap_height(bitmap) / 2.0, flags); } +SYMBOL_EXPORT void DrawCenteredScaled(ALLEGRO_BITMAP* bitmap, int x, int y, double sx, double sy, int flags) { + al_draw_scaled_rotated_bitmap(bitmap, al_get_bitmap_width(bitmap) / 2.0, al_get_bitmap_height(bitmap) / 2.0, + x, y, sx, sy, 0, flags); +} + SYMBOL_EXPORT double DotProduct(const double v[], const double u[], int n) { float result = 0.0; for (int i = 0; i < n; i++) { diff --git a/src/utils.h b/src/utils.h index 872544d..d2a1e0b 100644 --- a/src/utils.h +++ b/src/utils.h @@ -53,6 +53,7 @@ int DrawWrappedText(ALLEGRO_FONT* font, ALLEGRO_COLOR color, float x, float y, i int DrawWrappedTextWithShadow(ALLEGRO_FONT* font, ALLEGRO_COLOR color, float x, float y, int width, int flags, char const* text); void DrawCentered(ALLEGRO_BITMAP* bitmap, int x, int y, int flags); +void DrawCenteredScaled(ALLEGRO_BITMAP* bitmap, int x, int y, double sx, double sy, int flags); double DotProduct(const double v[], const double u[], int n); double VectorLength(double x, double y, double z);