static void SCR_CaptureVideo_RIFF_OverflowCheck(int framesize)
{
LOAD_FORMATSPECIFIC_AVI();
- fs_offset_t cursize, curfilesize;
+ fs_offset_t cursize;
+ //fs_offset_t curfilesize;
if (format->riffstacklevel != 2)
Sys_Error("SCR_CaptureVideo_RIFF_OverflowCheck: chunk stack leakage!\n");
// check where we are in the file
SCR_CaptureVideo_RIFF_Flush();
cursize = SCR_CaptureVideo_RIFF_GetPosition() - format->riffstackstartoffset[0];
- curfilesize = SCR_CaptureVideo_RIFF_GetPosition();
+ //curfilesize = SCR_CaptureVideo_RIFF_GetPosition();
// if this would overflow the windows limit of 1GB per RIFF chunk, we need
// to close the current RIFF chunk and open another for future frames
*/
void CL_ReadDemoMessage(void)
{
- int r, i;
+ int i;
float f;
if (!cls.demoplayback)
VectorCopy(cl.mviewangles[0], cl.mviewangles[1]);
for (i = 0;i < 3;i++)
{
- r = (int)FS_Read(cls.demofile, &f, 4);
+ FS_Read(cls.demofile, &f, 4);
cl.mviewangles[0][i] = LittleFloat(f);
}
static int (*osgk_addref) (OSGK_BaseObject* obj);
static int (*osgk_release) (OSGK_BaseObject* obj);
-static OSGK_INLINE int osgk_addref_real (OSGK_BaseObject* obj)
+/*static OSGK_INLINE int osgk_addref_real (OSGK_BaseObject* obj)
{
return osgk_addref (obj);
-}
+}*/
static OSGK_INLINE int osgk_release_real (OSGK_BaseObject* obj)
{
unsigned int apiVer, OSGK_EmbeddingOptions* options,
OSGK_GeckoResult* geckoResult);
-static OSGK_INLINE OSGK_Embedding* osgk_embedding_create (
+/*static OSGK_INLINE OSGK_Embedding* osgk_embedding_create (
OSGK_GeckoResult* geckoResult)
{
return osgk_embedding_create2 (OSGK_API_VERSION, 0, geckoResult);
-}
+}*/
static OSGK_INLINE OSGK_Embedding* osgk_embedding_create_with_options (
OSGK_EmbeddingOptions* options, OSGK_GeckoResult* geckoResult)
// these parameters, only trail handling does
void CL_ParticleTrail(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qboolean spawndlight, qboolean spawnparticles)
{
- vec3_t center;
qboolean found = false;
if (effectnameindex < 1 || effectnameindex >= MAX_PARTICLEEFFECTNAME || !particleeffectname[effectnameindex][0])
{
Con_DPrintf("Unknown effect number %i received from server\n", effectnameindex);
return; // no such effect
}
- VectorLerp(originmins, 0.5, originmaxs, center);
if (!cl_particles_quake.integer && particleeffectinfo[0].effectnameindex)
{
int effectinfoindex;
int tex, staintex;
particleeffectinfo_t *info;
vec3_t center;
- vec3_t centervelocity;
vec3_t traildir;
vec3_t trailpos;
vec3_t rvec;
particle_t *part;
// note this runs multiple effects with the same name, each one spawns only one kind of particle, so some effects need more than one
VectorLerp(originmins, 0.5, originmaxs, center);
- VectorLerp(velocitymins, 0.5, velocitymaxs, centervelocity);
supercontents = CL_PointSuperContents(center);
underwater = (supercontents & (SUPERCONTENTS_WATER | SUPERCONTENTS_SLIME)) != 0;
VectorSubtract(originmaxs, originmins, traildir);
void R_DrawParticles (void)
{
- int i, a, content;
+ int i, a;
int drawparticles = r_drawparticles.integer;
float minparticledist;
particle_t *p;
- float gravity, dvel, decalfade, frametime, f, dist, oldorg[3];
+ float gravity, frametime, f, dist, oldorg[3];
float drawdist2;
int hitent;
trace_t trace;
minparticledist = DotProduct(r_refdef.view.origin, r_refdef.view.forward) + 4.0f;
gravity = frametime * cl.movevars_gravity;
- dvel = 1+4*frametime;
- decalfade = frametime * 255 / cl_decals_fadetime.value;
update = frametime > 0;
drawdist2 = r_drawparticles_drawdistance.value * r_refdef.view.quality;
drawdist2 = drawdist2*drawdist2;
continue;
p->delayedspawn = 0;
- content = 0;
-
p->size += p->sizeincrease * frametime;
p->alpha -= p->alphafade * frametime;
}
particletype_t;
-typedef enum
+typedef enum ptype_e
{
pt_dead, pt_alphastatic, pt_static, pt_spark, pt_beam, pt_rain, pt_raindecal, pt_snow, pt_bubble, pt_blood, pt_smoke, pt_decal, pt_entityparticle, pt_total
}
Con_Printf("Command \"%s\" can not be executed\n", Cmd_Argv(0));
found = true;
goto command_found;
- break;
case src_client:
if (cmd->clientfunction)
{
result += processLine(passthroughPL, startOfLine, cursor - startOfLine, spaceUsedInLine, isContinuation);
isContinuation = false;
goto out;
- break;
case '\n': // end of line
result += processLine(passthroughPL, startOfLine, cursor - startOfLine, spaceUsedInLine, isContinuation);
isContinuation = false;
{
char name[128];
int i, p;
- int length;
int match;
int spos;
int count = 0;
if(!name[0])
continue;
- length = strlen(name);
match = -1;
spos = pos - 1; // no need for a minimum of characters :)
{
entnum = MSG_ReadShort();
if(!entnum || msg_badread)
- return;
+ break;
realentnum = entnum & 0x7FFF;
prog->globals.client->self = cl.csqc_server2csqcentitynumber[realentnum];
if(entnum & 0x8000)
// returns true if the packet is valid, false if end of file is reached
// used for dumping the CSQC download into demo files
-qboolean MakeDownloadPacket(const char *filename, unsigned char *data, unsigned long len, int crc, int cnt, sizebuf_t *buf, int protocol)
+qboolean MakeDownloadPacket(const char *filename, unsigned char *data, size_t len, int crc, int cnt, sizebuf_t *buf, int protocol)
{
int packetsize = buf->maxsize - 7; // byte short long
int npackets = (len + packetsize - 1) / (packetsize);
}
if (csprogsdata)
{
- csprogsdatacrc = CRC_Block(csprogsdata, csprogsdatasize);
+ csprogsdatacrc = CRC_Block(csprogsdata, (size_t)csprogsdatasize);
if (csprogsdatacrc != requiredcrc || csprogsdatasize != requiredsize)
{
if (cls.demoplayback)
i = 0;
CL_CutDemo(&demobuf, &demofilesize);
- while(MakeDownloadPacket(csqc_progname.string, csprogsdata, csprogsdatasize, csprogsdatacrc, i++, &sb, cls.protocol))
+ while(MakeDownloadPacket(csqc_progname.string, csprogsdata, (size_t)csprogsdatasize, csprogsdatacrc, i++, &sb, cls.protocol))
CL_WriteDemoMessage(&sb);
CL_PasteDemo(&demobuf, &demofilesize);
default:
s->error = DPVSIMPLEDECODEERROR_UNSUPPORTEDBPP;
return s->error;
- break;
}
for (Rshift = 0;!(Rmask & 1);Rshift++, Rmask >>= 1);
for (Gshift = 0;!(Gmask & 1);Gshift++, Gmask >>= 1);
float Font_VirtualToRealSize(float sz)
{
- int vh, vw, si;
+ int vh;
+ //int vw;
+ int si;
float sn;
if(sz < 0)
return sz;
- vw = ((vid.width > 0) ? vid.width : vid_width.value);
+ //vw = ((vid.width > 0) ? vid.width : vid_width.value);
vh = ((vid.height > 0) ? vid.height : vid_height.value);
// now try to scale to our actual size:
sn = sz * vh / vid_conheight.value;
}
}
-static const float gl_identitymatrix[16] = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1};
-
void R_Mesh_TexMatrix(unsigned int unitnum, const matrix4x4_t *matrix)
{
gltextureunit_t *unit = gl_state.units + unitnum;
int i;
cachepic_t *pic;
static double nextpurgetime;
- int purgeframe;
if (nextpurgetime > realtime)
return;
nextpurgetime = realtime + 0.05;
- purgeframe = draw_frame - 1;
for (i = 0, pic = cachepics;i < numcachepics;i++, pic++)
{
if (pic->autoload && pic->tex && pic->lastusedframe < draw_frame)
size_t bytes_left;
ft2_font_map_t *fontmap = NULL;
ft2_font_map_t *map = NULL;
- ft2_font_map_t *prevmap = NULL;
+ //ft2_font_map_t *prevmap = NULL;
ft2_font_t *ft2 = fnt->ft2;
// float ftbase_x;
qboolean snap = true;
qboolean least_one = false;
- float dw, dh; // display w/h
+ float dw; // display w
+ //float dh; // display h
const float *width_of;
if (!h) h = w;
}
dw = w * sw;
- dh = h * sh;
+ //dh = h * sh;
if (*maxlen < 1)
*maxlen = 1<<30;
if (prevch && Font_GetKerningForMap(ft2, map_index, w, h, prevch, ch, &kx, NULL))
x += kx * dw;
x += map->glyphs[mapch].advance_x * dw;
- prevmap = map;
+ //prevmap = map;
prevch = ch;
}
}
Uchar prevch = 0; // used for kerning
int tempcolorindex;
int map_index = 0;
- ft2_font_map_t *prevmap = NULL; // the previous map
+ //ft2_font_map_t *prevmap = NULL; // the previous map
ft2_font_map_t *map = NULL; // the currently used map
ft2_font_map_t *fontmap = NULL; // the font map for the size
float ftbase_y;
av = vertex3f;
}
- prevmap = map;
+ //prevmap = map;
prevch = ch;
}
if (shadow)
f = FS_LoadFile(name, tempmempool, true, &filesize);
if (f)
{
- if (LoadPCX_QWSkin(f, filesize, pixels, 296, 194))
+ if (LoadPCX_QWSkin(f, (int)filesize, pixels, 296, 194))
skinframe = R_SkinFrame_LoadInternalQuake(name, textureflags, true, r_fullbrights.integer, pixels, image_width, image_height);
Mem_Free(f);
}
tridecal_t *decal;
tridecal_t *decals;
int i;
- int maxdecals;
// expand or initialize the system
if (decalsystem->maxdecals <= decalsystem->numdecals)
}
// grab a decal and search for another free slot for the next one
- maxdecals = decalsystem->maxdecals;
decals = decalsystem->decals;
decal = decalsystem->decals + (i = decalsystem->freedecal++);
for (i = decalsystem->freedecal;i < decalsystem->numdecals && decals[i].color4ub[0][3];i++)
const msurface_t *surfaces;
const int *surfacelist;
const texture_t *texture;
- int numvertices;
int numtriangles;
int numsurfacelist;
int surfacelistindex;
int surfaceindex;
int triangleindex;
- int decalsurfaceindex;
int cornerindex;
int index;
int numpoints;
float localmins[3];
float localmaxs[3];
float localsize;
- float ilocalsize;
float v[9][3];
float tc[9][2];
float c[9][4];
Matrix4x4_Transform3x3(&rsurface.inversematrix, worldnormal, localnormal);
VectorNormalize(localnormal);
localsize = worldsize*rsurface.inversematrixscale;
- ilocalsize = 1.0f / localsize;
localmins[0] = localorigin[0] - localsize;
localmins[1] = localorigin[1] - localsize;
localmins[2] = localorigin[2] - localsize;
continue;
if (texture->surfaceflags & Q3SURFACEFLAG_NOMARKS)
continue;
- decalsurfaceindex = ent == r_refdef.scene.worldentity ? surfaceindex : -1;
- numvertices = surface->num_vertices;
numtriangles = surface->num_triangles;
for (triangleindex = 0, e = model->surfmesh.data_element3i + 3*surface->num_firsttriangle;triangleindex < numtriangles;triangleindex++, e += 3)
{
decalsystem_t *decalsystem = &ent->decalsystem;
int numdecals;
tridecal_t *decal;
- float fadedelay;
float faderate;
float alpha;
float *v3f;
decalsystem->lastupdatetime = cl.time;
decal = decalsystem->decals;
- fadedelay = cl_decals_time.value;
faderate = 1.0f / max(0.001f, cl_decals_fadetime.value);
// update vertex positions for animated models
{
entity_render_t *ent = rsurface.entity;
int i, j, k, l, flagsmask;
- const int *elements;
q3mbrush_t *brush;
const msurface_t *surface;
dp_model_t *model = ent->model;
GL_Color(r_refdef.view.colorscale, r_refdef.view.colorscale, r_refdef.view.colorscale, r_showtris.value);
else
GL_Color(0, r_refdef.view.colorscale, 0, r_showtris.value);
- elements = (model->surfmesh.data_element3i + 3 * surface->num_firsttriangle);
R_Mesh_VertexPointer(rsurface.vertex3f, 0, 0);
R_Mesh_ColorPointer(NULL, 0, 0);
R_Mesh_TexCoordPointer(0, 0, NULL, 0, 0);
const msurface_t **r_surfacelist = NULL;
void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean debug, qboolean prepass)
{
- int i, j, endj, f, flagsmask;
- texture_t *t;
+ int i, j, endj, flagsmask;
dp_model_t *model = r_refdef.scene.worldmodel;
msurface_t *surfaces;
unsigned char *update;
return;
}
- f = 0;
- t = NULL;
rsurface.uselightmaptexture = false;
rsurface.texture = NULL;
rsurface.rtlight = NULL;
void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean debug, qboolean prepass)
{
- int i, j, endj, f, flagsmask;
- texture_t *t;
+ int i, j, endj, flagsmask;
dp_model_t *model = ent->model;
msurface_t *surfaces;
unsigned char *update;
return;
}
- f = 0;
- t = NULL;
rsurface.uselightmaptexture = false;
rsurface.texture = NULL;
rsurface.rtlight = NULL;
dp_model_t *model = ent->model;
const msurface_t *surface;
int i, k, kend, l, m, mend, endsurface, batchnumsurfaces, batchnumtriangles, batchfirstvertex, batchlastvertex, batchfirsttriangle;
- qboolean usebufferobject;
const int *element3i;
static msurface_t *batchsurfacelist[RSURF_MAX_BATCHSURFACES];
static int batchelements[BATCHSIZE*3];
RSurf_PrepareVerticesForBatch(true, true, 1, &surface);
for (m = surface->num_firsttriangle, mend = m + surface->num_triangles;m < mend;m++)
{
- if (lighttrispvs && r_test.integer)
- {
- if (!CHECKPVSBIT(lighttrispvs, m))
- {
- usebufferobject = false;
- continue;
- }
- }
+ if (lighttrispvs && r_test.integer && !CHECKPVSBIT(lighttrispvs, m))
+ continue;
if (batchnumtriangles >= BATCHSIZE)
{
r_refdef.stats.lights_lighttriangles += batchnumtriangles;
R_Shadow_RenderLighting(batchfirstvertex, batchlastvertex + 1 - batchfirstvertex, batchfirsttriangle, batchnumtriangles, ent->model->surfmesh.data_element3i, ent->model->surfmesh.data_element3s, ent->model->surfmesh.ebo3i, ent->model->surfmesh.ebo3s);
else
R_Shadow_RenderLighting(batchfirstvertex, batchlastvertex + 1 - batchfirstvertex, 0, batchnumtriangles, batchelements, NULL, 0, 0);
- usebufferobject = true;
batchnumtriangles = 0;
batchfirsttriangle = m;
}
static unsigned char *resizebuffer = NULL, *colorconvertbuffer;
static int resizebuffersize = 0;
static const unsigned char *texturebuffer;
-static int texturebuffersize = 0;
static textypeinfo_t *R_GetTexTypeInfo(textype_t textype, int flags)
{
case TEXTYPE_RGBA:
if ((flags & TEXF_COMPRESS) && gl_texturecompression.integer >= 1 && vid.support.arb_texture_compression)
return (flags & TEXF_ALPHA) ? &textype_rgba_alpha_compress : &textype_rgba_compress;
- else
- return (flags & TEXF_ALPHA) ? &textype_rgba_alpha : &textype_rgba;
- break;
+ return (flags & TEXF_ALPHA) ? &textype_rgba_alpha : &textype_rgba;
case TEXTYPE_BGRA:
if ((flags & TEXF_COMPRESS) && gl_texturecompression.integer >= 1 && vid.support.arb_texture_compression)
return (flags & TEXF_ALPHA) ? &textype_bgra_alpha_compress : &textype_bgra_compress;
- else
- return (flags & TEXF_ALPHA) ? &textype_bgra_alpha : &textype_bgra;
- break;
+ return (flags & TEXF_ALPHA) ? &textype_bgra_alpha : &textype_bgra;
case TEXTYPE_ALPHA:
return &textype_alpha;
case TEXTYPE_SHADOWMAP:
return &textype_colorbuffer;
default:
Host_Error("R_GetTexTypeInfo: unknown texture format");
- return NULL;
+ break;
}
- return NULL; // this line only to hush compiler warnings
+ return NULL;
}
// dynamic texture code [11/22/2007 Black]
}
resizebuffersize = 0;
- texturebuffersize = 0;
resizebuffer = NULL;
colorconvertbuffer = NULL;
texturebuffer = NULL;
rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filename, int flags, qboolean *hasalphaflag, float *avgcolor)
{
- int i, size, dds_flags, dds_format_flags, dds_miplevels, dds_width, dds_height, textype;
+ int i, size, dds_format_flags, dds_miplevels, dds_width, dds_height;
+ //int dds_flags;
+ textype_t textype;
int bytesperblock, bytesperpixel;
int mipcomplete;
gltexture_t *glt;
return NULL;
}
- dds_flags = BuffLittleLong(dds+8);
+ //dds_flags = BuffLittleLong(dds+8);
dds_format_flags = BuffLittleLong(dds+80);
dds_miplevels = (BuffLittleLong(dds+108) & 0x400000) ? BuffLittleLong(dds+28) : 1;
dds_width = BuffLittleLong(dds+16);
if (COM_CheckParm("-benchmark"))
srand(0); // predictable random sequence for -benchmark
else
- srand(time(NULL));
+ srand((unsigned int)time(NULL));
// FIXME: this is evil, but possibly temporary
// LordHavoc: doesn't seem very temporary...
f = FS_LoadFile(name, tempmempool, true, &filesize);
if (f)
{
- data = format->loadfunc(f, filesize);
+ data = format->loadfunc(f, (int)filesize);
Mem_Free(f);
if(format->loadfunc == JPEG_LoadImage_BGRA) // jpeg can't do alpha, so let's simulate it by loading another jpeg
{
f = FS_LoadFile(name2, tempmempool, true, &filesize);
if(f)
{
- data2 = format->loadfunc(f, filesize);
+ data2 = format->loadfunc(f, (int)filesize);
Mem_Free(f);
Image_CopyAlphaFromBlueBGRA(data, data2, image_width, image_height);
Mem_Free(data2);
const unsigned char *b, *row[3];
int p[5];
unsigned char *out;
- float iwidth, iheight, ibumpscale, n[3];
- iwidth = 1.0f / width;
- iheight = 1.0f / height;
+ float ibumpscale, n[3];
ibumpscale = (255.0f * 6.0f) / bumpscale;
out = outpixels;
for (y = 0, y1 = height-1;y < height;y1 = y, y++)
switch(addresstype)
{
default:
- return 0;
+ break;
case LHNETADDRESSTYPE_LOOP:
// local:port (loopback)
memset(address, 0, sizeof(*address));
char buf[SAVEGAME_COMMENT_LENGTH + 256];
const char *t;
qfile_t *f;
- int version;
+// int version;
for (i=0 ; i<MAX_SAVEGAMES ; i++)
{
continue;
// read enough to get the comment
len = FS_Read(f, buf, sizeof(buf) - 1);
- buf[sizeof(buf) - 1] = 0;
+ len = min(len, sizeof(buf)-1);
+ buf[len] = 0;
t = buf;
// version
COM_ParseToken_Simple(&t, false, false);
- version = atoi(com_token);
+ //version = atoi(com_token);
// description
COM_ParseToken_Simple(&t, false, false);
strlcpy (m_filenames[i], com_token, sizeof (m_filenames[i]));
{
VectorAdd(start, boxmins, shiftstart);
VectorAdd(end, boxmins, shiftend);
- Mod_MDLMD2MD3_TraceLine(model, frameblend, skeleton, trace, start, end, hitsupercontentsmask);
+ Mod_MDLMD2MD3_TraceLine(model, frameblend, skeleton, trace, shiftstart, shiftend, hitsupercontentsmask);
VectorSubtract(trace->endpos, boxmins, trace->endpos);
return;
}
loadmodel->numframes = LittleLong(pinmodel->numframes);
BOUNDI(loadmodel->numframes,0,65536);
loadmodel->synctype = (synctype_t)LittleLong (pinmodel->synctype);
- BOUNDI(loadmodel->synctype,0,2);
+ BOUNDI((int)loadmodel->synctype,0,2);
// convert model flags to EF flags (MF_ROCKET becomes EF_ROCKET, etc)
i = LittleLong (pinmodel->flags);
loadmodel->effects = ((i & 255) << 24) | (i & 0x00FFFF00);
pskmatt_t *matts;
pskboneinfo_t *bones;
pskrawweights_t *rawweights;
- pskboneinfo_t *animbones;
+ //pskboneinfo_t *animbones;
pskaniminfo_t *anims;
pskanimkeys_t *animkeys;
void *animfilebuffer, *animbuffer, *animbufferend;
Host_Error("%s: %s has unsupported recordsize", animname, pchunk->id);
// byteswap in place and keep the pointer
numanimbones = numrecords;
- animbones = (pskboneinfo_t *)animbuffer;
+ //animbones = (pskboneinfo_t *)animbuffer;
// NOTE: supposedly psa does not need to match the psk model, the
// bones missing from the psa would simply use their base
// positions from the psk, but this is hard for me to implement
int i, j, k;
dheader_t *header;
dmodel_t *bm;
- mempool_t *mainmempool;
float dist, modelyawradius, modelradius;
msurface_t *surface;
int numshadowmeshtriangles;
mod->numframes = 2; // regular and alternate animation
mod->numskins = 1;
- mainmempool = mod->mempool;
-
// make a single combined shadow mesh to allow optimized shadow volume creation
numshadowmeshtriangles = 0;
for (j = 0, surface = loadmodel->data_surfaces;j < loadmodel->num_surfaces;j++, surface++)
static void Mod_Q3BSP_LoadLightmaps(lump_t *l, lump_t *faceslump)
{
q3dlightmap_t *input_pointer;
- int i, j, k, count, power, power2, mask, endlightmap, mergewidth, mergeheight;
+ int i, j, k, count, power, power2, endlightmap, mergewidth, mergeheight;
unsigned char *c;
unsigned char *convertedpixels;
power = loadmodel->brushq3.num_lightmapmergepower;
power2 = power * 2;
- mask = (1 << power) - 1;
for (i = 0;i < count;i++)
{
// figure out which merged lightmap texture this fits into
{
VectorCopy(vertexhashdata[j].v, loadmodel->surfmesh.data_vertex3f + 3*j);
VectorCopy(vertexhashdata[j].vn, loadmodel->surfmesh.data_normal3f + 3*j);
- VectorCopy(vertexhashdata[j].vt, loadmodel->surfmesh.data_texcoordtexture2f + 2*j);
+ Vector2Copy(vertexhashdata[j].vt, loadmodel->surfmesh.data_texcoordtexture2f + 2*j);
}
// load the textures
outbufferpos += l;
for (transformindex = 0;transformindex < model->num_bones;transformindex++)
{
- float a, b, c;
float angles[3];
float mtest[4][3];
matrix4x4_t posematrix;
if (angles[1] >= 180) angles[1] -= 360;
if (angles[2] >= 180) angles[2] -= 360;
- a = DEG2RAD(angles[ROLL]);
- b = DEG2RAD(angles[PITCH]);
- c = DEG2RAD(angles[YAW]);
-
#if 0
{
+ float a = DEG2RAD(angles[ROLL]);
+ float b = DEG2RAD(angles[PITCH]);
+ float c = DEG2RAD(angles[YAW]);
float cy, sy, cp, sp, cr, sr;
float test[4][3];
// smd matrix construction, for comparing
float lm_basescalepixels;
int lm_borderpixels;
int lm_texturesize;
- int lm_maxpixels;
+ //int lm_maxpixels;
const int *e;
lightmaptriangle_t *triangle;
unsigned char *lightmappixels;
lm_basescalepixels = 1.0f / max(0.0001f, mod_generatelightmaps_unitspersample.value);
lm_borderpixels = mod_generatelightmaps_borderpixels.integer;
lm_texturesize = bound(lm_borderpixels*2+1, 64, (int)vid.maxtexturesize_2d);
- lm_maxpixels = lm_texturesize-(lm_borderpixels*2+1);
+ //lm_maxpixels = lm_texturesize-(lm_borderpixels*2+1);
Mod_AllocLightmap_Init(&lmstate, lm_texturesize, lm_texturesize);
lightmapnumber = 0;
for (surfaceindex = 0;surfaceindex < model->num_surfaces;surfaceindex++)
int sequence, sequence_ack;
int reliable_ack, reliable_message;
int count;
- int qport;
+ //int qport;
sequence = LittleLong(*((int *)(data + 0)));
sequence_ack = LittleLong(*((int *)(data + 4)));
if (length < 2)
return 0;
// TODO: use qport to identify that this client really is who they say they are? (and elsewhere in the code to identify the connection without a port match?)
- qport = LittleShort(*((int *)(data + 8)));
+ //qport = LittleShort(*((int *)(data + 8)));
data += 2;
length -= 2;
}
if (length > 10 && !memcmp(string, "challenge ", 10) && cls.rcon_trying)
{
- int i, j;
+ int i = 0, j;
for (j = 0;j < MAX_RCONS;j++)
{
+ // note: this value from i is used outside the loop too...
i = (cls.rcon_ringpos + j) % MAX_RCONS;
if(cls.rcon_commands[i][0])
if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[i]))
if(HMAC_MDFOUR_16BYTES((unsigned char *) (buf + 29), (unsigned char *) argbuf, strlen(argbuf), (unsigned char *) rcon_password.string, n))
{
+ int k;
buf[45] = ' ';
strlcpy(buf + 46, argbuf, sizeof(buf) - 46);
NetConn_Write(mysocket, buf, 46 + strlen(buf + 46), peeraddress);
cls.rcon_commands[i][0] = 0;
--cls.rcon_trying;
- for (i = 0;i < MAX_RCONS;i++)
- if(cls.rcon_commands[i][0])
- if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[i]))
+ for (k = 0;k < MAX_RCONS;k++)
+ if(cls.rcon_commands[k][0])
+ if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[k]))
break;
- if(i < MAX_RCONS)
+ if(k < MAX_RCONS)
{
+ int l;
NetConn_WriteString(mysocket, "\377\377\377\377getchallenge", peeraddress);
// extend the timeout on other requests as we asked for a challenge
- for (i = 0;i < MAX_RCONS;i++)
- if(cls.rcon_commands[i][0])
- if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[i]))
- cls.rcon_timeout[i] = realtime + rcon_secure_challengetimeout.value;
+ for (l = 0;l < MAX_RCONS;l++)
+ if(cls.rcon_commands[l][0])
+ if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[l]))
+ cls.rcon_timeout[l] = realtime + rcon_secure_challengetimeout.value;
}
return true; // we used up the challenge, so we can't use this oen for connecting now anyway
void EntityFrameCSQC_LostFrame(client_t *client, int framenum)
{
// marks a frame as lost
- int i, j, n;
+ int i, j;
qboolean valid;
int ringfirst, ringlast;
static int recoversendflags[MAX_EDICTS];
csqcentityframedb_t *d;
- n = client->csqcnumedicts;
-
// is our frame out of history?
ringfirst = client->csqcentityframehistory_next; // oldest entry
ringlast = (ringfirst + NUM_CSQCENTITYDB_FRAMES - 1) % NUM_CSQCENTITYDB_FRAMES; // most recently added entry
static int EntityState5_Priority(entityframe5_database_t *d, int stateindex)
{
int limit, priority;
- entity_state_t *s;
+ entity_state_t *s = NULL; // hush compiler warning by initializing this
// if it is the player, update urgently
if (stateindex == d->viewentnum)
return ENTITYFRAME5_PRIORITYLEVELS - 1;
{
float *pos,*scale;
const char *string;
- int flag,color;
+ int flag;
float sx, sy;
VM_SAFEPARMCOUNT(5,VM_drawstring);
if(pos[2] || scale[2])
Con_Printf("VM_drawcolorcodedstring: z value%s from %s discarded\n",(pos[2] && scale[2]) ? "s" : " ",((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
- color = -1;
getdrawfontscale(&sx, &sy);
DrawQ_String_Scale(pos[0], pos[1], string, 0, scale[0], scale[1], sx, sy, 1, 1, 1, PRVM_G_FLOAT(OFS_PARM3), flag, NULL, false, getdrawfont());
PRVM_G_FLOAT(OFS_RETURN) = 1;
void VM_altstr_ins(void)
{
int num;
- const char *setstr;
const char *set;
- const char *instr;
const char *in;
char *out;
char outstr[VM_STRINGTEMP_LENGTH];
VM_SAFEPARMCOUNT(3, VM_altstr_ins);
- in = instr = PRVM_G_STRING( OFS_PARM0 );
+ in = PRVM_G_STRING( OFS_PARM0 );
num = (int)PRVM_G_FLOAT( OFS_PARM1 );
- set = setstr = PRVM_G_STRING( OFS_PARM2 );
+ set = PRVM_G_STRING( OFS_PARM2 );
out = outstr;
for( num = num * 2 + 2 ; *in && num > 0 ; *out++ = *in++ )
{
case 0:
goto finished;
- break;
case '%':
++s;