Matrix4x4_CreateTranslate(&matrix, touch->fields.client->origin[0], touch->fields.client->origin[1], touch->fields.client->origin[2]);
Matrix4x4_Invert_Simple(&imatrix, &matrix);
if ((int)touch->fields.client->flags & FL_MONSTER)
- Collision_ClipToGenericEntity(&trace, model, touch->fields.client->frame, touch->fields.client->mins, touch->fields.client->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins2, clipmaxs2, clipend, hitsupercontentsmask);
+ Collision_ClipToGenericEntity(&trace, model, (int) touch->fields.client->frame, touch->fields.client->mins, touch->fields.client->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins2, clipmaxs2, clipend, hitsupercontentsmask);
else
- Collision_ClipToGenericEntity(&trace, model, touch->fields.client->frame, touch->fields.client->mins, touch->fields.client->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins, clipmaxs, clipend, hitsupercontentsmask);
+ Collision_ClipToGenericEntity(&trace, model, (int) touch->fields.client->frame, touch->fields.client->mins, touch->fields.client->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins, clipmaxs, clipend, hitsupercontentsmask);
if (cliptrace.realfraction > trace.realfraction && hitnetworkentity)
*hitnetworkentity = 0;
}
static void cl_gecko_updatecallback( rtexture_t *texture, void* callbackData ) {
- clgecko_t *instance = callbackData;
+ clgecko_t *instance = (clgecko_t *) callbackData;
const unsigned char *data;
if( instance->browser ) {
// TODO: OSGK only supports BGRA right now
OSGK_ScriptVariant** params,
OSGK_ScriptVariant** returnVal)
{
- clgecko_t *instance = objTag;
+ clgecko_t *instance = (clgecko_t *) objTag;
OSGK_ScriptVariant* strVal;
OSGK_ScriptResult result = srFailed;
prvm_prog_t * saveProg;
break;
}
- CL_Gecko_Event_Key( instance, key, CLG_BET_PRESS );
+ CL_Gecko_Event_Key( instance, (keynum_t) key, CLG_BET_PRESS );
}
}
return;
}
- mappedx = x * instance->width;
- mappedy = y * instance->height;
+ mappedx = (int) (x * instance->width);
+ mappedy = (int) (y * instance->height);
osgk_browser_event_mouse_move( instance->browser, mappedx, mappedy );
}
if (bits & QW_CM_ANGLE3)
MSG_WriteAngle16i(buf, to->viewangles[2]);
if (bits & QW_CM_FORWARD)
- MSG_WriteShort(buf, to->forwardmove);
+ MSG_WriteShort(buf, (short) to->forwardmove);
if (bits & QW_CM_SIDE)
- MSG_WriteShort(buf, to->sidemove);
+ MSG_WriteShort(buf, (short) to->sidemove);
if (bits & QW_CM_UP)
- MSG_WriteShort(buf, to->upmove);
+ MSG_WriteShort(buf, (short) to->upmove);
if (bits & QW_CM_BUTTONS)
MSG_WriteByte(buf, to->buttons);
if (bits & QW_CM_IMPULSE)
if (!name)
name = "";
namelen = strlen(name);
- node = Mem_Alloc(cls.levelmempool, sizeof(cl_locnode_t) + namelen + 1);
+ node = (cl_locnode_t *) Mem_Alloc(cls.levelmempool, sizeof(cl_locnode_t) + namelen + 1);
VectorSet(node->mins, min(mins[0], maxs[0]), min(mins[1], maxs[1]), min(mins[2], maxs[2]));
VectorSet(node->maxs, max(mins[0], maxs[0]), max(mins[1], maxs[1]), max(mins[2], maxs[2]));
node->name = (char *)(node + 1);
//static qboolean QW_CL_IsUploading(void);
static void QW_CL_StopUpload(void);
void CL_VM_UpdateIntermissionState(int intermission);
-qboolean CL_VM_Event_Sound(int sound_num, int volume, int channel, float attenuation, int ent, vec3_t pos);
+qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos);
/*
==================
// we're really beginning a download now, so initialize stuff
strlcpy(cls.qw_downloadname, Cmd_Argv(2), sizeof(cls.qw_downloadname));
cls.qw_downloadmemorymaxsize = size;
- cls.qw_downloadmemory = Mem_Alloc(cls.permanentmempool, cls.qw_downloadmemorymaxsize);
+ cls.qw_downloadmemory = (unsigned char *) Mem_Alloc(cls.permanentmempool, cls.qw_downloadmemorymaxsize);
cls.qw_downloadnumber++;
cls.qw_download_deflate = false;
{
cl_iplog_item_t *olditems = cl_iplog_items;
cl_iplog_maxitems = max(1024, cl_iplog_maxitems + 256);
- cl_iplog_items = Mem_Alloc(cls.permanentmempool, cl_iplog_maxitems * sizeof(cl_iplog_item_t));
+ cl_iplog_items = (cl_iplog_item_t *) Mem_Alloc(cls.permanentmempool, cl_iplog_maxitems * sizeof(cl_iplog_item_t));
if (olditems)
{
if (cl_iplog_numitems)
Mem_Free(olditems);
}
}
- cl_iplog_items[cl_iplog_numitems].address = Mem_Alloc(cls.permanentmempool, strlen(address) + 1);
- cl_iplog_items[cl_iplog_numitems].name = Mem_Alloc(cls.permanentmempool, strlen(name) + 1);
+ cl_iplog_items[cl_iplog_numitems].address = (char *) Mem_Alloc(cls.permanentmempool, strlen(address) + 1);
+ cl_iplog_items[cl_iplog_numitems].name = (char *) Mem_Alloc(cls.permanentmempool, strlen(name) + 1);
strlcpy(cl_iplog_items[cl_iplog_numitems].address, address, strlen(address) + 1);
// TODO: maybe it would be better to strip weird characters from name when
// copying it here rather than using a straight strcpy?
// must match ptype_t values
particletype_t particletype[pt_total] =
{
- {0, 0, false}, // pt_dead
+ {PBLEND_INVALID, PARTICLE_INVALID, false}, //pt_dead (should never happen)
{PBLEND_ALPHA, PARTICLE_BILLBOARD, false}, //pt_alphastatic
{PBLEND_ADD, PARTICLE_BILLBOARD, false}, //pt_static
{PBLEND_ADD, PARTICLE_SPARK, false}, //pt_spark
c4f[3] = p->alpha * colormultiplier[3];
switch (blendmode)
{
+ case PBLEND_INVALID:
case PBLEND_INVMOD:
case PBLEND_ADD:
// additive and modulate can just fade out in fog (this is correct)
tex = &particletexture[p->texnum];
switch(p->orientation)
{
+ case PARTICLE_INVALID:
case PARTICLE_BILLBOARD:
VectorScale(r_refdef.view.left, -size * p->stretch, right);
VectorScale(r_refdef.view.up, size, up);
}
// now render batches of particles based on blendmode and texture
- blendmode = -1;
+ blendmode = PBLEND_INVALID;
texture = NULL;
GL_LockArrays(0, numsurfaces*4);
batchstart = 0;
case PBLEND_ALPHA:
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
break;
+ case PBLEND_INVALID:
case PBLEND_ADD:
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
break;
int l = newline ? (newline - start) : (int)strlen(start);
float width = DrawQ_TextWidth_Font(start, l, false, FONT_CENTERPRINT) * 8;
- x = (vid_conwidth.integer - width)/2;
+ x = (int) (vid_conwidth.integer - width)/2;
if (l > 0)
{
if (remaining < l)
unsigned char *olddata;
olddata = buf->data;
buf->maxsize = max(buf->maxsize * 2, 4096);
- buf->data = Mem_Alloc(tempmempool, buf->maxsize);
+ buf->data = (unsigned char *) Mem_Alloc(tempmempool, buf->maxsize);
if(olddata)
{
memcpy(buf->data, olddata, oldsize);
for(i = 1; i <= denomMax; ++i)
{
- int inum = floor(0.5 + val * i);
+ int inum = (int) floor(0.5 + val * i);
double diff = fabs(val - inum / (double)i);
if(diff < bestdiff)
{
area = (float)outw * (float)outh / (float)inw / (float)inh;
for(y = 0; y < outh; ++y)
{
- float iny0 = y / (float)outh * inh; int iny0_i = floor(iny0);
- float iny1 = (y+1) / (float)outh * inh; int iny1_i = ceil(iny1);
+ float iny0 = y / (float)outh * inh; int iny0_i = (int) floor(iny0);
+ float iny1 = (y+1) / (float)outh * inh; int iny1_i = (int) ceil(iny1);
for(x = 0; x < outw; ++x)
{
- float inx0 = x / (float)outw * inw; int inx0_i = floor(inx0);
- float inx1 = (x+1) / (float)outw * inw; int inx1_i = ceil(inx1);
+ float inx0 = x / (float)outw * inw; int inx0_i = (int) floor(inx0);
+ float inx1 = (x+1) / (float)outw * inw; int inx1_i = (int) ceil(inx1);
float r = 0, g = 0, b = 0, alpha = 0;
int xx, yy;
}
}
- out[4*(x + outw * y)+0] = r * area;
- out[4*(x + outw * y)+1] = g * area;
- out[4*(x + outw * y)+2] = b * area;
- out[4*(x + outw * y)+3] = alpha * area;
+ out[4*(x + outw * y)+0] = (unsigned char) (r * area);
+ out[4*(x + outw * y)+1] = (unsigned char) (g * area);
+ out[4*(x + outw * y)+2] = (unsigned char) (b * area);
+ out[4*(x + outw * y)+3] = (unsigned char) (alpha * area);
}
}
}
{
showlmp_t *oldshowlmps = cl.showlmps;
cl.max_showlmps += 16;
- cl.showlmps = Mem_Alloc(cls.levelmempool, cl.max_showlmps * sizeof(showlmp_t));
+ cl.showlmps = (showlmp_t *) Mem_Alloc(cls.levelmempool, cl.max_showlmps * sizeof(showlmp_t));
if (cl.num_showlmps)
memcpy(cl.showlmps, oldshowlmps, cl.num_showlmps * sizeof(showlmp_t));
if (oldshowlmps)
if(gamemode == GAME_NEXUIZ)
{
// play a bit with the palette (experimental)
- palette_rgb_pantscolormap[15][0] = 128 + 127 * sin(cl.time / exp(1) + 0*M_PI/3);
- palette_rgb_pantscolormap[15][1] = 128 + 127 * sin(cl.time / exp(1) + 2*M_PI/3);
- palette_rgb_pantscolormap[15][2] = 128 + 127 * sin(cl.time / exp(1) + 4*M_PI/3);
- palette_rgb_shirtcolormap[15][0] = 128 + 127 * sin(cl.time / M_PI + 5*M_PI/3);
- palette_rgb_shirtcolormap[15][1] = 128 + 127 * sin(cl.time / M_PI + 3*M_PI/3);
- palette_rgb_shirtcolormap[15][2] = 128 + 127 * sin(cl.time / M_PI + 1*M_PI/3);
+ palette_rgb_pantscolormap[15][0] = (unsigned char) (128 + 127 * sin(cl.time / exp(1) + 0*M_PI/3));
+ palette_rgb_pantscolormap[15][1] = (unsigned char) (128 + 127 * sin(cl.time / exp(1) + 2*M_PI/3));
+ palette_rgb_pantscolormap[15][2] = (unsigned char) (128 + 127 * sin(cl.time / exp(1) + 4*M_PI/3));
+ palette_rgb_shirtcolormap[15][0] = (unsigned char) (128 + 127 * sin(cl.time / M_PI + 5*M_PI/3));
+ palette_rgb_shirtcolormap[15][1] = (unsigned char) (128 + 127 * sin(cl.time / M_PI + 3*M_PI/3));
+ palette_rgb_shirtcolormap[15][2] = (unsigned char) (128 + 127 * sin(cl.time / M_PI + 1*M_PI/3));
memcpy(palette_rgb_pantsscoreboard[15], palette_rgb_pantscolormap[15], sizeof(*palette_rgb_pantscolormap));
memcpy(palette_rgb_shirtscoreboard[15], palette_rgb_shirtcolormap[15], sizeof(*palette_rgb_shirtcolormap));
}
}
static void VideoUpdateCallback(rtexture_t *rt, void *data) {
- clvideo_t *video = data;
+ clvideo_t *video = (clvideo_t *) data;
R_UpdateTexture( video->cpif.tex, (unsigned char *)video->imagedata, 0, 0, video->cpif.width, video->cpif.height );
}
PARTICLE_BILLBOARD = 0,
PARTICLE_SPARK = 1,
PARTICLE_ORIENTED_DOUBLESIDED = 2,
- PARTICLE_BEAM = 3
+ PARTICLE_BEAM = 3,
+ PARTICLE_INVALID = -1
}
porientation_t;
{
PBLEND_ALPHA = 0,
PBLEND_ADD = 1,
- PBLEND_INVMOD = 2
+ PBLEND_INVMOD = 2,
+ PBLEND_INVALID = -1
}
pblend_t;
{
// fields used by rendering: (40 bytes)
unsigned char typeindex;
- unsigned char blendmode;
- unsigned char orientation;
+ pblend_t blendmode;
+ porientation_t orientation;
unsigned char texnum;
vec3_t org;
vec3_t vel; // velocity of particle, or orientation of decal, or end point of beam
{
// texture not found
// use the attached jpeg as texture
- buf = Mem_Alloc(tempmempool, size);
+ buf = (unsigned char *) Mem_Alloc(tempmempool, size);
MSG_ReadBytes(size, buf);
data = JPEG_LoadImage_BGRA(buf, size);
Mem_Free(buf);
(void) 0;
else
{
- int x = ti->x + (ti->width - width) * ti->alignment;
+ int x = (int) (ti->x + (ti->width - width) * ti->alignment);
if(isContinuation && *ti->continuationString)
- x += DrawQ_String_Font(x, ti->y, ti->continuationString, strlen(ti->continuationString), ti->fontsize, ti->fontsize, 1.0, 1.0, 1.0, 1.0, 0, NULL, false, ti->font);
+ x += (int) DrawQ_String_Font(x, ti->y, ti->continuationString, strlen(ti->continuationString), ti->fontsize, ti->fontsize, 1.0, 1.0, 1.0, 1.0, 0, NULL, false, ti->font);
if(length > 0)
DrawQ_String_Font(x, ti->y, line, length, ti->fontsize, ti->fontsize, 1.0, 1.0, 1.0, 1.0, 0, &(ti->colorindex), false, ti->font);
}
l = 0;
Con_WordWidthFunc(&ti, NULL, &l, -1);
l = strlen(continuationString);
- continuationWidth = Con_WordWidthFunc(&ti, continuationString, &l, -1);
+ continuationWidth = (int) Con_WordWidthFunc(&ti, continuationString, &l, -1);
// first find the first line to draw by backwards iterating and word wrapping to find their length...
startidx = con_lines_count;
// self.frame1time is the animation base time for the interpolation target
// self.frame2 is the interpolation start (previous frame)
// self.frame2time is the animation base time for the interpolation start
- entrender->frame1 = entrender->frame2 = ed->fields.client->frame;
- if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2))) entrender->frame2 = val->_float;
+ entrender->frame1 = entrender->frame2 = (int) ed->fields.client->frame;
+ if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2))) entrender->frame2 = (int) val->_float;
if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame1time))) entrender->frame2time = val->_float;
if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2time))) entrender->frame1time = val->_float;
if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.lerpfrac))) entrender->framelerp = val->_float;
CSQC_END
}
}
-qboolean CL_VM_Event_Sound(int sound_num, int volume, int channel, float attenuation, int ent, vec3_t pos)
+qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float attenuation, int ent, vec3_t pos)
{
qboolean r = false;
if(cl.csqc_loaded)
sizebuf_t sb;
unsigned char *demobuf; fs_offset_t demofilesize;
- sb.data = (void *) buf;
+ sb.data = (unsigned char *) buf;
sb.maxsize = sizeof(buf);
i = 0;
// allocates a cvar by name and returns its address,
// or merely sets its value if it already exists.
-char *cvar_dummy_description; // ALWAYS the same pointer
-cvar_t *cvar_vars; // used to list all cvars
+extern char *cvar_dummy_description; // ALWAYS the same pointer
+extern cvar_t *cvar_vars; // used to list all cvars
#endif
{
oldstrings = list->strings;
list->maxstrings += 4096;
- list->strings = Z_Malloc(list->maxstrings * sizeof(*list->strings));
+ list->strings = (char **) Z_Malloc(list->maxstrings * sizeof(*list->strings));
if (list->numstrings)
memcpy(list->strings, oldstrings, list->numstrings * sizeof(*list->strings));
if (oldstrings)
Z_Free(oldstrings);
}
textlen = strlen(text) + 1;
- list->strings[list->numstrings] = Z_Malloc(textlen);
+ list->strings[list->numstrings] = (char *) Z_Malloc(textlen);
memcpy(list->strings[list->numstrings], text, textlen);
list->numstrings++;
}
strm.next_in = (unsigned char*)data;
strm.avail_in = size;
- tmp = Mem_Alloc(tempmempool, size);
+ tmp = (unsigned char *) Mem_Alloc(tempmempool, size);
if(!tmp)
{
Con_Printf("FS_Deflate: not enough memory in tempmempool!\n");
return NULL;
}
- out = Mem_Alloc(mempool, strm.total_out);
+ out = (unsigned char *) Mem_Alloc(mempool, strm.total_out);
if(!out)
{
Con_Printf("FS_Deflate: not enough memory in target mempool!\n");
unsigned char *olddata;
olddata = buf->data;
buf->maxsize += length;
- buf->data = Mem_Alloc(tempmempool, buf->maxsize);
+ buf->data = (unsigned char *) Mem_Alloc(tempmempool, buf->maxsize);
if(olddata)
{
memcpy(buf->data, olddata, oldsize);
sizebuf_t outbuf;
memset(&outbuf, 0, sizeof(outbuf));
- outbuf.data = Mem_Alloc(tempmempool, sizeof(tmp));
+ outbuf.data = (unsigned char *) Mem_Alloc(tempmempool, sizeof(tmp));
outbuf.maxsize = sizeof(tmp);
memset(&strm, 0, sizeof(strm));
qz_inflateEnd(&strm);
- out = Mem_Alloc(mempool, outbuf.cursize);
+ out = (unsigned char *) Mem_Alloc(mempool, outbuf.cursize);
if(!out)
{
Con_Printf("FS_Inflate: not enough memory in target mempool!\n");
}
qglBufferDataARB(target, size, data, GL_STATIC_DRAW_ARB);
- info = Mem_ExpandableArray_AllocRecord(&gl_bufferobjectinfoarray);
+ info = (gl_bufferobjectinfo_t *) Mem_ExpandableArray_AllocRecord(&gl_bufferobjectinfoarray);
memset(info, 0, sizeof(*info));
info->target = target;
info->object = bufferobject;
endindex = Mem_ExpandableArray_IndexRange(&gl_bufferobjectinfoarray);
for (i = 0;i < endindex;i++)
{
- info = Mem_ExpandableArray_RecordAtIndex(&gl_bufferobjectinfoarray, i);
+ info = (gl_bufferobjectinfo_t *) Mem_ExpandableArray_RecordAtIndex(&gl_bufferobjectinfoarray, i);
if (!info)
continue;
if (info->object == bufferobject)
endindex = Mem_ExpandableArray_IndexRange(&gl_bufferobjectinfoarray);
for (i = 0;i < endindex;i++)
{
- info = Mem_ExpandableArray_RecordAtIndex(&gl_bufferobjectinfoarray, i);
+ info = (gl_bufferobjectinfo_t *) Mem_ExpandableArray_RecordAtIndex(&gl_bufferobjectinfoarray, i);
if (!info)
continue;
switch(info->target)
{
if (text[i] == ' ')
{
- if(x + fnt->width_of[' '] > maxwidth)
+ if(x + fnt->width_of[(int) ' '] > maxwidth)
break; // oops, can't draw this
- x += fnt->width_of[' '];
+ x += fnt->width_of[(int) ' '];
continue;
}
if (text[i] == STRING_COLOR_TAG && !ignorecolorcodes && i + 1 < *maxlen)
{
if (text[i] == ' ')
{
- x += fnt->width_of[' '] * w;
+ x += fnt->width_of[(int) ' '] * w;
continue;
}
if (text[i] == STRING_COLOR_TAG && !ignorecolorcodes && i + 1 < maxlen)
}
else if (!strcmp(filename, "glsl/default.glsl"))
{
- shaderstring = Mem_Alloc(r_main_mempool, strlen(builtinshaderstring) + 1);
+ shaderstring = (char *) Mem_Alloc(r_main_mempool, strlen(builtinshaderstring) + 1);
memcpy(shaderstring, builtinshaderstring, strlen(builtinshaderstring) + 1);
}
return shaderstring;
}
-static void R_GLSL_CompilePermutation(shadermode_t mode, shaderpermutation_t permutation)
+static void R_GLSL_CompilePermutation(unsigned int mode, unsigned int permutation)
{
int i;
shadermodeinfo_t *modeinfo = shadermodeinfo + mode;
void R_GLSL_Restart_f(void)
{
- shadermode_t mode;
- shaderpermutation_t permutation;
+ unsigned int mode;
+ unsigned int permutation;
for (mode = 0;mode < SHADERMODE_COUNT;mode++)
for (permutation = 0;permutation < SHADERPERMUTATION_LIMIT;permutation++)
if (r_glsl_permutations[mode][permutation].program)
Con_Printf("glsl/default.glsl written\n");
}
-void R_SetupShader_SetPermutation(shadermode_t mode, unsigned int permutation)
+void R_SetupShader_SetPermutation(unsigned int mode, unsigned int permutation)
{
r_glsl_permutation_t *perm = &r_glsl_permutations[mode][permutation];
if (r_glsl_permutation != perm)
// minimum features necessary to avoid wasting rendering time in the
// fragment shader on features that are not being used
unsigned int permutation = 0;
- shadermode_t mode = 0;
+ unsigned int mode = 0;
// TODO: implement geometry-shader based shadow volumes someday
if (r_glsl_offsetmapping.integer)
{
#define SKINFRAME_HASH 1024
-struct
+typedef struct
{
int loadsequence; // incremented each level change
memexpandablearray_t array;
skinframe_t *hash[SKINFRAME_HASH];
}
-r_skinframe;
+r_skinframe_t;
+r_skinframe_t r_skinframe;
void R_SkinFrame_PrepareForPurge(void)
{
Matrix4x4_CreateTranslate(&matrix, tcmod->parms[0] * r_refdef.scene.time, tcmod->parms[1] * r_refdef.scene.time, 0);
break;
case Q3TCMOD_PAGE: // poor man's animmap (to store animations into a single file, useful for HTTP downloaded textures)
- w = tcmod->parms[0];
- h = tcmod->parms[1];
+ w = (int) tcmod->parms[0];
+ h = (int) tcmod->parms[1];
f = r_refdef.scene.time / (tcmod->parms[2] * w * h);
f = f - floor(f);
- idx = floor(f * w * h);
+ idx = (int) floor(f * w * h);
Matrix4x4_CreateTranslate(&matrix, (idx % w) / tcmod->parms[0], (idx / w) / tcmod->parms[1], 0);
break;
case Q3TCMOD_STRETCH:
r_maxsurfacelist = model->num_surfaces;
if (r_surfacelist)
Mem_Free(r_surfacelist);
- r_surfacelist = Mem_Alloc(r_main_mempool, r_maxsurfacelist * sizeof(*r_surfacelist));
+ r_surfacelist = (msurface_t **) Mem_Alloc(r_main_mempool, r_maxsurfacelist * sizeof(*r_surfacelist));
}
RSurf_ActiveWorldEntity();
r_maxsurfacelist = model->num_surfaces;
if (r_surfacelist)
Mem_Free(r_surfacelist);
- r_surfacelist = Mem_Alloc(r_main_mempool, r_maxsurfacelist * sizeof(*r_surfacelist));
+ r_surfacelist = (msurface_t **) Mem_Alloc(r_main_mempool, r_maxsurfacelist * sizeof(*r_surfacelist));
}
// if the model is static it doesn't matter what value we give for
cl.buildlightmapmemorysize = size*sizeof(int[3]);
if (cl.buildlightmapmemory)
Mem_Free(cl.buildlightmapmemory);
- cl.buildlightmapmemory = Mem_Alloc(cls.levelmempool, cl.buildlightmapmemorysize);
+ cl.buildlightmapmemory = (unsigned char *) Mem_Alloc(cls.levelmempool, cl.buildlightmapmemorysize);
}
// these both point at the same buffer, templight is only used for final
if (!r_svbsp.nodes)
{
r_svbsp.maxnodes = max(r_svbsp.maxnodes, 1<<18);
- r_svbsp.nodes = Mem_Alloc(r_main_mempool, r_svbsp.maxnodes * sizeof(svbsp_node_t));
+ r_svbsp.nodes = (svbsp_node_t*) Mem_Alloc(r_main_mempool, r_svbsp.maxnodes * sizeof(svbsp_node_t));
}
info->svbsp_active = true;
info->svbsp_insertoccluder = true;
break;
Mem_Free(r_svbsp.nodes);
r_svbsp.maxnodes *= 2;
- r_svbsp.nodes = Mem_Alloc(tempmempool, r_svbsp.maxnodes * sizeof(svbsp_node_t));
+ r_svbsp.nodes = (svbsp_node_t*) Mem_Alloc(tempmempool, r_svbsp.maxnodes * sizeof(svbsp_node_t));
}
else
break;
int const FIXTRANS_HAS_U = 8;
int const FIXTRANS_HAS_D = 16;
int const FIXTRANS_FIXED = 32;
- unsigned char *fixMask = Mem_Alloc(tempmempool, w * h);
+ unsigned char *fixMask = (unsigned char *) Mem_Alloc(tempmempool, w * h);
int fixPixels = 0;
int changedPixels = 0;
int x, y;
dest->pub.term_destination = JPEG_Mem_TermDestination;
dest->outfile = NULL;
- dest->buffer = buf;
+ dest->buffer = (unsigned char *) buf;
dest->bufsize = bufsize;
}
if(strlen(imagename) >= MAX_QPATH)
return; // can't add this
- i = Z_Malloc(sizeof(CompressedImageCacheItem));
+ i = (CompressedImageCacheItem*) Z_Malloc(sizeof(CompressedImageCacheItem));
strlcpy(i->imagename, imagename, sizeof(i->imagename));
i->maxsize = maxsize;
i->compressed = compressed;
Image_MipReduce32(imagedata, imagedata, &image_width, &image_height, &one, image_width/2, image_height/2, 1);
}
- newimagedata = Mem_Alloc(tempmempool, image_width * image_height * 3);
+ newimagedata = (unsigned char *) Mem_Alloc(tempmempool, image_width * image_height * 3);
// convert the image from BGRA to RGB
Image_CopyMux(newimagedata, imagedata, image_width, image_height, false, false, false, 3, 4, components);
// try to compress it to JPEG
*buf = Z_Malloc(maxsize);
- *size = JPEG_SaveImage_to_Buffer(*buf, maxsize, image_width, image_height, newimagedata);
+ *size = JPEG_SaveImage_to_Buffer((char *) *buf, maxsize, image_width, image_height, newimagedata);
if(!*size)
{
Z_Free(*buf);
case 4: // e.g. 404?
case 5: // e.g. 500?
failed = CURL_DOWNLOAD_SERVERERROR;
- result = code;
+ result = (CURLcode) code;
break;
}
}
# Compilation
-CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) -Wall -Wsign-compare -Wdeclaration-after-statement
+CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) -Wall -Wsign-compare
CFLAGS_DEBUG=-ggdb
CFLAGS_PROFILE=-g -pg -ggdb
CFLAGS_RELEASE=
{
int i, k;
double scale;
- float *basebonepose = Mem_Alloc(tempmempool, loadmodel->num_bones * sizeof(float[12]));
+ float *basebonepose = (float *) Mem_Alloc(tempmempool, loadmodel->num_bones * sizeof(float[12]));
float *in12f = loadmodel->data_poses;
float *out12f = basebonepose;
float *outinv12f = loadmodel->data_baseboneposeinverse;
frameblend_t frameblend[4];
memset(frameblend, 0, sizeof(frameblend));
frameblend[0].lerp = 1;
- vertex3f = Mem_Alloc(loadmodel->mempool, loadmodel->surfmesh.num_vertices * sizeof(float[3]));
+ vertex3f = (float *) Mem_Alloc(loadmodel->mempool, loadmodel->surfmesh.num_vertices * sizeof(float[3]));
VectorClear(loadmodel->normalmins);
VectorClear(loadmodel->normalmaxs);
yawradius = 0;
texture->currentmaterialflags = texture->basematerialflags;
}
-static void Mod_BuildAliasSkinsFromSkinFiles(texture_t *skin, skinfile_t *skinfile, char *meshname, char *shadername)
+static void Mod_BuildAliasSkinsFromSkinFiles(texture_t *skin, skinfile_t *skinfile, const char *meshname, const char *shadername)
{
int i;
skinfileitem_t *skinfileitem;
for (i = 0;i < loadmodel->surfmesh.num_triangles*3;i++)
loadmodel->surfmesh.data_element3s[i] = loadmodel->surfmesh.data_element3i[i];
}
- loadmodel->data_poses = Mem_Alloc(loadmodel->mempool, loadmodel->num_poses * sizeof(float[12]));
+ loadmodel->data_poses = (float *) Mem_Alloc(loadmodel->mempool, loadmodel->num_poses * sizeof(float[12]));
for (i = 0;i < loadmodel->numskins;i++)
{
}
}
- convertedpixels = Mem_Alloc(tempmempool, size*size*4);
+ convertedpixels = (unsigned char *) Mem_Alloc(tempmempool, size*size*4);
loadmodel->brushq3.lightmapsize = size;
loadmodel->brushq3.num_originallightmaps = count;
loadmodel->num_surfaces = count;
if(count > 0)
- patchtess = Mem_Alloc(tempmempool, count * sizeof(*patchtess));
+ patchtess = (patchtess_t*) Mem_Alloc(tempmempool, count * sizeof(*patchtess));
i = 0;
oldi = i;
Mod_LoadQ3Shaders();
for (i = 0;i < nummodels;i++)
- if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*')
+ if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*')
if (mod->used)
Mod_LoadModel(mod, true, false, mod->isworldmodel);
}
dp_model_t *mod;
for (i = 0;i < nummodels;i++)
- if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && (mod->loaded || mod->mempool))
+ if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && (mod->loaded || mod->mempool))
Mod_UnloadModel(mod);
Mem_FreePool (&q3shaders_mem);
R_SkinFrame_PrepareForPurge();
for (i = 0;i < nummodels;i++)
{
- if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->mempool && mod->data_textures)
+ if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->mempool && mod->data_textures)
{
for (j = 0;j < mod->num_textures;j++)
{
for (i = 0;i < nummodels;i++)
{
- if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->mempool && mod->data_surfaces)
+ if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->mempool && mod->data_surfaces)
{
for (surfacenum = 0, surface = mod->data_surfaces;surfacenum < mod->num_surfaces;surfacenum++, surface++)
{
int nummodels = Mem_ExpandableArray_IndexRange(&models);
dp_model_t *mod;
for (i = 0;i < nummodels;i++)
- if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0])
+ if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0])
mod->used = false;
}
dp_model_t *mod;
for (i = 0;i < nummodels;i++)
{
- if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && !mod->used)
+ if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && !mod->used)
{
Mod_UnloadModel(mod);
Mem_ExpandableArray_FreeRecord(&models, mod);
dp_model_t *mod;
for (i = 0;i < nummodels;i++)
{
- if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->isworldmodel && mod->loaded && skip != mod)
+ if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->isworldmodel && mod->loaded && skip != mod)
{
Mod_UnloadModel(mod);
mod->isworldmodel = false;
// search the currently loaded models
for (i = 0;i < nummodels;i++)
{
- if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && !strcmp(mod->name, name))
+ if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && !strcmp(mod->name, name))
{
mod->used = true;
return mod;
}
// no match found, create a new one
- mod = Mem_ExpandableArray_AllocRecord(&models);
+ mod = (dp_model_t *) Mem_ExpandableArray_AllocRecord(&models);
strlcpy(mod->name, name, sizeof(mod->name));
mod->loaded = false;
mod->used = true;
int nummodels = Mem_ExpandableArray_IndexRange(&models);
dp_model_t *mod;
for (i = 0;i < nummodels;i++)
- if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used)
+ if ((mod = (dp_model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used)
Mod_LoadModel(mod, true, true, mod->isworldmodel);
}
Con_Print("Loaded models:\n");
for (i = 0;i < nummodels;i++)
- if ((mod = Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0])
+ if ((mod = (dp_model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0])
Con_Printf("%4iK %s\n", mod->mempool ? (int)((mod->mempool->totalsize + 1023) / 1024) : 0, mod->name);
}
int i;
layer->numframes = min(numparameters - 2, TEXTURE_MAXFRAMES);
layer->framerate = atof(parameter[1]);
- layer->texturename = Mem_Alloc (q3shaders_mem, sizeof (char*) * layer->numframes);
+ layer->texturename = (char **) Mem_Alloc (q3shaders_mem, sizeof (char*) * layer->numframes);
for (i = 0;i < layer->numframes;i++)
layer->texturename[i] = Mem_strdup (q3shaders_mem, parameter[i + 2]);
}
else if (!strcasecmp(parameter[1], "vertex")) layer->alphagen.alphagen = Q3ALPHAGEN_VERTEX;
else if (!strcasecmp(parameter[1], "wave"))
{
- layer->alphagen.alphagen = Q3RGBGEN_WAVE;
+ layer->alphagen.alphagen = Q3ALPHAGEN_WAVE;
layer->alphagen.wavefunc = Mod_LoadQ3Shaders_EnumerateWaveFunc(parameter[2]);
for (i = 0;i < numparameters - 3 && i < Q3WAVEPARMS;i++)
layer->alphagen.waveparms[i] = atof(parameter[i+3]);
}
if (!(skinframe = R_SkinFrame_LoadExternal(name, texflags | TEXF_COMPRESS, false)))
{
- unsigned char *pixels = Mem_Alloc(loadmodel->mempool, width*height*4);
+ unsigned char *pixels = (unsigned char *) Mem_Alloc(loadmodel->mempool, width*height*4);
if (version == SPRITE32_VERSION)
{
for (x = 0;x < width*height;x++)
}
// parse the string into the value
- PRVM_G_FLOAT(OFS_RETURN) = ( PRVM_ED_ParseEpair(ent, d, PRVM_G_STRING(OFS_PARM2)) ) ? 1.0f : 0.0f;
+ PRVM_G_FLOAT(OFS_RETURN) = ( PRVM_ED_ParseEpair(ent, d, PRVM_G_STRING(OFS_PARM2), false) ) ? 1.0f : 0.0f;
}
/*
{
if(prog->globaloffsets.drawfont >= 0)
{
- int f = PRVM_G_FLOAT(prog->globaloffsets.drawfont);
+ int f = (int) PRVM_G_FLOAT(prog->globaloffsets.drawfont);
if(f < 0 || f >= MAX_FONTS)
return FONT_DEFAULT;
return &dp_fonts[f];
return;
}
- PRVM_G_FLOAT( OFS_RETURN ) = (CL_Gecko_Event_Key( instance, key, eventtype ) == true);
+ PRVM_G_FLOAT( OFS_RETURN ) = (CL_Gecko_Event_Key( instance, (keynum_t) key, eventtype ) == true);
}
/*
if( !instance ) {
return;
}
- CL_Gecko_Resize( instance, w, h );
+ CL_Gecko_Resize( instance, (int) w, (int) h );
}
stringbuffer->max_strings = max(stringbuffer->max_strings * 2, 128);
while (stringbuffer->max_strings <= strindex)
stringbuffer->max_strings *= 2;
- stringbuffer->strings = Mem_Alloc(prog->progs_mempool, stringbuffer->max_strings * sizeof(stringbuffer->strings[0]));
+ stringbuffer->strings = (char **) Mem_Alloc(prog->progs_mempool, stringbuffer->max_strings * sizeof(stringbuffer->strings[0]));
if (stringbuffer->num_strings > 0)
memcpy(stringbuffer->strings, oldstrings, stringbuffer->num_strings * sizeof(stringbuffer->strings[0]));
if (oldstrings)
prvm_stringbuffer_t *stringbuffer;
int i;
VM_SAFEPARMCOUNT(0, VM_buf_create);
- stringbuffer = Mem_ExpandableArray_AllocRecord(&prog->stringbuffersarray);
+ stringbuffer = (prvm_stringbuffer_t *) Mem_ExpandableArray_AllocRecord(&prog->stringbuffersarray);
for (i = 0;stringbuffer != Mem_ExpandableArray_RecordAtIndex(&prog->stringbuffersarray, i);i++);
stringbuffer->origin = PRVM_AllocationOrigin();
PRVM_G_FLOAT(OFS_RETURN) = i;
VM_SAFEPARMCOUNTRANGE(2, 3, VM_strstrofs);
instr = PRVM_G_STRING(OFS_PARM0);
match = PRVM_G_STRING(OFS_PARM1);
- firstofs = (prog->argc > 2)?PRVM_G_FLOAT(OFS_PARM2):0;
+ firstofs = (prog->argc > 2)?(int)PRVM_G_FLOAT(OFS_PARM2):0;
if (firstofs && (firstofs < 0 || firstofs > (int)strlen(instr)))
{
VM_SAFEPARMCOUNTRANGE(3, 8, VM_strconv);
- ccase = PRVM_G_FLOAT(OFS_PARM0); //0 same, 1 lower, 2 upper
- redalpha = PRVM_G_FLOAT(OFS_PARM1); //0 same, 1 white, 2 red, 5 alternate, 6 alternate-alternate
- rednum = PRVM_G_FLOAT(OFS_PARM2); //0 same, 1 white, 2 red, 3 redspecial, 4 whitespecial, 5 alternate, 6 alternate-alternate
+ ccase = (int) PRVM_G_FLOAT(OFS_PARM0); //0 same, 1 lower, 2 upper
+ redalpha = (int) PRVM_G_FLOAT(OFS_PARM1); //0 same, 1 white, 2 red, 5 alternate, 6 alternate-alternate
+ rednum = (int) PRVM_G_FLOAT(OFS_PARM2); //0 same, 1 white, 2 red, 3 redspecial, 4 whitespecial, 5 alternate, 6 alternate-alternate
VM_VarString(3, (char *) resbuf, sizeof(resbuf));
len = strlen((char *) resbuf);
char destbuf[VM_STRINGTEMP_LENGTH];
int pad;
VM_SAFEPARMCOUNTRANGE(1, 8, VM_strpad);
- pad = PRVM_G_FLOAT(OFS_PARM0);
+ pad = (int) PRVM_G_FLOAT(OFS_PARM0);
VM_VarString(1, src, sizeof(src));
// note: < 0 = left padding, > 0 = right padding,
static void uri_to_string_callback(int status, size_t length_received, unsigned char *buffer, void *cbdata)
{
- uri_to_prog_t *handle = cbdata;
+ uri_to_prog_t *handle = (uri_to_prog_t *) cbdata;
if(!PRVM_ProgLoaded(handle->prognr))
{
url = PRVM_G_STRING(OFS_PARM0);
id = PRVM_G_FLOAT(OFS_PARM1);
- handle = Z_Malloc(sizeof(*handle)); // this can't be the prog's mem pool, as curl may call the callback later!
+ handle = (uri_to_prog_t *) Z_Malloc(sizeof(*handle)); // this can't be the prog's mem pool, as curl may call the callback later!
handle->prognr = PRVM_GetProgNr();
handle->starttime = prog->starttime;
ip = PRVM_G_STRING(OFS_PARM0);
port = 0;
if(prog->argc > 1)
- port = PRVM_G_FLOAT(OFS_PARM1);
+ port = (int) PRVM_G_FLOAT(OFS_PARM1);
if(LHNETADDRESS_FromString(&addr, ip, port) && LHNETADDRESS_ToString(&addr, normalized, sizeof(normalized), prog->argc > 1))
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(normalized);
// And declared these ones for VM_getentityfieldstring and VM_putentityfieldstring in prvm_cmds.c
// the function is from prvm_edict.c
char *PRVM_UglyValueString (etype_t type, prvm_eval_t *val);
-qboolean PRVM_ED_ParseEpair(prvm_edict_t *ent, ddef_t *key, const char *s);
+qboolean PRVM_ED_ParseEpair(prvm_edict_t *ent, ddef_t *key, const char *s, qboolean parsebackslash);
// DRESK - String Length (not counting color codes)
void VM_strlennocol(void);
{
if (developer.integer >= 100)
Con_Printf("PRVM_SetTempString: enlarging tempstrings buffer (%iKB -> %iKB)\n", old.maxsize/1024, vm_tempstringsbuf.maxsize/1024);
- vm_tempstringsbuf.data = Mem_Alloc(sv_mempool, vm_tempstringsbuf.maxsize);
+ vm_tempstringsbuf.data = (unsigned char *) Mem_Alloc(sv_mempool, vm_tempstringsbuf.maxsize);
if (old.cursize)
memcpy(vm_tempstringsbuf.data, old.data, old.cursize);
if (old.data)
for (i = 0; i < (int)Mem_ExpandableArray_IndexRange(&prog->stringbuffersarray); ++i)
{
- prvm_stringbuffer_t *stringbuffer = Mem_ExpandableArray_RecordAtIndex(&prog->stringbuffersarray, i);
+ prvm_stringbuffer_t *stringbuffer = (prvm_stringbuffer_t*) Mem_ExpandableArray_RecordAtIndex(&prog->stringbuffersarray, i);
if(stringbuffer)
if(stringbuffer->origin)
{
size_t range = Mem_ExpandableArray_IndexRange(&r_shadow_worldlightsarray); // checked
for (lightindex = 0;lightindex < range;lightindex++)
{
- light = Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
+ light = (dlight_t *) Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
if (!light)
continue;
R_RTLight_Uncompile(&light->rtlight);
if (r_shadow_debuglight.integer >= 0)
{
lightindex = r_shadow_debuglight.integer;
- light = Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
+ light = (dlight_t *) Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
if (light && (light->flags & flag))
R_DrawRTLight(&light->rtlight, visible);
}
range = Mem_ExpandableArray_IndexRange(&r_shadow_worldlightsarray); // checked
for (lightindex = 0;lightindex < range;lightindex++)
{
- light = Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
+ light = (dlight_t *) Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
if (light && (light->flags & flag))
R_DrawRTLight(&light->rtlight, visible);
}
range = Mem_ExpandableArray_IndexRange(&r_shadow_worldlightsarray); // checked
for (lightindex = 0;lightindex < range;lightindex++)
{
- light = Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
+ light = (dlight_t *) Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
if (!light)
continue;
rtlight = &light->rtlight;
size_t range = Mem_ExpandableArray_IndexRange(&r_shadow_worldlightsarray); // checked
for (lightindex = 0;lightindex < range;lightindex++)
{
- light = Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
+ light = (dlight_t *) Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
if (light)
R_Shadow_FreeWorldLight(light);
}
size_t range = Mem_ExpandableArray_IndexRange(&r_shadow_worldlightsarray); // checked
for (lightindex = 0;lightindex < range;lightindex++)
{
- light = Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
+ light = (dlight_t *) Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
if (light)
R_MeshQueue_AddTransparent(light->origin, R_Shadow_DrawLightSprite_TransparentCallback, (entity_render_t *)light, 5, &light->rtlight);
}
bestrating = 0;
for (lightindex = 0;lightindex < range;lightindex++)
{
- light = Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
+ light = (dlight_t *) Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
if (!light)
continue;
VectorSubtract(light->origin, r_refdef.view.origin, temp);
buf = NULL;
for (lightindex = 0;lightindex < range;lightindex++)
{
- light = Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
+ light = (dlight_t *) Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
if (!light)
continue;
if (light->coronasizescale != 0.25f || light->ambientscale != 0 || light->diffusescale != 1 || light->specularscale != 1 || light->flags != LIGHTFLAG_REALTIMEMODE)
range = Mem_ExpandableArray_IndexRange(&r_shadow_worldlightsarray); // checked
for (lightindex = 0;lightindex < range;lightindex++)
{
- light = Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
+ light = (dlight_t *) Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
if (!light)
continue;
R_Shadow_SelectLight(light);
range = Mem_ExpandableArray_IndexRange(&r_shadow_worldlightsarray); // checked
for (lightindex = 0;lightindex < range;lightindex++)
{
- light = Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
+ light = (dlight_t *) Mem_ExpandableArray_RecordAtIndex(&r_shadow_worldlightsarray, lightindex);
if (!light)
continue;
if (light == r_shadow_selectedlight)
{
// The Impossible Combination[tm]
// Can only happen in Key Hunt mode...
- Sbar_DrawPic (x, (vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 128), sb_items[14]);
+ Sbar_DrawPic ((int) x, (int) ((vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 128)), sb_items[14]);
}
else
{
if (redflag)
- Sbar_DrawPic (x, (vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 64), sb_items[redflag+10]);
+ Sbar_DrawPic ((int) x, (int) ((vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 64)), sb_items[redflag+10]);
if (blueflag)
- Sbar_DrawPic (x, (vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 128), sb_items[blueflag+14]);
+ Sbar_DrawPic ((int) x, (int) ((vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 128)), sb_items[blueflag+14]);
}
// armor
{
// The Impossible Combination[tm]
// Can only happen in Key Hunt mode...
- Sbar_DrawPic (x, -179, sb_items[14]);
+ Sbar_DrawPic ((int) x, -179, sb_items[14]);
}
else
{
if (redflag)
- Sbar_DrawPic (x, -117, sb_items[redflag+10]);
+ Sbar_DrawPic ((int) x, -117, sb_items[redflag+10]);
if (blueflag)
- Sbar_DrawPic (x, -177, sb_items[blueflag+14]);
+ Sbar_DrawPic ((int) x, -177, sb_items[blueflag+14]);
}
// armor
ymax = 40 + 8 + (Sbar_IsTeammatch() ? (teamlines * 8 + 5): 0) + scoreboardlines * 8 - 1;
if (cls.protocol == PROTOCOL_QUAKEWORLD)
- xmin = (vid_conwidth.integer - (26 + 15) * 8 * FONT_SBAR->maxwidth) / 2; // 26 characters until name, then we assume 15 character names (they can be longer but usually aren't)
+ xmin = (int) (vid_conwidth.integer - (26 + 15) * 8 * FONT_SBAR->maxwidth) / 2; // 26 characters until name, then we assume 15 character names (they can be longer but usually aren't)
else
- xmin = (vid_conwidth.integer - (16 + 25) * 8 * FONT_SBAR->maxwidth) / 2; // 16 characters until name, then we assume 25 character names (they can be longer but usually aren't)
+ xmin = (int) (vid_conwidth.integer - (16 + 25) * 8 * FONT_SBAR->maxwidth) / 2; // 16 characters until name, then we assume 25 character names (they can be longer but usually aren't)
xmax = vid_conwidth.integer - xmin;
if(gamemode == GAME_NEXUIZ)
return;
// adjust the given y if sbar_miniscoreboard_size doesn't indicate default (< 0)
if(sbar_miniscoreboard_size.value > 0)
- y = vid_conheight.integer - sbar_miniscoreboard_size.value * 8;
+ y = (int) (vid_conheight.integer - sbar_miniscoreboard_size.value * 8);
// scores
Sbar_SortFrags ();
int sbar_y_save = sbar_y;
- sbar_y = vid_conheight.value - (32+12);
+ sbar_y = (int) (vid_conheight.value - (32+12));
sbar_x -= margin;
me = cl.playerentity - 1;
maxframes = sampleframes;
memsize = maxframes * format->width * format->channels;
- ringbuffer->ring = Mem_Alloc(snd_mempool, memsize);
+ ringbuffer->ring = (unsigned char *) Mem_Alloc(snd_mempool, memsize);
ringbuffer->maxframes = maxframes;
}
else
{
- ringbuffer->ring = buffer;
+ ringbuffer->ring = (unsigned char *) buffer;
ringbuffer->maxframes = sampleframes;
}
size_t newsampleframes, memsize;
snd_buffer_t* sb;
- newsampleframes = (double)sampleframes * (double)sb_speed / (double)in_format->speed;
+ newsampleframes = (size_t) ((double)sampleframes * (double)sb_speed / (double)in_format->speed);
memsize = newsampleframes * in_format->channels * in_format->width;
memsize += sizeof (*sb) - sizeof (sb->samples);
return false;
}
- outcount = (double)sampleframes * (double)sb->format.speed / (double)format->speed;
+ outcount = (size_t) ((double)sampleframes * (double)sb->format.speed / (double)format->speed);
// If the sound buffer is too short
if (outcount > sb->maxframes - sb->nbframes)
unsigned int i;
channel_t *ch;
unsigned int frames;
- unsigned char *outbytes = stream;
+ unsigned char *outbytes = (unsigned char *) stream;
// mix as many times as needed to fill the requested buffer
while (bufferframes)
static void (*ModPlug_Seek) (ModPlugFile* file, int millisecond);
static void (*ModPlug_GetSettings) (ModPlug_Settings* settings);
static void (*ModPlug_SetSettings) (const ModPlug_Settings* settings);
-static void (*ModPlug_SetMasterVolume) (ModPlugFile* file,unsigned int cvol) ;
+typedef void (ModPlug_SetMasterVolume_t) (ModPlugFile* file,unsigned int cvol) ;
+ModPlug_SetMasterVolume_t *ModPlug_SetMasterVolume;
static dllfunction_t modplugfuncs[] =
// the modplug DLL automatically when loading the modplugFile DLL
if(Sys_LoadLibrary (dllnames_modplug, &modplug_dll, modplugfuncs))
{
- ModPlug_SetMasterVolume = Sys_GetProcAddress(modplug_dll, "ModPlug_SetMasterVolume");
+ ModPlug_SetMasterVolume = (ModPlug_SetMasterVolume_t *) Sys_GetProcAddress(modplug_dll, "ModPlug_SetMasterVolume");
if(!ModPlug_SetMasterVolume)
Con_Print("Warning: modplug volume control not supported. Try getting a newer version of libmodplug.\n");
return true;
ModPlug_Seek(per_ch->mf, modplug_start);
sb->nbframes = 0;
- real_start = (float)modplug_start / 1000 * snd_renderbuffer->format.speed;
+ real_start = (unsigned int) ((float)modplug_start / 1000 * snd_renderbuffer->format.speed);
if (*start - real_start + nbsampleframes > sb->maxframes)
{
Con_Printf ("ModPlug_FetchSound: stream buffer too small after seek (%u sample frames required)\n",
}
sb->nbframes = 0;
- real_start = (float)ogg_start / per_sfx->format.speed * snd_renderbuffer->format.speed;
+ real_start = (unsigned int) ((float)ogg_start / per_sfx->format.speed * snd_renderbuffer->format.speed);
if (*start - real_start + nbsampleframes > sb->maxframes)
{
Con_Printf ("OGG_FetchSound: stream buffer too small after seek (%u sample frames required)\n",
if(startcomment)
{
- *start = bound(0, atof(startcomment) * samplesfactor, numsamples);
+ *start = (unsigned int) bound(0, atof(startcomment) * samplesfactor, numsamples);
if(endcomment)
- *length = bound(0, atof(endcomment) * samplesfactor, numsamples);
+ *length = (unsigned int) bound(0, atof(endcomment) * samplesfactor, numsamples);
else if(lengthcomment)
- *length = bound(0, *start + atof(lengthcomment) * samplesfactor, numsamples);
+ *length = (unsigned int) bound(0, *start + atof(lengthcomment) * samplesfactor, numsamples);
}
}
if (info.loopstart < 0)
sfx->loopstart = sfx->total_length;
else
- sfx->loopstart = (double)info.loopstart * (double)sb->format.speed / (double)info.rate;
+ sfx->loopstart = (unsigned int) ((double)info.loopstart * (double)sb->format.speed / (double)info.rate);
sfx->loopstart = min(sfx->loopstart, sfx->total_length);
sfx->flags &= ~SFXFLAG_STREAMED;
char buf[NET_MAXMESSAGE];
sizebuf_t sb;
- sb.data = (void *) buf;
+ sb.data = (unsigned char *) buf;
sb.maxsize = sizeof(buf);
i = 0;
while(MakeDownloadPacket(sv.csqc_progname, sv.csqc_progdata, sv.csqc_progsize, sv.csqc_progcrc, i++, &sb, sv.protocol))
stats[STAT_CELLS] = (int)ent->fields.server->ammo_cells;
stats[STAT_ACTIVEWEAPON] = (int)ent->fields.server->weapon;
stats[STAT_VIEWZOOM] = viewzoom;
- stats[STAT_TOTALSECRETS] = prog->globals.server->total_secrets;
- stats[STAT_TOTALMONSTERS] = prog->globals.server->total_monsters;
+ stats[STAT_TOTALSECRETS] = (int)prog->globals.server->total_secrets;
+ stats[STAT_TOTALMONSTERS] = (int)prog->globals.server->total_monsters;
// the QC bumps these itself by sending svc_'s, so we have to keep them
// zero or they'll be corrected by the engine
//stats[STAT_SECRETS] = prog->globals.server->found_secrets;
static void SV_VM_Setup(void)
{
- extern cvar_t csqc_progname; //[515]: csqc crc check and right csprogs name according to progs.dat
PRVM_Begin;
PRVM_InitProg( PRVM_SERVERPROG );
Matrix4x4_CreateTranslate(&matrix, touch->fields.server->origin[0], touch->fields.server->origin[1], touch->fields.server->origin[2]);
Matrix4x4_Invert_Simple(&imatrix, &matrix);
if ((int)touch->fields.server->flags & FL_MONSTER)
- Collision_ClipToGenericEntity(&trace, model, touch->fields.server->frame, touch->fields.server->mins, touch->fields.server->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins2, clipmaxs2, clipend, hitsupercontentsmask);
+ Collision_ClipToGenericEntity(&trace, model, (int) touch->fields.server->frame, touch->fields.server->mins, touch->fields.server->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins2, clipmaxs2, clipend, hitsupercontentsmask);
else
- Collision_ClipToGenericEntity(&trace, model, touch->fields.server->frame, touch->fields.server->mins, touch->fields.server->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins, clipmaxs, clipend, hitsupercontentsmask);
+ Collision_ClipToGenericEntity(&trace, model, (int) touch->fields.server->frame, touch->fields.server->mins, touch->fields.server->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins, clipmaxs, clipend, hitsupercontentsmask);
Collision_CombineTraces(&cliptrace, &trace, (void *)touch, touch->fields.server->solid == SOLID_BSP);
}
// final position, move it
if (!((int)check->fields.server->flags & FL_ONGROUND) || PRVM_PROG_TO_EDICT(check->fields.server->groundentity) != pusher)
{
- Collision_ClipToGenericEntity(&trace, pushermodel, pusher->fields.server->frame, pusher->fields.server->mins, pusher->fields.server->maxs, SUPERCONTENTS_BODY, &pusherfinalmatrix, &pusherfinalimatrix, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, checkcontents);
+ Collision_ClipToGenericEntity(&trace, pushermodel, (int) pusher->fields.server->frame, pusher->fields.server->mins, pusher->fields.server->maxs, SUPERCONTENTS_BODY, &pusherfinalmatrix, &pusherfinalimatrix, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, checkcontents);
//trace = SV_Move(check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, MOVE_NOMONSTERS, check, checkcontents);
if (!trace.startsolid)
{
check->fields.server->flags = (int)check->fields.server->flags & ~FL_ONGROUND;
// if it is still inside the pusher, block
- Collision_ClipToGenericEntity(&trace, pushermodel, pusher->fields.server->frame, pusher->fields.server->mins, pusher->fields.server->maxs, SUPERCONTENTS_BODY, &pusherfinalmatrix, &pusherfinalimatrix, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, checkcontents);
+ Collision_ClipToGenericEntity(&trace, pushermodel, (int) pusher->fields.server->frame, pusher->fields.server->mins, pusher->fields.server->maxs, SUPERCONTENTS_BODY, &pusherfinalmatrix, &pusherfinalimatrix, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, checkcontents);
if (trace.startsolid)
{
// try moving the contacted entity a tiny bit further to account for precision errors
VectorCopy (check->priv.server->moved_fromangles, check->fields.server->angles);
SV_PushEntity (check, move2, true);
pusher->fields.server->solid = savesolid;
- Collision_ClipToGenericEntity(&trace, pushermodel, pusher->fields.server->frame, pusher->fields.server->mins, pusher->fields.server->maxs, SUPERCONTENTS_BODY, &pusherfinalmatrix, &pusherfinalimatrix, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, checkcontents);
+ Collision_ClipToGenericEntity(&trace, pushermodel, (int) pusher->fields.server->frame, pusher->fields.server->mins, pusher->fields.server->maxs, SUPERCONTENTS_BODY, &pusherfinalmatrix, &pusherfinalimatrix, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, checkcontents);
if (trace.startsolid)
{
// try moving the contacted entity a tiny bit less to account for precision errors
VectorCopy (check->priv.server->moved_fromangles, check->fields.server->angles);
SV_PushEntity (check, move2, true);
pusher->fields.server->solid = savesolid;
- Collision_ClipToGenericEntity(&trace, pushermodel, pusher->fields.server->frame, pusher->fields.server->mins, pusher->fields.server->maxs, SUPERCONTENTS_BODY, &pusherfinalmatrix, &pusherfinalimatrix, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, checkcontents);
+ Collision_ClipToGenericEntity(&trace, pushermodel, (int) pusher->fields.server->frame, pusher->fields.server->mins, pusher->fields.server->maxs, SUPERCONTENTS_BODY, &pusherfinalmatrix, &pusherfinalimatrix, check->fields.server->origin, check->fields.server->mins, check->fields.server->maxs, check->fields.server->origin, checkcontents);
if (trace.startsolid)
{
// still inside pusher, so it's really blocked
int crc;
unsigned char *temp;
FS_Seek(host_client->download_file, 0, SEEK_SET);
- temp = Mem_Alloc(tempmempool, size);
+ temp = (unsigned char *) Mem_Alloc(tempmempool, size);
FS_Read(host_client->download_file, temp, size);
crc = CRC_Block(temp, size);
Mem_Free(temp);
VM_SAFEPARMCOUNT(3, VM_SV_WritePicture);
imgname = PRVM_G_STRING(OFS_PARM1);
- size = PRVM_G_FLOAT(OFS_PARM2);
+ size = (int) PRVM_G_FLOAT(OFS_PARM2);
if(size > 65535)
size = 65535;
{
// actual picture
MSG_WriteShort(WriteDest(), size);
- SZ_Write(WriteDest(), buf, size);
+ SZ_Write(WriteDest(), (unsigned char *) buf, size);
}
else
{
exit(returnvalue);
}
+#if defined(__linux__) || defined(__FreeBSD__)
+#ifdef __cplusplus
+extern "C"
+#endif
+int moncontrol(int);
+#endif
+
void Sys_AllowProfiling(qboolean enable)
{
#if defined(__linux__) || defined(__FreeBSD__)
-int moncontrol(int);
moncontrol(enable);
#endif
}
// close all hlwad files and free their lumps data
for (i = 0;i < Mem_ExpandableArray_IndexRange(&wad.hlwads);i++)
{
- w = Mem_ExpandableArray_RecordAtIndex(&wad.hlwads, i);
+ w = (mwad_t *) Mem_ExpandableArray_RecordAtIndex(&wad.hlwads, i);
if (!w)
continue;
if (w->file)
if (!wad.hlwads.mempool)
Mem_ExpandableArray_NewArray(&wad.hlwads, cls.permanentmempool, sizeof(mwad_t), 16);
- w = Mem_ExpandableArray_AllocRecord(&wad.hlwads);
+ w = (mwad_t *) Mem_ExpandableArray_AllocRecord(&wad.hlwads);
w->file = file;
w->numlumps = numlumps;
- w->lumps = Mem_Alloc(cls.permanentmempool, w->numlumps * sizeof(lumpinfo_t));
+ w->lumps = (lumpinfo_t *) Mem_Alloc(cls.permanentmempool, w->numlumps * sizeof(lumpinfo_t));
if (!w->lumps)
{
{
memexpandablearray_array_t *oldarrays = l->arrays;
l->maxarrays = max(l->maxarrays * 2, 128);
- l->arrays = Mem_Alloc(l->mempool, l->maxarrays * sizeof(*l->arrays));
+ l->arrays = (memexpandablearray_array_t*) Mem_Alloc(l->mempool, l->maxarrays * sizeof(*l->arrays));
if (oldarrays)
{
memcpy(l->arrays, oldarrays, l->numarrays * sizeof(*l->arrays));
}
}
l->arrays[i].numflaggedrecords = 0;
- l->arrays[i].data = Mem_Alloc(l->mempool, (l->recordsize + 1) * l->numrecordsperarray);
+ l->arrays[i].data = (unsigned char *) Mem_Alloc(l->mempool, (l->recordsize + 1) * l->numrecordsperarray);
l->arrays[i].allocflags = l->arrays[i].data + l->recordsize * l->numrecordsperarray;
l->numarrays++;
}