|
|
|
@ -357,20 +357,23 @@ void SPR_AdjustSize( float *x, float *y, float *w, float *h )
@@ -357,20 +357,23 @@ void SPR_AdjustSize( float *x, float *y, float *w, float *h )
|
|
|
|
|
*h *= yscale; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SPR_AdjustTexCoords( float width, float height, float *s1, float *t1, float *s2, float *t2 ) |
|
|
|
|
static void SPR_AdjustTexCoords( int texnum, float width, float height, float *s1, float *t1, float *s2, float *t2 ) |
|
|
|
|
{ |
|
|
|
|
if( refState.width != clgame.scrInfo.iWidth ) |
|
|
|
|
if( REF_GET_PARM( PARM_TEX_FILTERING, texnum )) |
|
|
|
|
{ |
|
|
|
|
// align to texel if scaling
|
|
|
|
|
*s1 += 0.5f; |
|
|
|
|
*s2 -= 0.5f; |
|
|
|
|
} |
|
|
|
|
if( refState.width != clgame.scrInfo.iWidth ) |
|
|
|
|
{ |
|
|
|
|
// align to texel if scaling
|
|
|
|
|
*s1 += 0.5f; |
|
|
|
|
*s2 -= 0.5f; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if( refState.height != clgame.scrInfo.iHeight ) |
|
|
|
|
{ |
|
|
|
|
// align to texel if scaling
|
|
|
|
|
*t1 += 0.5f; |
|
|
|
|
*t2 -= 0.5f; |
|
|
|
|
if( refState.height != clgame.scrInfo.iHeight ) |
|
|
|
|
{ |
|
|
|
|
// align to texel if scaling
|
|
|
|
|
*t1 += 0.5f; |
|
|
|
|
*t2 -= 0.5f; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
*s1 /= width; |
|
|
|
@ -402,6 +405,8 @@ static void SPR_DrawGeneric( int frame, float x, float y, float width, float hei
@@ -402,6 +405,8 @@ static void SPR_DrawGeneric( int frame, float x, float y, float width, float hei
|
|
|
|
|
height = h; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
texnum = ref.dllFuncs.R_GetSpriteTexture( clgame.ds.pSprite, frame ); |
|
|
|
|
|
|
|
|
|
if( prc ) |
|
|
|
|
{ |
|
|
|
|
wrect_t rc = *prc; |
|
|
|
@ -418,7 +423,7 @@ static void SPR_DrawGeneric( int frame, float x, float y, float width, float hei
@@ -418,7 +423,7 @@ static void SPR_DrawGeneric( int frame, float x, float y, float width, float hei
|
|
|
|
|
t2 = rc.bottom; |
|
|
|
|
|
|
|
|
|
// calc user-defined rectangle
|
|
|
|
|
SPR_AdjustTexCoords( width, height, &s1, &t1, &s2, &t2 ); |
|
|
|
|
SPR_AdjustTexCoords( texnum, width, height, &s1, &t1, &s2, &t2 ); |
|
|
|
|
width = rc.right - rc.left; |
|
|
|
|
height = rc.bottom - rc.top; |
|
|
|
|
} |
|
|
|
@ -434,7 +439,6 @@ static void SPR_DrawGeneric( int frame, float x, float y, float width, float hei
@@ -434,7 +439,6 @@ static void SPR_DrawGeneric( int frame, float x, float y, float width, float hei
|
|
|
|
|
|
|
|
|
|
// scale for screen sizes
|
|
|
|
|
SPR_AdjustSize( &x, &y, &width, &height ); |
|
|
|
|
texnum = ref.dllFuncs.R_GetSpriteTexture( clgame.ds.pSprite, frame ); |
|
|
|
|
ref.dllFuncs.Color4ub( clgame.ds.spriteColor[0], clgame.ds.spriteColor[1], clgame.ds.spriteColor[2], clgame.ds.spriteColor[3] ); |
|
|
|
|
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, s1, t1, s2, t2, texnum ); |
|
|
|
|
} |
|
|
|
|