mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-12-23 09:16:04 +01:00
ref_soft: sprite: fix to compile(copypasted from ref_gl)
This commit is contained in:
parent
3984a58025
commit
9045657352
27
r_sprite.c
27
r_sprite.c
@ -51,7 +51,7 @@ R_SpriteLoadFrame
|
||||
upload a single frame
|
||||
====================
|
||||
*/
|
||||
static dframetype_t *R_SpriteLoadFrame( model_t *mod, void *pin, mspriteframe_t **ppframe, int num )
|
||||
static const dframetype_t *R_SpriteLoadFrame( model_t *mod, const void *pin, mspriteframe_t **ppframe, int num )
|
||||
{
|
||||
dspriteframe_t pinframe;
|
||||
mspriteframe_t *pspriteframe;
|
||||
@ -87,7 +87,7 @@ static dframetype_t *R_SpriteLoadFrame( model_t *mod, void *pin, mspriteframe_t
|
||||
pspriteframe->gl_texturenum = gl_texturenum;
|
||||
*ppframe = pspriteframe;
|
||||
|
||||
return ( pin + sizeof(dspriteframe_t) + pinframe.width * pinframe.height * bytes );
|
||||
return ( const dframetype_t* )(( const byte* )pin + sizeof( dspriteframe_t ) + pinframe.width * pinframe.height * bytes );
|
||||
}
|
||||
|
||||
/*
|
||||
@ -97,16 +97,16 @@ R_SpriteLoadGroup
|
||||
upload a group frames
|
||||
====================
|
||||
*/
|
||||
static dframetype_t *R_SpriteLoadGroup( model_t *mod, void *pin, mspriteframe_t **ppframe, int framenum )
|
||||
static const dframetype_t *R_SpriteLoadGroup( model_t *mod, const void *pin, mspriteframe_t **ppframe, int framenum )
|
||||
{
|
||||
dspritegroup_t *pingroup;
|
||||
const dspritegroup_t *pingroup;
|
||||
mspritegroup_t *pspritegroup;
|
||||
dspriteinterval_t *pin_intervals;
|
||||
const dspriteinterval_t *pin_intervals;
|
||||
float *poutintervals;
|
||||
int i, groupsize, numframes;
|
||||
void *ptemp;
|
||||
const void *ptemp;
|
||||
|
||||
pingroup = (dspritegroup_t *)pin;
|
||||
pingroup = (const dspritegroup_t *)pin;
|
||||
numframes = pingroup->numframes;
|
||||
|
||||
groupsize = sizeof( mspritegroup_t ) + (numframes - 1) * sizeof( pspritegroup->frames[0] );
|
||||
@ -114,7 +114,7 @@ static dframetype_t *R_SpriteLoadGroup( model_t *mod, void *pin, mspriteframe_t
|
||||
pspritegroup->numframes = numframes;
|
||||
|
||||
*ppframe = (mspriteframe_t *)pspritegroup;
|
||||
pin_intervals = (dspriteinterval_t *)(pingroup + 1);
|
||||
pin_intervals = (const dspriteinterval_t *)(pingroup + 1);
|
||||
poutintervals = Mem_Calloc( mod->mempool, numframes * sizeof( float ));
|
||||
pspritegroup->intervals = poutintervals;
|
||||
|
||||
@ -127,13 +127,13 @@ static dframetype_t *R_SpriteLoadGroup( model_t *mod, void *pin, mspriteframe_t
|
||||
pin_intervals++;
|
||||
}
|
||||
|
||||
ptemp = (void *)pin_intervals;
|
||||
ptemp = (const void *)pin_intervals;
|
||||
for( i = 0; i < numframes; i++ )
|
||||
{
|
||||
ptemp = R_SpriteLoadFrame( mod, ptemp, &pspritegroup->frames[i], framenum * 10 + i );
|
||||
}
|
||||
|
||||
return (dframetype_t *)ptemp;
|
||||
return (const dframetype_t *)ptemp;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -206,7 +206,7 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui
|
||||
for( i = 0; i < mod->numframes; i++ )
|
||||
{
|
||||
frametype_t frametype = pframetype->type;
|
||||
psprite->frames[i].type = frametype;
|
||||
psprite->frames[i].type = (spriteframetype_t)frametype;
|
||||
|
||||
switch( frametype )
|
||||
{
|
||||
@ -237,7 +237,7 @@ Loading a bitmap image as sprite with multiple frames
|
||||
as pieces of input image
|
||||
====================
|
||||
*/
|
||||
void GAME_EXPORT Mod_LoadMapSprite( model_t *mod, const void *buffer, size_t size, qboolean *loaded )
|
||||
void Mod_LoadMapSprite( model_t *mod, const void *buffer, size_t size, qboolean *loaded )
|
||||
{
|
||||
byte *src, *dst;
|
||||
rgbdata_t *pix, temp;
|
||||
@ -672,10 +672,8 @@ static float R_SpriteGlowBlend( vec3_t origin, int rendermode, int renderfx, flo
|
||||
tr = gEngfuncs.EV_VisTraceLine( RI.vieworg, origin, r_traceglow->value ? PM_GLASS_IGNORE : (PM_GLASS_IGNORE|PM_STUDIO_IGNORE));
|
||||
|
||||
if(( 1.0f - tr->fraction ) * dist > 8.0f )
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if( renderfx == kRenderFxNoDissipation )
|
||||
return 1.0f;
|
||||
@ -700,7 +698,6 @@ qboolean R_SpriteOccluded( cl_entity_t *e, vec3_t origin, float *pscale )
|
||||
{
|
||||
float blend;
|
||||
vec3_t v;
|
||||
//return false;
|
||||
|
||||
TriWorldToScreen( origin, v );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user