ref_soft: fix different warnings

This commit is contained in:
Alibek Omarov 2019-10-10 05:55:44 +03:00
parent 690a317f4f
commit d96dcfba59
5 changed files with 19 additions and 19 deletions

View File

@ -151,7 +151,7 @@ void R_DrawStretchPicImplementation (int x, int y, int w, int h, int s1, int t1,
if( transparent )
{
alpha &= src >> 16 - 3;
alpha &= src >> ( 16 - 3 );
src = src << 3;
}
@ -159,12 +159,12 @@ void R_DrawStretchPicImplementation (int x, int y, int w, int h, int s1, int t1,
continue;
if( vid.color != COLOR_WHITE )
src = vid.modmap[src & 0xff00|(vid.color>>8)] << 8 | (src & vid.color & 0xff) | ((src & 0xff) >> 3);
src = vid.modmap[(src & 0xff00)|(vid.color>>8)] << 8 | (src & vid.color & 0xff) | ((src & 0xff) >> 3);
if( vid.rendermode == kRenderTransAdd)
{
pixel_t screen = dest[u];
dest[u] = vid.addmap[src & 0xff00|(screen>>8)] << 8 | (screen & 0xff) | ((src & 0xff) >> 0);
dest[u] = vid.addmap[(src & 0xff00)|(screen>>8)] << 8 | (screen & 0xff) | ((src & 0xff) >> 0);
}
else if( alpha < 7) // && (vid.rendermode == kRenderTransAlpha || vid.rendermode == kRenderTransTexture ) )
{
@ -259,7 +259,7 @@ void Draw_Fill (int x, int y, int w, int h)
if( vid.rendermode == kRenderTransAdd)
{
pixel_t screen = dest[u];
dest[u] = vid.addmap[src & 0xff00|(screen>>8)] << 8 | (screen & 0xff) | ((src & 0xff) >> 0);
dest[u] = vid.addmap[(src & 0xff00)|(screen>>8)] << 8 | (screen & 0xff) | ((src & 0xff) >> 0);
}
else if( alpha < 7) // && (vid.rendermode == kRenderTransAlpha || vid.rendermode == kRenderTransTexture ) )
{

View File

@ -553,7 +553,7 @@ static qboolean GL_UploadTexture( image_t *tex, rgbdata_t *pic )
mipCount = 4;//GL_CalcMipmapCount( tex, ( buf != NULL ));
// NOTE: only single uncompressed textures can be resamples, no mips, no layers, no sides
if(( tex->depth == 1 ) && ( pic->width != tex->width ) || ( pic->height != tex->height ))
if(( tex->depth == 1 ) && (( pic->width != tex->width ) || ( pic->height != tex->height )))
data = GL_ResampleTexture( buf, pic->width, pic->height, tex->width, tex->height, normalMap );
else data = buf;

View File

@ -604,7 +604,6 @@ int VGUI_GenerateTexture( void );
qboolean R_Init( void );
void R_Shutdown( void );
void GL_SetupAttributes( int safegl );
void GL_OnContextCreated( void );
void GL_InitExtensions( void );
void GL_ClearExtensions( void );
void VID_CheckChanges( void );
@ -1235,8 +1234,8 @@ void R_DrawBrushModel(cl_entity_t *pent);
// r_blitscreen.c
//
void R_InitCaches (void);
void R_BlitScreen();
void R_InitBlit();
void R_BlitScreen( void );
void R_InitBlit( void );
//
// r_edge.c
@ -1283,10 +1282,10 @@ int CL_FxBlend( cl_entity_t *e );
void R_SetUpWorldTransform (void);
#define BLEND_ALPHA_LOW(alpha, src, screen) (vid.alphamap[(alpha << 18) |( (src & 0xff00) << 2) | (screen >> 6)] | screen & 0x3f)
#define BLEND_ALPHA(alpha, src, dst) alpha > 3?BLEND_ALPHA_LOW(7 - 1 - alpha, dst,src):BLEND_ALPHA_LOW(alpha-1, src, dst)
#define BLEND_ADD(src, screen) vid.addmap[ src& 0xff00|(screen>>8)] << 8 | (screen & 0xff) | ((src & 0xff) >> 0);
#define BLEND_COLOR(src, color) vid.modmap[src & 0xff00|(color>>8)] << 8 | (src & color & 0xff) | ((src & 0xff) >> 3);
#define BLEND_ALPHA_LOW(alpha, src, screen) (vid.alphamap[((alpha) << 18) | (((src) & 0xff00) << 2) | ((screen) >> 6)] | ((screen) & 0x3f))
#define BLEND_ALPHA(alpha, src, dst) (alpha) > 3?BLEND_ALPHA_LOW(7 - 1 - (alpha), (dst), (src)) : BLEND_ALPHA_LOW((alpha)-1, (src), (dst))
#define BLEND_ADD(src, screen) vid.addmap[((src)& 0xff00)|((screen)>>8)] << 8 | ((screen) & 0xff) | (((src) & 0xff) >> 0);
#define BLEND_COLOR(src, color) vid.modmap[((src) & 0xff00)|((color)>>8)] << 8 | ((src) & (color) & 0xff) | (((src) & 0xff) >> 3);
#define LM_SAMPLE_SIZE_AUTO(surf) (tr.sample_size == -1?gEngfuncs.Mod_SampleSizeForFace( surf ): tr.sample_size)
@ -1296,6 +1295,7 @@ void R_SetUpWorldTransform (void);
// engine callbacks
//
#include "crtlib.h"
#include "crclib.h"
#if 1
#define Mem_Malloc( pool, size ) gEngfuncs._Mem_Alloc( pool, size, false, __FILE__, __LINE__ )
#define Mem_Calloc( pool, size ) gEngfuncs._Mem_Alloc( pool, size, true, __FILE__, __LINE__ )

View File

@ -871,9 +871,9 @@ void R_PolysetDrawSpansBlended( spanpackage_t *pspanpackage)
#endif
pixel_t temp = *lptex;//vid.colormap[*lptex + ( llight & 0xFF00 )];
int alpha = vid.alpha;
temp = BLEND_COLOR(temp, vid.color);
int alpha = vid.alpha;
if( alpha == 7 )
*lpdest = temp;
else if(alpha)
@ -1581,7 +1581,7 @@ void R_PolysetFillSpans8 (spanpackage_t *pspanpackage)
// very dirty, maybe need dual colormap?
//*lpdest = (vid.colormap[src >> 8 | (llight & 0xFF00)] << 8) | src & 0xff;
// 13 bit lighting, 32 light levels
*lpdest = vid.colormap[(src >> 3) | ((llight & 0x1F00) << 5)] | src & 7;
*lpdest = vid.colormap[(src >> 3) | ((llight & 0x1F00) << 5)] | (src & 7);
//PGM
*lpz = lzi >> 16;

View File

@ -66,7 +66,7 @@ static int rtable[MOD_FRAMES][MOD_FRAMES];
#if 1
static void R_BuildLightMap( );
static void R_BuildLightMap( void );
/*
===============
R_AddDynamicLights
@ -172,7 +172,7 @@ Combine and scale multiple lightmaps into the floating
format in r_blocklights
=================
*/
static void R_BuildLightMap( )
static void R_BuildLightMap( void )
{
int smax, tmax;
uint *bl, scale;
@ -622,7 +622,7 @@ void R_DrawSurface (void)
//=============================================================================
#if !id386
#define BLEND_LM(pix, light) vid.colormap[(pix >> 3) | ((light & 0x1f00) << 5)] | pix & 7;
#define BLEND_LM(pix, light) vid.colormap[(pix >> 3) | ((light & 0x1f00) << 5)] | ( pix & 7 );
/*
================
@ -1156,7 +1156,7 @@ int D_log2 (int num)
//=============================================================================
void R_DecalComputeBasis( msurface_t *surf, int flags, vec3_t textureSpaceBasis[3] );
void R_DrawSurfaceDecals()
void R_DrawSurfaceDecals( void )
{
msurface_t *fa = r_drawsurf.surf;
decal_t *p;
@ -1266,7 +1266,7 @@ void R_DrawSurfaceDecals()
if( transparent )
{
alpha &= src >> 16 - 3;
alpha &= src >> (16 - 3);
src = src << 3;
}