fix sw draw_image to work for both CSQC and plugins

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2088 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-03-12 00:45:33 +00:00
parent 82395d8b2d
commit f0c399ff9e
2 changed files with 14 additions and 15 deletions

View file

@ -345,7 +345,20 @@ void PF_CL_drawcharacter (progfuncs_t *prinst, struct globalvars_s *pr_globals)
if (Draw_ImageColours)
Draw_ImageColours(rgb[0], rgb[1], rgb[2], alpha);
if (Draw_Image)
Draw_Image(pos[0], pos[1], size[0], size[1], fcol, frow, fcol+fsize, frow+fsize, Draw_CachePic("conchars"));
{
if (qrenderer == QR_SOFTWARE)
{
extern cvar_t vid_conwidth, vid_conheight;
float xratio, yratio;
// this has to be done this way because CSQC drawing needs
// to respect these cvars
xratio = vid.width / vid_conwidth.value;
yratio = vid.height / vid_conheight.value;
Draw_Image(pos[0]*xratio, pos[1]*yratio, size[0]*xratio, size[1]*yratio, fcol, frow, fcol+fsize, frow+fsize, Draw_CachePic("conchars"));
}
else
Draw_Image(pos[0], pos[1], size[0], size[1], fcol, frow, fcol+fsize, frow+fsize, Draw_CachePic("conchars"));
}
G_FLOAT(OFS_RETURN) = 1;
}

View file

@ -1893,20 +1893,6 @@ void SWDraw_Image (float xp, float yp, float wp, float hp, float s1, float t1, f
if (!pic)
return;
// scale call against console vs actual video ration
{
// this has to be done this way because CSQC drawing needs
// to respect these cvars
extern cvar_t vid_conheight, vid_conwidth;
xratio = vid.width / vid_conwidth.value;
yratio = vid.height / vid_conheight.value;
xp *= xratio;
yp *= yratio;
wp *= xratio;
hp *= yratio;
}
// image scale
xratio = pic->width / wp;
yratio = pic->height / hp;