mirror of
https://github.com/nzp-team/dquakeplus.git
synced 2025-02-16 16:41:03 +00:00
Misc warning cleanup (fixes compilation with GCC 14) (#32)
This commit is contained in:
parent
afce92f79a
commit
27ad857d76
16 changed files with 109 additions and 123 deletions
|
@ -1185,7 +1185,7 @@ HUD_Powerups
|
|||
*/
|
||||
void HUD_Powerups (void)
|
||||
{
|
||||
int count;
|
||||
int count = 0;
|
||||
|
||||
// horrible way to offset check :)))))))))))))))))) :DDDDDDDD XOXO
|
||||
|
||||
|
|
|
@ -39,17 +39,15 @@ char decrypt(char c, int key)
|
|||
|
||||
}
|
||||
|
||||
void* Q_malloc(size_t);
|
||||
|
||||
char *strencrypt(char *s, int key, int len)
|
||||
{
|
||||
int i;
|
||||
char *result = Q_malloc(len);
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
result[i] = encrypt(s[i], key);
|
||||
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
char *strdecrypt(char *s, int key, int len)
|
||||
|
@ -57,9 +55,7 @@ char *strdecrypt(char *s, int key, int len)
|
|||
int i;
|
||||
char *result = Q_malloc(len);
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
result[i] = decrypt(s[i], -key);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,26 +47,6 @@ struct mplane_s;
|
|||
extern vec3_t vec3_origin;
|
||||
extern int nanmask;
|
||||
|
||||
/*
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||
#endif
|
||||
|
||||
#define M_PI_DIV_180 (M_PI / 180.0) //johnfitz
|
||||
//#define DEG2RAD( a ) ( a * M_PI ) / 180.0F
|
||||
#define DEG2RAD( a ) ( (a) * M_PI_DIV_180 ) //johnfitz
|
||||
|
||||
//#else
|
||||
*/
|
||||
#ifndef M_PI
|
||||
#define M_PI = GU_PI // matches value in gcc v2 math.h
|
||||
#endif
|
||||
|
||||
#define M_PI_DIV_180 (M_PI / 180.0) //johnfitz
|
||||
//#define DEG2RAD( a ) ( a * M_PI ) / 180.0F
|
||||
#define DEG2RAD( a ) ( (a) * M_PI_DIV_180 ) //johnfitz
|
||||
//#endif
|
||||
|
||||
#define CLAMP(min, x, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) //johnfitz
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
|
|
|
@ -417,6 +417,25 @@ void M_ToggleMenu_f (void)
|
|||
int M_Start_Cusor;
|
||||
#define Max_Start_Iteams 5
|
||||
|
||||
|
||||
void M_Load_Menu_Pics ()
|
||||
{
|
||||
menu_bk = loadtextureimage("gfx/menu/menu_background", 0, 0, false, GU_LINEAR);
|
||||
menu_ndu = loadtextureimage("gfx/menu/nacht_der_untoten", 0, 0, false, GU_LINEAR);
|
||||
//menu_kn = Draw_CacheImg("gfx/menu/kino_der_toten");
|
||||
menu_wh = loadtextureimage("gfx/menu/nzp_warehouse", 0, 0, false, GU_LINEAR);
|
||||
menu_wh2 = loadtextureimage("gfx/menu/nzp_warehouse2", 0, 0, false, GU_LINEAR);
|
||||
//menu_wn = Draw_CacheImg("gfx/menu/wahnsinn");
|
||||
menu_ch = loadtextureimage("gfx/menu/christmas_special", 0, 0, false, GU_LINEAR);
|
||||
menu_custom = loadtextureimage("gfx/menu/custom", 0, 0, false, GU_LINEAR);
|
||||
for (int i = 0; i < MAX_CUSTOM_MAPS; i++) {
|
||||
if (custom_maps[i].occupied == false) continue;
|
||||
if (custom_maps[i].map_use_thumbnail == false) continue;
|
||||
custom_maps[i].thumbnail_index = loadtextureimage(custom_maps[i].map_thumbnail_path, 0, 0, false, GU_LINEAR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void M_Start_Menu_f ()
|
||||
{
|
||||
Load_Achivements();
|
||||
|
@ -450,23 +469,6 @@ void M_Start_Key (int key)
|
|||
}
|
||||
}
|
||||
|
||||
void M_Load_Menu_Pics ()
|
||||
{
|
||||
menu_bk = loadtextureimage("gfx/menu/menu_background", 0, 0, false, GU_LINEAR);
|
||||
menu_ndu = loadtextureimage("gfx/menu/nacht_der_untoten", 0, 0, false, GU_LINEAR);
|
||||
//menu_kn = Draw_CacheImg("gfx/menu/kino_der_toten");
|
||||
menu_wh = loadtextureimage("gfx/menu/nzp_warehouse", 0, 0, false, GU_LINEAR);
|
||||
menu_wh2 = loadtextureimage("gfx/menu/nzp_warehouse2", 0, 0, false, GU_LINEAR);
|
||||
//menu_wn = Draw_CacheImg("gfx/menu/wahnsinn");
|
||||
menu_ch = loadtextureimage("gfx/menu/christmas_special", 0, 0, false, GU_LINEAR);
|
||||
menu_custom = loadtextureimage("gfx/menu/custom", 0, 0, false, GU_LINEAR);
|
||||
for (int i = 0; i < MAX_CUSTOM_MAPS; i++) {
|
||||
if (custom_maps[i].occupied == false) continue;
|
||||
if (custom_maps[i].map_use_thumbnail == false) continue;
|
||||
custom_maps[i].thumbnail_index = loadtextureimage(custom_maps[i].map_thumbnail_path, 0, 0, false, GU_LINEAR);
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
int M_Paused_Cusor;
|
||||
|
|
|
@ -1184,7 +1184,11 @@ inline static void QMB_UpdateParticles(void)
|
|||
{
|
||||
TraceLineN(oldorg, p->org, stop, normal);
|
||||
|
||||
if ((stop != p->org)&&(VectorLength(stop)!=0))
|
||||
if ( (stop[0] != p->org[0])
|
||||
&& (stop[1] != p->org[1])
|
||||
&& (stop[2] != p->org[2])
|
||||
&& VectorLength(stop)!=0)
|
||||
|
||||
{
|
||||
vec3_t tangent;
|
||||
VectorCopy(stop, p->org);
|
||||
|
@ -1222,7 +1226,10 @@ inline static void QMB_UpdateParticles(void)
|
|||
{
|
||||
TraceLineN(oldorg, p->org, stop, normal);
|
||||
|
||||
if ((stop != p->org)&&(VectorLength(stop)!=0))
|
||||
if ( (stop[0] != p->org[0])
|
||||
&& (stop[1] != p->org[1])
|
||||
&& (stop[2] != p->org[2])
|
||||
&& VectorLength(stop)!=0)
|
||||
{
|
||||
vec3_t tangent;
|
||||
|
||||
|
@ -2931,7 +2938,7 @@ void QMB_LaserSight (void)
|
|||
switch ((int)r_laserpoint.value)
|
||||
{
|
||||
case 1:
|
||||
color[0] = color[0] = 000;color[1] = 000;color[2] = 255;color[3] = 50;//B
|
||||
color[0] = 000;color[1] = 000;color[2] = 255;color[3] = 50;//B
|
||||
c = lt_blue;
|
||||
break;
|
||||
case 2:
|
||||
|
|
|
@ -779,7 +779,7 @@ void R_DrawSpriteModel (entity_t *e)
|
|||
s_right = v_right;
|
||||
break;
|
||||
case SPR_VP_PARALLEL_ORIENTED: //faces view plane, but obeys roll value
|
||||
angle = currententity->angles[ROLL] * M_PI_DIV_180;
|
||||
angle = DEG2RAD(currententity->angles[ROLL]);
|
||||
#ifdef PSP_VFPU
|
||||
sr = vfpu_sinf(angle);
|
||||
cr = vfpu_cosf(angle);
|
||||
|
@ -3753,9 +3753,9 @@ void R_RenderScene (void)
|
|||
//what a mess!
|
||||
//fovx = atan(tan(DEG2RAD(r_refdef.fov_x) / 2) * (0.97 + sin(cl.time * 1) * 0.04)) * 2 / M_PI_DIV_180;
|
||||
#ifdef PSP_VFPU
|
||||
fovy = vfpu_atanf(vfpu_tanf(DEG2RAD(r_refdef.fov_y) / 2) * (1.03 - vfpu_sinf(cl.time * 2) * 0.04)) * 2 / M_PI_DIV_180;
|
||||
fovy = RAD2DEG(vfpu_atanf(vfpu_tanf(DEG2RAD(r_refdef.fov_y) / 2) * (1.03 - vfpu_sinf(cl.time * 2) * 0.04)));
|
||||
#else
|
||||
fovy = atan(tan(DEG2RAD(r_refdef.fov_y) / 2) * (1.03 - sin(cl.time * 2) * 0.04)) * 2 / M_PI_DIV_180;
|
||||
fovy = RAD2DEG(atan(tan(DEG2RAD(r_refdef.fov_y) / 2) * (1.03 - sin(cl.time * 2) * 0.04)));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ void R_ReadPointFile_f (void)
|
|||
Sys_Error("Line buffer overflow when reading point file");
|
||||
}
|
||||
|
||||
if (!Sys_FileRead(f, &line[chars++], 1) != 1)
|
||||
if (Sys_FileRead(f, &line[chars++], 1) == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -340,6 +340,7 @@ store:
|
|||
r = bl[0] >> 7; if (r > 255) r = 255; r = r >> 3;
|
||||
g = bl[1] >> 7; if (g > 255) g = 255; g = g >> 3;
|
||||
b = bl[2] >> 7; if (b > 255) b = 255; b = b >> 3;
|
||||
a = bl[3] >> 7; if (a > 255) a = 255; a = a >> 3;
|
||||
|
||||
luxel lx;
|
||||
lx.rgb = (a << 15) | (b << 10) | (g << 5) | (r);
|
||||
|
|
|
@ -876,7 +876,7 @@ void UnloadSkyTexture (void)
|
|||
{
|
||||
if (skyimage[i])
|
||||
GL_UnloadTexture(skyimage[i]);
|
||||
skyimage[i] = NULL;
|
||||
skyimage[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1049,7 +1049,7 @@ void Sky_Init (void)
|
|||
Cmd_AddCommand ("sky",Sky_SkyCommand_f);
|
||||
|
||||
for (i=0; i<5; i++)
|
||||
skyimage[i] = NULL;
|
||||
skyimage[i] = 0;
|
||||
}
|
||||
|
||||
static vec3_t skyclip[6] = {
|
||||
|
|
|
@ -457,7 +457,7 @@ byte *W_GetTextureHL(char *name)
|
|||
char texname[17];
|
||||
int i, j;
|
||||
FILE *file;
|
||||
miptex_t *tex;
|
||||
miptex_t *tex = NULL;
|
||||
byte *data;
|
||||
|
||||
texname[16] = 0;
|
||||
|
@ -503,6 +503,6 @@ byte *W_GetTextureHL(char *name)
|
|||
else
|
||||
break;
|
||||
}
|
||||
tex->width = tex->width = 0;
|
||||
tex->width = tex->height = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -1424,7 +1424,7 @@ void Load_Waypoint_NZPBETA()
|
|||
Con_DPrintf("Loading BETA waypoints\n");
|
||||
|
||||
vec3_t way_origin;
|
||||
int way_id;
|
||||
int way_id = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
|
|
@ -124,7 +124,7 @@ float V_CalcBob (float speed,float which)//0 = regular, 1 = side bobbing
|
|||
float sprint = 1;
|
||||
|
||||
if (cl.stats[STAT_ZOOM] == 2)
|
||||
return;
|
||||
return bob;
|
||||
|
||||
// Bob idle-y, instead of presenting as if in-motion.
|
||||
if (speed < 0.1) {
|
||||
|
|
|
@ -119,7 +119,7 @@ void* memcpy_vfpu( void* dst, void* src, unsigned int size )
|
|||
// We use uncached dst to use VFPU writeback and free cpu cache for src only
|
||||
u8* udst8 = (u8*)((u32)dst8 | 0x40000000);
|
||||
// We need the 64 byte aligned address to make sure the dcache is invalidated correctly
|
||||
u8* dst64a = ((u32)dst8&~0x3F);
|
||||
u8* dst64a = (u8*)((u32)dst8&~0x3F);
|
||||
// Invalidate the first line that matches up to the dst start
|
||||
if (size>=64)
|
||||
asm(".set push\n" // save assembler option
|
||||
|
|
Loading…
Reference in a new issue