mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2025-01-18 22:41:49 +00:00
Added support to menu framework for changing font sizes of all menu controls.
Added r_clearcolor_r, r_clearcolor_g, r_clearcolor_b cvars to change gl_clear fill color.
This commit is contained in:
parent
8085bad68a
commit
e6ec99c444
12 changed files with 131 additions and 94 deletions
|
@ -642,9 +642,9 @@ SCR_DrawChar
|
|||
Coordinates are 640*480 virtual values
|
||||
=================
|
||||
*/
|
||||
void SCR_DrawChar (float x, float y, scralign_t align, int num, int red, int green, int blue, int alpha, qboolean italic, qboolean last)
|
||||
void SCR_DrawChar (float x, float y, int size, scralign_t align, int num, int red, int green, int blue, int alpha, qboolean italic, qboolean last)
|
||||
{
|
||||
float scale = SCR_GetScreenScale();
|
||||
float scale = SCR_ScaledScreen((float)size / (float)MENU_FONT_SIZE); // SCR_GetScreenScale()
|
||||
|
||||
SCR_AdjustFrom640 (&x, &y, NULL, NULL, align);
|
||||
R_DrawChar(x, y, num, scale, red, green, blue, alpha, italic, last);
|
||||
|
@ -2640,7 +2640,7 @@ void DrawDemoMessage (void)
|
|||
char *message = "Running Demo";
|
||||
len = strlen(message);
|
||||
|
||||
SCR_DrawFill (0, SCREEN_HEIGHT-(MENU_FONT_SIZE+3), SCREEN_WIDTH, MENU_FONT_SIZE+3, ALIGN_BOTTOM_STRETCH, 60,60,60,255);
|
||||
SCR_DrawFill (0, SCREEN_HEIGHT-(MENU_FONT_SIZE+3), SCREEN_WIDTH, MENU_FONT_SIZE+4, ALIGN_BOTTOM_STRETCH, 60,60,60,255); // go 1 pixel past screen bottom to prevent gap from scaling
|
||||
SCR_DrawFill (0, SCREEN_HEIGHT-(MENU_FONT_SIZE+3), SCREEN_WIDTH, 1, ALIGN_BOTTOM_STRETCH, 0,0,0,255);
|
||||
SCR_DrawString (SCREEN_WIDTH/2-(len/2)*MENU_FONT_SIZE, SCREEN_HEIGHT-(MENU_FONT_SIZE+1), MENU_FONT_SIZE, ALIGN_BOTTOM, message, 255);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ float SCR_GetScreenScale (void);
|
|||
void SCR_AdjustFrom640 (float *x, float *y, float *w, float *h, scralign_t align);
|
||||
void SCR_DrawFill (float x, float y, float width, float height, scralign_t align, int red, int green, int blue, int alpha);
|
||||
void SCR_DrawPic (float x, float y, float width, float height, scralign_t align, char *pic, float alpha);
|
||||
void SCR_DrawChar (float x, float y, scralign_t align, int num, int red, int green, int blue, int alpha, qboolean italic, qboolean last);
|
||||
void SCR_DrawChar (float x, float y, int size, scralign_t align, int num, int red, int green, int blue, int alpha, qboolean italic, qboolean last);
|
||||
void SCR_DrawString (float x, float y, int size, scralign_t align, const char *string, int alpha);
|
||||
void SCR_DrawCrosshair (void);
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ Changes as of v0.20 update 8:
|
|||
|
||||
- Added cel shading support. Uses cvars r_celshading to enable, and r_celshading_width for line width (1-10).
|
||||
|
||||
- Added Skuller's font upscaling from Q2Pro for old 128x128 fonts. Use cvar r_font_upscale to enable, value of 1 is pixel copy,
|
||||
value of 2 enables blending. Requires vid_restart for changes to take effect.
|
||||
- Added font upscaling (with optional blending by Skuller from Q2Pro) for old 128x128 fonts. Use cvar r_font_upscale to enable,
|
||||
value of 1 is pixel copy, value of 2 enables blending. Requires vid_restart for changes to take effect.
|
||||
|
||||
- Now compresses .sav and .sv2 savegame files into .savz files. It will still read savegames from earlier
|
||||
KMQ2 versions (with the same game DLL). This should improve load and save times in multi-level units.
|
||||
|
@ -35,6 +35,9 @@ Changes as of v0.20 update 8:
|
|||
- Added SGIS mipmaps menu option and cvar r_sgis_generatemipmap, for toggling SGIS mipmap generation. Default is 1,
|
||||
set to 0 and use vid_restart to disable.
|
||||
|
||||
- Added changeable gl_clear color controlled by cvars r_clearcolor_r, r_clearcolor_g, and r_clearcolor_b.
|
||||
Values are normalized (0-1).
|
||||
|
||||
- Fixed Shift-Ins to paste text not working in menus.
|
||||
|
||||
- Fixed crash when a map has too many submodels. Increased renderer model limit to 2 x MAX_MODELS.
|
||||
|
|
|
@ -4350,7 +4350,7 @@ model="models/items/q1keys/gold/tris.md2"
|
|||
"q1items/medkey.wav",
|
||||
"models/items/q1keys/gold/tris.md2", 0, EF_ROTATE,
|
||||
NULL,
|
||||
"q1hud/items/SbKeyG",
|
||||
"k_med_gold",
|
||||
"Gold Key",
|
||||
2,
|
||||
0,
|
||||
|
@ -4376,7 +4376,7 @@ model="models/items/q1keys/silver/tris.md2"
|
|||
"q1items/medkey.wav",
|
||||
"models/items/q1keys/silver/tris.md2", 0, EF_ROTATE,
|
||||
NULL,
|
||||
"q1hud/items/SbKeyS",
|
||||
"k_med_silver",
|
||||
"Silver Key",
|
||||
2,
|
||||
0,
|
||||
|
@ -4402,7 +4402,7 @@ model="models/items/q1keys/gold/rune/tris.md2"
|
|||
"q1items/runekey.wav",
|
||||
"models/items/q1keys/gold/rune/tris.md2", 0, EF_ROTATE,
|
||||
NULL,
|
||||
"q1hud/items/SbKeyG",
|
||||
"k_rune_gold",
|
||||
"Gold Rune Key",
|
||||
2,
|
||||
0,
|
||||
|
@ -4428,7 +4428,7 @@ model="models/items/q1keys/silver/rune/tris.md2"
|
|||
"q1items/runekey.wav",
|
||||
"models/items/q1keys/silver/rune/tris.md2", 0, EF_ROTATE,
|
||||
NULL,
|
||||
"q1hud/items/SbKeyS",
|
||||
"k_rune_silver",
|
||||
"Silver Rune Key",
|
||||
2,
|
||||
0,
|
||||
|
@ -4454,7 +4454,7 @@ model="models/items/q1keys/gold/base/tris.md2"
|
|||
"q1items/basekey.wav",
|
||||
"models/items/q1keys/gold/base/tris.md2", 0, EF_ROTATE,
|
||||
NULL,
|
||||
"q1hud/items/SbKeyG",
|
||||
"k_base_gold",
|
||||
"Gold Keycard",
|
||||
2,
|
||||
0,
|
||||
|
@ -4480,7 +4480,7 @@ model="models/items/q1keys/silver/base/tris.md2"
|
|||
"q1items/basekey.wav",
|
||||
"models/items/q1keys/silver/base/tris.md2", 0, EF_ROTATE,
|
||||
NULL,
|
||||
"q1hud/items/SbKeyS",
|
||||
"k_base_silver",
|
||||
"Silver Keycard",
|
||||
2,
|
||||
0,
|
||||
|
|
|
@ -363,8 +363,6 @@ typedef struct
|
|||
#define IT_KEY 0x00000010
|
||||
#define IT_POWERUP 0x00000020
|
||||
|
||||
#define IT_Q1 0x00000080 // added for Q1 keys
|
||||
|
||||
// ROGUE
|
||||
#define IT_MELEE 0x00000040
|
||||
#define IT_NOT_GIVEABLE 0x00000080 // item can not be given
|
||||
|
@ -375,6 +373,8 @@ typedef struct
|
|||
#define IT_LAZARUS 0x00000400 // Lazarus item
|
||||
#define IT_ZAERO 0x00000800 // Zaero item
|
||||
|
||||
#define IT_Q1 0x00001000 // added for Q1 keys
|
||||
|
||||
// gitem_t->weapmodel for weapons indicates model index
|
||||
#define WEAP_BLASTER 1
|
||||
#define WEAP_SHOTGUN 2
|
||||
|
|
|
@ -596,7 +596,8 @@ void GL_SetDefaultState (void)
|
|||
qglDepthFunc(GL_LEQUAL);
|
||||
qglDepthMask(GL_TRUE);
|
||||
|
||||
qglClearColor (1,0, 0.5, 0.5);
|
||||
// qglClearColor (1,0, 0.5, 0.5);
|
||||
qglClearColor (r_clearColor[0], r_clearColor[1], r_clearColor[2], r_clearColor[3]);
|
||||
qglClearDepth(1.0);
|
||||
qglClearStencil(128);
|
||||
|
||||
|
|
|
@ -1911,7 +1911,6 @@ qboolean GL_Upload32 (unsigned *data, int width, int height, imagetype_t type)
|
|||
{
|
||||
int maxsize;
|
||||
|
||||
#if 1
|
||||
if (r_picmip->integer == 1) // clamp to 1024x1024
|
||||
maxsize = 1024;
|
||||
else if (r_picmip->integer == 2) // clamp to 512x512
|
||||
|
@ -1920,14 +1919,6 @@ qboolean GL_Upload32 (unsigned *data, int width, int height, imagetype_t type)
|
|||
maxsize = 256;
|
||||
else // clamp to 128x128
|
||||
maxsize = 128;
|
||||
#else
|
||||
if (r_picmip->integer == 1) // clamp to 512x512
|
||||
maxsize = 512;
|
||||
else if (r_picmip->integer == 2) // clamp to 256x256
|
||||
maxsize = 256;
|
||||
else // clamp to 128x128
|
||||
maxsize = 128;
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
if (scaled_width <= maxsize && scaled_height <= maxsize)
|
||||
|
|
|
@ -335,6 +335,11 @@ extern cvar_t *r_skydistance; // variable sky range
|
|||
extern cvar_t *r_fog_skyratio; // variable sky fog ratio
|
||||
extern cvar_t *r_saturation; //** DMP
|
||||
|
||||
// Changable color for r_clearcolor (enabled by gl_clar)
|
||||
extern cvar_t *r_clearcolor_r;
|
||||
extern cvar_t *r_clearcolor_g;
|
||||
extern cvar_t *r_clearcolor_b;
|
||||
|
||||
extern cvar_t *r_bloom;
|
||||
|
||||
// Discoloda's cel shading
|
||||
|
@ -356,6 +361,8 @@ extern int c_visible_textures;
|
|||
|
||||
extern float r_world_matrix[16];
|
||||
|
||||
extern vec4_t r_clearColor; // for gl_clear
|
||||
|
||||
// entity sorting struct
|
||||
typedef struct sortedelement_s sortedelement_t;
|
||||
typedef struct sortedelement_s
|
||||
|
|
|
@ -62,6 +62,7 @@ vec3_t r_origin;
|
|||
|
||||
float r_world_matrix[16];
|
||||
float r_base_world_matrix[16];
|
||||
vec4_t r_clearColor = {0, 0.5, 0.5, 0.5}; // for gl_clear
|
||||
|
||||
GLdouble r_farz; // Knightmare- variable sky range, made this a global var
|
||||
|
||||
|
@ -195,6 +196,11 @@ cvar_t *vid_fullscreen;
|
|||
cvar_t *vid_gamma;
|
||||
cvar_t *vid_ref;
|
||||
|
||||
// Changable color for r_clearcolor (enabled by gl_clar)
|
||||
cvar_t *r_clearcolor_r;
|
||||
cvar_t *r_clearcolor_g;
|
||||
cvar_t *r_clearcolor_b;
|
||||
|
||||
cvar_t *r_bloom; // BLOOMS
|
||||
|
||||
// Discoloda's cel shading
|
||||
|
@ -404,7 +410,8 @@ void R_SetupFrame (void)
|
|||
qglClearColor( 0.3, 0.3, 0.3, 1 );
|
||||
qglScissor( r_newrefdef.x, vid.height - r_newrefdef.height - r_newrefdef.y, r_newrefdef.width, r_newrefdef.height );
|
||||
qglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
qglClearColor( 1, 0, 0.5, 0.5 );
|
||||
// qglClearColor( 1, 0, 0.5, 0.5 );
|
||||
qglClearColor (r_clearColor[0], r_clearColor[1], r_clearColor[2], r_clearColor[3]);
|
||||
GL_Disable( GL_SCISSOR_TEST );
|
||||
}*/
|
||||
}
|
||||
|
@ -1062,6 +1069,11 @@ void R_Register (void)
|
|||
vid_gamma = Cvar_Get( "vid_gamma", "0.8", CVAR_ARCHIVE ); // was 1.0
|
||||
vid_ref = Cvar_Get( "vid_ref", "gl", CVAR_ARCHIVE );
|
||||
|
||||
// Changable color for r_clearcolor (enabled by gl_clar)
|
||||
r_clearcolor_r = Cvar_Get( "r_clearcolor_r", "0", CVAR_ARCHIVE );
|
||||
r_clearcolor_g = Cvar_Get( "r_clearcolor_g", "0.5", CVAR_ARCHIVE );
|
||||
r_clearcolor_b = Cvar_Get( "r_clearcolor_b", "0.5", CVAR_ARCHIVE );
|
||||
|
||||
r_bloom = Cvar_Get( "r_bloom", "0", CVAR_ARCHIVE ); // BLOOMS
|
||||
|
||||
r_celshading = Cvar_Get( "r_celshading", "0", CVAR_ARCHIVE );
|
||||
|
@ -1866,6 +1878,11 @@ qboolean R_Init ( void *hinstance, void *hWnd, char *reason )
|
|||
Com_Printf( "Size of decals: %i\n", sizeof (particle_t)*MAX_DECAL_FRAGS );
|
||||
*/
|
||||
|
||||
// set r_clearColor
|
||||
r_clearColor[0] = min(max(r_clearcolor_r->value, 0.0f), 1.0f);
|
||||
r_clearColor[1] = min(max(r_clearcolor_g->value, 0.0f), 1.0f);
|
||||
r_clearColor[2] = min(max(r_clearcolor_b->value, 0.0f), 1.0f);
|
||||
|
||||
GL_SetDefaultState();
|
||||
|
||||
// draw our stereo patterns
|
||||
|
@ -1989,6 +2006,7 @@ void UpdateGammaRamp (void); //Knightmare added
|
|||
void RefreshFont (void);
|
||||
void R_BeginFrame( float camera_separation )
|
||||
{
|
||||
qboolean clearColor_modified = false;
|
||||
|
||||
glState.camera_separation = camera_separation;
|
||||
|
||||
|
@ -2050,6 +2068,26 @@ void R_BeginFrame( float camera_separation )
|
|||
}
|
||||
}
|
||||
|
||||
// change r_clearColor if necessary
|
||||
if (r_clearcolor_r->modified) {
|
||||
r_clearcolor_r->modified = false;
|
||||
clearColor_modified = true;
|
||||
r_clearColor[0] = min(max(r_clearcolor_r->value, 0.0f), 1.0f);
|
||||
}
|
||||
if (r_clearcolor_g->modified) {
|
||||
r_clearcolor_g->modified = false;
|
||||
clearColor_modified = true;
|
||||
r_clearColor[1] = min(max(r_clearcolor_g->value, 0.0f), 1.0f);
|
||||
}
|
||||
if (r_clearcolor_b->modified) {
|
||||
r_clearcolor_b->modified = false;
|
||||
clearColor_modified = true;
|
||||
r_clearColor[2] = min(max(r_clearcolor_b->value, 0.0f), 1.0f);
|
||||
}
|
||||
if (clearColor_modified) {
|
||||
qglClearColor (r_clearColor[0], r_clearColor[1], r_clearColor[2], r_clearColor[3]);
|
||||
}
|
||||
|
||||
//
|
||||
// update 3Dfx gamma -- it is expected that a user will do a vid_restart
|
||||
// after tweaking this value
|
||||
|
@ -2181,5 +2219,6 @@ void R_SetPalette ( const unsigned char *palette)
|
|||
|
||||
qglClearColor (0,0,0,0);
|
||||
qglClear (GL_COLOR_BUFFER_BIT);
|
||||
qglClearColor (1,0, 0.5 , 0.5);
|
||||
// qglClearColor (1,0, 0.5 , 0.5);
|
||||
qglClearColor (r_clearColor[0], r_clearColor[1], r_clearColor[2], r_clearColor[3]);
|
||||
}
|
||||
|
|
113
ui/ui_backend.c
113
ui/ui_backend.c
|
@ -119,7 +119,7 @@ void Field_Draw (menufield_s *f)
|
|||
|
||||
if (f->generic.name)
|
||||
Menu_DrawStringR2LDark (f->generic.x + f->generic.parent->x + LCOLUMN_OFFSET,
|
||||
f->generic.y + f->generic.parent->y, MENU_FONT_SIZE, f->generic.name, 255);
|
||||
f->generic.y + f->generic.parent->y, f->generic.textSize, f->generic.name, 255);
|
||||
|
||||
if (xtra = stringLengthExtra(f->buffer))
|
||||
{
|
||||
|
@ -139,29 +139,29 @@ void Field_Draw (menufield_s *f)
|
|||
offset = strlen(tempbuffer);
|
||||
}
|
||||
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + MENU_FONT_SIZE*2,
|
||||
f->generic.y + f->generic.parent->y - 4, ALIGN_CENTER, 18, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + MENU_FONT_SIZE*2,
|
||||
f->generic.y + f->generic.parent->y + 4, ALIGN_CENTER, 24, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + (3+f->visible_length)*MENU_FONT_SIZE,
|
||||
f->generic.y + f->generic.parent->y - 4, ALIGN_CENTER, 20,255,255,255,255, false, false);
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + (3+f->visible_length)*MENU_FONT_SIZE,
|
||||
f->generic.y + f->generic.parent->y + 4, ALIGN_CENTER, 26, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + RCOLUMN_OFFSET,
|
||||
f->generic.y + f->generic.parent->y - 4, f->generic.textSize, ALIGN_CENTER, 18, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + RCOLUMN_OFFSET,
|
||||
f->generic.y + f->generic.parent->y + 4, f->generic.textSize, ALIGN_CENTER, 24, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + (1+f->visible_length)*f->generic.textSize + RCOLUMN_OFFSET,
|
||||
f->generic.y + f->generic.parent->y - 4, f->generic.textSize, ALIGN_CENTER, 20,255,255,255,255, false, false);
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + (1+f->visible_length)*f->generic.textSize + RCOLUMN_OFFSET,
|
||||
f->generic.y + f->generic.parent->y + 4, f->generic.textSize, ALIGN_CENTER, 26, 255,255,255,255, false, false);
|
||||
|
||||
for (i = 0; i < f->visible_length; i++)
|
||||
{
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + (3+i)*MENU_FONT_SIZE,
|
||||
f->generic.y + f->generic.parent->y - 4, ALIGN_CENTER, 19, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + (3+i)*MENU_FONT_SIZE,
|
||||
f->generic.y + f->generic.parent->y + 4, ALIGN_CENTER, 25, 255,255,255,255, false, (i==(f->visible_length-1)));
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + (1+i)*f->generic.textSize + RCOLUMN_OFFSET,
|
||||
f->generic.y + f->generic.parent->y - 4, f->generic.textSize, ALIGN_CENTER, 19, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (f->generic.x + f->generic.parent->x + (1+i)*f->generic.textSize + RCOLUMN_OFFSET,
|
||||
f->generic.y + f->generic.parent->y + 4, f->generic.textSize, ALIGN_CENTER, 25, 255,255,255,255, false, (i==(f->visible_length-1)));
|
||||
}
|
||||
|
||||
// add cursor thingie
|
||||
if ( Menu_ItemAtCursor(f->generic.parent)==f && ((int)(Sys_Milliseconds()/250))&1 )
|
||||
if ( (Menu_ItemAtCursor(f->generic.parent) == f) && ((int)(Sys_Milliseconds()/250))&1 )
|
||||
Com_sprintf(tempbuffer, sizeof(tempbuffer), "%s%c", tempbuffer, 11);
|
||||
|
||||
Menu_DrawString (f->generic.x + f->generic.parent->x + MENU_FONT_SIZE*3,
|
||||
f->generic.y + f->generic.parent->y, MENU_FONT_SIZE, tempbuffer, alpha);
|
||||
Menu_DrawString (f->generic.x + f->generic.parent->x + f->generic.textSize*3,
|
||||
f->generic.y + f->generic.parent->y, f->generic.textSize, tempbuffer, alpha);
|
||||
}
|
||||
|
||||
qboolean Field_Key (menufield_s *f, int key)
|
||||
|
@ -313,9 +313,9 @@ void MenuList_Draw (menulist_s *l)
|
|||
{
|
||||
const char **n;
|
||||
int y = 0, alpha = mouseOverAlpha(&l->generic);
|
||||
|
||||
Menu_DrawStringR2LDark (l->generic.x + l->generic.parent->x - 2*MENU_FONT_SIZE,
|
||||
l->generic.y + l->generic.parent->y, MENU_FONT_SIZE, l->generic.name, alpha);
|
||||
|
||||
Menu_DrawStringR2LDark (l->generic.x + l->generic.parent->x + LCOLUMN_OFFSET, // - 2*MENU_FONT_SIZE,
|
||||
l->generic.y + l->generic.parent->y, l->generic.textSize, l->generic.name, alpha);
|
||||
|
||||
n = l->itemnames;
|
||||
|
||||
|
@ -327,7 +327,7 @@ void MenuList_Draw (menulist_s *l)
|
|||
while (*n)
|
||||
{
|
||||
Menu_DrawStringR2LDark (l->generic.x + l->generic.parent->x + LCOLUMN_OFFSET,
|
||||
l->generic.y + l->generic.parent->y + y + MENU_LINE_SIZE, MENU_FONT_SIZE, *n, alpha);
|
||||
l->generic.y + l->generic.parent->y + y + MENU_LINE_SIZE, l->generic.textSize, *n, alpha);
|
||||
n++;
|
||||
y += MENU_LINE_SIZE;
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ void Slider_Draw (menuslider_s *s)
|
|||
int i, alpha = mouseOverAlpha(&s->generic);
|
||||
|
||||
Menu_DrawStringR2LDark (s->generic.x + s->generic.parent->x + LCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, MENU_FONT_SIZE, s->generic.name, alpha);
|
||||
s->generic.y + s->generic.parent->y, s->generic.textSize, s->generic.name, alpha);
|
||||
|
||||
s->range = (s->curvalue - s->minvalue) / (float)(s->maxvalue - s->minvalue);
|
||||
|
||||
|
@ -372,17 +372,17 @@ void Slider_Draw (menuslider_s *s)
|
|||
s->range = 1;
|
||||
|
||||
SCR_DrawChar (s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, ALIGN_CENTER, 128, 255,255,255,255, false, false);
|
||||
s->generic.y + s->generic.parent->y, s->generic.textSize, ALIGN_CENTER, 128, 255,255,255,255, false, false);
|
||||
|
||||
for (i = 0; i < SLIDER_RANGE; i++)
|
||||
SCR_DrawChar (s->generic.x + s->generic.parent->x + (i+1)*MENU_FONT_SIZE + RCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, ALIGN_CENTER, 129, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (s->generic.x + s->generic.parent->x + (i+1)*s->generic.textSize + RCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, s->generic.textSize, ALIGN_CENTER, 129, 255,255,255,255, false, false);
|
||||
|
||||
SCR_DrawChar (s->generic.x + s->generic.parent->x + (i+1)*MENU_FONT_SIZE + RCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, ALIGN_CENTER, 130, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (s->generic.x + s->generic.parent->x + (i+1)*s->generic.textSize + RCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, s->generic.textSize, ALIGN_CENTER, 130, 255,255,255,255, false, false);
|
||||
|
||||
SCR_DrawChar (s->generic.x + s->generic.parent->x + MENU_FONT_SIZE*((SLIDER_RANGE-1)*s->range+1) + RCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, ALIGN_CENTER, 131, 255,255,255,255, false, true);
|
||||
SCR_DrawChar (s->generic.x + s->generic.parent->x + s->generic.textSize*((SLIDER_RANGE-1)*s->range+1) + RCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, s->generic.textSize, ALIGN_CENTER, 131, 255,255,255,255, false, true);
|
||||
}
|
||||
|
||||
void SpinControl_DoEnter (menulist_s *s)
|
||||
|
@ -431,12 +431,12 @@ void SpinControl_Draw (menulist_s *s)
|
|||
if (s->generic.name)
|
||||
{
|
||||
Menu_DrawStringR2LDark (s->generic.x + s->generic.parent->x + LCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, MENU_FONT_SIZE, s->generic.name, alpha);
|
||||
s->generic.y + s->generic.parent->y, s->generic.textSize, s->generic.name, alpha);
|
||||
}
|
||||
if (!strchr(s->itemnames[s->curvalue], '\n'))
|
||||
{
|
||||
Menu_DrawString (s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, MENU_FONT_SIZE, s->itemnames[s->curvalue], alpha);
|
||||
s->generic.y + s->generic.parent->y, s->generic.textSize, s->itemnames[s->curvalue], alpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -444,11 +444,11 @@ void SpinControl_Draw (menulist_s *s)
|
|||
Q_strncpyz(buffer, s->itemnames[s->curvalue], sizeof(buffer));
|
||||
*strchr(buffer, '\n') = 0;
|
||||
Menu_DrawString (s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y, MENU_FONT_SIZE, buffer, alpha);
|
||||
s->generic.y + s->generic.parent->y, s->generic.textSize, buffer, alpha);
|
||||
// strncpy(buffer, strchr( s->itemnames[s->curvalue], '\n' ) + 1 );
|
||||
Q_strncpyz(buffer, strchr( s->itemnames[s->curvalue], '\n' ) + 1, sizeof(buffer) );
|
||||
Menu_DrawString (s->generic.x + s->generic.parent->x + RCOLUMN_OFFSET,
|
||||
s->generic.y + s->generic.parent->y + MENU_LINE_SIZE, MENU_FONT_SIZE, buffer, alpha);
|
||||
s->generic.y + s->generic.parent->y + MENU_LINE_SIZE, s->generic.textSize, buffer, alpha);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -660,7 +660,7 @@ void Menu_Draw (menuframework_s *menu)
|
|||
|
||||
x1 = menu->x + item->x + RCOLUMN_OFFSET; // + 2 chars for space + cursor
|
||||
y1 = menu->y + item->y;
|
||||
w1 = 0; h1 = MENU_FONT_SIZE;
|
||||
w1 = 0; h1 = item->textSize; // MENU_FONT_SIZE
|
||||
SCR_AdjustFrom640 (&x1, &y1, &w1, &h1, ALIGN_CENTER);
|
||||
min[0] = x1; max[0] = x1+w1;
|
||||
min[1] = y1; max[1] = y1+h1;
|
||||
|
@ -677,10 +677,12 @@ void Menu_Draw (menuframework_s *menu)
|
|||
if (item->flags & QMF_LEFT_JUSTIFY)
|
||||
{
|
||||
min[0] += SCR_ScaledScreen(LCOLUMN_OFFSET*2);
|
||||
max[0] = min[0] + SCR_ScaledScreen(len*MENU_FONT_SIZE);
|
||||
// max[0] = min[0] + SCR_ScaledScreen(len*MENU_FONT_SIZE);
|
||||
max[0] = min[0] + SCR_ScaledScreen(len*item->textSize);
|
||||
}
|
||||
else
|
||||
min[0] -= SCR_ScaledScreen(len*MENU_FONT_SIZE + MENU_FONT_SIZE*3);
|
||||
// min[0] -= SCR_ScaledScreen(len*MENU_FONT_SIZE + MENU_FONT_SIZE*3);
|
||||
min[0] -= SCR_ScaledScreen(len*item->textSize + item->textSize*3);
|
||||
|
||||
type = MENUITEM_ACTION;
|
||||
}
|
||||
|
@ -690,11 +692,13 @@ void Menu_Draw (menuframework_s *menu)
|
|||
if (item->name)
|
||||
{
|
||||
len = strlen(item->name);
|
||||
min[0] -= SCR_ScaledScreen(len*MENU_FONT_SIZE - LCOLUMN_OFFSET*2);
|
||||
// min[0] -= SCR_ScaledScreen(len*MENU_FONT_SIZE - LCOLUMN_OFFSET*2);
|
||||
min[0] -= SCR_ScaledScreen(len*item->textSize - LCOLUMN_OFFSET*2);
|
||||
}
|
||||
else
|
||||
min[0] -= SCR_ScaledScreen(16);
|
||||
max[0] += SCR_ScaledScreen((SLIDER_RANGE + 4)*MENU_FONT_SIZE);
|
||||
// max[0] += SCR_ScaledScreen((SLIDER_RANGE + 4) * MENU_FONT_SIZE);
|
||||
max[0] += SCR_ScaledScreen((SLIDER_RANGE + 4) * item->textSize);
|
||||
type = MENUITEM_SLIDER;
|
||||
}
|
||||
break;
|
||||
|
@ -708,11 +712,13 @@ void Menu_Draw (menuframework_s *menu)
|
|||
if (item->name)
|
||||
{
|
||||
len = strlen(item->name);
|
||||
min[0] -= SCR_ScaledScreen(len*MENU_FONT_SIZE - LCOLUMN_OFFSET*2);
|
||||
// min[0] -= SCR_ScaledScreen(len*MENU_FONT_SIZE - LCOLUMN_OFFSET*2);
|
||||
min[0] -= SCR_ScaledScreen(len*item->textSize - LCOLUMN_OFFSET*2);
|
||||
}
|
||||
|
||||
len = strlen(spin->itemnames[spin->curvalue]);
|
||||
max[0] += SCR_ScaledScreen(len*MENU_FONT_SIZE);
|
||||
// max[0] += SCR_ScaledScreen(len*MENU_FONT_SIZE);
|
||||
max[0] += SCR_ScaledScreen(len*item->textSize);
|
||||
|
||||
type = MENUITEM_ROTATE;
|
||||
}
|
||||
|
@ -723,7 +729,8 @@ void Menu_Draw (menuframework_s *menu)
|
|||
|
||||
len = text->visible_length + 2;
|
||||
|
||||
max[0] += SCR_ScaledScreen(len*MENU_FONT_SIZE);
|
||||
// max[0] += SCR_ScaledScreen(len*MENU_FONT_SIZE);
|
||||
max[0] += SCR_ScaledScreen(len*item->textSize);
|
||||
type = MENUITEM_TEXT;
|
||||
}
|
||||
break;
|
||||
|
@ -776,13 +783,15 @@ void Menu_Draw (menuframework_s *menu)
|
|||
if (item->flags & QMF_LEFT_JUSTIFY)
|
||||
{
|
||||
SCR_DrawChar (menu->x+item->x+item->cursor_offset-24, menu->y+item->y,
|
||||
ALIGN_CENTER, 12+((int)(Sys_Milliseconds()/250)&1),
|
||||
// MENU_FONT_SIZE, ALIGN_CENTER, 12+((int)(Sys_Milliseconds()/250)&1),
|
||||
item->textSize, ALIGN_CENTER, 12+((int)(Sys_Milliseconds()/250)&1),
|
||||
255,255,255,255, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SCR_DrawChar (menu->x+item->cursor_offset, menu->y+item->y,
|
||||
ALIGN_CENTER, 12+((int)(Sys_Milliseconds()/250)&1),
|
||||
// MENU_FONT_SIZE, ALIGN_CENTER, 12+((int)(Sys_Milliseconds()/250)&1),
|
||||
item->textSize, ALIGN_CENTER, 12+((int)(Sys_Milliseconds()/250)&1),
|
||||
255,255,255,255, false, true);
|
||||
}
|
||||
}
|
||||
|
@ -806,7 +815,7 @@ void Menu_DrawStatusBar (const char *string)
|
|||
{
|
||||
int l = strlen( string );
|
||||
|
||||
SCR_DrawFill( 0, SCREEN_HEIGHT-(MENU_FONT_SIZE+3), SCREEN_WIDTH, MENU_FONT_SIZE+3, ALIGN_BOTTOM_STRETCH, 60,60,60,255 );
|
||||
SCR_DrawFill( 0, SCREEN_HEIGHT-(MENU_FONT_SIZE+3), SCREEN_WIDTH, MENU_FONT_SIZE+4, ALIGN_BOTTOM_STRETCH, 60,60,60,255 ); // go 1 pixel past screen bottom to prevent gap from scaling
|
||||
SCR_DrawFill( 0, SCREEN_HEIGHT-(MENU_FONT_SIZE+3), SCREEN_WIDTH, 1, ALIGN_BOTTOM_STRETCH, 0,0,0,255 );
|
||||
SCR_DrawString( SCREEN_WIDTH/2-(l/2)*MENU_FONT_SIZE, SCREEN_HEIGHT-(MENU_FONT_SIZE+1), MENU_FONT_SIZE, ALIGN_BOTTOM, string, 255 );
|
||||
}
|
||||
|
@ -856,36 +865,36 @@ void Menu_DrawTextBox (int x, int y, int width, int lines)
|
|||
// draw left side
|
||||
cx = x;
|
||||
cy = y;
|
||||
SCR_DrawChar (cx, cy, ALIGN_CENTER, 1, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (cx, cy, MENU_FONT_SIZE, ALIGN_CENTER, 1, 255,255,255,255, false, false);
|
||||
for (n = 0; n < lines; n++) {
|
||||
cy += MENU_FONT_SIZE;
|
||||
SCR_DrawChar (cx, cy, ALIGN_CENTER, 4, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (cx, cy, MENU_FONT_SIZE, ALIGN_CENTER, 4, 255,255,255,255, false, false);
|
||||
}
|
||||
SCR_DrawChar (cx, cy+MENU_FONT_SIZE, ALIGN_CENTER, 7, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (cx, cy+MENU_FONT_SIZE, MENU_FONT_SIZE, ALIGN_CENTER, 7, 255,255,255,255, false, false);
|
||||
|
||||
// draw middle
|
||||
cx += MENU_FONT_SIZE;
|
||||
while (width > 0)
|
||||
{
|
||||
cy = y;
|
||||
SCR_DrawChar (cx, cy, ALIGN_CENTER, 2, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (cx, cy, MENU_FONT_SIZE, ALIGN_CENTER, 2, 255,255,255,255, false, false);
|
||||
for (n = 0; n < lines; n++) {
|
||||
cy += MENU_FONT_SIZE;
|
||||
SCR_DrawChar (cx, cy, ALIGN_CENTER, 5, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (cx, cy, MENU_FONT_SIZE, ALIGN_CENTER, 5, 255,255,255,255, false, false);
|
||||
}
|
||||
SCR_DrawChar (cx, cy+MENU_FONT_SIZE, ALIGN_CENTER, 8, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (cx, cy+MENU_FONT_SIZE, MENU_FONT_SIZE, ALIGN_CENTER, 8, 255,255,255,255, false, false);
|
||||
width -= 1;
|
||||
cx += MENU_FONT_SIZE;
|
||||
}
|
||||
|
||||
// draw right side
|
||||
cy = y;
|
||||
SCR_DrawChar (cx, cy, ALIGN_CENTER, 3, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (cx, cy, MENU_FONT_SIZE, ALIGN_CENTER, 3, 255,255,255,255, false, false);
|
||||
for (n = 0; n < lines; n++) {
|
||||
cy += MENU_FONT_SIZE;
|
||||
SCR_DrawChar (cx, cy, ALIGN_CENTER, 6, 255,255,255,255, false, false);
|
||||
SCR_DrawChar (cx, cy, MENU_FONT_SIZE, ALIGN_CENTER, 6, 255,255,255,255, false, false);
|
||||
}
|
||||
SCR_DrawChar (cx, cy+MENU_FONT_SIZE, ALIGN_CENTER, 9, 255,255,255,255, false, true);
|
||||
SCR_DrawChar (cx, cy+MENU_FONT_SIZE, MENU_FONT_SIZE, ALIGN_CENTER, 9, 255,255,255,255, false, true);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -125,17 +125,17 @@ static void M_FindKeysForCommand (char *command, int *twokeys)
|
|||
|
||||
static void KeysBackCursorDrawFunc (menuaction_s *self) // back action
|
||||
{
|
||||
SCR_DrawChar (SCREEN_WIDTH*0.5 - 24, s_keys_menu.y + self->generic.y, ALIGN_CENTER,
|
||||
SCR_DrawChar (SCREEN_WIDTH*0.5 - 24, s_keys_menu.y + self->generic.y, MENU_FONT_SIZE, ALIGN_CENTER,
|
||||
12+((int)(Sys_Milliseconds()/250)&1), 255,255,255,255, false, true);
|
||||
}
|
||||
|
||||
static void KeyCursorDrawFunc (menuframework_s *menu)
|
||||
{
|
||||
if (bind_grab)
|
||||
SCR_DrawChar (menu->x, menu->y + menu->cursor * MENU_LINE_SIZE, ALIGN_CENTER,
|
||||
SCR_DrawChar (menu->x, menu->y + menu->cursor * MENU_LINE_SIZE, MENU_FONT_SIZE, ALIGN_CENTER,
|
||||
'=', 255,255,255,255, false, true);
|
||||
else
|
||||
SCR_DrawChar (menu->x, menu->y + menu->cursor * MENU_LINE_SIZE, ALIGN_CENTER,
|
||||
SCR_DrawChar (menu->x, menu->y + menu->cursor * MENU_LINE_SIZE, MENU_FONT_SIZE, ALIGN_CENTER,
|
||||
12+((int)(Sys_Milliseconds()/250)&1), 255,255,255,255, false, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -174,7 +174,6 @@ static void ApplyChanges( void *unused )
|
|||
Cvar_SetValue( "vid_fullscreen", s_fs_box.curvalue );
|
||||
// invert sense so greater = brighter, and scale to a range of 0.3 to 1.3
|
||||
Cvar_SetValue( "vid_gamma", (1.3 - (s_brightness_slider.curvalue/20.0)) );
|
||||
// Cvar_SetValue( "r_picmip", 3-s_texqual_box.curvalue );
|
||||
Cvar_SetValue( "r_picmip", 4-s_texqual_box.curvalue );
|
||||
|
||||
// Knightmare- refesh rate option
|
||||
|
@ -410,7 +409,6 @@ void Menu_Video_Init (void)
|
|||
"trilinear",
|
||||
0
|
||||
};
|
||||
#if 1
|
||||
static const char *lmh_names[] =
|
||||
{
|
||||
"lowest",
|
||||
|
@ -420,16 +418,6 @@ void Menu_Video_Init (void)
|
|||
"highest",
|
||||
0
|
||||
};
|
||||
#else
|
||||
static const char *lmh_names[] =
|
||||
{
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
"highest",
|
||||
0
|
||||
};
|
||||
#endif
|
||||
int y = 0;
|
||||
float temp;
|
||||
char *customStr;
|
||||
|
@ -536,7 +524,6 @@ void Menu_Video_Init (void)
|
|||
s_texqual_box.generic.x = 0;
|
||||
s_texqual_box.generic.y = y += MENU_LINE_SIZE;
|
||||
s_texqual_box.generic.name = "texture quality";
|
||||
// s_texqual_box.curvalue = ClampCvar (0, 3, 3-Cvar_VariableValue("r_picmip"));
|
||||
s_texqual_box.curvalue = ClampCvar (0, 4, 4-Cvar_VariableValue("r_picmip"));
|
||||
s_texqual_box.itemnames = lmh_names;
|
||||
s_texqual_box.generic.statusbar = "changes maximum texture size (highest = no limit)";
|
||||
|
|
Loading…
Reference in a new issue