removing of unused cvars, more xmms options (xmms tracks, xmms info) and different placement for resetting the config

This commit is contained in:
eukos 2015-08-22 00:48:06 +02:00
parent 8171b8c136
commit 9d3ff4c6a3
4 changed files with 41 additions and 106 deletions

1
CVARS
View file

@ -170,7 +170,6 @@ r_clearcolor
r_coloreddyns
r_coloredlightmethod
r_coloredlights
r_depthoffield
r_dither
r_drawentities
r_drawflat

View file

@ -273,7 +273,7 @@ extern cvar_t *vid_stretch_by_2;
#define MENU_PARTICLESET 198
#define MENU_STRETCHMODE 199
#define MENU_OLDSTATBAR 200
#define MENU_HUDSWAP 201
#define MENU_PSET_VANILLA 202
#define MENU_PSET_DP 203
#define MENU_PSET_FAKE 204
@ -331,7 +331,6 @@ menu_definition_t m_menu_options[] =
{MENU_CUSTOMIZE_CONTROLS, MENU_SELECTABLE},
// {MENU_CUSTOMIZE_CONTROLS2, MENU_SELECTABLE},
{MENU_GO_TO_CONSOLE, MENU_SELECTABLE},
{MENU_LOAD_DEFAULT_CFG, MENU_SELECTABLE},
{MENU_CONTROL_OPTIONS, MENU_SELECTABLE},
{MENU_SOUND_OPTIONS, MENU_SELECTABLE},
{MENU_INTERNAL_OPTIONS, MENU_SELECTABLE},
@ -346,7 +345,7 @@ menu_definition_t m_menu_options[] =
{MENU_BROKEN_OPTIONS, MENU_SELECTABLE},
#endif
{MENU_VIDEO_RESOLUTION, MENU_SELECTABLE},
{MENU_LOAD_DEFAULT_CFG, MENU_SELECTABLE},
//{MENU_HUD_OPTIONS, MENU_SELECTABLE}, // completely unfinished
{MENU_AUTOSAVER, MENU_SELECTABLE},
@ -526,7 +525,7 @@ menu_definition_t m_menu_view_options[] =
{MENU_SATURATION, MENU_SELECTABLE},
{MENU_CONTRAST, MENU_SELECTABLE},
{MENU_OLDSTATBAR, MENU_SELECTABLE},
{MENU_HUDSWAP, MENU_SELECTABLE},
#ifdef _WIN32
// {MENU_STRETCHMODE,MENU_SELECTABLE}, // only present in windowed mode on Win32
#endif
@ -1960,7 +1959,7 @@ int M_DrawFunction (menu_definition_t *menu_definition, int y)
break;
case MENU_LOAD_DEFAULT_CFG:
M_Print (16, y, " Reset to defaults");
M_PrintWhite (16, y, " Reset to defaults");
y += 8;
break;
@ -2288,11 +2287,7 @@ int M_DrawFunction (menu_definition_t *menu_definition, int y)
M_DrawCheckbox (220, y, scr_retroscale->value);
y += 8;
break;
case MENU_HUDSWAP:
M_Print (16, y, " hud on left side");
M_DrawCheckbox (220, y, cl_hudswap->value);
y += 8;
break;
case MENU_OLDSTATBAR:
M_Print (16, y, " draw hud");
M_DrawCheckbox (220, y, cl_sbar->value);
@ -3624,13 +3619,7 @@ void M_ExecFunction (menu_definition_t *menu_definition, int key)
}
break;
#endif
case MENU_HUDSWAP:
if (dir != 0)
{
Cvar_SetValue (cl_hudswap, !cl_hudswap->value);
m_changesound = true;
}
break;
case MENU_OLDSTATBAR:
if (dir != 0)
{

View file

@ -172,7 +172,7 @@ cvar_t *r_coloredlights;
cvar_t *r_coloredlightmethod;
cvar_t *r_shiftlights;
cvar_t *r_particlesort;
cvar_t *r_depthoffield;
cvar_t *r_truecolor;
cvar_t *r_overbrightBits;
cvar_t *r_fullbrights;
@ -292,7 +292,7 @@ void R_Init_Cvars (void)
r_coloredlightmethod = Cvar_Get ("r_coloredlightmethod", "0", CVAR_ARCHIVE |CVAR_ORIGINAL);
r_shiftlights = Cvar_Get ("r_shiftlights", "0", CVAR_ARCHIVE |CVAR_ORIGINAL);
r_particlesort = Cvar_Get ("r_particlesort", "1", CVAR_ARCHIVE |CVAR_ORIGINAL);
r_depthoffield = Cvar_Get ("r_depthoffield", "0", CVAR_ORIGINAL);
r_fogdither = Cvar_Get ("r_fogdither", "2", CVAR_ARCHIVE |CVAR_ORIGINAL);
r_fogquality = Cvar_Get ("r_fogquality", "0", CVAR_ARCHIVE |CVAR_ORIGINAL);
r_waterquality = Cvar_Get ("r_waterquality", "0", CVAR_ARCHIVE |CVAR_ORIGINAL);
@ -1875,9 +1875,6 @@ if(!reflectpass)
// if (foguse2)
// R_ApplyFog(); // you're too slow!
if(r_depthoffield->value)
R_ApplyDof(); // you're too slow!
if (!reflectpass)
if (r_dspeeds->value)
@ -2156,84 +2153,3 @@ void R_ApplyDorf (void)
}
void R_ApplyDof(void)
{
// test code for a cheesy depth of field effect
byte *pbuf;
//byte *pbuf;
short *zbuf;
extern short *d_pzbuffer;
int y, x, g;
float v, f,j,h, i;
int vd[64];
int detail;
float flr = vid.width / 320;
float ferv = scr_fov->value / 90;
float farv = scr_fov->value / 89 + 1 * -1;
float feev = 1 - ferv;
int var;
float zeom = vid.width * 0.4;
if (scr_fov->value > 89) return;
detail = (int)r_depthoffield->value;
if (detail == 1){
detail = (int)(vid.width / 120); // determine detail from our video mode.
}
//zeom = temp2->value;
if (detail < 1)
detail = 1; // 0 causes infinite loop crash.
if (r_virtualmode->value)
return; // i also crash.
for (y=0 ; y<scr_vrect.height ; y++)
{
int t, s, q;
pbuf = (byte *)(d_viewbuffer + scr_vrect.y + vid.rowbytes * y);// + scr_vrect.width * y);
//pbuf = (byte *)(d_viewbuffer + scr_vrect.y + vid.rowbytes + scr_vrect.x);
zbuf = d_pzbuffer + (scr_vrect.width*y);
// zbuf = d_pzbuffer + scr_vrect.y * vid.rowbytes + scr_vrect.x;
for (x=0 ; x<vid.width ; x+=detail)
{
if (!zbuf[x]){
return;
}
else
{
v = 92.0f / zbuf[x];
i = 256.0f - v;
// v = bound(0, v, 1);
// v = bound(farv, v, ferv);
// v = bound(24, v, 0);
v *= -zeom;
v += zeom;
v *= feev;
// pbuf[x] = pbuf[x + (rand()&(int)v)];
// if (v>1)
// pbuf[x] = transTable[pbuf[x + (rand()&(int)v)]][pbuf[x]];
// else if (v>2)
// pbuf[x] = transTable[pbuf[x]][pbuf[x + (rand()&(int)v)]];
if (v > detail)
{
int eh;
// Con_Printf("%f = v\n", v);
for(eh=0; eh<detail; eh++)
pbuf[x+eh] = pbuf[x + (rand()&((int)v))];
//pbuf[x] = host_fogmap[pbuf[x]+ (((int)v + 1024) >> 2 & 0xFF00)];
}
}
}
// }
}
}

View file

@ -25,29 +25,41 @@ unsigned int xmms_session = 0;
static int xmms_loop = 1;
static int xmms_track;
static qboolean xmms_playing = false;
static qboolean xmms_wasplaying = false;
void Tracker_Play(byte track, qboolean looping)
{
xmms_remote_set_playlist_pos(xmms_session, (int) track);
xmms_remote_play(xmms_session);
xmms_loop = looping == true ? 0 : 1;
xmms_track = (int) track;
xmms_playing = true;
}
void Tracker_Stop(void)
{
xmms_remote_stop(xmms_session);
xmms_wasplaying = false;
xmms_playing = false;
}
void Tracker_Pause(void)
{
xmms_remote_pause(xmms_session);
xmms_wasplaying = xmms_playing;
xmms_playing = false;
}
void Tracker_Resume(void)
{
if (!xmms_wasplaying)
return;
xmms_remote_play(xmms_session);
xmms_playing = false;
}
// DO NOTHING
@ -62,8 +74,7 @@ void Tracker_Update(void)
static void XMMS_f (void)
{
char *command;
int ret;
int n;
int i;
if (Cmd_Argc() < 2)
return;
@ -93,6 +104,26 @@ static void XMMS_f (void)
Tracker_Resume();
return;
}
if (Q_strcasecmp(command, "quit") == 0)
{
xmms_remote_quit(xmms_session);
return;
}
if (Q_strcasecmp(command, "info") == 0)
{
Con_Printf("%u tracks\n", xmms_remote_get_playlist_length(xmms_session));
if (xmms_playing)
Con_Printf("Currently %s track %u (%s)\n", xmms_loop ? "looping" : "playing", xmms_track, xmms_remote_get_playlist_title(xmms_session, xmms_track));
else if (xmms_wasplaying)
Con_Printf("Paused %s track %u (%s)\n", xmms_loop ? "looping" : "playing", xmms_track, xmms_remote_get_playlist_title(xmms_session, xmms_track));
Con_Printf("Volume is %f\n", xmms_remote_get_main_volume(xmms_session));
return;
}
if(Q_strcasecmp(command, "tracks") == 0)
for(i = 0; i < xmms_remote_get_playlist_length(xmms_session); i++)
Con_Printf("#%i %s\n", i, xmms_remote_get_playlist_title(xmms_session, i));
}
int Tracker_Init(void)