Draw FPS on/off is now available in the menu

version upcount
This commit is contained in:
q3rally 2021-10-02 20:12:29 +00:00
parent ea090e6c3d
commit 651df8789c
4 changed files with 40 additions and 257 deletions

View file

@ -31,15 +31,6 @@ SYSTEM CONFIGURATION MENU
#include "ui_local.h"
// STONELANCE
/*
#define ART_FRAMEL "menu/art/frame2_l"
#define ART_FRAMER "menu/art/frame1_r"
#define ART_BACK0 "menu/art/back_0"
#define ART_BACK1 "menu/art/back_1"
*/
// END
#define ID_GRAPHICS 10
#define ID_DISPLAY 11
#define ID_SOUND 12
@ -52,31 +43,21 @@ typedef struct {
menuframework_s menu;
menutext_s banner;
// STONELANCE
/*
menubitmap_s framel;
menubitmap_s framer;
*/
// END
menutext_s graphics;
menutext_s display;
menutext_s sound;
menutext_s network;
// STONELANCE
// menubitmap_s back;
menutext_s back;
// END
} optionsmenu_t;
static optionsmenu_t s_options;
/*
=================
=============
Options_Event
=================
=============
*/
static void Options_Event( void* ptr, int event ) {
if( event != QM_ACTIVATED ) {
@ -108,25 +89,18 @@ static void Options_Event( void* ptr, int event ) {
/*
===============
==================
SystemConfig_Cache
===============
==================
*/
void SystemConfig_Cache( void ) {
// STONELANCE
/*
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
trap_R_RegisterShaderNoMip( ART_BACK0 );
trap_R_RegisterShaderNoMip( ART_BACK1 );
*/
// END
}
/*
===============
================
Options_MenuInit
===============
================
*/
void Options_MenuInit( void ) {
int y;
@ -153,26 +127,6 @@ void Options_MenuInit( void ) {
s_options.banner.color = color_white;
s_options.banner.style = UI_CENTER;
// STONELANCE
/*
s_options.framel.generic.type = MTYPE_BITMAP;
s_options.framel.generic.name = ART_FRAMEL;
s_options.framel.generic.flags = QMF_INACTIVE;
s_options.framel.generic.x = 8;
s_options.framel.generic.y = 76;
s_options.framel.width = 256;
s_options.framel.height = 334;
s_options.framer.generic.type = MTYPE_BITMAP;
s_options.framer.generic.name = ART_FRAMER;
s_options.framer.generic.flags = QMF_INACTIVE;
s_options.framer.generic.x = 376;
s_options.framer.generic.y = 76;
s_options.framer.width = 256;
s_options.framer.height = 334;
*/
// END
y = 168;
s_options.graphics.generic.type = MTYPE_PTEXT;
s_options.graphics.generic.flags = QMF_CENTER_JUSTIFY|QMF_PULSEIFFOCUS;
@ -181,10 +135,7 @@ void Options_MenuInit( void ) {
s_options.graphics.generic.x = 320;
s_options.graphics.generic.y = y;
s_options.graphics.string = "GRAPHICS";
// BAGPUSS
// s_options.graphics.color = color_red;
s_options.graphics.color = text_color_normal;
// END
s_options.graphics.style = UI_CENTER;
y += VERTICAL_SPACING;
@ -195,10 +146,7 @@ void Options_MenuInit( void ) {
s_options.display.generic.x = 320;
s_options.display.generic.y = y;
s_options.display.string = "DISPLAY";
// BAGPUSS
// s_options.display.color = color_red;
s_options.display.color = text_color_normal;
// END
s_options.display.style = UI_CENTER;
y += VERTICAL_SPACING;
@ -209,10 +157,7 @@ void Options_MenuInit( void ) {
s_options.sound.generic.x = 320;
s_options.sound.generic.y = y;
s_options.sound.string = "SOUND";
// BAGPUSS
// s_options.sound.color = color_red;
s_options.sound.color = text_color_normal;
// END
s_options.sound.style = UI_CENTER;
y += VERTICAL_SPACING;
@ -223,26 +168,9 @@ void Options_MenuInit( void ) {
s_options.network.generic.x = 320;
s_options.network.generic.y = y;
s_options.network.string = "NETWORK";
// BAGPUSS
// s_options.network.color = color_red;
s_options.network.color = text_color_normal;
// END
s_options.network.style = UI_CENTER;
// STONELANCE
/*
s_options.back.generic.type = MTYPE_BITMAP;
s_options.back.generic.name = ART_BACK0;
s_options.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_options.back.generic.callback = Options_Event;
s_options.back.generic.id = ID_BACK;
s_options.back.generic.x = 0;
s_options.back.generic.y = 480-64;
s_options.back.width = 128;
s_options.back.height = 64;
s_options.back.focuspic = ART_BACK1;
*/
s_options.back.generic.type = MTYPE_PTEXT;
s_options.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_options.back.generic.x = 20;
@ -252,15 +180,8 @@ void Options_MenuInit( void ) {
s_options.back.string = "< BACK";
s_options.back.color = text_color_normal;
s_options.back.style = UI_LEFT | UI_SMALLFONT;
// END
Menu_AddItem( &s_options.menu, ( void * ) &s_options.banner );
// STONELANCE
/*
Menu_AddItem( &s_options.menu, ( void * ) &s_options.framel );
Menu_AddItem( &s_options.menu, ( void * ) &s_options.framer );
*/
// END
Menu_AddItem( &s_options.menu, ( void * ) &s_options.graphics );
Menu_AddItem( &s_options.menu, ( void * ) &s_options.display );
Menu_AddItem( &s_options.menu, ( void * ) &s_options.sound );
@ -270,9 +191,9 @@ void Options_MenuInit( void ) {
/*
===============
===================
UI_SystemConfigMenu
===============
===================
*/
void UI_SystemConfigMenu( void ) {
// STONELANCE FIXME: get rid of this after proper tansitions are added

View file

@ -32,19 +32,8 @@ GAME OPTIONS MENU
#include "ui_local.h"
// STONELANCE
/*
#define ART_FRAMEL "menu/art/frame2_l"
#define ART_FRAMER "menu/art/frame1_r"
#define ART_BACK0 "menu/art/back_0"
#define ART_BACK1 "menu/art/back_1"
*/
// END
#define PREFERENCES_X_POS 360
//#define ID_CROSSHAIR 127
#define ID_SIMPLEITEMS 128
#define ID_HIGHQUALITYSKY 129
#define ID_EJECTINGBRASS 130
@ -56,6 +45,7 @@ GAME OPTIONS MENU
#define ID_DRAWTEAMOVERLAY 136
#define ID_ALLOWDOWNLOAD 137
#define ID_BACK 138
#define ID_DRAWFPS 139
#define NUM_CROSSHAIRS 10
@ -64,14 +54,7 @@ typedef struct {
menuframework_s menu;
menutext_s banner;
// STONELANCE
/*
menubitmap_s framel;
menubitmap_s framer;
*/
// END
// menulist_s crosshair;
menuradiobutton_s simpleitems;
menuradiobutton_s brass;
menuradiobutton_s wallmarks;
@ -82,10 +65,9 @@ typedef struct {
menuradiobutton_s forcemodel;
menulist_s drawteamoverlay;
menuradiobutton_s allowdownload;
// STONELANCE
// menubitmap_s back;
menuradiobutton_s drawfps;
menutext_s back;
// END
qhandle_t crosshairShader[NUM_CROSSHAIRS];
} preferences_t;
@ -102,7 +84,7 @@ static const char *teamoverlay_names[] =
};
static void Preferences_SetMenuItems( void ) {
// s_preferences.crosshair.curvalue = (int)trap_Cvar_VariableValue( "cg_drawCrosshair" ) % NUM_CROSSHAIRS;
s_preferences.simpleitems.curvalue = trap_Cvar_VariableValue( "cg_simpleItems" ) != 0;
s_preferences.brass.curvalue = trap_Cvar_VariableValue( "cg_brassTime" ) != 0;
s_preferences.wallmarks.curvalue = trap_Cvar_VariableValue( "cg_marks" ) != 0;
@ -113,6 +95,7 @@ static void Preferences_SetMenuItems( void ) {
s_preferences.forcemodel.curvalue = trap_Cvar_VariableValue( "cg_forcemodel" ) != 0;
s_preferences.drawteamoverlay.curvalue = Com_Clamp( 0, 3, trap_Cvar_VariableValue( "cg_drawTeamOverlay" ) );
s_preferences.allowdownload.curvalue = trap_Cvar_VariableValue( "cl_allowDownload" ) != 0;
s_preferences.drawfps.curvalue = trap_Cvar_VariableValue( "cg_DrawFPS" ) != 0;
}
@ -122,9 +105,6 @@ static void Preferences_Event( void* ptr, int notification ) {
}
switch( ((menucommon_s*)ptr)->id ) {
// case ID_CROSSHAIR:
// trap_Cvar_SetValue( "cg_drawCrosshair", s_preferences.crosshair.curvalue );
// break;
case ID_SIMPLEITEMS:
trap_Cvar_SetValue( "cg_simpleItems", s_preferences.simpleitems.curvalue );
@ -169,62 +149,16 @@ static void Preferences_Event( void* ptr, int notification ) {
trap_Cvar_SetValue( "cl_allowDownload", s_preferences.allowdownload.curvalue );
break;
case ID_DRAWFPS:
trap_Cvar_SetValue( "cg_DrawFPS", s_preferences.drawfps.curvalue );
break;
case ID_BACK:
UI_PopMenu();
break;
}
}
/*
=================
Crosshair_Draw
=================
static void Crosshair_Draw( void *self ) {
menulist_s *s;
float *color;
int x, y;
int style;
qboolean focus;
s = (menulist_s *)self;
x = s->generic.x;
y = s->generic.y;
style = UI_SMALLFONT;
focus = (s->generic.parent->cursor == s->generic.menuPosition);
if ( s->generic.flags & QMF_GRAYED )
color = text_color_disabled;
else if ( focus )
{
color = text_color_highlight;
style |= UI_PULSE;
}
else if ( s->generic.flags & QMF_BLINK )
{
color = text_color_highlight;
style |= UI_BLINK;
}
else
color = text_color_normal;
if ( focus )
{
// draw cursor
UI_FillRect( s->generic.left, s->generic.top, s->generic.right-s->generic.left+1, s->generic.bottom-s->generic.top+1, listbar_color );
UI_DrawChar( x, y, 13, UI_CENTER|UI_BLINK|UI_SMALLFONT, color);
}
UI_DrawString( x - SMALLCHAR_WIDTH, y, s->generic.name, style|UI_RIGHT, color );
if( !s->curvalue ) {
return;
}
UI_DrawHandlePic( x + SMALLCHAR_WIDTH, y - 4, 24, 24, s_preferences.crosshairShader[s->curvalue] );
}
*/
static void Preferences_MenuInit( void ) {
int y;
@ -242,42 +176,6 @@ static void Preferences_MenuInit( void ) {
s_preferences.banner.color = color_white;
s_preferences.banner.style = UI_CENTER;
// STONELANCE
/*
s_preferences.framel.generic.type = MTYPE_BITMAP;
s_preferences.framel.generic.name = ART_FRAMEL;
s_preferences.framel.generic.flags = QMF_INACTIVE;
s_preferences.framel.generic.x = 0;
s_preferences.framel.generic.y = 78;
s_preferences.framel.width = 256;
s_preferences.framel.height = 329;
s_preferences.framer.generic.type = MTYPE_BITMAP;
s_preferences.framer.generic.name = ART_FRAMER;
s_preferences.framer.generic.flags = QMF_INACTIVE;
s_preferences.framer.generic.x = 376;
s_preferences.framer.generic.y = 76;
s_preferences.framer.width = 256;
s_preferences.framer.height = 334;
*/
// END
/*
y = 144;
s_preferences.crosshair.generic.type = MTYPE_SPINCONTROL;
s_preferences.crosshair.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT|QMF_NODEFAULTINIT|QMF_OWNERDRAW;
s_preferences.crosshair.generic.x = PREFERENCES_X_POS;
s_preferences.crosshair.generic.y = y;
s_preferences.crosshair.generic.name = "Crosshair:";
s_preferences.crosshair.generic.callback = Preferences_Event;
s_preferences.crosshair.generic.ownerdraw = Crosshair_Draw;
s_preferences.crosshair.generic.id = ID_CROSSHAIR;
s_preferences.crosshair.generic.top = y - 4;
s_preferences.crosshair.generic.bottom = y + 20;
s_preferences.crosshair.generic.left = PREFERENCES_X_POS - ( ( strlen(s_preferences.crosshair.generic.name) + 1 ) * SMALLCHAR_WIDTH );
s_preferences.crosshair.generic.right = PREFERENCES_X_POS + 48;
s_preferences.crosshair.numitems = NUM_CROSSHAIRS;
*/
// y += BIGCHAR_HEIGHT+2+4;
y = 144;
s_preferences.simpleitems.generic.type = MTYPE_RADIOBUTTON;
s_preferences.simpleitems.generic.name = "Simple Items:";
@ -369,20 +267,15 @@ static void Preferences_MenuInit( void ) {
s_preferences.allowdownload.generic.x = PREFERENCES_X_POS;
s_preferences.allowdownload.generic.y = y;
// STOENLANCE
/*
y += BIGCHAR_HEIGHT+2;
s_preferences.back.generic.type = MTYPE_BITMAP;
s_preferences.back.generic.name = ART_BACK0;
s_preferences.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_preferences.back.generic.callback = Preferences_Event;
s_preferences.back.generic.id = ID_BACK;
s_preferences.back.generic.x = 0;
s_preferences.back.generic.y = 480-64;
s_preferences.back.width = 128;
s_preferences.back.height = 64;
s_preferences.back.focuspic = ART_BACK1;
*/
s_preferences.drawfps.generic.type = MTYPE_RADIOBUTTON;
s_preferences.drawfps.generic.name = "Draw FPS:";
s_preferences.drawfps.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_preferences.drawfps.generic.callback = Preferences_Event;
s_preferences.drawfps.generic.id = ID_DRAWFPS;
s_preferences.drawfps.generic.x = PREFERENCES_X_POS;
s_preferences.drawfps.generic.y = y;
s_preferences.back.generic.type = MTYPE_PTEXT;
s_preferences.back.generic.flags = QMF_LEFT_JUSTIFY|QMF_PULSEIFFOCUS;
s_preferences.back.generic.x = 20;
@ -392,17 +285,9 @@ static void Preferences_MenuInit( void ) {
s_preferences.back.string = "< BACK";
s_preferences.back.color = text_color_normal;
s_preferences.back.style = UI_LEFT | UI_SMALLFONT;
// END
Menu_AddItem( &s_preferences.menu, &s_preferences.banner );
// STONELANCE
/*
Menu_AddItem( &s_preferences.menu, &s_preferences.framel );
Menu_AddItem( &s_preferences.menu, &s_preferences.framer );
*/
// END
// Menu_AddItem( &s_preferences.menu, &s_preferences.crosshair );
Menu_AddItem( &s_preferences.menu, &s_preferences.simpleitems );
Menu_AddItem( &s_preferences.menu, &s_preferences.wallmarks );
Menu_AddItem( &s_preferences.menu, &s_preferences.brass );
@ -413,6 +298,7 @@ static void Preferences_MenuInit( void ) {
Menu_AddItem( &s_preferences.menu, &s_preferences.forcemodel );
Menu_AddItem( &s_preferences.menu, &s_preferences.drawteamoverlay );
Menu_AddItem( &s_preferences.menu, &s_preferences.allowdownload );
Menu_AddItem( &s_preferences.menu, &s_preferences.drawfps );
Menu_AddItem( &s_preferences.menu, &s_preferences.back );
@ -421,21 +307,13 @@ static void Preferences_MenuInit( void ) {
/*
===============
=================
Preferences_Cache
===============
=================
*/
void Preferences_Cache( void ) {
int n;
// STONELANCE
/*
trap_R_RegisterShaderNoMip( ART_FRAMEL );
trap_R_RegisterShaderNoMip( ART_FRAMER );
trap_R_RegisterShaderNoMip( ART_BACK0 );
trap_R_RegisterShaderNoMip( ART_BACK1 );
*/
// END
for( n = 0; n < NUM_CROSSHAIRS; n++ ) {
s_preferences.crosshairShader[n] = trap_R_RegisterShaderNoMip( va("gfx/2d/crosshair%c", 'a' + n ) );
}
@ -443,9 +321,9 @@ void Preferences_Cache( void ) {
/*
===============
==================
UI_PreferencesMenu
===============
==================
*/
void UI_PreferencesMenu( void ) {
Preferences_MenuInit();

View file

@ -67,7 +67,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define BASETA "missionpack"
#ifndef PRODUCT_VERSION
#define PRODUCT_VERSION "v0.3c_r449"
#define PRODUCT_VERSION "v0.3c_r450"
#endif

View file

@ -886,29 +886,13 @@ q3rallycode
engine\cross-make-mingw64.sh
[Open project files]
0=engine\code\qcommon\q_shared.h
1=engine\code\q3_ui\ui_rally_options.c
2=engine\code\cgame\cg_local.h
3=engine\code\cgame\cg_main.c
4=engine\code\q3_ui\ui_main.c
5=engine\code\q3_ui\ui_rally_controls.c
1=engine\code\q3_ui\ui_preferences.c
[Selected Project Files]
Main=
Selected=engine\code\qcommon\q_shared.h
Selected=engine\code\q3_ui\ui_preferences.c
[engine\code\qcommon\q_shared.h]
TopLine=57
Caret=36,70
[engine\code\q3_ui\ui_rally_options.c]
TopLine=180
Caret=46,204
[engine\code\cgame\cg_local.h]
TopLine=1538
Caret=1,1554
[engine\code\cgame\cg_main.c]
TopLine=284
Caret=1,284
[engine\code\q3_ui\ui_main.c]
TopLine=241
Caret=1,241
[engine\code\q3_ui\ui_rally_controls.c]
TopLine=1453
Caret=1,1445
[engine\code\q3_ui\ui_preferences.c]
TopLine=46
Caret=33,68