From 59f053b1dba1fca3cbb77bdffbcd71071707afea Mon Sep 17 00:00:00 2001 From: mittorn Date: Sat, 25 Jan 2020 15:54:56 +0700 Subject: [PATCH] ref_soft: fix Werrors --- r_context.c | 2 +- r_image.c | 4 ++-- r_local.h | 4 ++-- r_main.c | 2 +- r_polyse.c | 4 ++-- r_studio.c | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/r_context.c b/r_context.c index a576492d..6f350bbc 100644 --- a/r_context.c +++ b/r_context.c @@ -309,7 +309,7 @@ void GAME_EXPORT R_ProcessEntData( qboolean allocate ) // stubs -void GAME_EXPORT GL_SetTexCoordArrayMode( void ) +void GAME_EXPORT GL_SetTexCoordArrayMode( uint mode ) { } diff --git a/r_image.c b/r_image.c index fccde428..b4f353f2 100644 --- a/r_image.c +++ b/r_image.c @@ -572,14 +572,14 @@ static qboolean GL_UploadTexture( image_t *tex, rgbdata_t *pic ) // increase size to workaround triangle renderer bugs // it seems to assume memory readable. maybe it was pointed to WAD? //tex->pixels[j] = (byte*)Mem_Calloc( r_temppool, width * height * sizeof(pixel_t) + 1024 ) + 512; - tex->pixels[j] = (byte*)Mem_Calloc( r_temppool, width * height * sizeof(pixel_t) ); + tex->pixels[j] = (pixel_t*)Mem_Calloc( r_temppool, width * height * sizeof(pixel_t) ); //memset( (byte*)tex->pixels[j] - 512, 0xFF, 512 ); //memset( (byte*)tex->pixels[j] + width * height * sizeof(pixel_t), 0xFF, 512 ); if( j == 0 && tex->flags & TF_HAS_ALPHA ) - tex->alpha_pixels = (byte*)Mem_Calloc( r_temppool, width * height * sizeof(pixel_t) ); + tex->alpha_pixels = (pixel_t*)Mem_Calloc( r_temppool, width * height * sizeof(pixel_t) ); for(i = 0; i < height * width; i++ ) { diff --git a/r_local.h b/r_local.h index d31bc462..67411b56 100644 --- a/r_local.h +++ b/r_local.h @@ -363,7 +363,7 @@ typedef struct image_s int servercount; uint hashValue; - struct gltexture_s *nextHash; + struct image_s *nextHash; } image_t; #if 0 @@ -956,7 +956,7 @@ typedef struct typedef struct { - byte *surfdat; // destination for generated surface + pixel_t *surfdat; // destination for generated surface int rowbytes; // destination logical width in bytes msurface_t *surf; // description for surface to generate fixed8_t lightadj[MAXLIGHTMAPS]; diff --git a/r_main.c b/r_main.c index 38bcd72d..2702736f 100644 --- a/r_main.c +++ b/r_main.c @@ -637,7 +637,7 @@ static void R_SetupFrame( void ) // if( !gl_nosort->value ) { // sort translucents entities by rendermode and distance - qsort( tr.draw_list->trans_entities, tr.draw_list->num_trans_entities, sizeof( cl_entity_t* ), R_TransEntityCompare ); + qsort( tr.draw_list->trans_entities, tr.draw_list->num_trans_entities, sizeof( cl_entity_t* ), (void*)R_TransEntityCompare ); } // current viewleaf diff --git a/r_polyse.c b/r_polyse.c index e987f33d..e1038f4d 100644 --- a/r_polyse.c +++ b/r_polyse.c @@ -1423,8 +1423,8 @@ void R_PolysetDrawSpans8_Opaque (spanpackage_t *pspanpackage) if (lcount) { int lsfrac, ltfrac; - byte *lpdest; - byte *lptex; + pixel_t *lpdest; + pixel_t *lptex; int llight; int lzi; short *lpz; diff --git a/r_studio.c b/r_studio.c index 557f1f09..de4197f7 100644 --- a/r_studio.c +++ b/r_studio.c @@ -2159,7 +2159,7 @@ static void R_StudioDrawPoints( void ) if( r_studio_sort_textures->value && need_sort ) { // resort opaque and translucent meshes draw order - qsort( g_studio.meshes, m_pSubModel->nummesh, sizeof( sortedmesh_t ), R_StudioMeshCompare ); + qsort( g_studio.meshes, m_pSubModel->nummesh, sizeof( sortedmesh_t ), (void*)R_StudioMeshCompare ); } // NOTE: rewind normals at start @@ -2880,7 +2880,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();