diff --git a/Ctrl.c b/Ctrl.c index e80060044..ebfbdea91 100644 --- a/Ctrl.c +++ b/Ctrl.c @@ -1,4 +1,4 @@ -// $Id: Ctrl.c,v 1.16 2007-06-16 22:23:00 johnnycz Exp $ +// $Id: Ctrl.c,v 1.17 2007-06-16 23:00:18 johnnycz Exp $ #include "quakedef.h" #include "utils.h" @@ -101,12 +101,22 @@ void UI_MakeLine2(char *buf, int w) buf[w] = 0; } +void UI_DrawColoredAlphaBox(int x, int y, int w, int h, float r, float g, float b, float a) +{ +#ifdef GLQUAKE + Draw_AlphaFillRGB(x, y, w, h, r, g, b, a); +#else + Draw_FadeBox(x, y, w, h, (c[0]+c[1]+c[2])/3, a); +#endif +} + void UI_DrawGrayBox(int x, int y, int w, int h) { // ridiculous function, eh? - byte *c = StringToRGB(menu_marked_bgcolor.string); -#ifdef GLQUAKE + byte c[4]; float fade = 1; + memcpy(c, StringToRGB(menu_marked_bgcolor.string), sizeof(byte)*4); +#ifdef GLQUAKE if (menu_marked_fade.value) { fade = 0.5 * (1.0 + sin(menu_marked_fade.value * Sys_DoubleTime())); // this give us sinusoid from 0 to 1 fade = 0.5 + (1.0 - 0.5) * fade ; // this give us sinusoid from 0.5 to 1, so no zero alpha @@ -114,11 +124,8 @@ void UI_DrawGrayBox(int x, int y, int w, int h) } #endif -#ifdef GLQUAKE - Draw_AlphaFillRGB(x, y, w, h, fade*c[0]/255, fade*c[1]/255, fade*c[2]/255, (float)c[3]/255); -#else - Draw_FadeBox(x, y, w, h, c[0], 1); -#endif + UI_DrawColoredAlphaBox(x,y,w,h, + fade*c[0]/255.0, fade*c[1]/255.0, fade*c[2]/255.0, c[3]/255.0); } void UI_DrawBox(int x, int y, int w, int h) diff --git a/Ctrl.h b/Ctrl.h index 8e170482e..91b8dcd69 100644 --- a/Ctrl.h +++ b/Ctrl.h @@ -1,4 +1,4 @@ -// $Id: Ctrl.h,v 1.12 2007-06-16 22:23:00 johnnycz Exp $ +// $Id: Ctrl.h,v 1.13 2007-06-16 23:00:18 johnnycz Exp $ #ifndef __CTRL_H__ #define __CTRL_H__ @@ -22,6 +22,7 @@ void UI_Print_Center3 (int cx, int cy, int w, char *str, clrinfo_t *clr, int clr void UI_DrawTextBox (int x, int y, int width, int lines); void UI_MakeLine(char *buf, int w); void UI_MakeLine2(char *buf, int w); +void UI_DrawColoredAlphaBox(int x, int y, int w, int h, float r, float g, float b, float a); void UI_DrawGrayBox(int x, int y, int w, int h); void UI_DrawBox(int x, int y, int w, int h); diff --git a/EX_browser.c b/EX_browser.c index 7bed75832..6908e7cc2 100644 --- a/EX_browser.c +++ b/EX_browser.c @@ -1,5 +1,5 @@ /* - $Id: EX_browser.c,v 1.39 2007-06-16 22:23:00 johnnycz Exp $ + $Id: EX_browser.c,v 1.40 2007-06-16 23:00:18 johnnycz Exp $ */ #include "quakedef.h" @@ -863,6 +863,12 @@ void Servers_Draw (int x, int y, int w, int h, CTab_t *tab, CTabPage_t *page) UI_DrawGrayBox(x, y+8*(i+1), w, 8); UI_DrawCharacter(x + 8*pos, y+8*(i+1), FLASHINGARROW()); } + else if (servers[servnum]->qizmo) + UI_DrawColoredAlphaBox(x, y+8*(i+1), w, 8, 0.1, 0.1, 0.3, 1); + else if (servnum % 2) + UI_DrawColoredAlphaBox(x, y+8*(i+1), w, 8, 0.1, 0.1, 0.1, 0.5); + else + UI_DrawColoredAlphaBox(x, y+8*(i+1), w, 8, 0.2, 0.2, 0.2, 0.5); // Display server pos = w/8; diff --git a/EX_browser.h b/EX_browser.h index dacbe570d..3c9f7cc03 100644 --- a/EX_browser.h +++ b/EX_browser.h @@ -98,6 +98,7 @@ typedef struct server_data_s int playersn; server_occupancy occupancy; int spectatorsn; + qbool qizmo; qbool support_teams; // is server support team per player } server_data; diff --git a/EX_browser_net.c b/EX_browser_net.c index 0b1c07833..393edd0b1 100644 --- a/EX_browser_net.c +++ b/EX_browser_net.c @@ -226,13 +226,17 @@ void Parse_Serverinfo(server_data *s, char *info) sprintf(s->display.timelimit, "%*.*s", COL_TIMELIMIT, COL_TIMELIMIT, strlen(tmp) > COL_TIMELIMIT ? "99" : tmp); tmp = ValueForKey(s, "*gamedir"); - if (tmp != NULL) + s->qizmo = false; + if (tmp != NULL) sprintf(s->display.gamedir, "%.*s", COL_GAMEDIR, tmp==NULL ? "" : tmp); else { tmp = ValueForKey(s, "*progs"); if (tmp != NULL && !strcmp(tmp, "666")) + { sprintf(s->display.gamedir, "qizmo"); + s->qizmo = true; + } } tmp = ValueForKey(s, "map");