Add extra hud defines (#409)

* Added extra HUD defines

* moved the defines to hud.h
This commit is contained in:
Reonu
2022-06-28 03:17:44 +01:00
committed by GitHub
parent aa1a48afeb
commit 1012fb7957
2 changed files with 16 additions and 12 deletions

View File

@@ -26,11 +26,6 @@
* cannon reticle, and the unused keys.
**/
#define HUD_POWER_METER_X 140
#define HUD_POWER_METER_EMPHASIZED_Y 166
#define HUD_POWER_METER_Y 200
#define HUD_POWER_METER_HIDDEN_Y 300
#ifdef BREATH_METER
// #ifdef DISABLE_LIVES
// #define HUD_BREATH_METER_X 64
@@ -395,7 +390,6 @@ void render_hud_breath_meter(void) {
}
#endif
#define HUD_TOP_Y 209
/**
* Renders the amount of lives Mario has.
@@ -422,13 +416,11 @@ void render_debug_mode(void) {
* Renders the amount of coins collected.
*/
void render_hud_coins(void) {
print_text(168, HUD_TOP_Y, "$"); // 'Coin' glyph
print_text(184, HUD_TOP_Y, "*"); // 'X' glyph
print_text_fmt_int(198, HUD_TOP_Y, "%d", gHudDisplay.coins);
print_text(HUD_COINS_X, HUD_TOP_Y, "$"); // 'Coin' glyph
print_text((HUD_COINS_X + 16), HUD_TOP_Y, "*"); // 'X' glyph
print_text_fmt_int((HUD_COINS_X + 30), HUD_TOP_Y, "%d", gHudDisplay.coins);
}
#define HUD_STARS_X 78
/**
* Renders the amount of stars collected.
* Disables "X" glyph when Mario has 100 stars or more.
@@ -498,7 +490,7 @@ void set_hud_camera_status(s16 status) {
*/
void render_hud_camera_status(void) {
Texture *(*cameraLUT)[6] = segmented_to_virtual(&main_hud_camera_lut);
s32 x = GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(54);
s32 x = GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_CAMERA_X);
s32 y = 205;
if (sCameraHUD.status == CAM_STATUS_NONE) {

View File

@@ -4,6 +4,18 @@
#include <PR/ultratypes.h>
#include <PR/gbi.h>
#define HUD_POWER_METER_X 140
#define HUD_POWER_METER_EMPHASIZED_Y 166
#define HUD_POWER_METER_Y 200
#define HUD_POWER_METER_HIDDEN_Y 300
#define HUD_TOP_Y 209
#define HUD_BOTTOM_Y 19 // Same height as the Lakitu icon
#define HUD_COINS_X 168
#define HUD_STARS_X 78 // This starts counting from the right edge
#define HUD_CAMERA_X 54 // This starts counting from the right edge
enum PowerMeterAnimation {
POWER_METER_HIDDEN,
POWER_METER_EMPHASIZED,