Merge pull request #205 from porcino/nightly

Option to hide the hud
This commit is contained in:
zerocloude 2020-05-19 23:46:19 +09:00 committed by GitHub
commit f1698b9081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 6 deletions

View File

@ -30,6 +30,7 @@
#define TEXT_OPT_VSYNC _("Vertical Sync") #define TEXT_OPT_VSYNC _("Vertical Sync")
#define TEXT_OPT_DOUBLE _("Double") #define TEXT_OPT_DOUBLE _("Double")
#define TEXT_RESET_WINDOW _("Reset Window") #define TEXT_RESET_WINDOW _("Reset Window")
#define TEXT_OPT_HUD _("HUD")
#define TEXT_OPT_UNBOUND _("NONE") #define TEXT_OPT_UNBOUND _("NONE")
#define TEXT_OPT_PRESSKEY _("...") #define TEXT_OPT_PRESSKEY _("...")

View File

@ -1,4 +1,5 @@
#include <ultra64.h> #include <ultra64.h>
#include <stdbool.h>
#include "sm64.h" #include "sm64.h"
#include "gfx_dimensions.h" #include "gfx_dimensions.h"
@ -56,6 +57,7 @@ static struct UnusedHUDStruct sUnusedHUDValues = { 0x00, 0x0A, 0x00 };
static struct CameraHUD sCameraHUD = { CAM_STATUS_NONE }; static struct CameraHUD sCameraHUD = { CAM_STATUS_NONE };
extern bool configHUD;
/** /**
* Renders a rgba16 16x16 glyph texture from a table list. * Renders a rgba16 16x16 glyph texture from a table list.
*/ */
@ -450,28 +452,28 @@ void render_hud(void) {
render_hud_cannon_reticle(); render_hud_cannon_reticle();
} }
if (hudDisplayFlags & HUD_DISPLAY_FLAG_LIVES) { if (hudDisplayFlags & HUD_DISPLAY_FLAG_LIVES && configHUD) {
render_hud_mario_lives(); render_hud_mario_lives();
} }
if (hudDisplayFlags & HUD_DISPLAY_FLAG_COIN_COUNT) { if (hudDisplayFlags & HUD_DISPLAY_FLAG_COIN_COUNT && configHUD) {
render_hud_coins(); render_hud_coins();
} }
if (hudDisplayFlags & HUD_DISPLAY_FLAG_STAR_COUNT) { if (hudDisplayFlags & HUD_DISPLAY_FLAG_STAR_COUNT && configHUD) {
render_hud_stars(); render_hud_stars();
} }
if (hudDisplayFlags & HUD_DISPLAY_FLAG_KEYS) { if (hudDisplayFlags & HUD_DISPLAY_FLAG_KEYS && configHUD) {
render_hud_keys(); render_hud_keys();
} }
if (hudDisplayFlags & HUD_DISPLAY_FLAG_CAMERA_AND_POWER) { if (hudDisplayFlags & HUD_DISPLAY_FLAG_CAMERA_AND_POWER && configHUD) {
render_hud_power_meter(); render_hud_power_meter();
render_hud_camera_status(); render_hud_camera_status();
} }
if (hudDisplayFlags & HUD_DISPLAY_FLAG_TIMER) { if (hudDisplayFlags & HUD_DISPLAY_FLAG_TIMER && configHUD) {
render_hud_timer(); render_hud_timer();
} }
} }

View File

@ -76,6 +76,7 @@ static const u8 optsVideoStr[][32] = {
{ TEXT_RESET_WINDOW }, { TEXT_RESET_WINDOW },
{ TEXT_OPT_VSYNC }, { TEXT_OPT_VSYNC },
{ TEXT_OPT_DOUBLE }, { TEXT_OPT_DOUBLE },
{ TEXT_OPT_HUD },
}; };
static const u8 optsAudioStr[][32] = { static const u8 optsAudioStr[][32] = {
@ -236,6 +237,7 @@ static struct Option optsVideo[] = {
DEF_OPT_CHOICE( optsVideoStr[5], &configWindow.vsync, vsyncChoices ), DEF_OPT_CHOICE( optsVideoStr[5], &configWindow.vsync, vsyncChoices ),
DEF_OPT_CHOICE( optsVideoStr[1], &configFiltering, filterChoices ), DEF_OPT_CHOICE( optsVideoStr[1], &configFiltering, filterChoices ),
DEF_OPT_BUTTON( optsVideoStr[4], optvideo_reset_window ), DEF_OPT_BUTTON( optsVideoStr[4], optvideo_reset_window ),
DEF_OPT_TOGGLE( optsVideoStr[7], &configHUD ),
}; };
static struct Option optsAudio[] = { static struct Option optsAudio[] = {

View File

@ -78,6 +78,7 @@ bool configEnableCamera = false;
bool configCameraMouse = false; bool configCameraMouse = false;
#endif #endif
unsigned int configSkipIntro = 0; unsigned int configSkipIntro = 0;
bool configHUD = true;
static const struct ConfigOption options[] = { static const struct ConfigOption options[] = {
{.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen}, {.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen},

View File

@ -46,6 +46,7 @@ extern bool configCameraInvertY;
extern bool configEnableCamera; extern bool configEnableCamera;
extern bool configCameraMouse; extern bool configCameraMouse;
#endif #endif
extern bool configHUD;
void configfile_load(const char *filename); void configfile_load(const char *filename);
void configfile_save(const char *filename); void configfile_save(const char *filename);