diff --git a/CMakeLists.txt b/CMakeLists.txt index a48cf7c..8ac93d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ set(ASSETS # HUD assets-cg/hud.png assets-cg/hud_life.png + assets-cg/hud_stars.png assets-cg/hud_window.png assets-cg/hud_xp.png assets-cg/skillicons.png diff --git a/assets-cg/fxconv-metadata.txt b/assets-cg/fxconv-metadata.txt index c18c6d3..5f2a435 100644 --- a/assets-cg/fxconv-metadata.txt +++ b/assets-cg/fxconv-metadata.txt @@ -3,15 +3,7 @@ name_regex: (.*)\.png img_\1 profile: p8 -hud.png: - profile: p4 -hud_life.png: - profile: p4 -hud_window.png: - profile: p4 -hud_xp.png: - profile: p4 -skillicons.png: +hud*.png: profile: p4 font_rogue.png: diff --git a/assets-cg/hud_stars.png b/assets-cg/hud_stars.png new file mode 100644 index 0000000..36339d9 Binary files /dev/null and b/assets-cg/hud_stars.png differ diff --git a/src/main.c b/src/main.c index 17bd805..96bfec5 100644 --- a/src/main.c +++ b/src/main.c @@ -191,9 +191,39 @@ int main(void) render_window(48, 24, 300, 154); extern font_t font_rogue; font_t const *old_font = dfont(&font_rogue); - dprint(54, 40, C_WHITE, "Player"); - dprint(54, 55, C_WHITE, "HP:%d ATK:%d MAG:%d DEF:%d", - player_f->HP_max, player_f->ATK, player_f->MAG, player_f->DEF); + anim_frame_render(62, 50, anims_player_Idle.start[RIGHT]); + dprint(74, 39, C_WHITE, "Rogue"); + dprint(60, 58, C_WHITE, "Level %d", player_data.xp_level); + dprint(60, 72, C_WHITE, "XP to next level: %d/%d", + player_data.xp_current, player_data.xp_to_next_level); + dprint(60, 93, C_WHITE, "HP"); + dprint(100, 93, C_WHITE, "%d/%d", player_f->HP, player_f->HP_max);; + dprint(60, 108, C_WHITE, "ATK"); + dprint(100, 108, C_WHITE, "%d", player_f->ATK); + dprint(60, 123, C_WHITE, "MAG"); + dprint(100, 123, C_WHITE, "%d", player_f->MAG); + dprint(60, 138, C_WHITE, "DEF"); + dprint(100, 138, C_WHITE, "%d", player_f->DEF); + + extern bopti_image_t img_hud_stars; + int w = img_hud_stars.width; + int h = img_hud_stars.height / 2; + dsubimage(182, 94, &img_hud_stars, 0, 0, w, h, DIMAGE_NONE); + dsubimage(182, 94, &img_hud_stars, 0, h+1, + w * player_data.stat_model.HP / fix(5.0), h, + DIMAGE_NONE); + dsubimage(182, 109, &img_hud_stars, 0, 0, w, h, DIMAGE_NONE); + dsubimage(182, 109, &img_hud_stars, 0, h+1, + w * player_data.stat_model.ATK / fix(5.0), h, + DIMAGE_NONE); + dsubimage(182, 124, &img_hud_stars, 0, 0, w, h, DIMAGE_NONE); + dsubimage(182, 124, &img_hud_stars, 0, h+1, + w * player_data.stat_model.MAG / fix(5.0), h, + DIMAGE_NONE); + dsubimage(182, 139, &img_hud_stars, 0, 0, w, h, DIMAGE_NONE); + dsubimage(182, 139, &img_hud_stars, 0, h+1, + w * player_data.stat_model.DEF / fix(5.0), h, + DIMAGE_NONE); dfont(old_font); } else if(menu_inventory_open) {