mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
character: Add DrawDebugCharacter
This commit is contained in:
parent
ac83b72899
commit
e536a8bc4f
2 changed files with 18 additions and 2 deletions
|
@ -791,12 +791,27 @@ SYMBOL_EXPORT void DrawCharacter(struct Game* game, struct Character* character)
|
|||
al_get_bitmap_width(character->frame->_priv.image) / character->spritesheet->scale, al_get_bitmap_height(character->frame->_priv.image) / character->spritesheet->scale,
|
||||
0);
|
||||
|
||||
/*al_hold_bitmap_drawing(false);
|
||||
al_use_transform(¤t);
|
||||
}
|
||||
|
||||
SYMBOL_EXPORT void DrawDebugCharacter(struct Game* game, struct Character* character) {
|
||||
if (!game->config.debug.enabled || !game->show_console || IsCharacterHidden(game, character)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ALLEGRO_TRANSFORM current = *al_get_current_transform();
|
||||
|
||||
ALLEGRO_TRANSFORM transform = GetCharacterTransform(game, character);
|
||||
al_compose_transform(&transform, ¤t);
|
||||
al_use_transform(&transform);
|
||||
|
||||
al_draw_rectangle(0, 0, character->spritesheet->width, character->spritesheet->height, al_map_rgb(0, 255, 255), 5);
|
||||
|
||||
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_map_rgb(255, 0, 255));
|
||||
|
||||
al_use_transform(¤t);
|
||||
}
|
||||
|
|
|
@ -148,6 +148,7 @@ ALLEGRO_TRANSFORM GetCharacterTransform(struct Game* game, struct Character* cha
|
|||
ALLEGRO_COLOR GetCharacterTint(struct Game* game, struct Character* character);
|
||||
|
||||
void DrawCharacter(struct Game* game, struct Character* character);
|
||||
void DrawDebugCharacter(struct Game* game, struct Character* character);
|
||||
|
||||
struct Character* CreateCharacter(struct Game* game, char* name);
|
||||
void DestroyCharacter(struct Game* game, struct Character* character);
|
||||
|
|
Loading…
Reference in a new issue