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