change out "renderer specific" draw_* calls for r2d_* and trim rendererinfo struct

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3760 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2011-03-31 01:14:01 +00:00
parent 479bf96982
commit a0f3482093
29 changed files with 324 additions and 577 deletions

View file

@ -446,8 +446,6 @@ int CG_MarkFragments( int numPoints, const vec3_t *points, const vec3_t projecti
return numtris; return numtris;
} }
void GLDraw_Image(float x, float y, float w, float h, float s1, float t1, float s2, float t2, qpic_t *pic);
int VM_LerpTag(void *out, model_t *model, int f1, int f2, float l2, char *tagname); int VM_LerpTag(void *out, model_t *model, int f1, int f2, float l2, char *tagname);
@ -803,14 +801,14 @@ static qintptr_t CG_SystemCalls(void *offset, quintptr_t mask, qintptr_t fn, con
{ {
float *f = VM_POINTER(arg[0]); float *f = VM_POINTER(arg[0]);
if (f) if (f)
Draw_ImageColours(f[0], f[1], f[2], f[3]); R2D_ImageColours(f[0], f[1], f[2], f[3]);
else else
Draw_ImageColours(1, 1, 1, 1); R2D_ImageColours(1, 1, 1, 1);
} }
break; break;
case CG_R_DRAWSTRETCHPIC: case CG_R_DRAWSTRETCHPIC:
Draw_Image(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]), VM_FLOAT(arg[5]), VM_FLOAT(arg[6]), VM_FLOAT(arg[7]), VM_FROMSHANDLE(VM_LONG(arg[8]))); R2D_Image(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]), VM_FLOAT(arg[5]), VM_FLOAT(arg[6]), VM_FLOAT(arg[7]), VM_FROMSHANDLE(VM_LONG(arg[8])));
break; break;
case CG_R_LERPTAG: //Lerp tag... case CG_R_LERPTAG: //Lerp tag...
@ -1099,7 +1097,7 @@ int CG_Refresh(void)
time = ccs.serverTime; time = ccs.serverTime;
VM_Call(cgvm, CG_DRAW_ACTIVE_FRAME, time, 0, false); VM_Call(cgvm, CG_DRAW_ACTIVE_FRAME, time, 0, false);
Draw_ImageColours(1, 1, 1, 1); R2D_ImageColours(1, 1, 1, 1);
return true; return true;
} }
@ -1127,7 +1125,7 @@ void CG_Start (void)
return; return;
} }
if (!Draw_SafeCachePic) //no renderer loaded if (!R2D_SafeCachePic) //no renderer loaded
{ {
CG_Stop(); CG_Stop();
return; return;

View file

@ -109,15 +109,10 @@ qintptr_t VARGS Plug_Draw_LoadImage(void *offset, quintptr_t mask, const qintptr
if (qrenderer != QR_NONE) if (qrenderer != QR_NONE)
{ {
if (fromwad && Draw_SafePicFromWad) if (fromwad)
pic = Draw_SafePicFromWad(name); pic = R2D_SafePicFromWad(name);
else else
{ pic = R2D_SafeCachePic(name);
if (Draw_SafeCachePic)
pic = Draw_SafeCachePic(name);
else
pic = NULL;
}
} }
else else
pic = NULL; pic = NULL;
@ -140,12 +135,9 @@ void Plug_DrawReloadImages(void)
continue; continue;
} }
if (Draw_SafePicFromWad) pluginimagearray[i].pic = R2D_SafePicFromWad(pluginimagearray[i].name);
pluginimagearray[i].pic = Draw_SafePicFromWad(pluginimagearray[i].name); //pluginimagearray[i].pic = R2D_SafeCachePic(pluginimagearray[i].name);
else if (Draw_SafeCachePic) //pluginimagearray[i].pic = NULL;
pluginimagearray[i].pic = Draw_SafeCachePic(pluginimagearray[i].name);
else
pluginimagearray[i].pic = NULL;
} }
} }
@ -163,15 +155,13 @@ void Plug_FreePlugImages(plugin_t *plug)
} }
} }
//int Draw_Image (float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t image) //int R2D_Image (float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t image)
qintptr_t VARGS Plug_Draw_Image(void *offset, quintptr_t mask, const qintptr_t *arg) qintptr_t VARGS Plug_Draw_Image(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
mpic_t *pic; mpic_t *pic;
int i; int i;
if (qrenderer == QR_NONE) if (qrenderer == QR_NONE)
return 0; return 0;
if (!Draw_Image)
return 0;
i = VM_LONG(arg[8]); i = VM_LONG(arg[8]);
if (i <= 0 || i > pluginimagearraylen) if (i <= 0 || i > pluginimagearraylen)
@ -186,12 +176,12 @@ qintptr_t VARGS Plug_Draw_Image(void *offset, quintptr_t mask, const qintptr_t *
return 0; //wasn't loaded. return 0; //wasn't loaded.
else else
{ {
pic = Draw_SafeCachePic(pluginimagearray[i].name); pic = R2D_SafeCachePic(pluginimagearray[i].name);
if (!pic) if (!pic)
return -1; return -1;
} }
Draw_Image(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]), VM_FLOAT(arg[5]), VM_FLOAT(arg[6]), VM_FLOAT(arg[7]), pic); R2D_Image(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]), VM_FLOAT(arg[5]), VM_FLOAT(arg[6]), VM_FLOAT(arg[7]), pic);
return 1; return 1;
} }
//x1,y1,x2,y2 //x1,y1,x2,y2
@ -224,7 +214,7 @@ qintptr_t VARGS Plug_Draw_Character(void *offset, quintptr_t mask, const qintptr
Font_EndString(font_conchar); Font_EndString(font_conchar);
return 0; return 0;
} }
void (D3D_Draw_Fill_Colours) (int x, int y, int w, int h);
qintptr_t VARGS Plug_Draw_Fill(void *offset, quintptr_t mask, const qintptr_t *arg) qintptr_t VARGS Plug_Draw_Fill(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
float x, y, width, height; float x, y, width, height;
@ -234,59 +224,27 @@ qintptr_t VARGS Plug_Draw_Fill(void *offset, quintptr_t mask, const qintptr_t *a
y = VM_FLOAT(arg[1]); y = VM_FLOAT(arg[1]);
width = VM_FLOAT(arg[2]); width = VM_FLOAT(arg[2]);
height = VM_FLOAT(arg[3]); height = VM_FLOAT(arg[3]);
switch(qrenderer) //FIXME: I don't want qrenderer seen outside the refresh
{ R2D_FillBlock(x, y, width, height);
#ifdef GLQUAKE
case QR_OPENGL:
qglDisable(GL_TEXTURE_2D);
qglBegin(GL_QUADS);
qglVertex2f(x, y);
qglVertex2f(x+width, y);
qglVertex2f(x+width, y+height);
qglVertex2f(x, y+height);
qglEnd();
qglEnable(GL_TEXTURE_2D);
return 1;
#endif
case QR_DIRECT3D:
// D3D_Draw_Fill_Colours(x, y, width, height);
break;
default:
break;
}
return 0; return 0;
} }
qintptr_t VARGS Plug_Draw_ColourP(void *offset, quintptr_t mask, const qintptr_t *arg) qintptr_t VARGS Plug_Draw_ColourP(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
qbyte *pal = host_basepal + VM_LONG(arg[0])*3;
if (arg[0]<0 || arg[0]>255) if (arg[0]<0 || arg[0]>255)
return false; return false;
if (Draw_ImageColours) R2D_ImagePaletteColour(arg[0], 1);
{ return 1;
Draw_ImageColours(pal[0]/255.0f, pal[1]/255.0f, pal[2]/255.0f, 1);
return 1;
}
return 0;
} }
qintptr_t VARGS Plug_Draw_Colour3f(void *offset, quintptr_t mask, const qintptr_t *arg) qintptr_t VARGS Plug_Draw_Colour3f(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
if (Draw_ImageColours) R2D_ImageColours(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), 1);
{ return 1;
Draw_ImageColours(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), 1);
return 1;
}
return 0;
} }
qintptr_t VARGS Plug_Draw_Colour4f(void *offset, quintptr_t mask, const qintptr_t *arg) qintptr_t VARGS Plug_Draw_Colour4f(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
if (Draw_ImageColours) R2D_ImageColours(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]));
{ return 1;
Draw_ImageColours(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]));
return 1;
}
return 0;
} }

View file

@ -424,7 +424,7 @@ void SCR_EraseCenterString (void)
} }
y = vid.height>>1; y = vid.height>>1;
Draw_TileClear (0, y, vid.width, min(8*p->erase_lines, vid.height - y - 1)); R2D_TileClear (0, y, vid.width, min(8*p->erase_lines, vid.height - y - 1));
} }
} }
@ -577,13 +577,13 @@ void SCR_DrawCursor(int prydoncursornum)
extern int mousecursor_x, mousecursor_y; extern int mousecursor_x, mousecursor_y;
mpic_t *p; mpic_t *p;
if (!*cl_cursor.string || prydoncursornum>1) if (!*cl_cursor.string || prydoncursornum>1)
p = Draw_SafeCachePic(va("gfx/prydoncursor%03i.lmp", prydoncursornum)); p = R2D_SafeCachePic(va("gfx/prydoncursor%03i.lmp", prydoncursornum));
else else
p = Draw_SafeCachePic(cl_cursor.string); p = R2D_SafeCachePic(cl_cursor.string);
if (p) if (p)
{ {
Draw_ImageColours(1, 1, 1, 1); R2D_ImageColours(1, 1, 1, 1);
Draw_Image(mousecursor_x-cl_cursorbias.value, mousecursor_y-cl_cursorbias.value, cl_cursorsize.value, cl_cursorsize.value, 0, 0, 1, 1, p); R2D_Image(mousecursor_x-cl_cursorbias.value, mousecursor_y-cl_cursorbias.value, cl_cursorsize.value, cl_cursorsize.value, 0, 0, 1, 1, p);
// Draw_TransPic(mousecursor_x-4, mousecursor_y-4, p); // Draw_TransPic(mousecursor_x-4, mousecursor_y-4, p);
} }
else else
@ -683,10 +683,10 @@ void SCR_ShowPics_Draw(void)
if (failed) if (failed)
continue; continue;
p = Draw_SafeCachePic(sp->picname); p = R2D_SafeCachePic(sp->picname);
if (!p) if (!p)
continue; continue;
Draw_ScalePic(x, y, p->width, p->height, p); R2D_ScalePic(x, y, p->width, p->height, p);
} }
} }
@ -1123,8 +1123,8 @@ void SCR_Init (void)
Cmd_AddRemCommand ("sizeup",SCR_SizeUp_f); Cmd_AddRemCommand ("sizeup",SCR_SizeUp_f);
Cmd_AddRemCommand ("sizedown",SCR_SizeDown_f); Cmd_AddRemCommand ("sizedown",SCR_SizeDown_f);
scr_net = Draw_SafePicFromWad ("net"); scr_net = R2D_SafePicFromWad ("net");
scr_turtle = Draw_SafePicFromWad ("turtle"); scr_turtle = R2D_SafePicFromWad ("turtle");
scr_initialized = true; scr_initialized = true;
} }
@ -1164,7 +1164,7 @@ void SCR_DrawTurtle (void)
if (count < 3) if (count < 3)
return; return;
Draw_ScalePic (scr_vrect.x, scr_vrect.y, 64, 64, scr_turtle); R2D_ScalePic (scr_vrect.x, scr_vrect.y, 64, 64, scr_turtle);
} }
/* /*
@ -1179,7 +1179,7 @@ void SCR_DrawNet (void)
if (cls.demoplayback || !scr_net) if (cls.demoplayback || !scr_net)
return; return;
Draw_ScalePic (scr_vrect.x+64, scr_vrect.y, 64, 64, scr_net); R2D_ScalePic (scr_vrect.x+64, scr_vrect.y, 64, 64, scr_net);
} }
void SCR_StringXY(char *str, float x, float y) void SCR_StringXY(char *str, float x, float y)
@ -1410,10 +1410,10 @@ void SCR_DrawPause (void)
if (key_dest == key_menu) if (key_dest == key_menu)
return; return;
pic = Draw_SafeCachePic ("gfx/pause.lmp"); pic = R2D_SafeCachePic ("gfx/pause.lmp");
if (pic) if (pic)
{ {
Draw_ScalePic ( (vid.width - pic->width)/2, R2D_ScalePic ( (vid.width - pic->width)/2,
(vid.height - 48 - pic->height)/2, pic->width, pic->height, pic); (vid.height - 48 - pic->height)/2, pic->width, pic->height, pic);
} }
else else
@ -1456,12 +1456,12 @@ void SCR_DrawLoading (void)
if (qdepth < h2depth || h2depth > 0xffffff) if (qdepth < h2depth || h2depth > 0xffffff)
{ //quake files { //quake files
pic = Draw_SafeCachePic ("gfx/loading.lmp"); pic = R2D_SafeCachePic ("gfx/loading.lmp");
if (pic) if (pic)
{ {
x = (vid.width - pic->width)/2; x = (vid.width - pic->width)/2;
y = (vid.height - 48 - pic->height)/2; y = (vid.height - 48 - pic->height)/2;
Draw_ScalePic (x, y, pic->width, pic->height, pic); R2D_ScalePic (x, y, pic->width, pic->height, pic);
x = (vid.width/2) - 96; x = (vid.width/2) - 96;
y += pic->height + 8; y += pic->height + 8;
} }
@ -1480,17 +1480,17 @@ void SCR_DrawLoading (void)
sizex = current_loading_size * 192 / total_loading_size; sizex = current_loading_size * 192 / total_loading_size;
if (loading_stage == LS_SERVER) if (loading_stage == LS_SERVER)
{ {
Draw_ImageColours(1.0, 0.0, 0.0, 1.0); R2D_ImageColours(1.0, 0.0, 0.0, 1.0);
Draw_FillBlock(x, y, sizex, 16); R2D_FillBlock(x, y, sizex, 16);
Draw_ImageColours(0.0, 0.0, 0.0, 1.0); R2D_ImageColours(0.0, 0.0, 0.0, 1.0);
Draw_FillBlock(x+sizex, y, 192-sizex, 16); R2D_FillBlock(x+sizex, y, 192-sizex, 16);
} }
else else
{ {
Draw_ImageColours(1.0, 1.0, 0.0, 1.0); R2D_ImageColours(1.0, 1.0, 0.0, 1.0);
Draw_FillBlock(x, y, sizex, 16); R2D_FillBlock(x, y, sizex, 16);
Draw_ImageColours(1.0, 0.0, 0.0, 1.0); R2D_ImageColours(1.0, 0.0, 0.0, 1.0);
Draw_FillBlock(x+sizex, y, 192-sizex, 16); R2D_FillBlock(x+sizex, y, 192-sizex, 16);
} }
Draw_FunString(x+8, y+4, va("Loading %s... %i%%", Draw_FunString(x+8, y+4, va("Loading %s... %i%%",
@ -1502,7 +1502,7 @@ void SCR_DrawLoading (void)
} }
else else
{ //hexen2 files { //hexen2 files
pic = Draw_SafeCachePic ("gfx/menu/loading.lmp"); pic = R2D_SafeCachePic ("gfx/menu/loading.lmp");
if (pic) if (pic)
{ {
int size, count, offset; int size, count, offset;
@ -1511,7 +1511,7 @@ void SCR_DrawLoading (void)
return; return;
offset = (vid.width - pic->width)/2; offset = (vid.width - pic->width)/2;
Draw_ScalePic (offset, 0, pic->width, pic->height, pic); R2D_ScalePic (offset, 0, pic->width, pic->height, pic);
if (loading_stage == LS_NONE) if (loading_stage == LS_NONE)
return; return;
@ -1526,22 +1526,22 @@ void SCR_DrawLoading (void)
else else
count = 106; count = 106;
Draw_ImagePaletteColour (136, 1.0); R2D_ImagePaletteColour (136, 1.0);
Draw_FillBlock (offset+42, 87, count, 1); R2D_FillBlock (offset+42, 87, count, 1);
Draw_FillBlock (offset+42, 87+5, count, 1); R2D_FillBlock (offset+42, 87+5, count, 1);
Draw_ImagePaletteColour (138, 1.0); R2D_ImagePaletteColour (138, 1.0);
Draw_FillBlock (offset+42, 87+1, count, 4); R2D_FillBlock (offset+42, 87+1, count, 4);
if (loading_stage == LS_SERVER) if (loading_stage == LS_SERVER)
count = size; count = size;
else else
count = 0; count = 0;
Draw_ImagePaletteColour(168, 1.0); R2D_ImagePaletteColour(168, 1.0);
Draw_FillBlock (offset+42, 97, count, 1); R2D_FillBlock (offset+42, 97, count, 1);
Draw_FillBlock (offset+42, 97+5, count, 1); R2D_FillBlock (offset+42, 97+5, count, 1);
Draw_ImagePaletteColour(170, 1.0); R2D_ImagePaletteColour(170, 1.0);
Draw_FillBlock (offset+42, 97+1, count, 4); R2D_FillBlock (offset+42, 97+1, count, 4);
y = 104; y = 104;
} }
@ -1635,7 +1635,7 @@ void SCR_ImageName (char *mapname)
#ifdef GLQUAKE #ifdef GLQUAKE
if (qrenderer == QR_OPENGL) if (qrenderer == QR_OPENGL)
{ {
if (!Draw_SafeCachePic (levelshotname)) if (!R2D_SafeCachePic (levelshotname))
{ {
*levelshotname = '\0'; *levelshotname = '\0';
return; return;
@ -2145,20 +2145,20 @@ void SCR_TileClear (void)
if (scr_vrect.x > 0) if (scr_vrect.x > 0)
{ {
// left // left
Draw_TileClear (0, 0, scr_vrect.x, vid.height); R2D_TileClear (0, 0, scr_vrect.x, vid.height);
// right // right
Draw_TileClear (scr_vrect.x + scr_vrect.width, 0, R2D_TileClear (scr_vrect.x + scr_vrect.width, 0,
vid.width - scr_vrect.x + scr_vrect.width, vid.width - scr_vrect.x + scr_vrect.width,
vid.height); vid.height);
} }
if (scr_vrect.y > 0 || scr_vrect.height != vid.height) if (scr_vrect.y > 0 || scr_vrect.height != vid.height)
{ {
// top // top
Draw_TileClear (scr_vrect.x, 0, R2D_TileClear (scr_vrect.x, 0,
scr_vrect.width, scr_vrect.width,
scr_vrect.y); scr_vrect.y);
// bottom // bottom
Draw_TileClear (scr_vrect.x, R2D_TileClear (scr_vrect.x,
scr_vrect.y + scr_vrect.height, scr_vrect.y + scr_vrect.height,
scr_vrect.width, scr_vrect.width,
vid.height); vid.height);
@ -2170,20 +2170,20 @@ void SCR_TileClear (void)
if (scr_vrect.x > 0) if (scr_vrect.x > 0)
{ {
// left // left
Draw_TileClear (0, 0, scr_vrect.x, vid.height - sb_lines); R2D_TileClear (0, 0, scr_vrect.x, vid.height - sb_lines);
// right // right
Draw_TileClear (scr_vrect.x + scr_vrect.width, 0, R2D_TileClear (scr_vrect.x + scr_vrect.width, 0,
vid.width - scr_vrect.x + scr_vrect.width, vid.width - scr_vrect.x + scr_vrect.width,
vid.height - sb_lines); vid.height - sb_lines);
} }
if (scr_vrect.y > 0) if (scr_vrect.y > 0)
{ {
// top // top
Draw_TileClear (scr_vrect.x, 0, R2D_TileClear (scr_vrect.x, 0,
scr_vrect.width, scr_vrect.width,
scr_vrect.y); scr_vrect.y);
// bottom // bottom
Draw_TileClear (scr_vrect.x, R2D_TileClear (scr_vrect.x,
scr_vrect.y + scr_vrect.height, scr_vrect.y + scr_vrect.height,
scr_vrect.width, scr_vrect.width,
vid.height - cl_sbar.value?sb_lines:0 - vid.height - cl_sbar.value?sb_lines:0 -

View file

@ -281,7 +281,6 @@ static vm_t *uivm;
static char *scr_centerstring; static char *scr_centerstring;
void GLDraw_Image(float x, float y, float w, float h, float s1, float t1, float s2, float t2, qpic_t *pic);
char *Get_Q2ConfigString(int i); char *Get_Q2ConfigString(int i);
@ -899,14 +898,14 @@ static qintptr_t UI_SystemCalls(void *offset, quintptr_t mask, qintptr_t fn, con
{ {
float *fl =VM_POINTER(arg[0]); float *fl =VM_POINTER(arg[0]);
if (!fl) if (!fl)
Draw_ImageColours(1, 1, 1, 1); R2D_ImageColours(1, 1, 1, 1);
else else
Draw_ImageColours(fl[0], fl[1], fl[2], fl[3]); R2D_ImageColours(fl[0], fl[1], fl[2], fl[3]);
} }
break; break;
case UI_R_DRAWSTRETCHPIC: case UI_R_DRAWSTRETCHPIC:
Draw_Image(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]), VM_FLOAT(arg[5]), VM_FLOAT(arg[6]), VM_FLOAT(arg[7]), VM_FROMSHANDLE(VM_LONG(arg[8]))); R2D_Image(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]), VM_FLOAT(arg[5]), VM_FLOAT(arg[6]), VM_FLOAT(arg[7]), VM_FROMSHANDLE(VM_LONG(arg[8])));
break; break;
case UI_CM_LERPTAG: //Lerp tag... case UI_CM_LERPTAG: //Lerp tag...

View file

@ -344,7 +344,7 @@ int hl_viewmodelsequencebody;
HLPIC QDECL CLGHL_pic_load (char *picname) HLPIC QDECL CLGHL_pic_load (char *picname)
{ {
return Mod_ForName(picname, false); return Mod_ForName(picname, false);
// return Draw_SafeCachePic(picname); // return R2D_SafeCachePic(picname);
} }
int QDECL CLGHL_pic_getnumframes (HLPIC pic) int QDECL CLGHL_pic_getnumframes (HLPIC pic)
{ {
@ -404,7 +404,7 @@ int QDECL CLGHL_pic_getwidth (HLPIC pic, int frame)
void QDECL CLGHL_pic_select (HLPIC pic, int r, int g, int b) void QDECL CLGHL_pic_select (HLPIC pic, int r, int g, int b)
{ {
selectedpic = pic; selectedpic = pic;
Draw_ImageColours(r/255.0f, g/255.0f, b/255.0f, 1); R2D_ImageColours(r/255.0f, g/255.0f, b/255.0f, 1);
} }
void QDECL CLGHL_pic_drawcuropaque (int frame, int x, int y, hlsubrect_t *loc) void QDECL CLGHL_pic_drawcuropaque (int frame, int x, int y, hlsubrect_t *loc)
{ {
@ -415,7 +415,7 @@ void QDECL CLGHL_pic_drawcuropaque (int frame, int x, int y, hlsubrect_t *loc)
//faster SW render: no blends/holes //faster SW render: no blends/holes
pic->flags &= ~1; pic->flags &= ~1;
Draw_Image(x, y, R2D_Image(x, y,
loc->r-loc->l, loc->b-loc->t, loc->r-loc->l, loc->b-loc->t,
(float)loc->l/pic->width, (float)loc->t/pic->height, (float)loc->l/pic->width, (float)loc->t/pic->height,
(float)loc->r/pic->width, (float)loc->b/pic->height, (float)loc->r/pic->width, (float)loc->b/pic->height,
@ -429,7 +429,7 @@ void QDECL CLGHL_pic_drawcuralphtest (int frame, int x, int y, hlsubrect_t *loc)
//use some kind of alpha //use some kind of alpha
pic->flags |= 1; pic->flags |= 1;
Draw_Image(x, y, R2D_Image(x, y,
loc->r-loc->l, loc->b-loc->t, loc->r-loc->l, loc->b-loc->t,
(float)loc->l/pic->width, (float)loc->t/pic->height, (float)loc->l/pic->width, (float)loc->t/pic->height,
(float)loc->r/pic->width, (float)loc->b/pic->height, (float)loc->r/pic->width, (float)loc->b/pic->height,
@ -448,7 +448,7 @@ void QDECL CLGHL_pic_drawcuradditive (int frame, int x, int y, hlsubrect_t *loc)
pic->flags |= 1; pic->flags |= 1;
if (loc) if (loc)
{ {
Draw_Image(x, y, R2D_Image(x, y,
loc->r-loc->l, loc->b-loc->t, loc->r-loc->l, loc->b-loc->t,
(float)loc->l/pic->width, (float)loc->t/pic->height, (float)loc->l/pic->width, (float)loc->t/pic->height,
(float)loc->r/pic->width, (float)loc->b/pic->height, (float)loc->r/pic->width, (float)loc->b/pic->height,
@ -456,7 +456,7 @@ void QDECL CLGHL_pic_drawcuradditive (int frame, int x, int y, hlsubrect_t *loc)
} }
else else
{ {
Draw_Image(x, y, R2D_Image(x, y,
pic->width, pic->height, pic->width, pic->height,
0, 0, 0, 0,
1, 1, 1, 1,

View file

@ -1211,7 +1211,7 @@ void Con_DrawConsole (int lines, qboolean noback)
// draw the background // draw the background
if (!noback) if (!noback)
Draw_ConsoleBackground (0, lines, scr_con_forcedraw); R2D_ConsoleBackground (0, lines, scr_con_forcedraw);
con_current->unseentext = false; con_current->unseentext = false;
@ -1378,12 +1378,12 @@ void Con_DrawConsole (int lines, qboolean noback)
else else
selstartoffset = 0; selstartoffset = 0;
} }
Draw_ImagePaletteColour(0, 1.0); R2D_ImagePaletteColour(0, 1.0);
Draw_FillBlock((sstart*vid.width)/vid.rotpixelwidth, (y*vid.height)/vid.rotpixelheight, ((send - sstart)*vid.width)/vid.rotpixelwidth, (Font_CharHeight()*vid.height)/vid.rotpixelheight); R2D_FillBlock((sstart*vid.width)/vid.rotpixelwidth, (y*vid.height)/vid.rotpixelheight, ((send - sstart)*vid.width)/vid.rotpixelwidth, (Font_CharHeight()*vid.height)/vid.rotpixelheight);
Draw_ImageColours(1.0, 1.0, 1.0, 1.0);
} }
} }
} }
R2D_ImageColours(1.0, 1.0, 1.0, 1.0);
x = sx; x = sx;
Font_LineDraw(x, y, s, s+linelength); Font_LineDraw(x, y, s, s+linelength);

View file

@ -20,68 +20,68 @@ void Draw_TextBox (int x, int y, int width, int lines)
// draw left side // draw left side
cx = x; cx = x;
cy = y; cy = y;
p = Draw_SafeCachePic ("gfx/box_tl.lmp"); p = R2D_SafeCachePic ("gfx/box_tl.lmp");
if (!p) //assume none exist if (!p) //assume none exist
{ {
Draw_ImageColours(0.0, 0.0, 0.0, 1.0); R2D_ImageColours(0.0, 0.0, 0.0, 1.0);
Draw_FillBlock(x, y, width + 16, 8 * (2 + lines)); R2D_FillBlock(x, y, width + 16, 8 * (2 + lines));
Draw_ImageColours(1.0, 1.0, 1.0, 1.0); R2D_ImageColours(1.0, 1.0, 1.0, 1.0);
return; return;
} }
if (p) if (p)
Draw_ScalePic (cx, cy, 8, 8, p); R2D_ScalePic (cx, cy, 8, 8, p);
p = Draw_SafeCachePic ("gfx/box_ml.lmp"); p = R2D_SafeCachePic ("gfx/box_ml.lmp");
for (n = 0; n < lines; n++) for (n = 0; n < lines; n++)
{ {
cy += 8; cy += 8;
if (p) if (p)
Draw_ScalePic (cx, cy, 8, 8, p); R2D_ScalePic (cx, cy, 8, 8, p);
} }
p = Draw_SafeCachePic ("gfx/box_bl.lmp"); p = R2D_SafeCachePic ("gfx/box_bl.lmp");
if (p) if (p)
Draw_ScalePic (cx, cy+8, 8, 8, p); R2D_ScalePic (cx, cy+8, 8, 8, p);
// draw middle // draw middle
cx += 8; cx += 8;
while (width > 0) while (width > 0)
{ {
cy = y; cy = y;
p = Draw_SafeCachePic ("gfx/box_tm.lmp"); p = R2D_SafeCachePic ("gfx/box_tm.lmp");
if (p) if (p)
Draw_ScalePic (cx, cy, 16, 8, p); R2D_ScalePic (cx, cy, 16, 8, p);
p = Draw_SafeCachePic ("gfx/box_mm.lmp"); p = R2D_SafeCachePic ("gfx/box_mm.lmp");
for (n = 0; n < lines; n++) for (n = 0; n < lines; n++)
{ {
cy += 8; cy += 8;
if (n == 1) if (n == 1)
p = Draw_SafeCachePic ("gfx/box_mm2.lmp"); p = R2D_SafeCachePic ("gfx/box_mm2.lmp");
if (p) if (p)
Draw_ScalePic (cx, cy, 16, 8, p); R2D_ScalePic (cx, cy, 16, 8, p);
} }
p = Draw_SafeCachePic ("gfx/box_bm.lmp"); p = R2D_SafeCachePic ("gfx/box_bm.lmp");
if (p) if (p)
Draw_ScalePic (cx, cy+8, 16, 8, p); R2D_ScalePic (cx, cy+8, 16, 8, p);
width -= 2; width -= 2;
cx += 16; cx += 16;
} }
// draw right side // draw right side
cy = y; cy = y;
p = Draw_SafeCachePic ("gfx/box_tr.lmp"); p = R2D_SafeCachePic ("gfx/box_tr.lmp");
if (p) if (p)
Draw_ScalePic (cx, cy, 8, 8, p); R2D_ScalePic (cx, cy, 8, 8, p);
p = Draw_SafeCachePic ("gfx/box_mr.lmp"); p = R2D_SafeCachePic ("gfx/box_mr.lmp");
for (n = 0; n < lines; n++) for (n = 0; n < lines; n++)
{ {
cy += 8; cy += 8;
if (p) if (p)
Draw_ScalePic (cx, cy, 8, 8, p); R2D_ScalePic (cx, cy, 8, 8, p);
} }
p = Draw_SafeCachePic ("gfx/box_br.lmp"); p = R2D_SafeCachePic ("gfx/box_br.lmp");
if (p) if (p)
Draw_ScalePic (cx, cy+8, 8, 8, p); R2D_ScalePic (cx, cy+8, 8, 8, p);
} }
void Draw_Hexen2BigFontString(int x, int y, const char *text) void Draw_Hexen2BigFontString(int x, int y, const char *text)
@ -91,7 +91,7 @@ void Draw_Hexen2BigFontString(int x, int y, const char *text)
unsigned int hack; unsigned int hack;
hack = d_8to24rgbtable[0]; hack = d_8to24rgbtable[0];
d_8to24rgbtable[0] = 0; d_8to24rgbtable[0] = 0;
p = Draw_SafeCachePic ("gfx/menu/bigfont.lmp"); p = R2D_SafeCachePic ("gfx/menu/bigfont.lmp");
d_8to24rgbtable[0] = hack; d_8to24rgbtable[0] = hack;
while(*text) while(*text)
@ -112,7 +112,7 @@ void Draw_Hexen2BigFontString(int x, int y, const char *text)
sy=-1; sy=-1;
} }
if(sx>=0) if(sx>=0)
Draw_SubPic(x, y, 20, 20, p, sx, sy, 20*8, 20*4); R2D_SubPic(x, y, 20, 20, p, sx, sy, 20*8, 20*4);
x+=20; x+=20;
text++; text++;
} }
@ -121,16 +121,16 @@ void Draw_Hexen2BigFontString(int x, int y, const char *text)
mpic_t *QBigFontWorks(void) mpic_t *QBigFontWorks(void)
{ {
mpic_t *p; mpic_t *p;
p = Draw_SafeCachePic ("gfx/mcharset.lmp"); p = R2D_SafeCachePic ("gfx/mcharset.lmp");
if (p) if (p)
return p; return p;
p = Draw_SafeCachePic ("mcharset.lmp"); p = R2D_SafeCachePic ("mcharset.lmp");
if (p) if (p)
return p; return p;
p = Draw_SafeCachePic ("textures/gfx/mcharset.lmp"); p = R2D_SafeCachePic ("textures/gfx/mcharset.lmp");
if (p) if (p)
return p; return p;
p = Draw_SafeCachePic ("textures/mcharset.lmp"); p = R2D_SafeCachePic ("textures/mcharset.lmp");
if (p) if (p)
return p; return p;
return NULL; return NULL;
@ -182,7 +182,7 @@ void Draw_BigFontString(int x, int y, const char *text)
sy=-1; sy=-1;
} }
if(sx>=0) if(sx>=0)
Draw_SubPic(x, y, 20, 20, p, sx, sy, 20*8, 20*8); R2D_SubPic(x, y, 20, 20, p, sx, sy, 20*8, 20*8);
x+=(p->width>>3); x+=(p->width>>3);
text++; text++;
} }
@ -399,8 +399,8 @@ void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu)
break; break;
case mt_menudot: case mt_menudot:
i = (int)(realtime * 10)%maxdots; i = (int)(realtime * 10)%maxdots;
p = Draw_SafeCachePic(va(menudotstyle, i+mindot )); p = R2D_SafeCachePic(va(menudotstyle, i+mindot ));
Draw_ScalePic(xpos+option->common.posx, ypos+option->common.posy+dotofs, 20, 20, p); R2D_ScalePic(xpos+option->common.posx, ypos+option->common.posy+dotofs, 20, 20, p);
break; break;
case mt_picturesel: case mt_picturesel:
p = NULL; p = NULL;
@ -410,16 +410,16 @@ void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu)
Q_strncpyz(selname, option->picture.picturename, sizeof(selname)); Q_strncpyz(selname, option->picture.picturename, sizeof(selname));
COM_StripExtension(selname, selname, sizeof(selname)); COM_StripExtension(selname, selname, sizeof(selname));
Q_strncatz(selname, "_sel", sizeof(selname)); Q_strncatz(selname, "_sel", sizeof(selname));
p = Draw_SafeCachePic(selname); p = R2D_SafeCachePic(selname);
} }
if (!p) if (!p)
p = Draw_SafeCachePic(option->picture.picturename); p = R2D_SafeCachePic(option->picture.picturename);
Draw_ScalePic(xpos+option->common.posx, ypos+option->common.posy, option->common.width?option->common.width:p->width, option->common.height?option->common.height:p->height, p); R2D_ScalePic(xpos+option->common.posx, ypos+option->common.posy, option->common.width?option->common.width:p->width, option->common.height?option->common.height:p->height, p);
break; break;
case mt_picture: case mt_picture:
p = Draw_SafeCachePic(option->picture.picturename); p = R2D_SafeCachePic(option->picture.picturename);
if (p) Draw_ScalePic(xpos+option->common.posx, ypos+option->common.posy, option->common.width, option->common.height, p); if (p) R2D_ScalePic(xpos+option->common.posx, ypos+option->common.posy, option->common.width, option->common.height, p);
break; break;
case mt_childwindow: case mt_childwindow:
MenuDrawItems(xpos+option->common.posx, ypos+option->common.posy, ((menu_t *)option->custom.data)->options, (menu_t *)option->custom.data); MenuDrawItems(xpos+option->common.posx, ypos+option->common.posy, ((menu_t *)option->custom.data)->options, (menu_t *)option->custom.data);
@ -716,8 +716,8 @@ menupicture_t *MC_AddSelectablePicture(menu_t *menu, int x, int y, char *picname
COM_StripExtension(selname, selname, sizeof(selname)); COM_StripExtension(selname, selname, sizeof(selname));
Q_strncatz(selname, "_sel", sizeof(selname)); Q_strncatz(selname, "_sel", sizeof(selname));
Draw_SafeCachePic(picname); R2D_SafeCachePic(picname);
Draw_SafeCachePic(selname); R2D_SafeCachePic(selname);
n = Z_Malloc(sizeof(menupicture_t) + strlen(picname)+1); n = Z_Malloc(sizeof(menupicture_t) + strlen(picname)+1);
n->common.type = mt_picturesel; n->common.type = mt_picturesel;
@ -738,7 +738,7 @@ menupicture_t *MC_AddPicture(menu_t *menu, int x, int y, int width, int height,
if (qrenderer == QR_NONE) if (qrenderer == QR_NONE)
return NULL; return NULL;
Draw_SafeCachePic(picname); R2D_SafeCachePic(picname);
n = Z_Malloc(sizeof(menupicture_t) + strlen(picname)+1); n = Z_Malloc(sizeof(menupicture_t) + strlen(picname)+1);
n->common.type = mt_picture; n->common.type = mt_picture;
@ -763,7 +763,7 @@ menupicture_t *MC_AddCenterPicture(menu_t *menu, int y, int height, char *picnam
if (qrenderer == QR_NONE) if (qrenderer == QR_NONE)
return NULL; return NULL;
p = Draw_SafeCachePic(picname); p = R2D_SafeCachePic(picname);
if (!p) if (!p)
{ {
x = 320/2; x = 320/2;
@ -1455,11 +1455,11 @@ void DrawCursor(int prydoncursornum)
if (!*cl_cursor.string) if (!*cl_cursor.string)
p = NULL; p = NULL;
else else
p = Draw_SafeCachePic(cl_cursor.string); p = R2D_SafeCachePic(cl_cursor.string);
if (p) if (p)
{ {
Draw_ImageColours(1, 1, 1, 1); R2D_ImageColours(1, 1, 1, 1);
Draw_Image(mousecursor_x-cl_cursorbias.value, mousecursor_y-cl_cursorbias.value, cl_cursorsize.value, cl_cursorsize.value, 0, 0, 1, 1, p); R2D_Image(mousecursor_x-cl_cursorbias.value, mousecursor_y-cl_cursorbias.value, cl_cursorsize.value, cl_cursorsize.value, 0, 0, 1, 1, p);
// Draw_TransPic(mousecursor_x-4, mousecursor_y-4, p); // Draw_TransPic(mousecursor_x-4, mousecursor_y-4, p);
} }
else else
@ -1830,12 +1830,6 @@ void M_Menu_Main_f (void)
SCR_EndLoadingPlaque(); //just in case... SCR_EndLoadingPlaque(); //just in case...
if (!Draw_SafeCachePic)
{
Con_ToggleConsole_f();
return;
}
/* /*
if (0) if (0)
{ {
@ -1866,7 +1860,7 @@ void M_Menu_Main_f (void)
mgt = M_GameType(); mgt = M_GameType();
if (mgt == MGT_QUAKE2) //quake2 main menu. if (mgt == MGT_QUAKE2) //quake2 main menu.
{ {
if (Draw_SafeCachePic("pics/m_main_game")) if (R2D_SafeCachePic("pics/m_main_game"))
{ {
m_state = m_complex; m_state = m_complex;
key_dest = key_menu; key_dest = key_menu;
@ -1875,7 +1869,7 @@ void M_Menu_Main_f (void)
mainm->key = MC_Main_Key; mainm->key = MC_Main_Key;
MC_AddPicture(mainm, 0, 4, 38, 166, "pics/m_main_plaque"); MC_AddPicture(mainm, 0, 4, 38, 166, "pics/m_main_plaque");
p = Draw_SafeCachePic("pics/m_main_logo"); p = R2D_SafeCachePic("pics/m_main_logo");
if (!p) if (!p)
return; return;
MC_AddPicture(mainm, 0, 173, 36, 42, "pics/m_main_logo"); MC_AddPicture(mainm, 0, 173, 36, 42, "pics/m_main_logo");
@ -1921,7 +1915,7 @@ void M_Menu_Main_f (void)
mainm->key = MC_Main_Key; mainm->key = MC_Main_Key;
MC_AddPicture(mainm, 16, 0, 35, 176, "gfx/menu/hplaque.lmp"); MC_AddPicture(mainm, 16, 0, 35, 176, "gfx/menu/hplaque.lmp");
p = Draw_SafeCachePic("gfx/menu/title0.lmp"); p = R2D_SafeCachePic("gfx/menu/title0.lmp");
if (!p) if (!p)
return; return;
MC_AddCenterPicture(mainm, 0, 60, "gfx/menu/title0.lmp"); MC_AddCenterPicture(mainm, 0, 60, "gfx/menu/title0.lmp");
@ -1959,7 +1953,7 @@ void M_Menu_Main_f (void)
key_dest = key_menu; key_dest = key_menu;
mainm = M_CreateMenu(0); mainm = M_CreateMenu(0);
p = Draw_SafeCachePic("gfx/ttl_main.lmp"); p = R2D_SafeCachePic("gfx/ttl_main.lmp");
if (!p) if (!p)
{ {
MC_AddRedText(mainm, 16, 0, "MAIN MENU", false); MC_AddRedText(mainm, 16, 0, "MAIN MENU", false);
@ -1993,7 +1987,7 @@ void M_Menu_Main_f (void)
key_dest = key_menu; key_dest = key_menu;
mainm = M_CreateMenu(0); mainm = M_CreateMenu(0);
p = Draw_SafeCachePic("gfx/ttl_main.lmp"); p = R2D_SafeCachePic("gfx/ttl_main.lmp");
if (!p) if (!p)
{ {
MC_AddRedText(mainm, 16, 0, "MAIN MENU", false); MC_AddRedText(mainm, 16, 0, "MAIN MENU", false);
@ -2011,7 +2005,7 @@ void M_Menu_Main_f (void)
MC_AddPicture(mainm, 72, 32, 240, 112, "gfx/mainmenu.lmp"); MC_AddPicture(mainm, 72, 32, 240, 112, "gfx/mainmenu.lmp");
p = Draw_SafeCachePic("gfx/mainmenu.lmp"); p = R2D_SafeCachePic("gfx/mainmenu.lmp");
b=MC_AddConsoleCommand (mainm, 72, 32, "", "menu_single\n"); b=MC_AddConsoleCommand (mainm, 72, 32, "", "menu_single\n");
mainm->selecteditem = (menuoption_t *)b; mainm->selecteditem = (menuoption_t *)b;

View file

@ -237,11 +237,11 @@ void M_DrawOneServer (int inity)
{ {
if (y>=miny) if (y>=miny)
{ {
Draw_ImagePaletteColour(Sbar_ColorForMap(selectedserver.detail->players[i].topc), 1.0); R2D_ImagePaletteColour(Sbar_ColorForMap(selectedserver.detail->players[i].topc), 1.0);
Draw_FillBlock (12, y, 28, 4); R2D_FillBlock (12, y, 28, 4);
Draw_ImagePaletteColour(Sbar_ColorForMap(selectedserver.detail->players[i].botc), 1.0); R2D_ImagePaletteColour(Sbar_ColorForMap(selectedserver.detail->players[i].botc), 1.0);
Draw_FillBlock (12, y+4, 28, 4); R2D_FillBlock (12, y+4, 28, 4);
Draw_ImageColours(1.0, 1.0, 1.0, 1.0); R2D_ImageColours(1.0, 1.0, 1.0, 1.0);
NM_PrintWhite (12, y, va("%3i", selectedserver.detail->players[i].frags)); NM_PrintWhite (12, y, va("%3i", selectedserver.detail->players[i].frags));
NM_Print (12+8*4, y, selectedserver.detail->players[i].name); NM_Print (12+8*4, y, selectedserver.detail->players[i].name);
} }
@ -417,8 +417,8 @@ void M_DrawServerList(void)
// make sure we have a highlighted background // make sure we have a highlighted background
if (highlight >= 0) if (highlight >= 0)
{ {
Draw_ImageColours(consolecolours[highlight].fr, consolecolours[highlight].fg, consolecolours[highlight].fb, 1.0); R2D_ImageColours(consolecolours[highlight].fr, consolecolours[highlight].fg, consolecolours[highlight].fb, 1.0);
Draw_FillBlock(8, y, vid.width-16, 8); R2D_FillBlock(8, y, vid.width-16, 8);
} }
if (sb_showtimelimit.value) if (sb_showtimelimit.value)
@ -915,8 +915,8 @@ void SL_DrawColumnTitle (int *x, int y, int xlen, int mx, char *str, qboolean re
if (mx >= xmin && !(*filldraw)) if (mx >= xmin && !(*filldraw))
{ {
*filldraw = true; *filldraw = true;
Draw_ImageColours((sin(realtime*4.4)*0.25)+0.5, (sin(realtime*4.4)*0.25)+0.5, 0.08, 1.0); R2D_ImageColours((sin(realtime*4.4)*0.25)+0.5, (sin(realtime*4.4)*0.25)+0.5, 0.08, 1.0);
Draw_FillBlock(xmin, y, xlen, 8); R2D_FillBlock(xmin, y, xlen, 8);
} }
Draw_FunStringWidth(xmin, y, str, xlen); Draw_FunStringWidth(xmin, y, str, xlen);
@ -1062,25 +1062,25 @@ void SL_ServerDraw (int x, int y, menucustom_t *ths, menu_t *menu)
stype = flagstoservertype(si->special); stype = flagstoservertype(si->special);
if (thisone == info->selectedpos) if (thisone == info->selectedpos)
{ {
Draw_ImageColours( R2D_ImageColours(
serverhighlight[(int)stype][0], serverhighlight[(int)stype][0],
serverhighlight[(int)stype][1], serverhighlight[(int)stype][1],
serverhighlight[(int)stype][2], serverhighlight[(int)stype][2],
1.0); 1.0);
} }
else if (thisone == info->scrollpos + (mousecursor_y-16)/8 && mousecursor_x < x) else if (thisone == info->scrollpos + (mousecursor_y-16)/8 && mousecursor_x < x)
Draw_ImageColours((sin(realtime*4.4)*0.25)+0.5, (sin(realtime*4.4)*0.25)+0.5, 0.08, 1.0); R2D_ImageColours((sin(realtime*4.4)*0.25)+0.5, (sin(realtime*4.4)*0.25)+0.5, 0.08, 1.0);
else if (selectedserver.inuse && NET_CompareAdr(si->adr, selectedserver.adr)) else if (selectedserver.inuse && NET_CompareAdr(si->adr, selectedserver.adr))
Draw_ImageColours(((sin(realtime*4.4)*0.25)+0.5) * 0.5, ((sin(realtime*4.4)*0.25)+0.5)*0.5, 0.08*0.5, 1.0); R2D_ImageColours(((sin(realtime*4.4)*0.25)+0.5) * 0.5, ((sin(realtime*4.4)*0.25)+0.5)*0.5, 0.08*0.5, 1.0);
else else
{ {
Draw_ImageColours( R2D_ImageColours(
serverbackcolor[(int)stype * 2 + (thisone & 1)][0], serverbackcolor[(int)stype * 2 + (thisone & 1)][0],
serverbackcolor[(int)stype * 2 + (thisone & 1)][1], serverbackcolor[(int)stype * 2 + (thisone & 1)][1],
serverbackcolor[(int)stype * 2 + (thisone & 1)][2], serverbackcolor[(int)stype * 2 + (thisone & 1)][2],
1.0); 1.0);
} }
Draw_FillBlock(0, y, ths->common.width, 8); R2D_FillBlock(0, y, ths->common.width, 8);
if (sb_showtimelimit.value) {Draw_FunStringWidth((x-3*8), y, va("%i", si->tl), 3*8); x-=4*8;} if (sb_showtimelimit.value) {Draw_FunStringWidth((x-3*8), y, va("%i", si->tl), 3*8); x-=4*8;}
if (sb_showfraglimit.value) {Draw_FunStringWidth((x-3*8), y, va("%i", si->fl), 3*8); x-=4*8;} if (sb_showfraglimit.value) {Draw_FunStringWidth((x-3*8), y, va("%i", si->fl), 3*8); x-=4*8;}
@ -1114,7 +1114,7 @@ qboolean SL_ServerKey (menucustom_t *ths, menu_t *menu, int key)
if (server) if (server)
{ {
snprintf(info->mappic->picturename, 32, "levelshots/%s", server->map); snprintf(info->mappic->picturename, 32, "levelshots/%s", server->map);
if (!Draw_SafeCachePic(info->mappic->picturename)) if (!R2D_SafeCachePic(info->mappic->picturename))
snprintf(info->mappic->picturename, 32, "levelshots/nomap"); snprintf(info->mappic->picturename, 32, "levelshots/nomap");
} }
else else
@ -1217,7 +1217,7 @@ qboolean SL_Key (int key, menu_t *menu)
if (server) if (server)
{ {
snprintf(info->mappic->picturename, 32, "levelshots/%s", server->map); snprintf(info->mappic->picturename, 32, "levelshots/%s", server->map);
if (!Draw_SafeCachePic(info->mappic->picturename)) if (!R2D_SafeCachePic(info->mappic->picturename))
snprintf(info->mappic->picturename, 32, "levelshots/nomap"); snprintf(info->mappic->picturename, 32, "levelshots/nomap");
} }
else else
@ -1246,10 +1246,10 @@ void SL_ServerPlayer (int x, int y, menucustom_t *ths, menu_t *menu)
if ((int)ths->data < selectedserver.detail->numplayers) if ((int)ths->data < selectedserver.detail->numplayers)
{ {
int i = (int)ths->data; int i = (int)ths->data;
Draw_ImagePaletteColour (Sbar_ColorForMap(selectedserver.detail->players[i].topc), 1.0); R2D_ImagePaletteColour (Sbar_ColorForMap(selectedserver.detail->players[i].topc), 1.0);
Draw_FillBlock (x, y, 28, 4); R2D_FillBlock (x, y, 28, 4);
Draw_ImagePaletteColour (Sbar_ColorForMap(selectedserver.detail->players[i].botc), 1.0); R2D_ImagePaletteColour (Sbar_ColorForMap(selectedserver.detail->players[i].botc), 1.0);
Draw_FillBlock (x, y+4, 28, 4); R2D_FillBlock (x, y+4, 28, 4);
NM_PrintWhite (x, y, va("%3i", selectedserver.detail->players[i].frags)); NM_PrintWhite (x, y, va("%3i", selectedserver.detail->players[i].frags));
Draw_FunStringWidth (x+28, y, selectedserver.detail->players[i].name, 12*8); Draw_FunStringWidth (x+28, y, selectedserver.detail->players[i].name, 12*8);
@ -1263,33 +1263,33 @@ void SL_SliderDraw (int x, int y, menucustom_t *ths, menu_t *menu)
mpic_t *pic; mpic_t *pic;
pic = Draw_SafeCachePic("scrollbars/slidebg.png"); pic = R2D_SafeCachePic("scrollbars/slidebg.png");
if (pic) if (pic)
{ {
Draw_ScalePic(x + ths->common.width - 8, y+8, 8, ths->common.height-16, pic); R2D_ScalePic(x + ths->common.width - 8, y+8, 8, ths->common.height-16, pic);
pic = Draw_SafeCachePic("scrollbars/arrow_up.png"); pic = R2D_SafeCachePic("scrollbars/arrow_up.png");
Draw_ScalePic(x + ths->common.width - 8, y, 8, 8, pic); R2D_ScalePic(x + ths->common.width - 8, y, 8, 8, pic);
pic = Draw_SafeCachePic("scrollbars/arrow_down.png"); pic = R2D_SafeCachePic("scrollbars/arrow_down.png");
Draw_ScalePic(x + ths->common.width - 8, y + ths->common.height - 8, 8, 8, pic); R2D_ScalePic(x + ths->common.width - 8, y + ths->common.height - 8, 8, 8, pic);
y += ((info->scrollpos) / ((float)info->numslots - info->visibleslots)) * (float)(ths->common.height-(64+16-1)); y += ((info->scrollpos) / ((float)info->numslots - info->visibleslots)) * (float)(ths->common.height-(64+16-1));
y += 8; y += 8;
pic = Draw_SafeCachePic("scrollbars/slider.png"); pic = R2D_SafeCachePic("scrollbars/slider.png");
Draw_ScalePic(x + ths->common.width - 8, y, 8, 64, pic); R2D_ScalePic(x + ths->common.width - 8, y, 8, 64, pic);
} }
else else
{ {
Draw_ImageColours(0.1, 0.1, 0.2, 1.0); R2D_ImageColours(0.1, 0.1, 0.2, 1.0);
Draw_FillBlock(x, y, ths->common.width, ths->common.height); R2D_FillBlock(x, y, ths->common.width, ths->common.height);
y += ((info->scrollpos) / ((float)info->numslots - info->visibleslots)) * (ths->common.height-8); y += ((info->scrollpos) / ((float)info->numslots - info->visibleslots)) * (ths->common.height-8);
Draw_ImageColours(0.35, 0.35, 0.55, 1.0); R2D_ImageColours(0.35, 0.35, 0.55, 1.0);
Draw_FillBlock(x, y, 8, 8); R2D_FillBlock(x, y, 8, 8);
} }
if (info->sliderpressed) if (info->sliderpressed)
@ -1303,7 +1303,7 @@ void SL_SliderDraw (int x, int y, menucustom_t *ths, menu_t *menu)
my = mousecursor_y; my = mousecursor_y;
my -= ths->common.posy; my -= ths->common.posy;
if (Draw_SafeCachePic("scrollbars/slidebg.png")) if (R2D_SafeCachePic("scrollbars/slidebg.png"))
{ {
my -= 32+8; my -= 32+8;
my /= ths->common.height - (64+16); my /= ths->common.height - (64+16);
@ -1333,7 +1333,7 @@ qboolean SL_SliderKey (menucustom_t *ths, menu_t *menu, int key)
my = mousecursor_y; my = mousecursor_y;
my -= ths->common.posy; my -= ths->common.posy;
if (Draw_SafeCachePic("scrollbars/slidebg.png")) if (R2D_SafeCachePic("scrollbars/slidebg.png"))
{ {
my -= 32+8; my -= 32+8;
my /= ths->common.height - (64+16); my /= ths->common.height - (64+16);

View file

@ -287,7 +287,7 @@ void M_Media_Draw (void)
#define MP_Hightlight(x,y,text,hl) (hl?M_PrintWhite(x, y, text):M_Print(x, y, text)) #define MP_Hightlight(x,y,text,hl) (hl?M_PrintWhite(x, y, text):M_Print(x, y, text))
p = Draw_SafeCachePic ("gfx/p_option.lmp"); p = R2D_SafeCachePic ("gfx/p_option.lmp");
if (p) if (p)
M_DrawScalePic ( (320-p->width)/2, 4, 144, 24, p); M_DrawScalePic ( (320-p->width)/2, 4, 144, 24, p);
if (!bgmvolume.value) if (!bgmvolume.value)
@ -914,7 +914,7 @@ qboolean Media_WinAvi_DecodeFrame(cin_t *cin, qboolean nosound)
if (!lpbi || lpbi->biBitCount != 24)//oops if (!lpbi || lpbi->biBitCount != 24)//oops
{ {
SCR_SetUpToDrawConsole(); SCR_SetUpToDrawConsole();
Draw_ConsoleBackground(0, vid.height, true); R2D_ConsoleBackground(0, vid.height, true);
Draw_FunString(0, 0, "Video stream is corrupt\n"); Draw_FunString(0, 0, "Video stream is corrupt\n");
} }
else else
@ -1743,8 +1743,8 @@ qboolean Media_ShowFilm(void)
Media_PlayFilm(""); Media_PlayFilm("");
else else
{ {
Draw_ImageColours(1, 1, 1, 1); R2D_ImageColours(1, 1, 1, 1);
Draw_ScalePic(0, 0, vid.width, vid.height, videoshader); R2D_ScalePic(0, 0, vid.width, vid.height, videoshader);
SCR_SetUpToDrawConsole(); SCR_SetUpToDrawConsole();
if (scr_con_current) if (scr_con_current)

View file

@ -72,7 +72,7 @@ void M_Menu_MultiPlayer_f (void)
} }
else else
{ {
p = Draw_SafeCachePic("gfx/mp_menu.lmp"); p = R2D_SafeCachePic("gfx/mp_menu.lmp");
if (p) if (p)
{ {
MC_AddPicture(menu, 16, 4, 32, 144, "gfx/qplaque.lmp"); MC_AddPicture(menu, 16, 4, 32, 144, "gfx/qplaque.lmp");
@ -254,7 +254,7 @@ void MSetupQ2_TransDraw (int x, int y, menucustom_t *option, menu_t *menu)
mpic_t *p; mpic_t *p;
p = Draw_SafeCachePic (va("players/%s_i", skin.string)); p = R2D_SafeCachePic (va("players/%s_i", skin.string));
if (!p) if (!p)
{ {
q2skinsearch_t *s = Z_Malloc(sizeof(*s)); q2skinsearch_t *s = Z_Malloc(sizeof(*s));
@ -263,10 +263,10 @@ void MSetupQ2_TransDraw (int x, int y, menucustom_t *option, menu_t *menu)
Cvar_Set(&skin, s->names[rand()%s->entries]); Cvar_Set(&skin, s->names[rand()%s->entries]);
q2skin_destroy(s); q2skin_destroy(s);
p = Draw_SafeCachePic (va("players/%s_i", skin.string)); p = R2D_SafeCachePic (va("players/%s_i", skin.string));
} }
if (p) if (p)
Draw_ScalePic (x-12, y-8, p->width, p->height, p); R2D_ScalePic (x-12, y-8, p->width, p->height, p);
} }
void MSetup_TransDraw (int x, int y, menucustom_t *option, menu_t *menu) void MSetup_TransDraw (int x, int y, menucustom_t *option, menu_t *menu)
@ -312,9 +312,9 @@ void MSetup_TransDraw (int x, int y, menucustom_t *option, menu_t *menu)
} }
} }
p = Draw_SafeCachePic ("gfx/bigbox.lmp"); p = R2D_SafeCachePic ("gfx/bigbox.lmp");
if (p) if (p)
Draw_ScalePic (x-12, y-8, 72, 72, p); R2D_ScalePic (x-12, y-8, 72, 72, p);
M_BuildTranslationTable(info->topcolour, info->lowercolour); M_BuildTranslationTable(info->topcolour, info->lowercolour);
Draw_TransPicTranslate (x, y, info->tiwidth, info->tiheight, info->translationimage, translationTable); Draw_TransPicTranslate (x, y, info->tiwidth, info->tiheight, info->translationimage, translationTable);
@ -339,7 +339,7 @@ void M_Menu_Setup_f (void)
mgt = M_GameType(); mgt = M_GameType();
if (mgt == MGT_QUAKE2) //quake2 main menu. if (mgt == MGT_QUAKE2) //quake2 main menu.
{ {
if (Draw_SafeCachePic("pics/m_banner_plauer_setup")) if (R2D_SafeCachePic("pics/m_banner_plauer_setup"))
{ {
char *modeloptions[] = char *modeloptions[] =
{ {
@ -357,7 +357,7 @@ void M_Menu_Setup_f (void)
// menu->key = MC_Main_Key; // menu->key = MC_Main_Key;
MC_AddPicture(menu, 0, 4, 38, 166, "pics/m_main_plaque"); MC_AddPicture(menu, 0, 4, 38, 166, "pics/m_main_plaque");
p = Draw_SafeCachePic("pics/m_main_logo"); p = R2D_SafeCachePic("pics/m_main_logo");
if (!p) if (!p)
return; return;
MC_AddPicture(menu, 0, 173, 36, 42, "pics/m_main_logo"); MC_AddPicture(menu, 0, 173, 36, 42, "pics/m_main_logo");

View file

@ -154,7 +154,7 @@ void M_MenuS_Picture_f (void)
return; return;
} }
p = Draw_SafeCachePic(picname); p = R2D_SafeCachePic(picname);
if (!p) if (!p)
return; return;

View file

@ -328,7 +328,7 @@ void M_Menu_SinglePlayer_f (void)
MC_AddCenterPicture(menu, 4, 24, "gfx/p_option.lmp"); MC_AddCenterPicture(menu, 4, 24, "gfx/p_option.lmp");
} }
p = Draw_SafeCachePic("gfx/sp_menu.lmp"); p = R2D_SafeCachePic("gfx/sp_menu.lmp");
if (!p) if (!p)
{ {
MC_AddBox (menu, 60, 10*8, 23, 4); MC_AddBox (menu, 60, 10*8, 23, 4);

View file

@ -58,7 +58,7 @@ void M_PrintWhite (int cx, int cy, qbyte *str)
} }
void M_DrawScalePic (int x, int y, int w, int h, mpic_t *pic) void M_DrawScalePic (int x, int y, int w, int h, mpic_t *pic)
{ {
Draw_ScalePic (x + ((vid.width - 320)>>1), y, w, h, pic); R2D_ScalePic (x + ((vid.width - 320)>>1), y, w, h, pic);
} }
qbyte identityTable[256]; qbyte identityTable[256];
@ -129,18 +129,18 @@ void M_DrawTextBox (int x, int y, int width, int lines)
// draw left side // draw left side
cx = x; cx = x;
cy = y; cy = y;
p = Draw_SafeCachePic ("gfx/box_tl.lmp"); p = R2D_SafeCachePic ("gfx/box_tl.lmp");
if (!p) if (!p)
return; //assume we can't find any return; //assume we can't find any
M_DrawScalePic (cx, cy, 8, 8, p); M_DrawScalePic (cx, cy, 8, 8, p);
p = Draw_SafeCachePic ("gfx/box_ml.lmp"); p = R2D_SafeCachePic ("gfx/box_ml.lmp");
if (p) if (p)
for (n = 0; n < lines; n++) for (n = 0; n < lines; n++)
{ {
cy += 8; cy += 8;
M_DrawScalePic (cx, cy, 8, 8, p); M_DrawScalePic (cx, cy, 8, 8, p);
} }
p = Draw_SafeCachePic ("gfx/box_bl.lmp"); p = R2D_SafeCachePic ("gfx/box_bl.lmp");
if (p) if (p)
M_DrawScalePic (cx, cy+8, 8, 8, p); M_DrawScalePic (cx, cy+8, 8, 8, p);
@ -149,23 +149,23 @@ void M_DrawTextBox (int x, int y, int width, int lines)
while (width > 0) while (width > 0)
{ {
cy = y; cy = y;
p = Draw_SafeCachePic ("gfx/box_tm.lmp"); p = R2D_SafeCachePic ("gfx/box_tm.lmp");
if (p) if (p)
M_DrawScalePic (cx, cy, 16, 8, p); M_DrawScalePic (cx, cy, 16, 8, p);
p = Draw_SafeCachePic ("gfx/box_mm.lmp"); p = R2D_SafeCachePic ("gfx/box_mm.lmp");
if (p) if (p)
for (n = 0; n < lines; n++) for (n = 0; n < lines; n++)
{ {
cy += 8; cy += 8;
if (n == 1) if (n == 1)
{ {
p = Draw_SafeCachePic ("gfx/box_mm2.lmp"); p = R2D_SafeCachePic ("gfx/box_mm2.lmp");
if (!p) if (!p)
break; break;
} }
M_DrawScalePic (cx, cy, 16, 8, p); M_DrawScalePic (cx, cy, 16, 8, p);
} }
p = Draw_SafeCachePic ("gfx/box_bm.lmp"); p = R2D_SafeCachePic ("gfx/box_bm.lmp");
if (p) if (p)
M_DrawScalePic (cx, cy+8, 16, 8, p); M_DrawScalePic (cx, cy+8, 16, 8, p);
width -= 2; width -= 2;
@ -174,17 +174,17 @@ void M_DrawTextBox (int x, int y, int width, int lines)
// draw right side // draw right side
cy = y; cy = y;
p = Draw_SafeCachePic ("gfx/box_tr.lmp"); p = R2D_SafeCachePic ("gfx/box_tr.lmp");
if (p) if (p)
M_DrawScalePic (cx, cy, 8, 8, p); M_DrawScalePic (cx, cy, 8, 8, p);
p = Draw_SafeCachePic ("gfx/box_mr.lmp"); p = R2D_SafeCachePic ("gfx/box_mr.lmp");
if (p) if (p)
for (n = 0; n < lines; n++) for (n = 0; n < lines; n++)
{ {
cy += 8; cy += 8;
M_DrawScalePic (cx, cy, 8, 8, p); M_DrawScalePic (cx, cy, 8, 8, p);
} }
p = Draw_SafeCachePic ("gfx/box_br.lmp"); p = R2D_SafeCachePic ("gfx/box_br.lmp");
if (p) if (p)
M_DrawScalePic (cx, cy+8, 8, 8, p); M_DrawScalePic (cx, cy+8, 8, 8, p);
} }
@ -544,7 +544,7 @@ void M_Menu_Help_f (void)
void M_Help_Draw (void) void M_Help_Draw (void)
{ {
mpic_t *pic; mpic_t *pic;
pic = Draw_SafeCachePic(va(helpstyle, help_page+helppagemin)); pic = R2D_SafeCachePic(va(helpstyle, help_page+helppagemin));
if (!pic) if (!pic)
M_Menu_Main_f (); M_Menu_Main_f ();
else else
@ -992,7 +992,7 @@ void M_Draw (int uimenu)
if (uimenu) if (uimenu)
{ {
if (uimenu == 2) if (uimenu == 2)
Draw_FadeScreen (); R2D_FadeScreen ();
#ifdef VM_UI #ifdef VM_UI
UI_DrawMenu(); UI_DrawMenu();
#endif #endif
@ -1013,14 +1013,14 @@ void M_Draw (int uimenu)
if ((!menu_script || scr_con_current) && !m_recursiveDraw) if ((!menu_script || scr_con_current) && !m_recursiveDraw)
{ {
Draw_FadeScreen (); R2D_FadeScreen ();
} }
else else
{ {
m_recursiveDraw = false; m_recursiveDraw = false;
} }
Draw_ImageColours(1, 1, 1, 1); R2D_ImageColours(1, 1, 1, 1);
switch (m_state) switch (m_state)
{ {

View file

@ -56,31 +56,28 @@ typedef struct {
extern r_qrenderer_t qrenderer; extern r_qrenderer_t qrenderer;
extern char *q_renderername; extern char *q_renderername;
extern mpic_t *(*Draw_SafePicFromWad) (char *name); mpic_t *R2D_SafeCachePic (char *path);
extern mpic_t *(*Draw_SafeCachePic) (char *path); mpic_t *R2D_SafePicFromWad (char *name);
void R2D_ScalePic (int x, int y, int width, int height, mpic_t *pic);
void R2D_SubPic(int x, int y, int width, int height, mpic_t *pic, int srcx, int srcy, int srcwidth, int srcheight);
void R2D_TileClear (int x, int y, int w, int h);
void R2D_FadeScreen (void);
void R2D_ConsoleBackground (int firstline, int lastline, qboolean forceopaque);
void R2D_EditorBackground (void);
void R2D_Image(float x, float y, float w, float h, float s1, float t1, float s2, float t2, mpic_t *pic);
void R2D_ImageColours(float r, float g, float b, float a);
void R2D_ImagePaletteColour(unsigned int i, float a);
void R2D_FillBlock(int x, int y, int w, int h);
extern void (*Draw_Init) (void); extern void (*Draw_Init) (void);
extern void (*Draw_TinyCharacter) (int x, int y, unsigned int num); extern void (*Draw_TinyCharacter) (int x, int y, unsigned int num);
extern void (*Draw_Crosshair) (void); extern void (*Draw_Crosshair) (void);
extern void (*Draw_ScalePic) (int x, int y, int width, int height, mpic_t *pic);
extern void (*Draw_SubPic) (int x, int y, int width, int height, mpic_t *pic, int srcx, int srcy, int srcwidth, int srcheight);
extern void (*Draw_TransPicTranslate) (int x, int y, int width, int height, qbyte *image, qbyte *translation); extern void (*Draw_TransPicTranslate) (int x, int y, int width, int height, qbyte *image, qbyte *translation);
extern void (*Draw_ConsoleBackground) (int firstline, int lastline, qboolean forceopaque);
extern void (*Draw_EditorBackground) (void);
extern void (*Draw_TileClear) (int x, int y, int w, int h);
extern void (*Draw_Fill) (int x, int y, int w, int h, unsigned 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);
extern qboolean (*Draw_IsCached) (char *picname); //can be null extern qboolean (*Draw_IsCached) (char *picname); //can be null
extern void (*Draw_Image) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, mpic_t *pic); //gl-style scaled/coloured/subpic
extern void (*Draw_ImageColours) (float r, float g, float b, float a);
void R2D_FillBlock(int x, int y, int w, int h);
#define Draw_FillBlock R2D_FillBlock
void R2D_ImagePaletteColour(unsigned int i, float a);
#define Draw_ImagePaletteColour R2D_ImagePaletteColour
extern void (*R_Init) (void); extern void (*R_Init) (void);
extern void (*R_DeInit) (void); extern void (*R_DeInit) (void);
extern void (*R_RenderView) (void); // must set r_refdef first extern void (*R_RenderView) (void); // must set r_refdef first
@ -181,25 +178,10 @@ typedef struct rendererinfo_s {
char *name[4]; char *name[4];
r_qrenderer_t rtype; r_qrenderer_t rtype;
mpic_t *(*Draw_SafePicFromWad) (char *name);
mpic_t *(*Draw_SafeCachePic) (char *path);
void (*Draw_Init) (void); void (*Draw_Init) (void);
void (*Draw_Shutdown) (void); void (*Draw_Shutdown) (void);
void (*Draw_Crosshair) (void); void (*Draw_Crosshair) (void); //TODO: MARKED FOR DEMOLITION
void (*Draw_ScalePic) (int x, int y, int width, int height, mpic_t *pic); void (*Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *pic, qbyte *translation); //TODO: MARKED FOR DEMOLITION
void (*Draw_SubPic) (int x, int y, int width, int height, mpic_t *pic, int srcx, int srcy, int srcwidth, int srcheight);
void (*Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *pic, qbyte *translation);
void (*Draw_ConsoleBackground) (int firstline, int lastline, qboolean forceopaque);
void (*Draw_EditorBackground) (void);
void (*Draw_TileClear) (int x, int y, int w, int h);
void (*Draw_Fill) (int x, int y, int w, int h, unsigned 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);
void (*Draw_Image) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, mpic_t *pic); //gl-style scaled/coloured/subpic
void (*Draw_ImageColours) (float r, float g, float b, float a);
texid_t (*IMG_LoadTexture) (char *identifier, int width, int height, uploadfmt_t fmt, void *data, unsigned int flags); texid_t (*IMG_LoadTexture) (char *identifier, int width, int height, uploadfmt_t fmt, void *data, unsigned int flags);
texid_t (*IMG_LoadTexture8Pal24) (char *identifier, int width, int height, qbyte *data, qbyte *palette24, unsigned int flags); texid_t (*IMG_LoadTexture8Pal24) (char *identifier, int width, int height, qbyte *data, qbyte *palette24, unsigned int flags);

View file

@ -279,8 +279,8 @@ void QCBUILTIN PF_CL_drawfill (progfuncs_t *prinst, struct globalvars_s *pr_glob
float *rgb = G_VECTOR(OFS_PARM2); float *rgb = G_VECTOR(OFS_PARM2);
float alpha = G_FLOAT(OFS_PARM3); float alpha = G_FLOAT(OFS_PARM3);
Draw_ImageColours(rgb[0], rgb[1], rgb[2], alpha); R2D_ImageColours(rgb[0], rgb[1], rgb[2], alpha);
Draw_FillBlock(pos[0], pos[1], size[0], size[1]); R2D_FillBlock(pos[0], pos[1], size[0], size[1]);
G_FLOAT(OFS_RETURN) = 1; G_FLOAT(OFS_RETURN) = 1;
} }
@ -417,13 +417,13 @@ void QCBUILTIN PF_CL_drawpic (progfuncs_t *prinst, struct globalvars_s *pr_globa
mpic_t *p; mpic_t *p;
p = Draw_SafeCachePic(picname); p = R2D_SafeCachePic(picname);
if (!p) if (!p)
p = Draw_SafePicFromWad(picname); p = R2D_SafePicFromWad(picname);
PF_SelectDPDrawFlag(flag); PF_SelectDPDrawFlag(flag);
Draw_ImageColours(rgb[0], rgb[1], rgb[2], alpha); R2D_ImageColours(rgb[0], rgb[1], rgb[2], alpha);
Draw_Image(pos[0], pos[1], size[0], size[1], 0, 0, 1, 1, p); R2D_Image(pos[0], pos[1], size[0], size[1], 0, 0, 1, 1, p);
BE_SelectMode(BEM_STANDARD, 0); BE_SelectMode(BEM_STANDARD, 0);
G_FLOAT(OFS_RETURN) = 1; G_FLOAT(OFS_RETURN) = 1;
@ -442,11 +442,11 @@ void QCBUILTIN PF_CL_drawsubpic (progfuncs_t *prinst, struct globalvars_s *pr_gl
mpic_t *p; mpic_t *p;
p = Draw_SafeCachePic(picname); p = R2D_SafeCachePic(picname);
PF_SelectDPDrawFlag(flag); PF_SelectDPDrawFlag(flag);
Draw_ImageColours(rgb[0], rgb[1], rgb[2], alpha); R2D_ImageColours(rgb[0], rgb[1], rgb[2], alpha);
Draw_Image( pos[0], pos[1], R2D_Image( pos[0], pos[1],
size[0], size[1], size[0], size[1],
srcPos[0], srcPos[1], srcPos[0], srcPos[1],
srcPos[0]+srcSize[0], srcPos[1]+srcSize[1], srcPos[0]+srcSize[0], srcPos[1]+srcSize[1],
@ -484,7 +484,7 @@ void QCBUILTIN PF_CL_precache_pic (progfuncs_t *prinst, struct globalvars_s *pr_
fromwad = false; fromwad = false;
if (fromwad) if (fromwad)
pic = Draw_SafePicFromWad(str); pic = R2D_SafePicFromWad(str);
else else
{ {
if (cls.state if (cls.state
@ -494,7 +494,7 @@ void QCBUILTIN PF_CL_precache_pic (progfuncs_t *prinst, struct globalvars_s *pr_
) )
CL_CheckOrEnqueDownloadFile(str, str, 0); CL_CheckOrEnqueDownloadFile(str, str, 0);
pic = Draw_SafeCachePic(str); pic = R2D_SafeCachePic(str);
} }
if (pic) if (pic)
@ -597,12 +597,12 @@ void QCBUILTIN PF_CL_drawline (progfuncs_t *prinst, struct globalvars_s *pr_glob
void QCBUILTIN PF_CL_drawgetimagesize (progfuncs_t *prinst, struct globalvars_s *pr_globals) void QCBUILTIN PF_CL_drawgetimagesize (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
char *picname = PR_GetStringOfs(prinst, OFS_PARM0); char *picname = PR_GetStringOfs(prinst, OFS_PARM0);
mpic_t *p = Draw_SafeCachePic(picname); mpic_t *p = R2D_SafeCachePic(picname);
float *ret = G_VECTOR(OFS_RETURN); float *ret = G_VECTOR(OFS_RETURN);
if (!p) if (!p)
p = Draw_SafeCachePic(va("%s.tga", picname)); p = R2D_SafeCachePic(va("%s.tga", picname));
if (p) if (p)
{ {

View file

@ -88,9 +88,9 @@ void R2D_Init(void)
missing_texture = R_LoadTexture8("no_texture", 16, 16, (unsigned char*)r_notexture_mip + r_notexture_mip->offsets[0], IF_NOALPHA|IF_NOGAMMA, 0); missing_texture = R_LoadTexture8("no_texture", 16, 16, (unsigned char*)r_notexture_mip + r_notexture_mip->offsets[0], IF_NOALPHA|IF_NOGAMMA, 0);
draw_backtile = Draw_SafePicFromWad ("backtile"); draw_backtile = R2D_SafePicFromWad ("backtile");
if (!draw_backtile) if (!draw_backtile)
draw_backtile = Draw_SafeCachePic ("gfx/menu/backtile.lmp"); draw_backtile = R2D_SafeCachePic ("gfx/menu/backtile.lmp");
shader_draw_fill = R_RegisterShader("fill_opaque", shader_draw_fill = R_RegisterShader("fill_opaque",
"{\n" "{\n"

View file

@ -640,28 +640,14 @@ void Renderer_Start(void)
} }
mpic_t *(*Draw_SafePicFromWad) (char *name);
mpic_t *(*Draw_SafeCachePic) (char *path);
void (*Draw_Init) (void); void (*Draw_Init) (void);
void (*Draw_Shutdown) (void); void (*Draw_Shutdown) (void);
//void (*Draw_TinyCharacter) (int x, int y, unsigned int num); //void (*Draw_TinyCharacter) (int x, int y, unsigned int num);
void (*Draw_Crosshair) (void); void (*Draw_Crosshair) (void);
void (*Draw_ScalePic) (int x, int y, int width, int height, mpic_t *pic);
void (*Draw_SubPic) (int x, int y, int width, int height, mpic_t *pic, int srcx, int srcy, int srcwidth, int srcheight); void (*Draw_SubPic) (int x, int y, int width, int height, mpic_t *pic, int srcx, int srcy, int srcwidth, int srcheight);
void (*Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *image, qbyte *translation); void (*Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *image, qbyte *translation);
void (*Draw_ConsoleBackground) (int firstline, int lastline, qboolean forceopaque);
void (*Draw_EditorBackground) (void);
void (*Draw_TileClear) (int x, int y, int w, int h);
void (*Draw_Fill) (int x, int y, int w, int h, unsigned 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);
void (*Draw_Image) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, mpic_t *pic); //gl-style scaled/coloured/subpic
void (*Draw_ImageColours) (float r, float g, float b, float a);
void (*R_Init) (void); void (*R_Init) (void);
void (*R_DeInit) (void); void (*R_DeInit) (void);
@ -715,25 +701,10 @@ rendererinfo_t dedicatedrendererinfo = {
}, },
QR_NONE, QR_NONE,
NULL, //Draw_PicFromWad; //Not supported
NULL, //Draw_SafeCachePic;
NULL, //Draw_Init; NULL, //Draw_Init;
NULL, //Draw_Shutdown; NULL, //Draw_Shutdown;
NULL, //Draw_Crosshair; NULL, //Draw_Crosshair;
NULL, //Draw_SubPic;
NULL, //Draw_TransPicTranslate; NULL, //Draw_TransPicTranslate;
NULL, //Draw_ConsoleBackground;
NULL, //Draw_EditorBackground;
NULL, //Draw_TileClear;
NULL, //Draw_Fill;
NULL, //Draw_FillRGB;
NULL, //Draw_FadeScreen;
NULL, //Draw_BeginDisc;
NULL, //Draw_EndDisc;
NULL, //I'm lazy.
NULL, //Draw_Image
NULL, //Draw_ImageColours
NULL, //R_LoadTexture NULL, //R_LoadTexture
NULL, //R_LoadTexture8Pal24 NULL, //R_LoadTexture8Pal24
@ -1276,25 +1247,10 @@ void R_SetRenderer(rendererinfo_t *ri)
qrenderer = ri->rtype; qrenderer = ri->rtype;
q_renderername = ri->name[0]; q_renderername = ri->name[0];
Draw_SafePicFromWad = ri->Draw_SafePicFromWad; //Not supported
Draw_SafeCachePic = ri->Draw_SafeCachePic;
Draw_Init = ri->Draw_Init; Draw_Init = ri->Draw_Init;
Draw_Shutdown = ri->Draw_Shutdown; Draw_Shutdown = ri->Draw_Shutdown;
Draw_Crosshair = ri->Draw_Crosshair; Draw_Crosshair = ri->Draw_Crosshair;
Draw_SubPic = ri->Draw_SubPic;
Draw_TransPicTranslate = ri->Draw_TransPicTranslate; Draw_TransPicTranslate = ri->Draw_TransPicTranslate;
Draw_ConsoleBackground = ri->Draw_ConsoleBackground;
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;
Draw_ScalePic = ri->Draw_ScalePic;
Draw_Image = ri->Draw_Image;
Draw_ImageColours = ri->Draw_ImageColours;
R_Init = ri->R_Init; R_Init = ri->R_Init;
R_DeInit = ri->R_DeInit; R_DeInit = ri->R_DeInit;

View file

@ -243,7 +243,7 @@ static char *q2sb_nums[2][11] =
static mpic_t *Sbar_Q2CachePic(char *name) static mpic_t *Sbar_Q2CachePic(char *name)
{ {
return Draw_SafeCachePic(va("pics/%s.pcx", name)); return R2D_SafeCachePic(va("pics/%s.pcx", name));
} }
#define ICON_WIDTH 24 #define ICON_WIDTH 24
@ -280,7 +280,7 @@ static void SCR_DrawField (int x, int y, int color, int width, int value)
p = Sbar_Q2CachePic(q2sb_nums[color][frame]); p = Sbar_Q2CachePic(q2sb_nums[color][frame]);
if (p) if (p)
Draw_ScalePic (x,y,p->width, p->height, p); R2D_ScalePic (x,y,p->width, p->height, p);
x += CHAR_WIDTH; x += CHAR_WIDTH;
ptr++; ptr++;
l--; l--;
@ -378,7 +378,7 @@ void Sbar_ExecuteLayoutString (char *s)
// SCR_AddDirtyPoint (x+23, y+23); // SCR_AddDirtyPoint (x+23, y+23);
p = Sbar_Q2CachePic(Get_Q2ConfigString(Q2CS_IMAGES+value)); p = Sbar_Q2CachePic(Get_Q2ConfigString(Q2CS_IMAGES+value));
if (p) if (p)
Draw_ScalePic (x, y, p->width, p->height, p); R2D_ScalePic (x, y, p->width, p->height, p);
} }
continue; continue;
} }
@ -417,7 +417,7 @@ void Sbar_ExecuteLayoutString (char *s)
// if (!ci->icon) // if (!ci->icon)
// ci = &cl.baseclientinfo; // ci = &cl.baseclientinfo;
// Draw_Pic (x, y, Draw_SafeCachePic(ci->iconname)); // Draw_Pic (x, y, R2D_SafeCachePic(ci->iconname));
continue; continue;
} }
@ -463,7 +463,7 @@ void Sbar_ExecuteLayoutString (char *s)
// SCR_AddDirtyPoint (x+23, y+23); // SCR_AddDirtyPoint (x+23, y+23);
p = Sbar_Q2CachePic(com_token); p = Sbar_Q2CachePic(com_token);
if (p) if (p)
Draw_ScalePic (x, y, p->width, p->height, p); R2D_ScalePic (x, y, p->width, p->height, p);
continue; continue;
} }
@ -494,7 +494,7 @@ void Sbar_ExecuteLayoutString (char *s)
{ {
p = Sbar_Q2CachePic("field_3"); p = Sbar_Q2CachePic("field_3");
if (p) if (p)
Draw_ScalePic (x, y, p->width, p->height, p); R2D_ScalePic (x, y, p->width, p->height, p);
} }
SCR_DrawField (x, y, color, width, value); SCR_DrawField (x, y, color, width, value);
@ -518,7 +518,7 @@ void Sbar_ExecuteLayoutString (char *s)
{ {
p = Sbar_Q2CachePic("field_3"); p = Sbar_Q2CachePic("field_3");
if (p) if (p)
Draw_ScalePic (x, y, p->width, p->height, p); R2D_ScalePic (x, y, p->width, p->height, p);
} }
SCR_DrawField (x, y, color, width, value); SCR_DrawField (x, y, color, width, value);
@ -537,7 +537,7 @@ void Sbar_ExecuteLayoutString (char *s)
color = 0; // green color = 0; // green
if (cl.q2frame.playerstate.stats[Q2STAT_FLASHES] & 2) if (cl.q2frame.playerstate.stats[Q2STAT_FLASHES] & 2)
Draw_ScalePic (x, y, FINDOUT, FINDOUT, Draw_SafeCachePic("field_3")); R2D_ScalePic (x, y, FINDOUT, FINDOUT, R2D_SafeCachePic("field_3"));
SCR_DrawField (x, y, color, width, value); SCR_DrawField (x, y, color, width, value);
continue; continue;
@ -773,7 +773,7 @@ char *failedpic;
mpic_t *Sbar_PicFromWad(char *name) mpic_t *Sbar_PicFromWad(char *name)
{ {
mpic_t *ret; mpic_t *ret;
ret = Draw_SafePicFromWad(name); ret = R2D_SafePicFromWad(name);
if (ret) if (ret)
return ret; return ret;
@ -958,7 +958,7 @@ Sbar_DrawPic
*/ */
void Sbar_DrawPic (int x, int y, int w, int h, mpic_t *pic) void Sbar_DrawPic (int x, int y, int w, int h, mpic_t *pic)
{ {
Draw_ScalePic(sbar_rect.x + x /* + ((sbar_rect.width - 320)>>1) */, sbar_rect.y + y + (sbar_rect.height-SBAR_HEIGHT), w, h, pic); R2D_ScalePic(sbar_rect.x + x /* + ((sbar_rect.width - 320)>>1) */, sbar_rect.y + y + (sbar_rect.height-SBAR_HEIGHT), w, h, pic);
} }
/* /*
@ -970,7 +970,7 @@ JACK: Draws a portion of the picture in the status bar.
void Sbar_DrawSubPic(int x, int y, int width, int height, mpic_t *pic, int srcx, int srcy, int srcwidth, int srcheight) void Sbar_DrawSubPic(int x, int y, int width, int height, mpic_t *pic, int srcx, int srcy, int srcwidth, int srcheight)
{ {
Draw_SubPic (sbar_rect.x + x, sbar_rect.y + y+(sbar_rect.height-SBAR_HEIGHT), width, height, pic, srcx, srcy, srcwidth, srcheight); R2D_SubPic (sbar_rect.x + x, sbar_rect.y + y+(sbar_rect.height-SBAR_HEIGHT), width, height, pic, srcx, srcy, srcwidth, srcheight);
} }
/* /*
@ -1038,26 +1038,26 @@ void Sbar_FillPC (int x, int y, int w, int h, unsigned int pcolour)
{ {
if (pcolour >= 16) if (pcolour >= 16)
{ {
Draw_ImageColours (((pcolour&0xff0000)>>16)/255.0f, ((pcolour&0xff00)>>8)/255.0f, (pcolour&0xff)/255.0f, 1.0); R2D_ImageColours (((pcolour&0xff0000)>>16)/255.0f, ((pcolour&0xff00)>>8)/255.0f, (pcolour&0xff)/255.0f, 1.0);
Draw_FillBlock (x, y, w, h); R2D_FillBlock (x, y, w, h);
} }
else else
{ {
Draw_ImagePaletteColour(Sbar_ColorForMap(pcolour), 1.0); R2D_ImagePaletteColour(Sbar_ColorForMap(pcolour), 1.0);
Draw_FillBlock (x, y, w, h); R2D_FillBlock (x, y, w, h);
} }
} }
static void Sbar_FillPCDark (int x, int y, int w, int h, unsigned int pcolour) static void Sbar_FillPCDark (int x, int y, int w, int h, unsigned int pcolour)
{ {
if (pcolour >= 16) if (pcolour >= 16)
{ {
Draw_ImageColours (((pcolour&0xff0000)>>16)/1024.0f, ((pcolour&0xff00)>>8)/1024.0f, (pcolour&0xff)/1024.0f, 1.0); R2D_ImageColours (((pcolour&0xff0000)>>16)/1024.0f, ((pcolour&0xff00)>>8)/1024.0f, (pcolour&0xff)/1024.0f, 1.0);
Draw_FillBlock (x, y, w, h); R2D_FillBlock (x, y, w, h);
} }
else else
{ {
Draw_ImagePaletteColour(Sbar_ColorForMap(pcolour)-1, 1.0); R2D_ImagePaletteColour(Sbar_ColorForMap(pcolour)-1, 1.0);
Draw_FillBlock (x, y, w, h); R2D_FillBlock (x, y, w, h);
} }
} }
@ -1669,7 +1669,7 @@ void Sbar_DrawFrags (void)
} }
x+=4; x+=4;
} }
Draw_ImageColours(1.0, 1.0, 1.0, 1.0); R2D_ImageColours(1.0, 1.0, 1.0, 1.0);
} }
//============================================================================= //=============================================================================
@ -1879,14 +1879,14 @@ void Sbar_DrawScoreboard (void)
void Sbar_Hexen2DrawItem(int pnum, int x, int y, int itemnum) void Sbar_Hexen2DrawItem(int pnum, int x, int y, int itemnum)
{ {
int num; int num;
Sbar_DrawPic(x, y, 29, 28, Draw_SafeCachePic(va("gfx/arti%02d.lmp", itemnum))); Sbar_DrawPic(x, y, 29, 28, R2D_SafeCachePic(va("gfx/arti%02d.lmp", itemnum)));
num = cl.stats[pnum][STAT_H2_CNT_TORCH+itemnum]; num = cl.stats[pnum][STAT_H2_CNT_TORCH+itemnum];
if(num > 0) if(num > 0)
{ {
if (num >= 10) if (num >= 10)
Sbar_DrawPic(x+20, y+21, 4, 6, Draw_SafeCachePic(va("gfx/artinum%d.lmp", num/10))); Sbar_DrawPic(x+20, y+21, 4, 6, R2D_SafeCachePic(va("gfx/artinum%d.lmp", num/10)));
Sbar_DrawPic(x+20+4, y+21, 4, 6, Draw_SafeCachePic(va("gfx/artinum%d.lmp", num%10))); Sbar_DrawPic(x+20+4, y+21, 4, 6, R2D_SafeCachePic(va("gfx/artinum%d.lmp", num%10)));
} }
} }
@ -1926,7 +1926,7 @@ void Sbar_Hexen2DrawInventory(int pnum)
continue; continue;
if (i == sb_hexen2_cur_item[pnum]) if (i == sb_hexen2_cur_item[pnum])
Sbar_DrawPic(x+9, y-12, 11, 11, Draw_SafeCachePic("gfx/artisel.lmp")); Sbar_DrawPic(x+9, y-12, 11, 11, R2D_SafeCachePic("gfx/artisel.lmp"));
Sbar_Hexen2DrawItem(pnum, x, y, i); Sbar_Hexen2DrawItem(pnum, x, y, i);
x -= 33; x -= 33;
} }
@ -1937,7 +1937,7 @@ void Sbar_Hexen2DrawInventory(int pnum)
if (i != sb_hexen2_cur_item[pnum] && !cl.stats[pnum][STAT_H2_CNT_TORCH+i]) if (i != sb_hexen2_cur_item[pnum] && !cl.stats[pnum][STAT_H2_CNT_TORCH+i])
continue; continue;
if (i == sb_hexen2_cur_item[pnum]) if (i == sb_hexen2_cur_item[pnum])
Sbar_DrawPic(x+9, y-12, 11, 11, Draw_SafeCachePic("gfx/artisel.lmp")); Sbar_DrawPic(x+9, y-12, 11, 11, R2D_SafeCachePic("gfx/artisel.lmp"));
Sbar_Hexen2DrawItem(pnum, x, y, i); Sbar_Hexen2DrawItem(pnum, x, y, i);
x+=33; x+=33;
} }
@ -1985,8 +1985,8 @@ void Sbar_Hexen2DrawExtra (int pnum)
//adjust it so there's space //adjust it so there's space
sbar_rect.y -= 46+98-SBAR_HEIGHT; sbar_rect.y -= 46+98-SBAR_HEIGHT;
Sbar_DrawPic(0, 46, 160, 98, Draw_SafeCachePic("gfx/btmbar1.lmp")); Sbar_DrawPic(0, 46, 160, 98, R2D_SafeCachePic("gfx/btmbar1.lmp"));
Sbar_DrawPic(160, 46, 160, 98, Draw_SafeCachePic("gfx/btmbar2.lmp")); Sbar_DrawPic(160, 46, 160, 98, R2D_SafeCachePic("gfx/btmbar2.lmp"));
Sbar_DrawTinyString (11, 48, pclassname[pclass]); Sbar_DrawTinyString (11, 48, pclassname[pclass]);
@ -2019,7 +2019,7 @@ void Sbar_Hexen2DrawExtra (int pnum)
{ {
if (cl.stats[pnum][STAT_H2_ARMOUR1+i] > 0) if (cl.stats[pnum][STAT_H2_ARMOUR1+i] > 0)
{ {
Sbar_DrawPic (164+i*40, 115, 28, 19, Draw_SafeCachePic(va("gfx/armor%d.lmp", i+1))); Sbar_DrawPic (164+i*40, 115, 28, 19, R2D_SafeCachePic(va("gfx/armor%d.lmp", i+1)));
Sbar_DrawTinyString (168+i*40, 136, va("+%d", cl.stats[pnum][STAT_H2_ARMOUR1+i])); Sbar_DrawTinyString (168+i*40, 136, va("+%d", cl.stats[pnum][STAT_H2_ARMOUR1+i]));
} }
} }
@ -2027,14 +2027,14 @@ void Sbar_Hexen2DrawExtra (int pnum)
{ {
if (cl.stats[pnum][STAT_H2_FLIGHT_T+i] > 0) if (cl.stats[pnum][STAT_H2_FLIGHT_T+i] > 0)
{ {
Sbar_DrawPic (ringpos[i], 119, 32, 22, Draw_SafeCachePic(va("gfx/ring_f.lmp"))); Sbar_DrawPic (ringpos[i], 119, 32, 22, R2D_SafeCachePic(va("gfx/ring_f.lmp")));
val = cl.stats[pnum][STAT_H2_FLIGHT_T+i]; val = cl.stats[pnum][STAT_H2_FLIGHT_T+i];
if (val > 100) if (val > 100)
val = 100; val = 100;
if (val < 0) if (val < 0)
val = 0; val = 0;
Sbar_DrawPic(ringpos[i]+29 - (int)(26 * (val/(float)100)),142, 26, 1, Draw_SafeCachePic("gfx/ringhlth.lmp")); Sbar_DrawPic(ringpos[i]+29 - (int)(26 * (val/(float)100)),142, 26, 1, R2D_SafeCachePic("gfx/ringhlth.lmp"));
Sbar_DrawPic(ringpos[i]+29, 142, 26, 1, Draw_SafeCachePic("gfx/rhlthcvr.lmp")); Sbar_DrawPic(ringpos[i]+29, 142, 26, 1, R2D_SafeCachePic("gfx/rhlthcvr.lmp"));
} }
} }
@ -2043,12 +2043,12 @@ void Sbar_Hexen2DrawExtra (int pnum)
{ {
if (cl.statsstr[pnum][STAT_H2_PUZZLE1+i]) if (cl.statsstr[pnum][STAT_H2_PUZZLE1+i])
{ {
Sbar_DrawPic (194+(slot%4)*31, slot<4?51:82, 26, 26, Draw_SafeCachePic(va("gfx/puzzle/%s.lmp", cl.statsstr[pnum][STAT_H2_PUZZLE1+i]))); Sbar_DrawPic (194+(slot%4)*31, slot<4?51:82, 26, 26, R2D_SafeCachePic(va("gfx/puzzle/%s.lmp", cl.statsstr[pnum][STAT_H2_PUZZLE1+i])));
slot++; slot++;
} }
} }
Sbar_DrawPic(134, 50, 49, 56, Draw_SafeCachePic(va("gfx/cport%d.lmp", pclass))); Sbar_DrawPic(134, 50, 49, 56, R2D_SafeCachePic(va("gfx/cport%d.lmp", pclass)));
} }
int Sbar_Hexen2ArmourValue(int pnum) int Sbar_Hexen2ArmourValue(int pnum)
@ -2089,11 +2089,11 @@ void Sbar_Hexen2DrawBasic(int pnum)
{ {
int chainpos; int chainpos;
int val, maxval; int val, maxval;
Sbar_DrawPic(0, 0, 160, 46, Draw_SafeCachePic("gfx/topbar1.lmp")); Sbar_DrawPic(0, 0, 160, 46, R2D_SafeCachePic("gfx/topbar1.lmp"));
Sbar_DrawPic(160, 0, 160, 46, Draw_SafeCachePic("gfx/topbar2.lmp")); Sbar_DrawPic(160, 0, 160, 46, R2D_SafeCachePic("gfx/topbar2.lmp"));
Sbar_DrawPic(0, -23, 51, 23, Draw_SafeCachePic("gfx/topbumpl.lmp")); Sbar_DrawPic(0, -23, 51, 23, R2D_SafeCachePic("gfx/topbumpl.lmp"));
Sbar_DrawPic(138, -8, 39, 8, Draw_SafeCachePic("gfx/topbumpm.lmp")); Sbar_DrawPic(138, -8, 39, 8, R2D_SafeCachePic("gfx/topbumpm.lmp"));
Sbar_DrawPic(269, -23, 51, 23, Draw_SafeCachePic("gfx/topbumpr.lmp")); Sbar_DrawPic(269, -23, 51, 23, R2D_SafeCachePic("gfx/topbumpr.lmp"));
//mana1 //mana1
maxval = cl.stats[pnum][STAT_H2_MAXMANA]; maxval = cl.stats[pnum][STAT_H2_MAXMANA];
@ -2102,8 +2102,8 @@ void Sbar_Hexen2DrawBasic(int pnum)
Sbar_DrawTinyString(201, 22, va("%03d", val)); Sbar_DrawTinyString(201, 22, va("%03d", val));
if(val) if(val)
{ {
Sbar_DrawPic(190, 26-(int)((val*18.0)/(float)maxval+0.5), 3, 19, Draw_SafeCachePic("gfx/bmana.lmp")); Sbar_DrawPic(190, 26-(int)((val*18.0)/(float)maxval+0.5), 3, 19, R2D_SafeCachePic("gfx/bmana.lmp"));
Sbar_DrawPic(190, 27, 3, 19, Draw_SafeCachePic("gfx/bmanacov.lmp")); Sbar_DrawPic(190, 27, 3, 19, R2D_SafeCachePic("gfx/bmanacov.lmp"));
} }
//mana2 //mana2
@ -2113,8 +2113,8 @@ void Sbar_Hexen2DrawBasic(int pnum)
Sbar_DrawTinyString(243, 22, va("%03d", val)); Sbar_DrawTinyString(243, 22, va("%03d", val));
if(val) if(val)
{ {
Sbar_DrawPic(232, 26-(int)((val*18.0)/(float)maxval+0.5), 3, 19, Draw_SafeCachePic("gfx/gmana.lmp")); Sbar_DrawPic(232, 26-(int)((val*18.0)/(float)maxval+0.5), 3, 19, R2D_SafeCachePic("gfx/gmana.lmp"));
Sbar_DrawPic(232, 27, 3, 19, Draw_SafeCachePic("gfx/gmanacov.lmp")); Sbar_DrawPic(232, 27, 3, 19, R2D_SafeCachePic("gfx/gmanacov.lmp"));
} }
@ -2132,10 +2132,10 @@ void Sbar_Hexen2DrawBasic(int pnum)
chainpos = (195.0f*cl.stats[pnum][STAT_HEALTH]) / cl.stats[pnum][STAT_H2_MAXHEALTH]; chainpos = (195.0f*cl.stats[pnum][STAT_HEALTH]) / cl.stats[pnum][STAT_H2_MAXHEALTH];
if (chainpos < 0) if (chainpos < 0)
chainpos = 0; chainpos = 0;
Sbar_DrawPic(45+((int)chainpos&7), 38, 222, 5, Draw_SafeCachePic("gfx/hpchain.lmp")); Sbar_DrawPic(45+((int)chainpos&7), 38, 222, 5, R2D_SafeCachePic("gfx/hpchain.lmp"));
Sbar_DrawPic(45+(int)chainpos, 36, 35, 9, Draw_SafeCachePic("gfx/hpgem.lmp")); Sbar_DrawPic(45+(int)chainpos, 36, 35, 9, R2D_SafeCachePic("gfx/hpgem.lmp"));
Sbar_DrawPic(43, 36, 10, 10, Draw_SafeCachePic("gfx/chnlcov.lmp")); Sbar_DrawPic(43, 36, 10, 10, R2D_SafeCachePic("gfx/chnlcov.lmp"));
Sbar_DrawPic(267, 36, 10, 10, Draw_SafeCachePic("gfx/chnrcov.lmp")); Sbar_DrawPic(267, 36, 10, 10, R2D_SafeCachePic("gfx/chnrcov.lmp"));
Sbar_Hexen2DrawItem(pnum, 144, 3, sb_hexen2_cur_item[pnum]); Sbar_Hexen2DrawItem(pnum, 144, 3, sb_hexen2_cur_item[pnum]);
@ -2145,8 +2145,8 @@ void Sbar_Hexen2DrawMinimal(int pnum)
{ {
int y; int y;
y = -16; y = -16;
Sbar_DrawPic(3, y, 31, 17, Draw_SafeCachePic("gfx/bmmana.lmp")); Sbar_DrawPic(3, y, 31, 17, R2D_SafeCachePic("gfx/bmmana.lmp"));
Sbar_DrawPic(3, y+18, 31, 17, Draw_SafeCachePic("gfx/gmmana.lmp")); Sbar_DrawPic(3, y+18, 31, 17, R2D_SafeCachePic("gfx/gmmana.lmp"));
Sbar_DrawTinyString(10, y+6, va("%03d", cl.stats[pnum][STAT_H2_BLUEMANA])); Sbar_DrawTinyString(10, y+6, va("%03d", cl.stats[pnum][STAT_H2_BLUEMANA]));
Sbar_DrawTinyString(10, y+18+6, va("%03d", cl.stats[pnum][STAT_H2_GREENMANA])); Sbar_DrawTinyString(10, y+18+6, va("%03d", cl.stats[pnum][STAT_H2_GREENMANA]));
@ -2338,7 +2338,7 @@ void Sbar_Draw (void)
if (cls.protocol == CP_QUAKE2) if (cls.protocol == CP_QUAKE2)
{ {
SCR_VRectForPlayer(&sbar_rect, 0); SCR_VRectForPlayer(&sbar_rect, 0);
Draw_ImageColours(1, 1, 1, 1); R2D_ImageColours(1, 1, 1, 1);
if (*cl.q2statusbar) if (*cl.q2statusbar)
Sbar_ExecuteLayoutString(cl.q2statusbar); Sbar_ExecuteLayoutString(cl.q2statusbar);
if (*cl.q2layout) if (*cl.q2layout)
@ -2352,7 +2352,7 @@ void Sbar_Draw (void)
Sbar_Start(); Sbar_Start();
Draw_ImageColours(1, 1, 1, 1); R2D_ImageColours(1, 1, 1, 1);
for (pnum = 0; pnum < cl.splitclients; pnum++) for (pnum = 0; pnum < cl.splitclients; pnum++)
{ {
@ -2474,10 +2474,10 @@ void Sbar_Draw (void)
{ {
if (cl.splitclients==1 && sbar_rect.x>0) if (cl.splitclients==1 && sbar_rect.x>0)
{ // left { // left
Draw_TileClear (0, sbar_rect.height - sb_lines, sbar_rect.x, sb_lines); R2D_TileClear (0, sbar_rect.height - sb_lines, sbar_rect.x, sb_lines);
} }
if (sbar_rect.x + 320 <= sbar_rect.width && !headsup) if (sbar_rect.x + 320 <= sbar_rect.width && !headsup)
Draw_TileClear (sbar_rect.x + 320, sbar_rect.height - sb_lines, sbar_rect.width - (320), sb_lines); R2D_TileClear (sbar_rect.x + 320, sbar_rect.height - sb_lines, sbar_rect.width - (320), sb_lines);
} }
#endif #endif
@ -2523,7 +2523,7 @@ void Sbar_IntermissionNumber (int x, int y, int num, int digits, int color)
else else
frame = *ptr -'0'; frame = *ptr -'0';
Draw_ScalePic (x,y, 16, 24, sb_nums[color][frame]); R2D_ScalePic (x,y, 16, 24, sb_nums[color][frame]);
x += 24; x += 24;
ptr++; ptr++;
} }
@ -2558,11 +2558,11 @@ void Sbar_TeamOverlay (void)
if (scr_scoreboard_drawtitle.ival) if (scr_scoreboard_drawtitle.ival)
{ {
pic = Draw_SafeCachePic ("gfx/ranking.lmp"); pic = R2D_SafeCachePic ("gfx/ranking.lmp");
if (pic) if (pic)
{ {
k = (pic->width * 24) / pic->height; k = (pic->width * 24) / pic->height;
Draw_ScalePic ((vid.width-k)/2, 0, k, 24, pic); R2D_ScalePic ((vid.width-k)/2, 0, k, 24, pic);
} }
y += 24; y += 24;
} }
@ -2763,11 +2763,11 @@ void Sbar_DeathmatchOverlay (int start)
y = 0; y = 0;
if (scr_scoreboard_drawtitle.ival) if (scr_scoreboard_drawtitle.ival)
{ {
pic = Draw_SafeCachePic ("gfx/ranking.lmp"); pic = R2D_SafeCachePic ("gfx/ranking.lmp");
if (pic) if (pic)
{ {
k = (pic->width * 24) / pic->height; k = (pic->width * 24) / pic->height;
Draw_ScalePic ((vid.width-k)/2, 0, k, 24, pic); R2D_ScalePic ((vid.width-k)/2, 0, k, 24, pic);
} }
y += 24; y += 24;
} }
@ -2832,12 +2832,12 @@ void Sbar_DeathmatchOverlay (int start)
if (scr_scoreboard_newstyle.ival) if (scr_scoreboard_newstyle.ival)
{ {
// Electro's scoreboard eyecandy: Draw top border // Electro's scoreboard eyecandy: Draw top border
Draw_ImagePaletteColour (0, 1.0); R2D_ImagePaletteColour (0, 1.0);
Draw_FillBlock(startx - 3, y - 1, rank_width - 1, 1); R2D_FillBlock(startx - 3, y - 1, rank_width - 1, 1);
// Electro's scoreboard eyecandy: Draw the title row background // Electro's scoreboard eyecandy: Draw the title row background
Draw_ImagePaletteColour (1, 1.0); R2D_ImagePaletteColour (1, 1.0);
Draw_FillBlock(startx - 2, y, rank_width - 3, 9); R2D_FillBlock(startx - 2, y, rank_width - 3, 9);
} }
x = startx; x = startx;
@ -2868,14 +2868,14 @@ if (showcolumns & (1<<COLUMN##title)) \
if (scr_scoreboard_newstyle.ival) if (scr_scoreboard_newstyle.ival)
{ {
// Electro's scoreboard eyecandy: Draw top border (under header) // Electro's scoreboard eyecandy: Draw top border (under header)
Draw_ImagePaletteColour (0, 1.0); R2D_ImagePaletteColour (0, 1.0);
Draw_FillBlock (startx - 3, y + 1, rank_width - 1, 1); R2D_FillBlock (startx - 3, y + 1, rank_width - 1, 1);
// Electro's scoreboard eyecandy: Don't go over the black border, move the rest down // Electro's scoreboard eyecandy: Don't go over the black border, move the rest down
y += 2; y += 2;
// Electro's scoreboard eyecandy: Draw left border // Electro's scoreboard eyecandy: Draw left border
Draw_FillBlock (startx - 3, y - 10, 1, 9); R2D_FillBlock (startx - 3, y - 10, 1, 9);
// Electro's scoreboard eyecandy: Draw right border // Electro's scoreboard eyecandy: Draw right border
Draw_FillBlock (startx - 3 + rank_width - 2, y - 10, 1, 9); R2D_FillBlock (startx - 3 + rank_width - 2, y - 10, 1, 9);
} }
y -= skip; y -= skip;
@ -2924,13 +2924,13 @@ if (showcolumns & (1<<COLUMN##title)) \
Sbar_FillPCDark (startx - 2, y, rank_width - 3, skip, 0x00ff00); Sbar_FillPCDark (startx - 2, y, rank_width - 3, skip, 0x00ff00);
else else
{ {
Draw_ImagePaletteColour (2, 1.0); R2D_ImagePaletteColour (2, 1.0);
Draw_FillBlock (startx - 2, y, rank_width - 3, skip); R2D_FillBlock (startx - 2, y, rank_width - 3, skip);
} }
Draw_ImagePaletteColour (0, 1.0); R2D_ImagePaletteColour (0, 1.0);
Draw_FillBlock (startx - 3, y, 1, skip); // Electro - Border - Left R2D_FillBlock (startx - 3, y, 1, skip); // Electro - Border - Left
Draw_FillBlock (startx - 3 + rank_width - 2, y, 1, skip); // Electro - Border - Right R2D_FillBlock (startx - 3 + rank_width - 2, y, 1, skip); // Electro - Border - Right
} }
x = startx; x = startx;
@ -2946,14 +2946,14 @@ if (showcolumns & (1<<COLUMN##title)) \
if (scr_scoreboard_newstyle.ival) if (scr_scoreboard_newstyle.ival)
{ {
Draw_ImagePaletteColour (0, 1.0); R2D_ImagePaletteColour (0, 1.0);
Draw_FillBlock (startx - 3, y + skip, rank_width - 1, 1); // Electro - Border - Bottom R2D_FillBlock (startx - 3, y + skip, rank_width - 1, 1); // Electro - Border - Bottom
} }
if (y >= vid.height-10) // we ran over the screen size, squish if (y >= vid.height-10) // we ran over the screen size, squish
largegame = true; largegame = true;
Draw_ImageColours(1.0, 1.0, 1.0, 1.0); R2D_ImageColours(1.0, 1.0, 1.0, 1.0);
} }
void Sbar_ChatModeOverlay(void) void Sbar_ChatModeOverlay(void)
@ -3199,30 +3199,30 @@ void Sbar_CoopIntermission (void)
sbar_rect.x = 0; sbar_rect.x = 0;
sbar_rect.y = 0; sbar_rect.y = 0;
pic = Draw_SafeCachePic ("gfx/complete.lmp"); pic = R2D_SafeCachePic ("gfx/complete.lmp");
if (!pic) if (!pic)
return; return;
Draw_ScalePic ((sbar_rect.width - 320)/2 + 64, (sbar_rect.height - 200)/2 + 24, 192, 24, pic); R2D_ScalePic ((sbar_rect.width - 320)/2 + 64, (sbar_rect.height - 200)/2 + 24, 192, 24, pic);
pic = Draw_SafeCachePic ("gfx/inter.lmp"); pic = R2D_SafeCachePic ("gfx/inter.lmp");
if (pic) if (pic)
Draw_ScalePic ((sbar_rect.width - 320)/2 + 0, (sbar_rect.height - 200)/2 + 56, 160, 144, pic); R2D_ScalePic ((sbar_rect.width - 320)/2 + 0, (sbar_rect.height - 200)/2 + 56, 160, 144, pic);
// time // time
dig = cl.completed_time/60; dig = cl.completed_time/60;
Sbar_IntermissionNumber ((sbar_rect.width - 320)/2 + 160, (sbar_rect.height - 200)/2 + 64, dig, 3, 0); Sbar_IntermissionNumber ((sbar_rect.width - 320)/2 + 160, (sbar_rect.height - 200)/2 + 64, dig, 3, 0);
num = cl.completed_time - dig*60; num = cl.completed_time - dig*60;
Draw_ScalePic ((sbar_rect.width - 320)/2 + 234,(sbar_rect.height - 200)/2 + 64, 16, 24, sb_colon); R2D_ScalePic ((sbar_rect.width - 320)/2 + 234,(sbar_rect.height - 200)/2 + 64, 16, 24, sb_colon);
Draw_ScalePic ((sbar_rect.width - 320)/2 + 246,(sbar_rect.height - 200)/2 + 64, 16, 26, sb_nums[0][num/10]); R2D_ScalePic ((sbar_rect.width - 320)/2 + 246,(sbar_rect.height - 200)/2 + 64, 16, 26, sb_nums[0][num/10]);
Draw_ScalePic ((sbar_rect.width - 320)/2 + 266,(sbar_rect.height - 200)/2 + 64, 16, 24, sb_nums[0][num%10]); R2D_ScalePic ((sbar_rect.width - 320)/2 + 266,(sbar_rect.height - 200)/2 + 64, 16, 24, sb_nums[0][num%10]);
//it is assumed that secrits/monsters are going to be constant for any player... //it is assumed that secrits/monsters are going to be constant for any player...
Sbar_IntermissionNumber ((sbar_rect.width - 320)/2 + 160, (sbar_rect.height - 200)/2 + 104, cl.stats[0][STAT_SECRETS], 3, 0); Sbar_IntermissionNumber ((sbar_rect.width - 320)/2 + 160, (sbar_rect.height - 200)/2 + 104, cl.stats[0][STAT_SECRETS], 3, 0);
Draw_ScalePic ((sbar_rect.width - 320)/2 + 232,(sbar_rect.height - 200)/2 + 104, 16, 24, sb_slash); R2D_ScalePic ((sbar_rect.width - 320)/2 + 232,(sbar_rect.height - 200)/2 + 104, 16, 24, sb_slash);
Sbar_IntermissionNumber ((sbar_rect.width - 320)/2 + 240, (sbar_rect.height - 200)/2 + 104, cl.stats[0][STAT_TOTALSECRETS], 3, 0); Sbar_IntermissionNumber ((sbar_rect.width - 320)/2 + 240, (sbar_rect.height - 200)/2 + 104, cl.stats[0][STAT_TOTALSECRETS], 3, 0);
Sbar_IntermissionNumber ((sbar_rect.width - 320)/2 + 160, (sbar_rect.height - 200)/2 + 144, cl.stats[0][STAT_MONSTERS], 3, 0); Sbar_IntermissionNumber ((sbar_rect.width - 320)/2 + 160, (sbar_rect.height - 200)/2 + 144, cl.stats[0][STAT_MONSTERS], 3, 0);
Draw_ScalePic ((sbar_rect.width - 320)/2 + 232,(sbar_rect.height - 200)/2 + 144, 16, 24, sb_slash); R2D_ScalePic ((sbar_rect.width - 320)/2 + 232,(sbar_rect.height - 200)/2 + 144, 16, 24, sb_slash);
Sbar_IntermissionNumber ((sbar_rect.width - 320)/2 + 240, (sbar_rect.height - 200)/2 + 144, cl.stats[0][STAT_TOTALMONSTERS], 3, 0); Sbar_IntermissionNumber ((sbar_rect.width - 320)/2 + 240, (sbar_rect.height - 200)/2 + 144, cl.stats[0][STAT_TOTALMONSTERS], 3, 0);
} }
/* /*
@ -3263,8 +3263,8 @@ void Sbar_FinaleOverlay (void)
if (UI_DrawFinale()>0) if (UI_DrawFinale()>0)
return; return;
#endif #endif
pic = Draw_SafeCachePic ("gfx/finale.lmp"); pic = R2D_SafeCachePic ("gfx/finale.lmp");
if (pic) if (pic)
Draw_ScalePic ( (vid.width-pic->width)/2, 16, pic->width, pic->height, pic); R2D_ScalePic ( (vid.width-pic->width)/2, 16, pic->width, pic->height, pic);
} }

View file

@ -870,7 +870,7 @@ void Editor_Draw(void)
key_dest = key_editor; key_dest = key_editor;
if ((editoractive && cls.state == ca_disconnected) || editormodal) if ((editoractive && cls.state == ca_disconnected) || editormodal)
Draw_EditorBackground(); R2D_EditorBackground();
if (cursorlinenum < 0) //look for the cursor line num if (cursorlinenum < 0) //look for the cursor line num
{ {

View file

@ -1065,21 +1065,10 @@ qbyte *COM_LoadFile (const char *path, int usehunk)
Sys_Error ("COM_LoadFile: not enough space for %s", path); Sys_Error ("COM_LoadFile: not enough space for %s", path);
((qbyte *)buf)[len] = 0; ((qbyte *)buf)[len] = 0;
#ifndef SERVERONLY
if (qrenderer != QR_NONE)
if (Draw_BeginDisc)
Draw_BeginDisc ();
#endif
VFS_READ(f, buf, len); VFS_READ(f, buf, len);
VFS_CLOSE(f); VFS_CLOSE(f);
#ifndef SERVERONLY
if (qrenderer != QR_NONE)
if (Draw_EndDisc)
Draw_EndDisc ();
#endif
return buf; return buf;
} }

View file

@ -1638,8 +1638,7 @@ void Plug_SBar(void)
for (cp = 0; cp < cl.splitclients; cp++) for (cp = 0; cp < cl.splitclients; cp++)
{ //if you don't use splitscreen, use a full videosize rect. { //if you don't use splitscreen, use a full videosize rect.
SCR_VRectForPlayer(&rect, cp); SCR_VRectForPlayer(&rect, cp);
if (Draw_ImageColours) R2D_ImageColours(1, 1, 1, 1); // ensure menu colors are reset
Draw_ImageColours(1, 1, 1, 1); // ensure menu colors are reset
ret |= VM_Call(currentplug->vm, currentplug->sbarlevel[0], cp, rect.x, rect.y, rect.width, rect.height, sb_showscores+sb_showteamscores*2); ret |= VM_Call(currentplug->vm, currentplug->sbarlevel[0], cp, rect.x, rect.y, rect.width, rect.height, sb_showscores+sb_showteamscores*2);
} }
break; break;
@ -1658,8 +1657,7 @@ void Plug_SBar(void)
for (cp = 0; cp < cl.splitclients; cp++) for (cp = 0; cp < cl.splitclients; cp++)
{ //if you don't use splitscreen, use a full videosize rect. { //if you don't use splitscreen, use a full videosize rect.
SCR_VRectForPlayer(&rect, cp); SCR_VRectForPlayer(&rect, cp);
if (Draw_ImageColours) R2D_ImageColours(1, 1, 1, 1); // ensure menu colors are reset
Draw_ImageColours(1, 1, 1, 1); // ensure menu colors are reset
ret |= VM_Call(currentplug->vm, currentplug->sbarlevel[1], cp, rect.x, rect.y, rect.width, rect.height, sb_showscores+sb_showteamscores*2); ret |= VM_Call(currentplug->vm, currentplug->sbarlevel[1], cp, rect.x, rect.y, rect.width, rect.height, sb_showscores+sb_showteamscores*2);
} }
} }
@ -1672,8 +1670,7 @@ void Plug_SBar(void)
for (cp = 0; cp < cl.splitclients; cp++) for (cp = 0; cp < cl.splitclients; cp++)
{ //if you don't use splitscreen, use a full videosize rect. { //if you don't use splitscreen, use a full videosize rect.
SCR_VRectForPlayer(&rect, cp); SCR_VRectForPlayer(&rect, cp);
if (Draw_ImageColours) R2D_ImageColours(1, 1, 1, 1); // ensure menu colors are reset
Draw_ImageColours(1, 1, 1, 1); // ensure menu colors are reset
ret |= VM_Call(currentplug->vm, currentplug->sbarlevel[2], cp, rect.x, rect.y, rect.width, rect.height, sb_showscores+sb_showteamscores*2); ret |= VM_Call(currentplug->vm, currentplug->sbarlevel[2], cp, rect.x, rect.y, rect.width, rect.height, sb_showscores+sb_showteamscores*2);
} }
} }

View file

@ -974,7 +974,7 @@ static void (D3D9_SCR_UpdateScreen) (void)
scr_con_current = vid.height; scr_con_current = vid.height;
if (scr_con_current != vid.height) if (scr_con_current != vid.height)
Draw_ConsoleBackground(0, vid.height, true); R2D_ConsoleBackground(0, vid.height, true);
else else
scr_con_forcedraw = true; scr_con_forcedraw = true;
@ -1011,12 +1011,6 @@ static void (D3D9_SCR_UpdateScreen) (void)
static void (D3D9_Draw_BeginDisc) (void)
{
}
static void (D3D9_Draw_EndDisc) (void)
{
}
static void (D3D9_Draw_Init) (void) static void (D3D9_Draw_Init) (void)
@ -1032,14 +1026,6 @@ static void (D3D9_Draw_Crosshair) (void)
static void (D3D9_Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *pic, qbyte *translation) static void (D3D9_Draw_TransPicTranslate) (int x, int y, int w, int h, qbyte *pic, qbyte *translation)
{ {
} }
static void (D3D9_Draw_Fill) (int x, int y, int w, int h, unsigned int c)
{
}
static void (D3D9_Draw_FillRGB) (int x, int y, int w, int h, float r, float g, float b)
{
}
static void (D3D9_Draw_BeginDisc) (void);
static void (D3D9_Draw_EndDisc) (void);
static void (D3D9_R_Init) (void) static void (D3D9_R_Init) (void)
{ {
@ -1165,25 +1151,10 @@ rendererinfo_t d3drendererinfo =
}, },
QR_DIRECT3D, QR_DIRECT3D,
R2D_SafePicFromWad,
R2D_SafeCachePic,
D3D9_Draw_Init, D3D9_Draw_Init,
D3D9_Draw_ReInit, D3D9_Draw_ReInit,
D3D9_Draw_Crosshair, D3D9_Draw_Crosshair,
R2D_ScalePic,
R2D_SubPic,
D3D9_Draw_TransPicTranslate, D3D9_Draw_TransPicTranslate,
R2D_ConsoleBackground,
R2D_EditorBackground,
R2D_TileClear,
D3D9_Draw_Fill,
D3D9_Draw_FillRGB,
R2D_FadeScreen,
D3D9_Draw_BeginDisc,
D3D9_Draw_EndDisc,
R2D_Image,
R2D_ImageColours,
D3D9_LoadTexture, D3D9_LoadTexture,
D3D9_LoadTexture8Pal24, D3D9_LoadTexture8Pal24,

View file

@ -364,9 +364,9 @@ TRACE(("dbg: GLDraw_ReInit: Allocating upload buffers\n"));
qglClear(GL_COLOR_BUFFER_BIT); qglClear(GL_COLOR_BUFFER_BIT);
{ {
mpic_t *pic = Draw_SafeCachePic ("gfx/loading.lmp"); mpic_t *pic = R2D_SafeCachePic ("gfx/loading.lmp");
if (pic) if (pic)
Draw_ScalePic ( ((int)vid.width - pic->width)/2, R2D_ScalePic ( ((int)vid.width - pic->width)/2,
((int)vid.height - 48 - pic->height)/2, pic->width, pic->height, pic); ((int)vid.height - 48 - pic->height)/2, pic->width, pic->height, pic);
} }
@ -393,8 +393,8 @@ TRACE(("dbg: GLDraw_ReInit: Allocating upload buffers\n"));
// //
// get the other pics we need // get the other pics we need
// //
TRACE(("dbg: GLDraw_ReInit: Draw_SafePicFromWad\n")); TRACE(("dbg: GLDraw_ReInit: R2D_SafePicFromWad\n"));
draw_disc = Draw_SafePicFromWad ("disc"); draw_disc = R2D_SafePicFromWad ("disc");
#ifdef GL_USE8BITTEX #ifdef GL_USE8BITTEX
inited15to8 = false; inited15to8 = false;
@ -654,81 +654,9 @@ void GLDraw_TransPicTranslate (int x, int y, int width, int height, qbyte *pic,
qglEnd (); qglEnd ();
} }
void GLDraw_FillRGB (int x, int y, int w, int h, float r, float g, float b)
{
if (gl_config.gles)
return; //TODO: DRAW FILL NOT FIXED YET
qglDisable (GL_TEXTURE_2D);
qglColor3f (r, g, b);
qglBegin (GL_QUADS);
qglVertex2f (x,y);
qglVertex2f (x+w, y);
qglVertex2f (x+w, y+h);
qglVertex2f (x, y+h);
qglEnd ();
qglColor3f (1,1,1);
qglEnable (GL_TEXTURE_2D);
}
/*
=============
Draw_Fill
Fills a box of pixels with a single color
=============
*/
void GLDraw_Fill (int x, int y, int w, int h, unsigned int c)
{
unsigned int r, g, b;
extern qboolean gammaworks;
r = host_basepal[c*3];
g = host_basepal[c*3+1];
b = host_basepal[c*3+2];
if (!gammaworks)
{
r = gammatable[r];
g = gammatable[r];
b = gammatable[r];
}
GLDraw_FillRGB (x, y, w, h,
r/255.0,
g/255.0,
b/255.0);
}
//============================================================================= //=============================================================================
/*
================
Draw_BeginDisc
Draws the little blue disc in the corner of the screen.
Call before beginning any disc IO.
================
*/
void GLDraw_BeginDisc (void)
{
}
/*
================
Draw_EndDisc
Erases the disc icon.
Call after completing any disc IO
================
*/
void GLDraw_EndDisc (void)
{
}
/* /*
================ ================
GL_Set2D GL_Set2D

View file

@ -26,10 +26,6 @@ void GLDraw_ReInit (void);
void GLDraw_DeInit (void); void GLDraw_DeInit (void);
void Surf_DeInit (void); void Surf_DeInit (void);
void GLDraw_TransPicTranslate (int x, int y, int w, int h, qbyte *pic, qbyte *translation); void GLDraw_TransPicTranslate (int x, int y, int w, int h, qbyte *pic, qbyte *translation);
void GLDraw_BeginDisc (void);
void GLDraw_EndDisc (void);
void GLDraw_FillRGB (int x, int y, int w, int h, float r, float g, float b);
void GLDraw_Fill (int x, int y, int w, int h, unsigned int c);
void GLDraw_Crosshair(void); void GLDraw_Crosshair(void);
void GLDraw_LevelPic (mpic_t *pic); void GLDraw_LevelPic (mpic_t *pic);

View file

@ -1102,8 +1102,6 @@ void Font_InvalidateColour(void)
font_colourmask = ~0; font_colourmask = ~0;
} }
void GLDraw_FillRGB (int x, int y, int w, int h, float r, float g, float b);
//draw a character from the current font at a pixel location. //draw a character from the current font at a pixel location.
int Font_DrawChar(int px, int py, unsigned int charcode) int Font_DrawChar(int px, int py, unsigned int charcode)
{ {

View file

@ -192,14 +192,9 @@ void GLSCR_UpdateScreen (void)
//draw the levelshot or the conback fullscreen //draw the levelshot or the conback fullscreen
if (*levelshotname) if (*levelshotname)
{ R2D_ScalePic(0, 0, vid.width, vid.height, R2D_SafeCachePic (levelshotname));
if(Draw_ScalePic)
Draw_ScalePic(0, 0, vid.width, vid.height, Draw_SafeCachePic (levelshotname));
else if (scr_con_current != vid.height)
Draw_ConsoleBackground(0, vid.height, true);
}
else if (scr_con_current != vid.height) else if (scr_con_current != vid.height)
Draw_ConsoleBackground(0, vid.height, true); R2D_ConsoleBackground(0, vid.height, true);
else else
scr_con_forcedraw = true; scr_con_forcedraw = true;

View file

@ -684,6 +684,7 @@ static void Shader_Sort ( shader_t *shader, shaderpass_t *pass, char **ptr )
{ {
char *token; char *token;
token = Shader_ParseString ( ptr ); token = Shader_ParseString ( ptr );
if ( !Q_stricmp( token, "portal" ) ) { if ( !Q_stricmp( token, "portal" ) ) {
shader->sort = SHADER_SORT_PORTAL; shader->sort = SHADER_SORT_PORTAL;

View file

@ -1965,15 +1965,15 @@ static qboolean Sh_DrawStencilLight(dlight_t *dl, vec3_t colour, qbyte *vvis)
{ {
qglColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE); qglColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE);
qglStencilFunc(GL_GREATER, 1, ~0); qglStencilFunc(GL_GREATER, 1, ~0);
Draw_ConsoleBackground(vid.height); R2D_ConsoleBackground(vid.height);
qglColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); qglColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE);
qglStencilFunc(GL_LESS, 1, ~0); qglStencilFunc(GL_LESS, 1, ~0);
Draw_ConsoleBackground(vid.height); R2D_ConsoleBackground(vid.height);
qglColorMask(GL_FALSE, GL_FALSE, GL_TRUE, GL_FALSE); qglColorMask(GL_FALSE, GL_FALSE, GL_TRUE, GL_FALSE);
qglStencilFunc(GL_NEVER, 1, ~0); qglStencilFunc(GL_NEVER, 1, ~0);
Draw_ConsoleBackground(vid.height); R2D_ConsoleBackground(vid.height);
} }
qglMatrixMode(GL_PROJECTION); qglMatrixMode(GL_PROJECTION);

View file

@ -1065,25 +1065,10 @@ rendererinfo_t openglrendererinfo = {
QR_OPENGL, QR_OPENGL,
R2D_SafePicFromWad,
R2D_SafeCachePic,
GLDraw_Init, GLDraw_Init,
GLDraw_ReInit, GLDraw_ReInit,
GLDraw_Crosshair, GLDraw_Crosshair,
R2D_ScalePic,
R2D_SubPic,
GLDraw_TransPicTranslate, GLDraw_TransPicTranslate,
R2D_ConsoleBackground,
R2D_EditorBackground,
R2D_TileClear,
GLDraw_Fill,
GLDraw_FillRGB,
R2D_FadeScreen,
GLDraw_BeginDisc,
GLDraw_EndDisc,
R2D_Image,
R2D_ImageColours,
GL_LoadTextureFmt, GL_LoadTextureFmt,
GL_LoadTexture8Pal24, GL_LoadTexture8Pal24,