soft: fix cppcheck warning and remove unused fullscreen property

This commit is contained in:
Denis Pauk 2024-03-17 15:44:32 +02:00
parent 2b9c4e88fe
commit 6590097752
8 changed files with 34 additions and 27 deletions

View file

@ -455,7 +455,7 @@ void R_DrawSolidClippedSubmodelPolygons(entity_t *currententity, const model_t *
void R_AliasDrawModel(entity_t *currententity, const model_t *currentmodel);
void R_BeginEdgeFrame(void);
void R_ScanEdges(entity_t *currententity, surf_t *surface);
void R_ScanEdges(entity_t *currententity, const surf_t *surface);
void RI_PushDlights(const model_t *model);
void R_RotateBmodel(const entity_t *currententity);
@ -563,7 +563,7 @@ extern byte d_8to24table[256 * 4];
void R_InitImages(void);
void R_ShutdownImages(void);
image_t *R_FindImage(const char *name, imagetype_t type);
image_t *R_LoadPic(char *name, byte *pic, int width, int realwidth, int height, int realheight,
image_t *R_LoadPic(const char *name, const byte *pic, int width, int realwidth, int height, int realheight,
size_t data_size, imagetype_t type, int bits);
byte *Get_BestImageSize(const image_t *image, int *req_width, int *req_height);
void R_FreeUnusedImages(void);

View file

@ -598,7 +598,7 @@ Each surface has a linked list of its visible spans
==============
*/
void
R_ScanEdges (entity_t *currententity, surf_t *surface)
R_ScanEdges (entity_t *currententity, const surf_t *surface)
{
shift20_t iv, bottom;
surf_t *s;

View file

@ -331,7 +331,7 @@ R_LoadPic8(const char *name, const byte *pic, int width, int realwidth, int heig
}
image_t *
R_LoadPic(char *name, byte *pic, int width, int realwidth, int height, int realheight,
R_LoadPic(const char *name, const byte *pic, int width, int realwidth, int height, int realheight,
size_t data_size, imagetype_t type, int bits)
{
if (!realwidth || !realheight)

View file

@ -225,8 +225,9 @@ RI_BuildLightMap(drawsurf_t* drawsurf)
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
maps++)
{
const light_t *max_light;
light_t *curr_light;
unsigned scale;
light_t *curr_light, *max_light;
curr_light = blocklights;
max_light = blocklights + size;
@ -277,8 +278,9 @@ RI_BuildLightMap(drawsurf_t* drawsurf)
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
maps++)
{
const light_t *max_light;
light_t *curr_light;
unsigned scale;
light_t *curr_light, *max_light;
curr_light = blocklights;
max_light = blocklights + size;
@ -302,7 +304,8 @@ RI_BuildLightMap(drawsurf_t* drawsurf)
// bound, invert, and shift
{
light_t *curr_light, *max_light;
const light_t *max_light;
light_t *curr_light;
curr_light = blocklights;
max_light = blocklights + size;

View file

@ -64,11 +64,10 @@ pixel_t *r_warpbuffer;
typedef struct swstate_s
{
qboolean fullscreen;
int prev_mode; // last valid SW mode
int prev_mode; /* last valid SW mode */
unsigned char gammatable[256];
unsigned char currentpalette[1024];
unsigned char gammatable[256];
unsigned char currentpalette[1024];
} swstate_t;
static swstate_t sw_state;
@ -928,7 +927,7 @@ R_BmodelCheckBBox
=============
*/
static int
R_BmodelCheckBBox (const float *minmaxs)
R_BmodelCheckBBox(const float *minmaxs)
{
int i, clipflags;
@ -937,7 +936,7 @@ R_BmodelCheckBBox (const float *minmaxs)
for (i=0 ; i<4 ; i++)
{
vec3_t acceptpt, rejectpt;
int *pindex;
const int *pindex;
float d;
// generate accept and reject points
@ -986,7 +985,7 @@ R_FindTopnode (vec3_t mins, vec3_t maxs)
while (1)
{
cplane_t *splitplane;
const cplane_t *splitplane;
int sides;
if (node->visframe != r_visframecount)
@ -2085,7 +2084,7 @@ char shift_size;
static void
RE_CopyFrame (Uint32 * pixels, int pitch, int vmin, int vmax)
{
Uint32 *sdl_palette = (Uint32 *)sw_state.currentpalette;
const Uint32 *sdl_palette = (Uint32 *)sw_state.currentpalette;
// no gaps between images rows
if (pitch == vid_buffer_width)
@ -2130,7 +2129,8 @@ RE_CopyFrame (Uint32 * pixels, int pitch, int vmin, int vmax)
static int
RE_BufferDifferenceStart(int vmin, int vmax)
{
int *front_buffer, *back_buffer, *back_max;
int *front_buffer, *back_buffer;
const int *back_max;
back_buffer = (int*)(swap_frames[0] + vmin);
front_buffer = (int*)(swap_frames[1] + vmin);
@ -2146,7 +2146,8 @@ RE_BufferDifferenceStart(int vmin, int vmax)
static int
RE_BufferDifferenceEnd(int vmin, int vmax)
{
int *front_buffer, *back_buffer, *back_min;
int *front_buffer, *back_buffer;
const int *back_min;
back_buffer = (int*)(swap_frames[0] + vmax);
front_buffer = (int*)(swap_frames[1] + vmax);
@ -2197,7 +2198,7 @@ RE_FlushFrame(int vmin, int vmax)
if (is_render_flushed)
{
Com_Printf("%s: Render is already flushed\n", __func__);
R_Printf(PRINT_DEVELOPER, "%s: Render is already flushed\n", __func__);
return;
}

View file

@ -336,7 +336,7 @@ R_SetupFrame (void)
// current viewleaf
if ( !( r_newrefdef.rdflags & RDF_NOWORLDMODEL ) )
{
mleaf_t *r_viewleaf;
const mleaf_t *r_viewleaf;
if (!r_worldmodel)
{

View file

@ -519,10 +519,11 @@ R_DrawSpanlet66Stipple(const int *r_turb_turb)
static int
R_ClipPolyFace(int nump, clipplane_t *pclipplane)
{
int i, outcount;
float frac, clipdist, *pclipnormal;
float *in, *instep, *outstep, *vert2;
float dists[MAXWORKINGVERTS+3] = {0};
float dists[MAXWORKINGVERTS+3] = {0};
const float *vert2, *pclipnormal;
float *in, *instep, *outstep;
float frac, clipdist;
int i, outcount;
clipdist = pclipplane->dist;
pclipnormal = pclipplane->normal;

View file

@ -37,7 +37,7 @@ msurface_t *r_alpha_surfaces;
vklightmapstate_t vk_lms;
static void
DrawVkPoly(mpoly_t *p, image_t *texture, float *color)
DrawVkPoly(mpoly_t *p, image_t *texture, const float *color)
{
QVk_BindPipeline(&vk_drawPolyPipeline);
@ -74,7 +74,7 @@ DrawVkFlowingPoly -- version of DrawVkPoly that handles scrolling texture
================
*/
static void
DrawVkFlowingPoly(msurface_t *fa, image_t *texture, float *color)
DrawVkFlowingPoly(msurface_t *fa, image_t *texture, const float *color)
{
float scroll;
mpoly_t *p;
@ -187,7 +187,8 @@ R_DrawTriangleOutlines(void)
}
static void
R_RenderBrushPoly(msurface_t *fa, float *modelMatrix, float alpha, entity_t *currententity)
R_RenderBrushPoly(msurface_t *fa, const float *modelMatrix, float alpha,
const entity_t *currententity)
{
int maps;
image_t *image;
@ -390,7 +391,8 @@ DrawTextureChains(entity_t *currententity)
static void
Vk_RenderLightmappedPoly(msurface_t *surf, float *modelMatrix, float alpha, entity_t *currententity)
Vk_RenderLightmappedPoly(msurface_t *surf, const float *modelMatrix, float alpha,
const entity_t *currententity)
{
int i, nv = surf->polys->numverts;
int map;