engine: fix fs_offset_t/size_t conversion, const qualifiers

This commit is contained in:
Alibek Omarov 2019-05-02 19:12:23 +03:00
parent ab7a67464b
commit fe14a360b4
33 changed files with 91 additions and 90 deletions

View File

@ -647,7 +647,7 @@ and hold them into permament memory pool
*/
static void CL_InitTitles( const char *filename )
{
size_t fileSize;
fs_offset_t fileSize;
byte *pMemFile;
int i;
@ -1194,7 +1194,7 @@ upload sprite frames
static qboolean CL_LoadHudSprite( const char *szSpriteName, model_t *m_pSprite, uint type, uint texFlags )
{
byte *buf;
size_t size;
fs_offset_t size;
qboolean loaded;
Assert( m_pSprite != NULL );

View File

@ -1702,7 +1702,7 @@ CL_ParseResLocation
*/
void CL_ParseResLocation( sizebuf_t *msg )
{
const char *data = MSG_ReadString( msg );
char *data = MSG_ReadString( msg );
char token[256];
if( Q_strlen( data ) > 256 )

View File

@ -550,7 +550,7 @@ qboolean SCR_LoadVariableWidthFont( const char *fontname )
{
int i, fontWidth;
byte *buffer;
size_t length;
fs_offset_t length;
qfont_t *src;
if( cls.creditsFont.valid )

View File

@ -558,7 +558,7 @@ static qboolean Con_LoadVariableWidthFont( const char *fontname, cl_font_t *font
{
int i, fontWidth;
byte *buffer;
size_t length;
fs_offset_t length;
qfont_t *src;
if( font->valid )
@ -807,7 +807,7 @@ int Con_UtfMoveRight( char *str, int pos, int length )
static void Con_DrawCharToConback( int num, const byte *conchars, byte *dest )
{
int row, col;
byte *source;
const byte *source;
int drawline;
int x;
@ -2349,8 +2349,8 @@ void Con_VidInit( void )
if( !con.background ) // last chance - quake conback image
{
qboolean draw_to_console = false;
int length = 0;
byte *buf;
fs_offset_t length = 0;
const byte *buf;
// NOTE: only these games want to draw build number into console background
if( !Q_stricmp( FS_Gamedir(), "id1" ))

View File

@ -450,7 +450,7 @@ int S_MixDataToDevice( channel_t *pChannel, int sampleCount, int outRate, int ou
int availableSamples, outSampleCount;
wavdata_t *pSource = pChannel->sfx->cache;
qboolean use_loop = pChannel->use_loop;
char *pData = NULL;
void *pData = NULL;
double sampleFrac;
int i, j;
@ -1059,4 +1059,4 @@ void MIX_PaintChannels( int endtime )
S_TransferPaintBuffer( end );
paintedtime = end;
}
}
}

View File

@ -75,7 +75,7 @@ void SND_MoveMouth8( channel_t *ch, wavdata_t *pSource, int count )
}
else pos = ch->pMixer.sample;
count = S_GetOutputData( pSource, &pdata, pos, count, ch->use_loop );
count = S_GetOutputData( pSource, (void**)&pdata, pos, count, ch->use_loop );
if( pdata == NULL ) return;
i = 0;
@ -123,7 +123,7 @@ void SND_MoveMouth16( channel_t *ch, wavdata_t *pSource, int count )
}
else pos = ch->pMixer.sample;
count = S_GetOutputData( pSource, &pdata, pos, count, ch->use_loop );
count = S_GetOutputData( pSource, (void**)&pdata, pos, count, ch->use_loop );
if( pdata == NULL ) return;
i = 0;
@ -149,4 +149,4 @@ void SND_MoveMouth16( channel_t *ch, wavdata_t *pSource, int count )
pMouth->sndavg = 0;
pMouth->sndcount = 0;
}
}
}

View File

@ -278,7 +278,7 @@ void BaseCmd_Test_f( void )
}
}
Cvar_LookupVars( 0, NULL, &invalid, BaseCmd_CheckCvars );
Cvar_LookupVars( 0, NULL, &invalid, (setpair_t)BaseCmd_CheckCvars );
if( !invalid )
{

View File

@ -765,7 +765,7 @@ void Cmd_RemoveCommand( const char *cmd_name )
Cmd_LookupCmds
============
*/
void Cmd_LookupCmds( char *buffer, void *ptr, setpair_t callback )
void Cmd_LookupCmds( void *buffer, void *ptr, setpair_t callback )
{
cmd_t *cmd;
cmdalias_t *alias;

View File

@ -847,7 +847,7 @@ byte* COM_LoadFileForMe( const char *filename, int *pLength )
{
string name;
byte *file, *pfile;
size_t iLength;
fs_offset_t iLength;
if( !COM_CheckString( filename ))
{

View File

@ -914,9 +914,9 @@ static void Con_AddCommandToList( const char *s, const char *unused1, const char
Con_SortCmds
=================
*/
static int Con_SortCmds( const char **arg1, const char **arg2 )
static int Con_SortCmds( const void *arg1, const void *arg2 )
{
return Q_stricmp( *arg1, *arg2 );
return Q_stricmp( *(const char **)arg1, *(const char **)arg2 );
}
/*
@ -1035,8 +1035,8 @@ void Con_CompleteCommand( field_t *field )
con.shortestMatch[0] = 0;
// find matching commands and variables
Cmd_LookupCmds( NULL, NULL, Con_AddCommandToList );
Cvar_LookupVars( 0, NULL, NULL, Con_AddCommandToList );
Cmd_LookupCmds( NULL, NULL, (setpair_t)Con_AddCommandToList );
Cvar_LookupVars( 0, NULL, NULL, (setpair_t)Con_AddCommandToList );
if( !con.matchCount ) return; // no matches
@ -1100,8 +1100,8 @@ void Con_CompleteCommand( field_t *field )
Con_Printf( "]%s\n", con.completionField->buffer );
// run through again, printing matches
Cmd_LookupCmds( NULL, NULL, Con_PrintCmdMatches );
Cvar_LookupVars( 0, NULL, NULL, Con_PrintCvarMatches );
Cmd_LookupCmds( NULL, NULL, (setpair_t)Con_PrintCmdMatches );
Cvar_LookupVars( 0, NULL, NULL, (setpair_t)Con_PrintCvarMatches );
}
}

View File

@ -64,7 +64,7 @@ void COM_ClearCustomizationList( customization_t *pHead, qboolean bCleanDecals )
qboolean COM_CreateCustomization( customization_t *pListHead, resource_t *pResource, int playernumber, int flags, customization_t **pOut, int *nLumps )
{
qboolean bError = false;
size_t checksize = 0;
fs_offset_t checksize = 0;
customization_t *pCust;
if( pOut ) *pOut = NULL;

View File

@ -255,7 +255,7 @@ void Host_Exec_f( void )
{
string cfgpath;
char *f, *txt;
size_t len;
fs_offset_t len;
if( Cmd_Argc() != 2 )
{

View File

@ -47,7 +47,7 @@ typedef struct loadformat_s
{
const char *formatstring;
const char *ext;
qboolean (*loadfunc)( const char *name, const byte *buffer, size_t filesize );
qboolean (*loadfunc)( const char *name, const byte *buffer, fs_offset_t filesize );
image_hint_t hint;
} loadpixformat_t;
@ -296,15 +296,15 @@ void Image_GetPaletteHL( void );
//
// formats load
//
qboolean Image_LoadMIP( const char *name, const byte *buffer, size_t filesize );
qboolean Image_LoadMDL( const char *name, const byte *buffer, size_t filesize );
qboolean Image_LoadSPR( const char *name, const byte *buffer, size_t filesize );
qboolean Image_LoadTGA( const char *name, const byte *buffer, size_t filesize );
qboolean Image_LoadBMP( const char *name, const byte *buffer, size_t filesize );
qboolean Image_LoadDDS( const char *name, const byte *buffer, size_t filesize );
qboolean Image_LoadFNT( const char *name, const byte *buffer, size_t filesize );
qboolean Image_LoadLMP( const char *name, const byte *buffer, size_t filesize );
qboolean Image_LoadPAL( const char *name, const byte *buffer, size_t filesize );
qboolean Image_LoadMIP( const char *name, const byte *buffer, fs_offset_t filesize );
qboolean Image_LoadMDL( const char *name, const byte *buffer, fs_offset_t filesize );
qboolean Image_LoadSPR( const char *name, const byte *buffer, fs_offset_t filesize );
qboolean Image_LoadTGA( const char *name, const byte *buffer, fs_offset_t filesize );
qboolean Image_LoadBMP( const char *name, const byte *buffer, fs_offset_t filesize );
qboolean Image_LoadDDS( const char *name, const byte *buffer, fs_offset_t filesize );
qboolean Image_LoadFNT( const char *name, const byte *buffer, fs_offset_t filesize );
qboolean Image_LoadLMP( const char *name, const byte *buffer, fs_offset_t filesize );
qboolean Image_LoadPAL( const char *name, const byte *buffer, fs_offset_t filesize );
//
// formats save

View File

@ -33,7 +33,7 @@ typedef struct tagRGBQUAD {
Image_LoadBMP
=============
*/
qboolean Image_LoadBMP( const char *name, const byte *buffer, size_t filesize )
qboolean Image_LoadBMP( const char *name, const byte *buffer, fs_offset_t filesize )
{
byte *buf_p, *pixbuf;
byte palette[256][4];
@ -83,7 +83,7 @@ qboolean Image_LoadBMP( const char *name, const byte *buffer, size_t filesize )
if( bhdr.fileSize != filesize )
{
// Sweet Half-Life issues. splash.bmp have bogus filesize
Con_Reportf( S_WARN "Image_LoadBMP: %s have incorrect file size %i should be %i\n", name, filesize, bhdr.fileSize );
Con_Reportf( S_WARN "Image_LoadBMP: %s have incorrect file size %li should be %i\n", name, filesize, bhdr.fileSize );
}
// bogus compression? Only non-compressed supported.

View File

@ -239,7 +239,7 @@ void Image_DXTAdjustVolume( dds_t *hdr )
Image_LoadDDS
=============
*/
qboolean Image_LoadDDS( const char *name, const byte *buffer, size_t filesize )
qboolean Image_LoadDDS( const char *name, const byte *buffer, fs_offset_t filesize )
{
dds_t header;
byte *fin;
@ -329,4 +329,4 @@ qboolean Image_LoadDDS( const char *name, const byte *buffer, size_t filesize )
SetBits( image.flags, IMAGE_DDS_FORMAT );
return true;
}
}

View File

@ -214,7 +214,7 @@ rgbdata_t *FS_LoadImage( const char *filename, const byte *buffer, size_t size )
string path, loadname, sidename;
qboolean anyformat = true;
int i;
size_t filesize = 0;
fs_offset_t filesize = 0;
const loadpixformat_t *format;
const cubepack_t *cmap;
byte *f;

View File

@ -21,7 +21,7 @@ GNU General Public License for more details.
Image_LoadTGA
=============
*/
qboolean Image_LoadTGA( const char *name, const byte *buffer, size_t filesize )
qboolean Image_LoadTGA( const char *name, const byte *buffer, fs_offset_t filesize )
{
int i, columns, rows, row_inc, row, col;
byte *buf_p, *pixbuf, *targa_rgba;
@ -302,4 +302,4 @@ qboolean Image_SaveTGA( const char *name, rgbdata_t *pix )
Mem_Free( buffer );
return true;
}
}

View File

@ -25,13 +25,13 @@ GNU General Public License for more details.
Image_LoadPAL
============
*/
qboolean Image_LoadPAL( const char *name, const byte *buffer, size_t filesize )
qboolean Image_LoadPAL( const char *name, const byte *buffer, fs_offset_t filesize )
{
int rendermode = LUMP_NORMAL;
if( filesize != 768 )
{
Con_DPrintf( S_ERROR "Image_LoadPAL: (%s) have invalid size (%d should be %d)\n", name, filesize, 768 );
Con_DPrintf( S_ERROR "Image_LoadPAL: (%s) have invalid size (%ld should be %d)\n", name, filesize, 768 );
return false;
}
@ -74,7 +74,7 @@ qboolean Image_LoadPAL( const char *name, const byte *buffer, size_t filesize )
Image_LoadFNT
============
*/
qboolean Image_LoadFNT( const char *name, const byte *buffer, size_t filesize )
qboolean Image_LoadFNT( const char *name, const byte *buffer, fs_offset_t filesize )
{
qfont_t font;
const byte *pal, *fin;
@ -147,7 +147,7 @@ void Image_SetMDLPointer( byte *p )
Image_LoadMDL
============
*/
qboolean Image_LoadMDL( const char *name, const byte *buffer, size_t filesize )
qboolean Image_LoadMDL( const char *name, const byte *buffer, fs_offset_t filesize )
{
byte *fin;
size_t pixels;
@ -197,7 +197,7 @@ qboolean Image_LoadMDL( const char *name, const byte *buffer, size_t filesize )
Image_LoadSPR
============
*/
qboolean Image_LoadSPR( const char *name, const byte *buffer, size_t filesize )
qboolean Image_LoadSPR( const char *name, const byte *buffer, fs_offset_t filesize )
{
dspriteframe_t *pin; // identical for q1\hl sprites
qboolean truecolor = false;
@ -261,7 +261,7 @@ qboolean Image_LoadSPR( const char *name, const byte *buffer, size_t filesize )
Image_LoadLMP
============
*/
qboolean Image_LoadLMP( const char *name, const byte *buffer, size_t filesize )
qboolean Image_LoadLMP( const char *name, const byte *buffer, fs_offset_t filesize )
{
lmp_t lmp;
byte *fin, *pal;
@ -346,7 +346,7 @@ qboolean Image_LoadLMP( const char *name, const byte *buffer, size_t filesize )
Image_LoadMIP
=============
*/
qboolean Image_LoadMIP( const char *name, const byte *buffer, size_t filesize )
qboolean Image_LoadMIP( const char *name, const byte *buffer, fs_offset_t filesize )
{
mip_t mip;
qboolean hl_texture;

View File

@ -1251,7 +1251,7 @@ static qboolean Mod_LoadColoredLighting( dbspmodel_t *bmod )
char modelname[64];
char path[64];
int iCompare;
size_t litdatasize;
fs_offset_t litdatasize;
byte *in;
COM_FileBase( loadmodel->name, modelname );
@ -1279,7 +1279,7 @@ static qboolean Mod_LoadColoredLighting( dbspmodel_t *bmod )
if( litdatasize != ( bmod->lightdatasize * 3 ))
{
Con_Printf( S_ERROR "%s has mismatched size (%i should be %i)\n", path, litdatasize, bmod->lightdatasize * 3 );
Con_Printf( S_ERROR "%s has mismatched size (%li should be %i)\n", path, litdatasize, bmod->lightdatasize * 3 );
Mem_Free( in );
return false;
}
@ -1301,7 +1301,7 @@ Mod_LoadDeluxemap
static void Mod_LoadDeluxemap( dbspmodel_t *bmod )
{
char modelname[64];
size_t deluxdatasize;
fs_offset_t deluxdatasize;
char path[64];
int iCompare;
byte *in;
@ -1334,7 +1334,7 @@ static void Mod_LoadDeluxemap( dbspmodel_t *bmod )
if( deluxdatasize != bmod->lightdatasize )
{
Con_Reportf( S_ERROR "%s has mismatched size (%i should be %i)\n", path, deluxdatasize, bmod->lightdatasize );
Con_Reportf( S_ERROR "%s has mismatched size (%li should be %i)\n", path, deluxdatasize, bmod->lightdatasize );
Mem_Free( in );
return;
}
@ -1527,7 +1527,7 @@ static void Mod_LoadEntities( dbspmodel_t *bmod )
if( bmod->isworld )
{
char entfilename[MAX_QPATH];
int entpatchsize;
fs_offset_t entpatchsize;
size_t ft1, ft2;
// world is check for entfile too
@ -1947,7 +1947,7 @@ static void Mod_LoadTextures( dbspmodel_t *bmod )
}
else
{
size_t srcSize = 0;
fs_offset_t srcSize = 0;
byte *src = NULL;
// NOTE: we can't loading it from wad as normal because _luma texture doesn't exist
@ -2086,7 +2086,7 @@ Mod_LoadTexInfo
static void Mod_LoadTexInfo( dbspmodel_t *bmod )
{
mfaceinfo_t *fout, *faceinfo;
int i, j, miptex;
int i, j, k, miptex;
dfaceinfo_t *fin;
mtexinfo_t *out;
dtexinfo_t *in;
@ -2109,8 +2109,9 @@ static void Mod_LoadTexInfo( dbspmodel_t *bmod )
for( i = 0; i < bmod->numtexinfo; i++, in++, out++ )
{
for( j = 0; j < 8; j++ )
out->vecs[0][j] = in->vecs[0][j];
for( j = 0; j < 2; j++ )
for( k = 0; k < 4; k++ )
out->vecs[j][k] = in->vecs[j][k];
miptex = in->miptex;
if( miptex < 0 || miptex > loadmodel->numtextures )

View File

@ -598,8 +598,8 @@ void *R_StudioGetAnim( studiohdr_t *m_pStudioHeader, model_t *m_pSubModel, mstud
{
mstudioseqgroup_t *pseqgroup;
cache_user_t *paSequences;
size_t filesize;
byte *buf;
fs_offset_t filesize;
byte *buf;
pseqgroup = (mstudioseqgroup_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqgroupindex) + pseqdesc->seqgroup;
if( pseqdesc->seqgroup == 0 )

View File

@ -507,7 +507,7 @@ Mod_LoadCacheFile
void Mod_LoadCacheFile( const char *filename, cache_user_t *cu )
{
char modname[MAX_QPATH];
size_t size;
fs_offset_t size;
byte *buf;
Assert( cu != NULL );

View File

@ -953,7 +953,7 @@ int Netchan_CreateFileFragments( netchan_t *chan, const char *filename )
int send, pos;
int remaining;
int bufferid = 1;
int filesize = 0;
fs_offset_t filesize = 0;
char compressedfilename[MAX_OSPATH];
int compressedFileTime;
int fileTime;

View File

@ -59,7 +59,7 @@ wavdata_t *FS_LoadSound( const char *filename, const byte *buffer, size_t size )
const char *ext = COM_FileExtension( filename );
string path, loadname;
qboolean anyformat = true;
size_t filesize = 0;
fs_offset_t filesize = 0;
const loadwavfmt_t *format;
byte *f;

View File

@ -52,7 +52,7 @@ const char *get_error( void *mpeg );
=================================================================
*/
qboolean Sound_LoadMPG( const char *name, const byte *buffer, size_t filesize )
qboolean Sound_LoadMPG( const char *name, const byte *buffer, fs_offset_t filesize )
{
void *mpeg;
size_t pos = 0;

View File

@ -139,7 +139,7 @@ qboolean StreamFindNextChunk( file_t *file, const char *name, int *last_chunk )
Sound_LoadWAV
=============
*/
qboolean Sound_LoadWAV( const char *name, const byte *buffer, size_t filesize )
qboolean Sound_LoadWAV( const char *name, const byte *buffer, fs_offset_t filesize )
{
int samples, fmt;
qboolean mpeg_stream = false;

View File

@ -25,7 +25,7 @@ typedef struct loadwavfmt_s
{
const char *formatstring;
const char *ext;
qboolean (*loadfunc)( const char *name, const byte *buffer, size_t filesize );
qboolean (*loadfunc)( const char *name, const byte *buffer, fs_offset_t filesize );
} loadwavfmt_t;
typedef struct streamfmt_s
@ -117,8 +117,8 @@ extern sndlib_t sound;
//
// formats load
//
qboolean Sound_LoadWAV( const char *name, const byte *buffer, size_t filesize );
qboolean Sound_LoadMPG( const char *name, const byte *buffer, size_t filesize );
qboolean Sound_LoadWAV( const char *name, const byte *buffer, fs_offset_t filesize );
qboolean Sound_LoadMPG( const char *name, const byte *buffer, fs_offset_t filesize );
//
// stream operate

View File

@ -98,6 +98,6 @@ void Platform_MessageBox( const char *title, const char *message, qboolean paren
fprintf( stderr,
"======================================\n"
"%s: %s\n"
"======================================\n, title, message );
"======================================\n", title, message );
}
#endif

View File

@ -2172,7 +2172,7 @@ SV_StartMusic
void SV_StartMusic( const char *curtrack, const char *looptrack, int position )
{
MSG_BeginServerCmd( &sv.multicast, svc_stufftext );
MSG_WriteString( &sv.multicast, va( "music \"%s\" \"%s\" %li\n", curtrack, looptrack, position ));
MSG_WriteString( &sv.multicast, va( "music \"%s\" \"%s\" %d\n", curtrack, looptrack, position ));
SV_Multicast( MSG_ALL, NULL, NULL, false, false );
}

View File

@ -149,7 +149,7 @@ void Log_PrintServerVars( void )
return;
Log_Printf( "Server cvars start\n" );
Cvar_LookupVars( FCVAR_SERVER, NULL, NULL, Log_PrintServerCvar );
Cvar_LookupVars( FCVAR_SERVER, NULL, NULL, (setpair_t)Log_PrintServerCvar );
Log_Printf( "Server cvars end\n" );
}

View File

@ -78,7 +78,7 @@ R_TransEntityCompare
Sorting translucent entities by rendermode then by distance
===============
*/
static int R_TransEntityCompare( const cl_entity_t **a, const cl_entity_t **b )
static int R_TransEntityCompare( const void *a, const void *b )
{
cl_entity_t *ent1, *ent2;
vec3_t vecLen, org;
@ -86,8 +86,8 @@ static int R_TransEntityCompare( const cl_entity_t **a, const cl_entity_t **b )
int rendermode1;
int rendermode2;
ent1 = (cl_entity_t *)*a;
ent2 = (cl_entity_t *)*b;
ent1 = *(cl_entity_t **)a;
ent2 = *(cl_entity_t **)b;
rendermode1 = R_GetEntityRenderMode( ent1 );
rendermode2 = R_GetEntityRenderMode( ent2 );

View File

@ -1435,14 +1435,14 @@ R_SurfaceCompare
compare translucent surfaces
=================
*/
static int R_SurfaceCompare( const sortedface_t *a, const sortedface_t *b )
static int R_SurfaceCompare( const void *a, const void *b )
{
msurface_t *surf1, *surf2;
vec3_t org1, org2;
float len1, len2;
surf1 = (msurface_t *)a->surf;
surf2 = (msurface_t *)b->surf;
surf1 = (msurface_t *)((sortedface_t *)a)->surf;
surf2 = (msurface_t *)((sortedface_t *)b)->surf;
VectorAdd( RI.currententity->origin, surf1->info->origin, org1 );
VectorAdd( RI.currententity->origin, surf2->info->origin, org2 );

View File

@ -51,9 +51,9 @@ 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;
const dspriteframe_t *pinframe;
mspriteframe_t *pspriteframe;
int gl_texturenum = 0;
char texname[128];
@ -96,16 +96,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] );
@ -113,7 +113,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;
@ -126,13 +126,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;
}
/*

View File

@ -1939,12 +1939,12 @@ R_StudioMeshCompare
Sorting opaque entities by model type
===============
*/
static int R_StudioMeshCompare( const sortedmesh_t *a, const sortedmesh_t *b )
static int R_StudioMeshCompare( const void *a, const void *b )
{
if( FBitSet( a->flags, STUDIO_NF_ADDITIVE ))
if( FBitSet( ((const sortedmesh_t*)a)->flags, STUDIO_NF_ADDITIVE ))
return 1;
if( FBitSet( a->flags, STUDIO_NF_MASKED ))
if( FBitSet( ((const sortedmesh_t*)a)->flags, STUDIO_NF_MASKED ))
return -1;
return 0;
@ -3118,7 +3118,7 @@ void R_StudioRenderFinal( void )
{
for( i = 0; i < m_pStudioHeader->numbodyparts; i++ )
{
R_StudioSetupModel( i, &m_pBodyPart, &m_pSubModel );
R_StudioSetupModel( i, (void**)&m_pBodyPart, (void**)&m_pSubModel );
GL_StudioSetRenderMode( rendermode );
R_StudioDrawPoints();