From 05ace9bdcb6e8dd7fe4c50833771f0b40bfca02a Mon Sep 17 00:00:00 2001 From: TimeServ Date: Sat, 11 Mar 2006 00:51:00 +0000 Subject: [PATCH] add Draw_FillRGB, allow con_selectioncolour to use R/G/B git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2078 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/keys.c | 8 +++++++- engine/client/merged.h | 2 ++ engine/client/renderer.c | 5 +++++ engine/gl/gltod3d/gl_fakegl.cpp | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/engine/client/keys.c b/engine/client/keys.c index 740aab41c..7552af380 100644 --- a/engine/client/keys.c +++ b/engine/client/keys.c @@ -385,6 +385,9 @@ void Con_ExecuteLine(console_t *con, char *line) // may take some time } +int scmodified; +vec3_t sccolor; + void Key_ConsoleDrawSelectionBox(void) { extern cvar_t vid_conwidth, vid_conheight; @@ -424,7 +427,10 @@ void Key_ConsoleDrawSelectionBox(void) } ypos++; - Draw_Fill(xpos2*8, ypos2*8, (xpos - xpos2)*8, (ypos - ypos2)*8, con_selectioncolour.value); + if (scmodified != con_selectioncolour.modified) + SCR_StringToRGB(con_selectioncolour.string, sccolor, 1); + + Draw_FillRGB(xpos2*8, ypos2*8, (xpos - xpos2)*8, (ypos - ypos2)*8, sccolor[0], sccolor[1], sccolor[2]); } void Key_ConsoleRelease(int key) diff --git a/engine/client/merged.h b/engine/client/merged.h index fffc91ce1..c63337d56 100644 --- a/engine/client/merged.h +++ b/engine/client/merged.h @@ -34,6 +34,7 @@ extern void (*Draw_ConsoleBackground) (int lines); extern void (*Draw_EditorBackground) (int lines); extern void (*Draw_TileClear) (int x, int y, int w, int h); extern void (*Draw_Fill) (int x, int y, int w, int h, int c); +extern void (*Draw_FillRGB) (int x, int y, int w, int h, float r, float g, float b); extern void (*Draw_FadeScreen) (void); extern void (*Draw_BeginDisc) (void); extern void (*Draw_EndDisc) (void); @@ -141,6 +142,7 @@ typedef struct { void (*Draw_EditorBackground) (int lines); void (*Draw_TileClear) (int x, int y, int w, int h); void (*Draw_Fill) (int x, int y, int w, int h, int c); + void (*Draw_FillRGB) (int x, int y, int w, int h, float r, float g, float b); void (*Draw_FadeScreen) (void); void (*Draw_BeginDisc) (void); void (*Draw_EndDisc) (void); diff --git a/engine/client/renderer.c b/engine/client/renderer.c index cc8a00b52..c2e555beb 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -592,6 +592,7 @@ void (*Draw_ConsoleBackground) (int lines); void (*Draw_EditorBackground) (int lines); void (*Draw_TileClear) (int x, int y, int w, int h); void (*Draw_Fill) (int x, int y, int w, int h, int c); +void (*Draw_FillRGB) (int x, int y, int w, int h, float r, float g, float b); void (*Draw_FadeScreen) (void); void (*Draw_BeginDisc) (void); void (*Draw_EndDisc) (void); @@ -685,6 +686,7 @@ rendererinfo_t dedicatedrendererinfo = { NULL, //Draw_EditorBackground; NULL, //Draw_TileClear; NULL, //Draw_Fill; + NULL, //Draw_FillRGB; NULL, //Draw_FadeScreen; NULL, //Draw_BeginDisc; NULL, //Draw_EndDisc; @@ -793,6 +795,7 @@ rendererinfo_t softwarerendererinfo = { SWDraw_EditorBackground, SWDraw_TileClear, SWDraw_Fill, + SWDraw_FillRGB, SWDraw_FadeScreen, SWDraw_BeginDisc, SWDraw_EndDisc, @@ -886,6 +889,7 @@ rendererinfo_t openglrendererinfo = { GLDraw_EditorBackground, GLDraw_TileClear, GLDraw_Fill, + GLDraw_FillRGB, GLDraw_FadeScreen, GLDraw_BeginDisc, GLDraw_EndDisc, @@ -1369,6 +1373,7 @@ void R_SetRenderer(int wanted) Draw_EditorBackground = ri->Draw_EditorBackground; Draw_TileClear = ri->Draw_TileClear; Draw_Fill = ri->Draw_Fill; + Draw_FillRGB = ri->Draw_FillRGB; Draw_FadeScreen = ri->Draw_FadeScreen; Draw_BeginDisc = ri->Draw_BeginDisc; Draw_EndDisc = ri->Draw_EndDisc; diff --git a/engine/gl/gltod3d/gl_fakegl.cpp b/engine/gl/gltod3d/gl_fakegl.cpp index 8bbb943fa..de748e259 100644 --- a/engine/gl/gltod3d/gl_fakegl.cpp +++ b/engine/gl/gltod3d/gl_fakegl.cpp @@ -4098,6 +4098,7 @@ rendererinfo_t d3drendererinfo = { GLDraw_EditorBackground, GLDraw_TileClear, GLDraw_Fill, + GLDraw_FillRGB, GLDraw_FadeScreen, GLDraw_BeginDisc, GLDraw_EndDisc,