1
0
Fork 0

Updated hud controls a bit:

"h" toggles between day/night/off
"H" cycles through black/dark/medium/light intensities.
This commit is contained in:
curt 2000-05-15 17:47:50 +00:00
parent 9dc5c9ca22
commit ed973e8993
3 changed files with 97 additions and 88 deletions

View file

@ -957,76 +957,76 @@ int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ )
int global_day_night_switch = DAY; int global_day_night_switch = DAY;
void HUD_masterswitch( bool incr )
{
if ( current_options.get_hud_status() ) {
if ( global_day_night_switch == DAY ) {
global_day_night_switch = NIGHT;
} else {
current_options.set_hud_status( false );
}
} else {
current_options.set_hud_status( true );
global_day_night_switch = DAY;
}
}
void HUD_brightkey( bool incr_bright ) void HUD_brightkey( bool incr_bright )
{ {
instr_item *pHUDInstr = HUD_deque[0]; instr_item *pHUDInstr = HUD_deque[0];
int brightness = pHUDInstr->get_brightness(); int brightness = pHUDInstr->get_brightness();
if( current_options.get_hud_status() ) { if( current_options.get_hud_status() ) {
if( incr_bright ) { if( incr_bright ) {
switch (brightness) { switch (brightness)
case BRT_LIGHT: {
current_options.set_hud_status(0); case BRT_LIGHT:
break; brightness = BRT_BLACK;
break;
case BRT_MEDIUM: case BRT_MEDIUM:
brightness = BRT_LIGHT; brightness = BRT_LIGHT;
break; break;
case BRT_DARK: case BRT_DARK:
brightness = BRT_MEDIUM; brightness = BRT_MEDIUM;
break; break;
case BRT_BLACK: case BRT_BLACK:
brightness = BRT_DARK; brightness = BRT_DARK;
break; break;
default: default:
brightness = BRT_BLACK; brightness = BRT_BLACK;
} }
} } else {
else { switch (brightness)
switch (brightness) { {
case BRT_LIGHT: case BRT_LIGHT:
brightness = BRT_MEDIUM; brightness = BRT_MEDIUM;
break; break;
case BRT_MEDIUM: case BRT_MEDIUM:
brightness = BRT_DARK; brightness = BRT_DARK;
break; break;
case BRT_DARK: case BRT_DARK:
brightness = BRT_BLACK; brightness = BRT_BLACK;
break; break;
case BRT_BLACK: case BRT_BLACK:
default: brightness = BRT_LIGHT;
current_options.set_hud_status(0); break;
}
} default:
current_options.set_hud_status(0);
}
}
} else {
current_options.set_hud_status(true);
} }
else {
current_options.set_hud_status(1); pHUDInstr->SetBrightness( brightness );
if( incr_bright ) {
if( DAY == global_day_night_switch ) {
brightness = BRT_BLACK;
}
else {
brightness = BRT_DARK;
global_day_night_switch = DAY;
}
}
else {
if( NIGHT == global_day_night_switch ) {
brightness = BRT_DARK;
}
else {
brightness = BRT_MEDIUM;
global_day_night_switch = NIGHT;
}
}
}
pHUDInstr->SetBrightness( brightness );
} }
@ -1214,46 +1214,53 @@ void fgUpdateHUD( void ) {
} }
if( day_night_sw == DAY) { if( day_night_sw == DAY) {
switch (brightness) { switch (brightness)
case BRT_LIGHT: {
set_hud_color (0.1f, 0.9f, 0.1f); case BRT_LIGHT:
break; set_hud_color (0.1f, 0.9f, 0.1f);
break;
case BRT_MEDIUM: case BRT_MEDIUM:
set_hud_color (0.1f, 0.7f, 0.0f); set_hud_color (0.1f, 0.7f, 0.0f);
break; break;
case BRT_DARK: case BRT_DARK:
set_hud_color (0.0f, 0.6f, 0.0f); set_hud_color (0.0f, 0.6f, 0.0f);
break; break;
case BRT_BLACK: case BRT_BLACK:
set_hud_color( 0.0f, 0.0f, 0.0f); set_hud_color( 0.0f, 0.0f, 0.0f);
break; break;
default: default:
set_hud_color (0.1f, 0.9f, 0.1f); set_hud_color (0.1f, 0.9f, 0.1f);
} }
} } else {
else { if( day_night_sw == NIGHT) {
if( day_night_sw == NIGHT) { switch (brightness)
switch (brightness) { {
case BRT_LIGHT: case BRT_LIGHT:
set_hud_color (0.9f, 0.1f, 0.1f); set_hud_color (0.9f, 0.1f, 0.1f);
break; break;
case BRT_MEDIUM: case BRT_MEDIUM:
set_hud_color (0.7f, 0.0f, 0.1f); set_hud_color (0.7f, 0.0f, 0.1f);
break; break;
case BRT_DARK: case BRT_DARK:
default: set_hud_color (0.6f, 0.0f, 0.0f);
set_hud_color (0.6f, 0.0f, 0.0f); break;
}
} case BRT_BLACK:
else { // Just in case default set_hud_color( 0.0f, 0.0f, 0.0f);
set_hud_color (0.1f, 0.9f, 0.1f); break;
}
default:
set_hud_color (0.6f, 0.0f, 0.0f);
}
} else { // Just in case default
set_hud_color (0.1f, 0.9f, 0.1f);
}
} }
deque < instr_item * > :: iterator current = HUD_deque.begin(); deque < instr_item * > :: iterator current = HUD_deque.begin();

View file

@ -808,6 +808,7 @@ class HudLadder : public dual_instr_item {
//using namespace std; //using namespace std;
//deque <instr_item> * Hdeque_ptr; //deque <instr_item> * Hdeque_ptr;
extern void HUD_masterswitch( bool incr );
extern void HUD_brightkey( bool incr_bright ); extern void HUD_brightkey( bool incr_bright );
extern int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ ); extern int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ );
extern int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ ); extern int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ );

View file

@ -61,6 +61,7 @@
# include <Weather/weather.hxx> # include <Weather/weather.hxx>
#endif #endif
#include "bfi.hxx"
#include "keyboard.hxx" #include "keyboard.hxx"
#include "options.hxx" #include "options.hxx"
#include "save.hxx" #include "save.hxx"
@ -320,7 +321,7 @@ void GLUTkey(unsigned char k, int x, int y) {
controls.set_brake( FGControls::ALL_WHEELS, b_set); controls.set_brake( FGControls::ALL_WHEELS, b_set);
return; return;
case 104: // h key case 104: // h key
HUD_brightkey( false ); HUD_masterswitch( true );
return; return;
case 105: // i key case 105: // i key
fgHUDInit(&current_aircraft); // normal HUD fgHUDInit(&current_aircraft); // normal HUD