remove gamma stuff from d3d getrgbinfo
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3770 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
b4bd2cc64c
commit
8238e06d3e
1 changed files with 6 additions and 23 deletions
|
@ -800,7 +800,6 @@ static char *(D3D9_VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevi
|
||||||
{
|
{
|
||||||
IDirect3DSurface9 *surf;
|
IDirect3DSurface9 *surf;
|
||||||
D3DLOCKED_RECT rect;
|
D3DLOCKED_RECT rect;
|
||||||
extern qboolean gammaworks;
|
|
||||||
int i, j, c;
|
int i, j, c;
|
||||||
qbyte *ret = BZ_Malloc(prepad + vid.pixelwidth*vid.pixelheight*3);
|
qbyte *ret = BZ_Malloc(prepad + vid.pixelwidth*vid.pixelheight*3);
|
||||||
qbyte *p;
|
qbyte *p;
|
||||||
|
@ -822,31 +821,15 @@ static char *(D3D9_VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevi
|
||||||
c = prepad+vid.pixelwidth*vid.pixelheight*3;
|
c = prepad+vid.pixelwidth*vid.pixelheight*3;
|
||||||
p = (qbyte *)rect.pBits;
|
p = (qbyte *)rect.pBits;
|
||||||
|
|
||||||
if (gammaworks)
|
for (i=c-(3*vid.pixelwidth); i>=prepad; i-=(3*vid.pixelwidth))
|
||||||
{
|
{
|
||||||
extern qbyte gammatable[256];
|
for (j=0; j<vid.pixelwidth; j++)
|
||||||
for (i=c-(3*vid.pixelwidth); i>=prepad; i-=(3*vid.pixelwidth))
|
|
||||||
{
|
{
|
||||||
for (j=0; j<vid.pixelwidth; j++)
|
ret[i+j*3+0] = p[j*4+2];
|
||||||
{
|
ret[i+j*3+1] = p[j*4+1];
|
||||||
ret[i+j*3+0] = gammatable[p[j*4+2]];
|
ret[i+j*3+2] = p[j*4+0];
|
||||||
ret[i+j*3+1] = gammatable[p[j*4+1]];
|
|
||||||
ret[i+j*3+2] = gammatable[p[j*4+0]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (i=c-(3*vid.pixelwidth); i>=prepad; i-=(3*vid.pixelwidth))
|
|
||||||
{
|
|
||||||
for (j=0; j<vid.pixelwidth; j++)
|
|
||||||
{
|
|
||||||
ret[i+j*3+0] = p[j*4+2];
|
|
||||||
ret[i+j*3+1] = p[j*4+1];
|
|
||||||
ret[i+j*3+2] = p[j*4+0];
|
|
||||||
}
|
|
||||||
p += rect.Pitch;
|
|
||||||
}
|
}
|
||||||
|
p += rect.Pitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
*truevidwidth = vid.pixelwidth;
|
*truevidwidth = vid.pixelwidth;
|
||||||
|
|
Loading…
Reference in a new issue