]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
UNMERGE
authorhavoc havoc@d7cf8633-e32d-0410-b094-e92efae38249 <>
Fri, 2 Jul 2010 02:24:32 +0000 (02:24 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 24 Sep 2010 20:01:43 +0000 (22:01 +0200)
fix a bunch of warnings if compiling darkplaces as C++ in MSVC2008

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10262 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::unmerge=861c406b589acf1252ddc231e02f94557a15e2bc

24 files changed:
cl_main.c
cl_particles.c
cl_screen.c
clvm_cmds.c
fs.c
ft2.c
gl_draw.c
gl_rmain.c
gl_textures.c
host_cmd.c
image.c
lhnet.c
model_brush.c
model_shared.c
prvm_cmds.c
prvm_edict.c
r_shadow.c
r_sky.c
svvm_cmds.c
sys_shared.c
vid.h
vid_shared.c
vid_wgl.c
zone.c

index be5497fe5cedf91adbcaf8b6b8c5e4aaef7d34ab..88b02ee8337d10d275bc10d36141675274ffbee0 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -122,7 +122,7 @@ void CL_ClearState(void)
        cl.sensitivityscale = 1.0f;
 
        // enable rendering of the world and such
-       cl.csqc_vidvars.drawworld = r_drawworld.integer != 0;
+       cl.csqc_vidvars.drawworld = r_drawworld.integer;
        cl.csqc_vidvars.drawenginesbar = true;
        cl.csqc_vidvars.drawcrosshair = true;
 
index d0510fa6f5db88d793973246402a169332c3f009..05f7b246b1c1e4dd82fb0d7df8a1f8239d9f7204 100644 (file)
@@ -1943,7 +1943,7 @@ static void R_InitBloodTextures (unsigned char *particletexturedata)
 {
        int i, j, k, m;
        size_t datasize = PARTICLETEXTURESIZE*PARTICLETEXTURESIZE*4;
-       unsigned char *data = (unsigned char *)Mem_Alloc(tempmempool, datasize);
+       unsigned char *data = Mem_Alloc(tempmempool, datasize);
 
        // blood particles
        for (i = 0;i < 8;i++)
@@ -2159,7 +2159,7 @@ static void R_InitParticleTexture (void)
        }
 
 #ifndef DUMPPARTICLEFONT
-       particletexture[tex_beam].texture = loadtextureimage(particletexturepool, "particles/nexbeam.tga", false, TEXF_ALPHA | TEXF_FORCELINEAR, true, r_texture_convertsRGB_particles.integer != 0);
+       particletexture[tex_beam].texture = loadtextureimage(particletexturepool, "particles/nexbeam.tga", false, TEXF_ALPHA | TEXF_FORCELINEAR, true, r_texture_convertsRGB_particles.integer);
        if (!particletexture[tex_beam].texture)
 #endif
        {
index e74d0f359b9e32883afa63d26ee4803000801d88..ea0297d70582bdf51fa6cbabb2840589a494f60d 100644 (file)
@@ -1006,14 +1006,14 @@ void SCR_ScreenShot_f (void)
        buffer1 = (unsigned char *)Mem_Alloc(tempmempool, vid.width * vid.height * 4);
        buffer2 = (unsigned char *)Mem_Alloc(tempmempool, vid.width * vid.height * (scr_screenshot_alpha.integer ? 4 : 3));
 
-       if (SCR_ScreenShot (filename, buffer1, buffer2, 0, 0, vid.width, vid.height, false, false, false, jpeg, png, true, scr_screenshot_alpha.integer != 0))
+       if (SCR_ScreenShot (filename, buffer1, buffer2, 0, 0, vid.width, vid.height, false, false, false, jpeg, png, true, scr_screenshot_alpha.integer))
                Con_Printf("Wrote %s\n", filename);
        else
        {
                Con_Printf("Unable to write %s\n", filename);
                if(jpeg || png)
                {
-                       if(SCR_ScreenShot (filename, buffer1, buffer2, 0, 0, vid.width, vid.height, false, false, false, false, false, true, scr_screenshot_alpha.integer != 0))
+                       if(SCR_ScreenShot (filename, buffer1, buffer2, 0, 0, vid.width, vid.height, false, false, false, false, false, true, scr_screenshot_alpha.integer))
                        {
                                strlcpy(filename + strlen(filename) - 3, "tga", 4);
                                Con_Printf("Wrote %s\n", filename);
index 3e2e325f1561d483ef5f3bf3b91ec7b41624bf69..cae5257c728634327455d48ca80d2aa532ab0c22 100644 (file)
@@ -723,7 +723,7 @@ void VM_CL_R_ClearScene (void)
        r_refdef.view.isoverlay = false;
        // FIXME: restore cl.csqc_origin
        // FIXME: restore cl.csqc_angles
-       cl.csqc_vidvars.drawworld = r_drawworld.integer != 0;
+       cl.csqc_vidvars.drawworld = r_drawworld.integer;
        cl.csqc_vidvars.drawenginesbar = false;
        cl.csqc_vidvars.drawcrosshair = false;
 }
@@ -2622,8 +2622,8 @@ void VM_CL_ParticleThemeToGlobals(vmparticletheme_t *theme)
 void VM_CL_ParticleThemeFromGlobals(vmparticletheme_t *theme)
 {
        theme->typeindex = (unsigned short)*vmpartspawner.particle_type;
-       theme->blendmode = (pblend_t)(int)*vmpartspawner.particle_blendmode;
-       theme->orientation = (porientation_t)(int)*vmpartspawner.particle_orientation;
+       theme->blendmode = (pblend_t)*vmpartspawner.particle_blendmode;
+       theme->orientation = (porientation_t)*vmpartspawner.particle_orientation;
        theme->color1 = ((int)vmpartspawner.particle_color1[0] << 16) + ((int)vmpartspawner.particle_color1[1] << 8) + ((int)vmpartspawner.particle_color1[2]);
        theme->color2 = ((int)vmpartspawner.particle_color2[0] << 16) + ((int)vmpartspawner.particle_color2[1] << 8) + ((int)vmpartspawner.particle_color2[2]);
        theme->tex = (int)*vmpartspawner.particle_tex;
@@ -2795,7 +2795,7 @@ void VM_CL_SpawnParticle (void)
        
        if (prog->argc < 3) // global-set particle
        {
-               part = CL_NewParticle(org, (unsigned short)*vmpartspawner.particle_type, ((int)(vmpartspawner.particle_color1[0]) << 16) + ((int)(vmpartspawner.particle_color1[1]) << 8) + ((int)(vmpartspawner.particle_color1[2])), ((int)vmpartspawner.particle_color2[0] << 16) + ((int)vmpartspawner.particle_color2[1] << 8) + ((int)vmpartspawner.particle_color2[2]), (int)*vmpartspawner.particle_tex, *vmpartspawner.particle_size, *vmpartspawner.particle_sizeincrease, *vmpartspawner.particle_alpha*256, *vmpartspawner.particle_alphafade*256, *vmpartspawner.particle_gravity, *vmpartspawner.particle_bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], *vmpartspawner.particle_airfriction, *vmpartspawner.particle_liquidfriction, *vmpartspawner.particle_originjitter, *vmpartspawner.particle_velocityjitter, (*vmpartspawner.particle_qualityreduction) ? true : false, *vmpartspawner.particle_time, *vmpartspawner.particle_stretch, (pblend_t)(int)*vmpartspawner.particle_blendmode, (porientation_t)(int)*vmpartspawner.particle_orientation, (int)(vmpartspawner.particle_staincolor1[0])*65536 + (int)(vmpartspawner.particle_staincolor1[1])*256 + (int)(vmpartspawner.particle_staincolor1[2]), (int)(vmpartspawner.particle_staincolor2[0])*65536 + (int)(vmpartspawner.particle_staincolor2[1])*256 + (int)(vmpartspawner.particle_staincolor2[2]), (int)*vmpartspawner.particle_staintex, *vmpartspawner.particle_stainalpha*256, *vmpartspawner.particle_stainsize, *vmpartspawner.particle_angle, *vmpartspawner.particle_spin, NULL);
+               part = CL_NewParticle(org, (unsigned short)*vmpartspawner.particle_type, ((int)(vmpartspawner.particle_color1[0]) << 16) + ((int)(vmpartspawner.particle_color1[1]) << 8) + ((int)(vmpartspawner.particle_color1[2])), ((int)vmpartspawner.particle_color2[0] << 16) + ((int)vmpartspawner.particle_color2[1] << 8) + ((int)vmpartspawner.particle_color2[2]), (int)*vmpartspawner.particle_tex, *vmpartspawner.particle_size, *vmpartspawner.particle_sizeincrease, *vmpartspawner.particle_alpha*256, *vmpartspawner.particle_alphafade*256, *vmpartspawner.particle_gravity, *vmpartspawner.particle_bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], *vmpartspawner.particle_airfriction, *vmpartspawner.particle_liquidfriction, *vmpartspawner.particle_originjitter, *vmpartspawner.particle_velocityjitter, (*vmpartspawner.particle_qualityreduction) ? true : false, *vmpartspawner.particle_time, *vmpartspawner.particle_stretch, (pblend_t)*vmpartspawner.particle_blendmode, (porientation_t)*vmpartspawner.particle_orientation, (int)(vmpartspawner.particle_staincolor1[0])*65536 + (int)(vmpartspawner.particle_staincolor1[1])*256 + (int)(vmpartspawner.particle_staincolor1[2]), (int)(vmpartspawner.particle_staincolor2[0])*65536 + (int)(vmpartspawner.particle_staincolor2[1])*256 + (int)(vmpartspawner.particle_staincolor2[2]), (int)*vmpartspawner.particle_staintex, *vmpartspawner.particle_stainalpha*256, *vmpartspawner.particle_stainsize, *vmpartspawner.particle_angle, *vmpartspawner.particle_spin, NULL);
                if (!part)
                {
                        PRVM_G_FLOAT(OFS_RETURN) = 0; 
@@ -2849,7 +2849,7 @@ void VM_CL_SpawnParticleDelayed (void)
        org = PRVM_G_VECTOR(OFS_PARM0);
        dir = PRVM_G_VECTOR(OFS_PARM1);
        if (prog->argc < 5) // global-set particle
-               part = CL_NewParticle(org, (unsigned short)*vmpartspawner.particle_type, ((int)vmpartspawner.particle_color1[0] << 16) + ((int)vmpartspawner.particle_color1[1] << 8) + ((int)vmpartspawner.particle_color1[2]), ((int)vmpartspawner.particle_color2[0] << 16) + ((int)vmpartspawner.particle_color2[1] << 8) + ((int)vmpartspawner.particle_color2[2]), (int)*vmpartspawner.particle_tex, *vmpartspawner.particle_size, *vmpartspawner.particle_sizeincrease, *vmpartspawner.particle_alpha*256, *vmpartspawner.particle_alphafade*256, *vmpartspawner.particle_gravity, *vmpartspawner.particle_bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], *vmpartspawner.particle_airfriction, *vmpartspawner.particle_liquidfriction, *vmpartspawner.particle_originjitter, *vmpartspawner.particle_velocityjitter, (*vmpartspawner.particle_qualityreduction) ? true : false, *vmpartspawner.particle_time, *vmpartspawner.particle_stretch, (pblend_t)(int)*vmpartspawner.particle_blendmode, (porientation_t)(int)*vmpartspawner.particle_orientation, ((int)vmpartspawner.particle_staincolor1[0] << 16) + ((int)vmpartspawner.particle_staincolor1[1] << 8) + ((int)vmpartspawner.particle_staincolor1[2]), ((int)vmpartspawner.particle_staincolor2[0] << 16) + ((int)vmpartspawner.particle_staincolor2[1] << 8) + ((int)vmpartspawner.particle_staincolor2[2]), (int)*vmpartspawner.particle_staintex, *vmpartspawner.particle_stainalpha*256, *vmpartspawner.particle_stainsize, *vmpartspawner.particle_angle, *vmpartspawner.particle_spin, NULL);
+               part = CL_NewParticle(org, (unsigned short)*vmpartspawner.particle_type, ((int)vmpartspawner.particle_color1[0] << 16) + ((int)vmpartspawner.particle_color1[1] << 8) + ((int)vmpartspawner.particle_color1[2]), ((int)vmpartspawner.particle_color2[0] << 16) + ((int)vmpartspawner.particle_color2[1] << 8) + ((int)vmpartspawner.particle_color2[2]), (int)*vmpartspawner.particle_tex, *vmpartspawner.particle_size, *vmpartspawner.particle_sizeincrease, *vmpartspawner.particle_alpha*256, *vmpartspawner.particle_alphafade*256, *vmpartspawner.particle_gravity, *vmpartspawner.particle_bounce, org[0], org[1], org[2], dir[0], dir[1], dir[2], *vmpartspawner.particle_airfriction, *vmpartspawner.particle_liquidfriction, *vmpartspawner.particle_originjitter, *vmpartspawner.particle_velocityjitter, (*vmpartspawner.particle_qualityreduction) ? true : false, *vmpartspawner.particle_time, *vmpartspawner.particle_stretch, (pblend_t)*vmpartspawner.particle_blendmode, (porientation_t)*vmpartspawner.particle_orientation, ((int)vmpartspawner.particle_staincolor1[0] << 16) + ((int)vmpartspawner.particle_staincolor1[1] << 8) + ((int)vmpartspawner.particle_staincolor1[2]), ((int)vmpartspawner.particle_staincolor2[0] << 16) + ((int)vmpartspawner.particle_staincolor2[1] << 8) + ((int)vmpartspawner.particle_staincolor2[2]), (int)*vmpartspawner.particle_staintex, *vmpartspawner.particle_stainalpha*256, *vmpartspawner.particle_stainsize, *vmpartspawner.particle_angle, *vmpartspawner.particle_spin, NULL);
        else // themed particle
        {
                themenum = (int)PRVM_G_FLOAT(OFS_PARM4);
@@ -3689,7 +3689,7 @@ static void VM_CL_skel_create(void)
                        break;
        if (i == MAX_EDICTS)
                return;
-       prog->skeletons[i] = skeleton = (skeleton_t *)Mem_Alloc(cls.levelmempool, sizeof(skeleton_t) + model->num_bones * sizeof(matrix4x4_t));
+       prog->skeletons[i] = skeleton = Mem_Alloc(cls.levelmempool, sizeof(skeleton_t) + model->num_bones * sizeof(matrix4x4_t));
        PRVM_G_FLOAT(OFS_RETURN) = i + 1;
        skeleton->model = model;
        skeleton->relativetransforms = (matrix4x4_t *)(skeleton+1);
diff --git a/fs.c b/fs.c
index a5281f584be580bb33e8073bfdc906094730c974..a058ada2ddef52ec20db740bb13bcdfd49af03ef 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -1283,7 +1283,7 @@ static void FS_AddSelfPack(void)
        if(fs_selfpack)
        {
                searchpath_t *search;
-               search = (searchpath_t *)Mem_Alloc(fs_mempool, sizeof(searchpath_t));
+               search = Mem_Alloc(fs_mempool, sizeof(searchpath_t));
                search->next = fs_searchpaths;
                search->pack = fs_selfpack;
                fs_searchpaths = search;
diff --git a/ft2.c b/ft2.c
index 9f7c36800d747c27feb7aa0d4b934f19e6fcc421..1079b5db52eba3d981dc5a3408fcc51e9e7badbc 100644 (file)
--- a/ft2.c
+++ b/ft2.c
@@ -290,7 +290,7 @@ ft2_font_t *Font_Alloc(void)
 {
        if (!ft2_dll)
                return NULL;
-       return (ft2_font_t *)Mem_Alloc(font_mempool, sizeof(ft2_font_t));
+       return Mem_Alloc(font_mempool, sizeof(ft2_font_t));
 }
 
 qboolean Font_Attach(ft2_font_t *font, ft2_attachment_t *attachment)
@@ -527,7 +527,7 @@ static qboolean Font_LoadFile(const char *name, int _face, ft2_settings_t *setti
                args.flags = FT_OPEN_MEMORY;
                args.memory_base = (const FT_Byte*)font->attachments[i].data;
                args.memory_size = font->attachments[i].size;
-               if (qFT_Attach_Stream((FT_Face)font->face, &args))
+               if (qFT_Attach_Stream(font->face, &args))
                        Con_Printf("Failed to add attachment %u to %s\n", (unsigned)i, font->name);
        }
 
@@ -586,7 +586,7 @@ void Font_Postprocess_Update(ft2_font_t *fnt, int bpp, int w, int h)
                if(pp.buf)
                        Mem_Free(pp.buf);
                pp.bufsize = needed * 4;
-               pp.buf = (unsigned char *)Mem_Alloc(font_mempool, pp.bufsize);
+               pp.buf = Mem_Alloc(font_mempool, pp.bufsize);
                pp.buf2 = pp.buf + needed;
        }
 }
@@ -773,9 +773,9 @@ static qboolean Font_LoadSize(ft2_font_t *font, float size, qboolean check_only)
                        for (r = 0; r < 256; ++r)
                        {
                                FT_ULong ul, ur;
-                               ul = qFT_Get_Char_Index((FT_Face)font->face, l);
-                               ur = qFT_Get_Char_Index((FT_Face)font->face, r);
-                               if (qFT_Get_Kerning((FT_Face)font->face, ul, ur, FT_KERNING_DEFAULT, &kernvec))
+                               ul = qFT_Get_Char_Index(font->face, l);
+                               ur = qFT_Get_Char_Index(font->face, r);
+                               if (qFT_Get_Kerning(font->face, ul, ur, FT_KERNING_DEFAULT, &kernvec))
                                {
                                        fmap->kerning.kerning[l][r][0] = 0;
                                        fmap->kerning.kerning[l][r][1] = 0;
@@ -923,9 +923,9 @@ qboolean Font_GetKerningForMap(ft2_font_t *font, int map_index, float w, float h
                        Con_Printf("Failed to get kerning for %s\n", font->name);
                        return false;
                }
-               ul = qFT_Get_Char_Index((FT_Face)font->face, left);
-               ur = qFT_Get_Char_Index((FT_Face)font->face, right);
-               if (qFT_Get_Kerning((FT_Face)font->face, ul, ur, FT_KERNING_DEFAULT, &kernvec))
+               ul = qFT_Get_Char_Index(font->face, left);
+               ur = qFT_Get_Char_Index(font->face, right);
+               if (qFT_Get_Kerning(font->face, ul, ur, FT_KERNING_DEFAULT, &kernvec))
                {
                        if (outx) *outx = Font_SnapTo(kernvec.x * fmap->sfx, 1 / fmap->size);// * (w / (float)fmap->size);
                        if (outy) *outy = Font_SnapTo(kernvec.y * fmap->sfy, 1 / fmap->size);// * (h / (float)fmap->size);
@@ -1107,7 +1107,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
                return false;
        }
 
-       map = (ft2_font_map_t *)Mem_Alloc(font_mempool, sizeof(ft2_font_map_t));
+       map = Mem_Alloc(font_mempool, sizeof(ft2_font_map_t));
        if (!map)
        {
                Con_Printf("ERROR: Out of memory when loading fontmap for %s\n", font->name);
@@ -1124,7 +1124,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
        map->sfy = mapstart->sfy;
 
        pitch = map->glyphSize * FONT_CHARS_PER_LINE * bytesPerPixel;
-       data = (unsigned char *)Mem_Alloc(font_mempool, (FONT_CHAR_LINES * map->glyphSize) * pitch);
+       data = Mem_Alloc(font_mempool, (FONT_CHAR_LINES * map->glyphSize) * pitch);
        if (!data)
        {
                Con_Printf("ERROR: Failed to allocate memory for font %s size %g\n", font->name, map->size);
@@ -1185,7 +1185,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
                imagedata += gpad_t * pitch + gpad_l * bytesPerPixel;
                //status = qFT_Load_Char(face, ch, FT_LOAD_RENDER);
                // we need the glyphIndex
-               face = (FT_Face)font->face;
+               face = font->face;
                usefont = NULL;
                if (font->image_font && mapch == ch && img_fontmap[mapch])
                {
@@ -1202,7 +1202,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
                                if (!Font_SetSize(usefont, mapstart->intSize, mapstart->intSize))
                                        continue;
                                // try that glyph
-                               face = (FT_Face)usefont->face;
+                               face = usefont->face;
                                glyphIndex = qFT_Get_Char_Index(face, ch);
                                if (glyphIndex == 0)
                                        continue;
@@ -1215,7 +1215,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
                        {
                                //Con_Printf("failed to load fallback glyph for char %lx from font %s\n", (unsigned long)ch, font->name);
                                // now we let it use the "missing-glyph"-glyph
-                               face = (FT_Face)font->face;
+                               face = font->face;
                                glyphIndex = 0;
                        }
                }
@@ -1223,7 +1223,7 @@ static qboolean Font_LoadMap(ft2_font_t *font, ft2_font_map_t *mapstart, Uchar _
                if (!usefont)
                {
                        usefont = font;
-                       face = (FT_Face)font->face;
+                       face = font->face;
                        status = qFT_Load_Glyph(face, glyphIndex, FT_LOAD_RENDER | load_flags);
                        if (status)
                        {
index 92aa3b1e3442996d1ff286b9492c1f74d2644cfa..7a05e3a3850fd0d79f4aac3e663fc9e122a53fae 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -365,9 +365,9 @@ cachepic_t *Draw_CachePic_Flags(const char *path, unsigned int cachepicflags)
        pic->autoload = (cachepicflags & CACHEPICFLAG_NOTPERSISTENT);
 
        // load a high quality image from disk if possible
-       pixels = loadimagepixelsbgra(path, false, true, r_texture_convertsRGB_2d.integer != 0, NULL);
+       pixels = loadimagepixelsbgra(path, false, true, r_texture_convertsRGB_2d.integer, NULL);
        if (pixels == NULL && !strncmp(path, "gfx/", 4))
-               pixels = loadimagepixelsbgra(path+4, false, true, r_texture_convertsRGB_2d.integer != 0, NULL);
+               pixels = loadimagepixelsbgra(path+4, false, true, r_texture_convertsRGB_2d.integer, NULL);
        if (pixels)
        {
                pic->hasalpha = false;
@@ -466,9 +466,9 @@ rtexture_t *Draw_GetPicTexture(cachepic_t *pic)
 {
        if (pic->autoload && !pic->tex)
        {
-               pic->tex = loadtextureimage(drawtexturepool, pic->name, false, pic->texflags, true, r_texture_convertsRGB_2d.integer != 0);
+               pic->tex = loadtextureimage(drawtexturepool, pic->name, false, pic->texflags, true, r_texture_convertsRGB_2d.integer);
                if (pic->tex == NULL && !strncmp(pic->name, "gfx/", 4))
-                       pic->tex = loadtextureimage(drawtexturepool, pic->name+4, false, pic->texflags, true, r_texture_convertsRGB_2d.integer != 0);
+                       pic->tex = loadtextureimage(drawtexturepool, pic->name+4, false, pic->texflags, true, r_texture_convertsRGB_2d.integer);
                if (pic->tex == NULL)
                        pic->tex = draw_generatepic(pic->name, true);
        }
@@ -738,7 +738,7 @@ dp_font_t *FindFont(const char *title, qboolean allocate_new)
                dp_fonts.maxsize = dp_fonts.maxsize + FONTS_EXPAND;
                if (developer_font.integer)
                        Con_Printf("FindFont: enlarging fonts buffer (%i -> %i)\n", i, dp_fonts.maxsize);
-               dp_fonts.f = (dp_font_t *)Mem_Realloc(fonts_mempool, dp_fonts.f, sizeof(dp_font_t) * dp_fonts.maxsize);
+               dp_fonts.f = Mem_Realloc(fonts_mempool, dp_fonts.f, sizeof(dp_font_t) * dp_fonts.maxsize);
                // register a font in first expanded slot
                strlcpy(dp_fonts.f[i].title, title, sizeof(dp_fonts.f[i].title));
                return &dp_fonts.f[i];
@@ -958,7 +958,7 @@ void GL_Draw_Init (void)
        // allocate fonts storage
        fonts_mempool = Mem_AllocPool("FONTS", 0, NULL);
        dp_fonts.maxsize = MAX_FONTS;
-       dp_fonts.f = (dp_font_t *)Mem_Alloc(fonts_mempool, sizeof(dp_font_t) * dp_fonts.maxsize);
+       dp_fonts.f = Mem_Alloc(fonts_mempool, sizeof(dp_font_t) * dp_fonts.maxsize);
        memset(dp_fonts.f, 0, sizeof(dp_font_t) * dp_fonts.maxsize);
 
        // assign starting font names
index 5790dd7a1ffcb993c18208f9848363333c976a86..461fe09db0fde7f267287f03d9feead659e126a2 100644 (file)
@@ -252,7 +252,6 @@ static r_qwskincache_t *r_qwskincache;
 static int r_qwskincache_size;
 
 /// vertex coordinates for a quad that covers the screen exactly
-extern const float r_screenvertex3f[12];
 const float r_screenvertex3f[12] =
 {
        0, 0, 0,
@@ -378,7 +377,7 @@ static void R_BuildNormalizationCube(void)
        vec_t s, t, intensity;
 #define NORMSIZE 64
        unsigned char *data;
-       data = (unsigned char *)Mem_Alloc(tempmempool, 6*NORMSIZE*NORMSIZE*4);
+       data = Mem_Alloc(tempmempool, 6*NORMSIZE*NORMSIZE*4);
        for (side = 0;side < 6;side++)
        {
                for (y = 0;y < NORMSIZE;y++)
@@ -518,8 +517,8 @@ static void R_BuildFogHeightTexture(void)
        }
        size = image_width;
        r_refdef.fog_height_tablesize = size;
-       r_refdef.fog_height_table1d = (unsigned char *)Mem_Alloc(r_main_mempool, size * 4);
-       r_refdef.fog_height_table2d = (unsigned char *)Mem_Alloc(r_main_mempool, size * size * 4);
+       r_refdef.fog_height_table1d = Mem_Alloc(r_main_mempool, size * 4);
+       r_refdef.fog_height_table2d = Mem_Alloc(r_main_mempool, size * size * 4);
        memcpy(r_refdef.fog_height_table1d, inpixels, size * 4);
        Mem_Free(inpixels);
        // LordHavoc: now the magic - what is that table2d for?  it is a cooked
@@ -4430,8 +4429,8 @@ void R_GLSL_Restart_f(void)
                        }
                        memset(r_cg_permutationhash, 0, sizeof(r_cg_permutationhash));
                }
-#endif
                break;
+#endif
        case RENDERPATH_GL13:
        case RENDERPATH_GL11:
                break;
@@ -5649,7 +5648,7 @@ skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboole
        // check for DDS texture file first
        if (!r_loaddds || !(ddsbase = R_LoadTextureDDSFile(r_main_texturepool, va("dds/%s.dds", basename), textureflags, &ddshasalpha, ddsavgcolor, miplevel)))
        {
-               basepixels = loadimagepixelsbgra(name, complain, true, r_texture_convertsRGB_skin.integer != 0, &miplevel);
+               basepixels = loadimagepixelsbgra(name, complain, true, r_texture_convertsRGB_skin.integer, &miplevel);
                if (basepixels == NULL)
                        return NULL;
        }
@@ -5766,7 +5765,7 @@ skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboole
        // _luma is supported only for tenebrae compatibility
        // _glow is the preferred name
        mymiplevel = savemiplevel;
-       if (skinframe->glow == NULL && ((pixels = loadimagepixelsbgra(va("%s_glow",  skinframe->basename), false, false, r_texture_convertsRGB_skin.integer != 0, &mymiplevel)) || (pixels = loadimagepixelsbgra(va("%s_luma", skinframe->basename), false, false, r_texture_convertsRGB_skin.integer != 0, &mymiplevel))))
+       if (skinframe->glow == NULL && ((pixels = loadimagepixelsbgra(va("%s_glow",  skinframe->basename), false, false, r_texture_convertsRGB_skin.integer, &mymiplevel)) || (pixels = loadimagepixelsbgra(va("%s_luma", skinframe->basename), false, false, r_texture_convertsRGB_skin.integer, &mymiplevel))))
        {
                skinframe->glow = R_LoadTexture2D (r_main_texturepool, va("%s_glow", skinframe->basename), image_width, image_height, pixels, TEXTYPE_BGRA, textureflags & (gl_texturecompression_glow.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL);
                if (r_savedds && qglGetCompressedTexImageARB && skinframe->glow)
@@ -5775,7 +5774,7 @@ skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboole
        }
 
        mymiplevel = savemiplevel;
-       if (skinframe->gloss == NULL && r_loadgloss && (pixels = loadimagepixelsbgra(va("%s_gloss", skinframe->basename), false, false, r_texture_convertsRGB_skin.integer != 0, &mymiplevel)))
+       if (skinframe->gloss == NULL && r_loadgloss && (pixels = loadimagepixelsbgra(va("%s_gloss", skinframe->basename), false, false, r_texture_convertsRGB_skin.integer, &mymiplevel)))
        {
                skinframe->gloss = R_LoadTexture2D (r_main_texturepool, va("%s_gloss", skinframe->basename), image_width, image_height, pixels, TEXTYPE_BGRA, textureflags & (gl_texturecompression_gloss.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL);
                if (r_savedds && qglGetCompressedTexImageARB && skinframe->gloss)
@@ -5785,7 +5784,7 @@ skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboole
        }
 
        mymiplevel = savemiplevel;
-       if (skinframe->pants == NULL && (pixels = loadimagepixelsbgra(va("%s_pants", skinframe->basename), false, false, r_texture_convertsRGB_skin.integer != 0, &mymiplevel)))
+       if (skinframe->pants == NULL && (pixels = loadimagepixelsbgra(va("%s_pants", skinframe->basename), false, false, r_texture_convertsRGB_skin.integer, &mymiplevel)))
        {
                skinframe->pants = R_LoadTexture2D (r_main_texturepool, va("%s_pants", skinframe->basename), image_width, image_height, pixels, TEXTYPE_BGRA, textureflags & (gl_texturecompression_color.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL);
                if (r_savedds && qglGetCompressedTexImageARB && skinframe->pants)
@@ -5795,7 +5794,7 @@ skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboole
        }
 
        mymiplevel = savemiplevel;
-       if (skinframe->shirt == NULL && (pixels = loadimagepixelsbgra(va("%s_shirt", skinframe->basename), false, false, r_texture_convertsRGB_skin.integer != 0, &mymiplevel)))
+       if (skinframe->shirt == NULL && (pixels = loadimagepixelsbgra(va("%s_shirt", skinframe->basename), false, false, r_texture_convertsRGB_skin.integer, &mymiplevel)))
        {
                skinframe->shirt = R_LoadTexture2D (r_main_texturepool, va("%s_shirt", skinframe->basename), image_width, image_height, pixels, TEXTYPE_BGRA, textureflags & (gl_texturecompression_color.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL);
                if (r_savedds && qglGetCompressedTexImageARB && skinframe->shirt)
@@ -5805,7 +5804,7 @@ skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboole
        }
 
        mymiplevel = savemiplevel;
-       if (skinframe->reflect == NULL && (pixels = loadimagepixelsbgra(va("%s_reflect", skinframe->basename), false, false, r_texture_convertsRGB_skin.integer != 0, &mymiplevel)))
+       if (skinframe->reflect == NULL && (pixels = loadimagepixelsbgra(va("%s_reflect", skinframe->basename), false, false, r_texture_convertsRGB_skin.integer, &mymiplevel)))
        {
                skinframe->reflect = R_LoadTexture2D (r_main_texturepool, va("%s_reflect", skinframe->basename), image_width, image_height, pixels, TEXTYPE_BGRA, textureflags & (gl_texturecompression_reflectmask.integer ? ~0 : ~TEXF_COMPRESS), mymiplevel, NULL);
                if (r_savedds && qglGetCompressedTexImageARB && skinframe->reflect)
@@ -5924,7 +5923,7 @@ skinframe_t *R_SkinFrame_LoadInternalQuake(const char *name, int textureflags, i
                Con_Printf("loading quake skin \"%s\"\n", name);
 
        // we actually don't upload anything until the first use, because mdl skins frequently go unused, and are almost never used in both modes (colormapped and non-colormapped)
-       skinframe->qpixels = (unsigned char *)Mem_Alloc(r_main_mempool, width*height);
+       skinframe->qpixels = Mem_Alloc(r_main_mempool, width*height);
        memcpy(skinframe->qpixels, skindata, width*height);
        skinframe->qwidth = width;
        skinframe->qheight = height;
@@ -6149,7 +6148,7 @@ rtexture_t *R_LoadCubemap(const char *basename)
                        // generate an image name based on the base and and suffix
                        dpsnprintf(name, sizeof(name), "%s%s", basename, suffix[j][i].suffix);
                        // load it
-                       if ((image_buffer = loadimagepixelsbgra(name, false, false, r_texture_convertsRGB_cubemap.integer != 0, NULL)))
+                       if ((image_buffer = loadimagepixelsbgra(name, false, false, r_texture_convertsRGB_cubemap.integer, NULL)))
                        {
                                // an image loaded, make sure width and height are equal
                                if (image_width == image_height && (!cubemappixels || image_width == cubemapsize))
@@ -6248,7 +6247,7 @@ void R_Main_ResizeViewCache(void)
                r_refdef.viewcache.maxentities = numentities;
                if (r_refdef.viewcache.entityvisible)
                        Mem_Free(r_refdef.viewcache.entityvisible);
-               r_refdef.viewcache.entityvisible = (unsigned char *)Mem_Alloc(r_main_mempool, r_refdef.viewcache.maxentities);
+               r_refdef.viewcache.entityvisible = Mem_Alloc(r_main_mempool, r_refdef.viewcache.maxentities);
        }
        if (r_refdef.viewcache.world_numclusters != numclusters)
        {
@@ -6256,21 +6255,21 @@ void R_Main_ResizeViewCache(void)
                r_refdef.viewcache.world_numclusterbytes = numclusterbytes;
                if (r_refdef.viewcache.world_pvsbits)
                        Mem_Free(r_refdef.viewcache.world_pvsbits);
-               r_refdef.viewcache.world_pvsbits = (unsigned char *)Mem_Alloc(r_main_mempool, r_refdef.viewcache.world_numclusterbytes);
+               r_refdef.viewcache.world_pvsbits = Mem_Alloc(r_main_mempool, r_refdef.viewcache.world_numclusterbytes);
        }
        if (r_refdef.viewcache.world_numleafs != numleafs)
        {
                r_refdef.viewcache.world_numleafs = numleafs;
                if (r_refdef.viewcache.world_leafvisible)
                        Mem_Free(r_refdef.viewcache.world_leafvisible);
-               r_refdef.viewcache.world_leafvisible = (unsigned char *)Mem_Alloc(r_main_mempool, r_refdef.viewcache.world_numleafs);
+               r_refdef.viewcache.world_leafvisible = Mem_Alloc(r_main_mempool, r_refdef.viewcache.world_numleafs);
        }
        if (r_refdef.viewcache.world_numsurfaces != numsurfaces)
        {
                r_refdef.viewcache.world_numsurfaces = numsurfaces;
                if (r_refdef.viewcache.world_surfacevisible)
                        Mem_Free(r_refdef.viewcache.world_surfacevisible);
-               r_refdef.viewcache.world_surfacevisible = (unsigned char *)Mem_Alloc(r_main_mempool, r_refdef.viewcache.world_numsurfaces);
+               r_refdef.viewcache.world_surfacevisible = Mem_Alloc(r_main_mempool, r_refdef.viewcache.world_numsurfaces);
        }
 }
 
@@ -6839,9 +6838,9 @@ void R_AnimCache_UpdateEntityMeshBuffers(entity_render_t *ent, int numvertices)
 {
        int i;
        if (!ent->animcache_vertexmesh && ent->animcache_normal3f)
-               ent->animcache_vertexmesh = (r_vertexmesh_t *)R_FrameData_Alloc(sizeof(r_vertexmesh_t)*numvertices);
+               ent->animcache_vertexmesh = R_FrameData_Alloc(sizeof(r_vertexmesh_t)*numvertices);
        if (!ent->animcache_vertexposition)
-               ent->animcache_vertexposition = (r_vertexposition_t *)R_FrameData_Alloc(sizeof(r_vertexposition_t)*numvertices);
+               ent->animcache_vertexposition = R_FrameData_Alloc(sizeof(r_vertexposition_t)*numvertices);
        if (ent->animcache_vertexposition)
        {
                for (i = 0;i < numvertices;i++)
@@ -6884,11 +6883,11 @@ qboolean R_AnimCache_GetEntity(entity_render_t *ent, qboolean wantnormals, qbool
                        {
                                numvertices = model->surfmesh.num_vertices;
                                if (wantnormals)
-                                       ent->animcache_normal3f = (float *)R_FrameData_Alloc(sizeof(float[3])*numvertices);
+                                       ent->animcache_normal3f = R_FrameData_Alloc(sizeof(float[3])*numvertices);
                                if (wanttangents)
                                {
-                                       ent->animcache_svector3f = (float *)R_FrameData_Alloc(sizeof(float[3])*numvertices);
-                                       ent->animcache_tvector3f = (float *)R_FrameData_Alloc(sizeof(float[3])*numvertices);
+                                       ent->animcache_svector3f = R_FrameData_Alloc(sizeof(float[3])*numvertices);
+                                       ent->animcache_tvector3f = R_FrameData_Alloc(sizeof(float[3])*numvertices);
                                }
                                if (!r_framedata_failed)
                                {
@@ -6905,13 +6904,13 @@ qboolean R_AnimCache_GetEntity(entity_render_t *ent, qboolean wantnormals, qbool
                        return false;
                // get some memory for this entity and generate mesh data
                numvertices = model->surfmesh.num_vertices;
-               ent->animcache_vertex3f = (float *)R_FrameData_Alloc(sizeof(float[3])*numvertices);
+               ent->animcache_vertex3f = R_FrameData_Alloc(sizeof(float[3])*numvertices);
                if (wantnormals)
-                       ent->animcache_normal3f = (float *)R_FrameData_Alloc(sizeof(float[3])*numvertices);
+                       ent->animcache_normal3f = R_FrameData_Alloc(sizeof(float[3])*numvertices);
                if (wanttangents)
                {
-                       ent->animcache_svector3f = (float *)R_FrameData_Alloc(sizeof(float[3])*numvertices);
-                       ent->animcache_tvector3f = (float *)R_FrameData_Alloc(sizeof(float[3])*numvertices);
+                       ent->animcache_svector3f = R_FrameData_Alloc(sizeof(float[3])*numvertices);
+                       ent->animcache_tvector3f = R_FrameData_Alloc(sizeof(float[3])*numvertices);
                }
                if (!r_framedata_failed)
                {
@@ -7608,7 +7607,7 @@ static void R_Water_StartFrame(void)
        r_waterstate.numwaterplanes = 0;
 }
 
-void R_Water_AddWaterPlane(msurface_t *surface, int entno)
+void R_Water_AddWaterPlane(msurface_t *surface)
 {
        int triangleindex, planeindex;
        const int *e;
@@ -9424,7 +9423,7 @@ texture_t *R_GetCurrentTexture(texture_t *t)
                        r_qwskincache_size = cl.maxclients;
                        if (r_qwskincache)
                                Mem_Free(r_qwskincache);
-                       r_qwskincache = (r_qwskincache_t *)Mem_Alloc(r_main_mempool, sizeof(*r_qwskincache) * r_qwskincache_size);
+                       r_qwskincache = Mem_Alloc(r_main_mempool, sizeof(*r_qwskincache) * r_qwskincache_size);
                }
                if (strcmp(r_qwskincache[i].name, cl.scores[i].qw_skin))
                        R_LoadQWSkin(&r_qwskincache[i], cl.scores[i].qw_skin);
@@ -12283,7 +12282,7 @@ static void R_DecalSystem_SpawnTriangle(decalsystem_t *decalsystem, const float
                qboolean useshortelements;
                decalsystem->maxdecals = max(16, decalsystem->maxdecals * 2);
                useshortelements = decalsystem->maxdecals * 3 <= 65536;
-               decalsystem->decals = (tridecal_t *)Mem_Alloc(cls.levelmempool, decalsystem->maxdecals * (sizeof(tridecal_t) + sizeof(float[3][3]) + sizeof(float[3][2]) + sizeof(float[3][4]) + sizeof(int[3]) + (useshortelements ? sizeof(unsigned short[3]) : 0)));
+               decalsystem->decals = Mem_Alloc(cls.levelmempool, decalsystem->maxdecals * (sizeof(tridecal_t) + sizeof(float[3][3]) + sizeof(float[3][2]) + sizeof(float[3][4]) + sizeof(int[3]) + (useshortelements ? sizeof(unsigned short[3]) : 0)));
                decalsystem->color4f = (float *)(decalsystem->decals + decalsystem->maxdecals);
                decalsystem->texcoord2f = (float *)(decalsystem->color4f + decalsystem->maxdecals*12);
                decalsystem->vertex3f = (float *)(decalsystem->texcoord2f + decalsystem->maxdecals*6);
index 8e23844526144775821b0dfbcfa53c034cbffdb1..c358bf593d2c6a1450dee39bcb246a97d5bc6efb 100644 (file)
@@ -1037,7 +1037,7 @@ static rtexture_t *R_SetupTexture(rtexturepool_t *rtexturepool, const char *iden
        qglGenTextures(1, (GLuint *)&glt->texnum);CHECKGLERROR
        R_Upload(glt, data, 0, 0, 0, glt->inputwidth, glt->inputheight, glt->inputdepth);
        if ((glt->flags & TEXF_ALLOWUPDATES) && gl_nopartialtextureupdates.integer)
-               glt->bufferpixels = (unsigned char *)Mem_Alloc(texturemempool, glt->tilewidth*glt->tileheight*glt->tiledepth*glt->sides*glt->bytesperpixel);
+               glt->bufferpixels = Mem_Alloc(texturemempool, glt->tilewidth*glt->tileheight*glt->tiledepth*glt->sides*glt->bytesperpixel);
 
        // texture converting and uploading can take a while, so make sure we're sending keepalives
        CL_KeepaliveMessage(false);
@@ -1154,7 +1154,7 @@ int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qboolean skipunco
                mipinfo[mip][3] = ddssize;
                ddssize += mipinfo[mip][2];
        }
-       dds = (unsigned char *)Mem_Alloc(tempmempool, ddssize);
+       dds = Mem_Alloc(tempmempool, ddssize);
        if (!dds)
                return -4;
        dds_caps1 = 0x1000; // DDSCAPS_TEXTURE
index 0934d5959d0d3b57ad1f470fe9582e880b4a4c17..068caa699c92718b34ca9baa6da0e623efb6df00 100644 (file)
@@ -2491,7 +2491,7 @@ void Host_PQRcon_f (void)
                SZ_Clear(&net_message);
                MSG_WriteLong (&net_message, 0);
                MSG_WriteByte (&net_message, CCREQ_RCON);
-               SZ_Write(&net_message, (const unsigned char*)rcon_password.string, n);
+               SZ_Write(&net_message, (void*)rcon_password.string, n);
                MSG_WriteByte (&net_message, 0); // terminate the (possibly partial) string
                MSG_WriteString (&net_message, Cmd_Args());
                StoreBigLong(net_message.data, NETFLAG_CTL | (net_message.cursize & NETFLAG_LENGTH_MASK));
diff --git a/image.c b/image.c
index bec68ec591a2036b020eca44826aa4b7303dbd15..4e4572ab1f2f090e860572c56ac57c1235a37a1e 100644 (file)
--- a/image.c
+++ b/image.c
@@ -804,7 +804,7 @@ void Image_MakeLinearColorsFromsRGB(unsigned char *pout, const unsigned char *pi
        // this math from http://www.opengl.org/registry/specs/EXT/texture_sRGB.txt
        if (!image_linearfromsrgb[255])
                for (i = 0;i < 256;i++)
-                       image_linearfromsrgb[i] = i < 11 ? (int)(i / 12.92f) : (int)(pow((i/256.0f + 0.055f)/1.0555f, 2.4f)*256.0f);
+                       image_linearfromsrgb[i] = i < 11 ? (int)(i / 12.92f) : (int)(pow((i/256.0f + 0.055f)/1.0555f, 2.4)*256.0f);
        for (i = 0;i < numpixels;i++)
        {
                pout[i*4+0] = image_linearfromsrgb[pin[i*4+0]];
diff --git a/lhnet.c b/lhnet.c
index 2ba0fcfe743ef2513754790e657d283012725395..99b9f144f941d9a3c1459c0ac781e1130c901773 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -2,7 +2,6 @@
 // Written by Forest Hale 2003-06-15 and placed into public domain.
 
 #ifdef WIN32
-#pragma comment(lib, "ws2_32.lib")
 # ifdef SUPPORTIPV6
 // Windows XP or higher is required for getaddrinfo, but the inclusion of wspiapi provides fallbacks for older versions
 # define _WIN32_WINNT 0x0501
index bb6b1888201a7e0eccb6d240a87b96d9f4efeeec..8db8ec9d572d5eaa851cfe8801bae1170a1f2e4f 100644 (file)
@@ -1333,8 +1333,8 @@ void R_Q1BSP_LoadSplitSky (unsigned char *src, int width, int height, int bytesp
        int x, y;
        int w = width/2;
        int h = height;
-       unsigned int *solidpixels = (unsigned int *)Mem_Alloc(tempmempool, w*h*sizeof(unsigned char[4]));
-       unsigned int *alphapixels = (unsigned int *)Mem_Alloc(tempmempool, w*h*sizeof(unsigned char[4]));
+       unsigned *solidpixels = Mem_Alloc(tempmempool, w*h*sizeof(unsigned char[4]));
+       unsigned *alphapixels = Mem_Alloc(tempmempool, w*h*sizeof(unsigned char[4]));
 
        // allocate a texture pool if we need it
        if (loadmodel->texturepool == NULL && cls.state != ca_dedicated)
@@ -1576,9 +1576,9 @@ static void Mod_Q1BSP_LoadTextures(lump_t *l)
                        // LordHavoc: HL sky textures are entirely different than quake
                        if (!loadmodel->brush.ishlbsp && !strncmp(tx->name, "sky", 3) && mtwidth == mtheight * 2)
                        {
-                               data = loadimagepixelsbgra(gamemode == GAME_TENEBRAE ? tx->name : va("textures/%s/%s", mapname, tx->name), false, false, r_texture_convertsRGB_skin.integer != 0, NULL);
+                               data = loadimagepixelsbgra(gamemode == GAME_TENEBRAE ? tx->name : va("textures/%s/%s", mapname, tx->name), false, false, r_texture_convertsRGB_skin.integer, NULL);
                                if (!data)
-                                       data = loadimagepixelsbgra(gamemode == GAME_TENEBRAE ? tx->name : va("textures/%s", tx->name), false, false, r_texture_convertsRGB_skin.integer != 0, NULL);
+                                       data = loadimagepixelsbgra(gamemode == GAME_TENEBRAE ? tx->name : va("textures/%s", tx->name), false, false, r_texture_convertsRGB_skin.integer, NULL);
                                if (data && image_width == image_height * 2)
                                {
                                        R_Q1BSP_LoadSplitSky(data, image_width, image_height, 4);
@@ -2454,8 +2454,8 @@ static void Mod_Q1BSP_LoadFaces(lump_t *l)
                                        loadmodel->texturepool = R_AllocTexturePool();
                                // could not find room, make a new lightmap
                                loadmodel->brushq3.num_mergedlightmaps = lightmapnumber + 1;
-                               loadmodel->brushq3.data_lightmaps = (rtexture_t **)Mem_Realloc(loadmodel->mempool, loadmodel->brushq3.data_lightmaps, loadmodel->brushq3.num_mergedlightmaps * sizeof(loadmodel->brushq3.data_lightmaps[0]));
-                               loadmodel->brushq3.data_deluxemaps = (rtexture_t **)Mem_Realloc(loadmodel->mempool, loadmodel->brushq3.data_deluxemaps, loadmodel->brushq3.num_mergedlightmaps * sizeof(loadmodel->brushq3.data_deluxemaps[0]));
+                               loadmodel->brushq3.data_lightmaps = Mem_Realloc(loadmodel->mempool, loadmodel->brushq3.data_lightmaps, loadmodel->brushq3.num_mergedlightmaps * sizeof(loadmodel->brushq3.data_lightmaps[0]));
+                               loadmodel->brushq3.data_deluxemaps = Mem_Realloc(loadmodel->mempool, loadmodel->brushq3.data_deluxemaps, loadmodel->brushq3.num_mergedlightmaps * sizeof(loadmodel->brushq3.data_deluxemaps[0]));
                                loadmodel->brushq3.data_lightmaps[lightmapnumber] = lightmaptexture = R_LoadTexture2D(loadmodel->texturepool, va("lightmap%i", lightmapnumber), lightmapsize, lightmapsize, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_ALLOWUPDATES, -1, NULL);
                                if (loadmodel->brushq1.nmaplightdata)
                                        loadmodel->brushq3.data_deluxemaps[lightmapnumber] = deluxemaptexture = R_LoadTexture2D(loadmodel->texturepool, va("deluxemap%i", lightmapnumber), lightmapsize, lightmapsize, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_ALLOWUPDATES, -1, NULL);
@@ -3182,7 +3182,7 @@ static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node)
        if (portalpointsbuffersize < portalpointsbufferoffset + 6*MAX_PORTALPOINTS)
        {
                portalpointsbuffersize = portalpointsbufferoffset * 2;
-               portalpointsbuffer = (double *)Mem_Realloc(loadmodel->mempool, portalpointsbuffer, portalpointsbuffersize * sizeof(*portalpointsbuffer));
+               portalpointsbuffer = Mem_Realloc(loadmodel->mempool, portalpointsbuffer, portalpointsbuffersize * sizeof(*portalpointsbuffer));
        }
        frontpoints = portalpointsbuffer + portalpointsbufferoffset;
        portalpointsbufferoffset += 3*MAX_PORTALPOINTS;
@@ -3315,7 +3315,7 @@ static void Mod_Q1BSP_MakePortals(void)
        Mem_ExpandableArray_NewArray(&portalarray, loadmodel->mempool, sizeof(portal_t), 1020*1024/sizeof(portal_t));
        portalpointsbufferoffset = 0;
        portalpointsbuffersize = 6*MAX_PORTALPOINTS*128;
-       portalpointsbuffer = (double *)Mem_Alloc(loadmodel->mempool, portalpointsbuffersize * sizeof(*portalpointsbuffer));
+       portalpointsbuffer = Mem_Alloc(loadmodel->mempool, portalpointsbuffersize * sizeof(*portalpointsbuffer));
        Mod_Q1BSP_RecursiveNodePortals(loadmodel->brush.data_nodes + loadmodel->brushq1.hulls[0].firstclipnode);
        Mem_Free(portalpointsbuffer);
        portalpointsbuffer = NULL;
@@ -5096,8 +5096,8 @@ static void Mod_Q3BSP_LoadFaces(lump_t *l)
        Mod_AllocSurfMesh(loadmodel->mempool, meshvertices, meshtriangles, false, true, false);
        if (collisiontriangles)
        {
-               loadmodel->brush.data_collisionvertex3f = (float *)Mem_Alloc(loadmodel->mempool, collisionvertices * sizeof(float[3]));
-               loadmodel->brush.data_collisionelement3i = (int *)Mem_Alloc(loadmodel->mempool, collisiontriangles * sizeof(int[3]));
+               loadmodel->brush.data_collisionvertex3f = Mem_Alloc(loadmodel->mempool, collisionvertices * sizeof(float[3]));
+               loadmodel->brush.data_collisionelement3i = Mem_Alloc(loadmodel->mempool, collisiontriangles * sizeof(int[3]));
        }
        meshvertices = 0;
        meshtriangles = 0;
@@ -6743,7 +6743,7 @@ bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces, bih_t
                return NULL;
 
        // allocate the memory for the BIH leaf nodes
-       bihleafs = (bih_leaf_t *)Mem_Alloc(loadmodel->mempool, sizeof(bih_leaf_t) * bihnumleafs);
+       bihleafs = Mem_Alloc(loadmodel->mempool, sizeof(bih_leaf_t) * bihnumleafs);
 
        // now populate the BIH leaf nodes
        bihleafindex = 0;
@@ -6811,8 +6811,8 @@ bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces, bih_t
 
        // allocate buffers for the produced and temporary data
        bihmaxnodes = bihnumleafs - 1;
-       bihnodes = (bih_node_t *)Mem_Alloc(loadmodel->mempool, sizeof(bih_node_t) * bihmaxnodes);
-       temp_leafsort = (int *)Mem_Alloc(loadmodel->mempool, sizeof(int) * bihnumleafs * 2);
+       bihnodes = Mem_Alloc(loadmodel->mempool, sizeof(bih_node_t) * bihmaxnodes);
+       temp_leafsort = Mem_Alloc(loadmodel->mempool, sizeof(int) * bihnumleafs * 2);
        temp_leafsortscratch = temp_leafsort + bihnumleafs;
 
        // now build it
@@ -6825,7 +6825,7 @@ bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces, bih_t
        if (out->maxnodes > out->numnodes)
        {
                out->maxnodes = out->numnodes;
-               out->nodes = (bih_node_t *)Mem_Realloc(loadmodel->mempool, out->nodes, out->numnodes * sizeof(bih_node_t));
+               out->nodes = Mem_Realloc(loadmodel->mempool, out->nodes, out->numnodes * sizeof(bih_node_t));
        }
 
        return out;
@@ -7459,12 +7459,12 @@ void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend)
        loadmodel->radius2 = modelradius * modelradius;
 
        // allocate storage for triangles
-       loadmodel->surfmesh.data_element3i = (int *)Mem_Alloc(loadmodel->mempool, numtriangles * sizeof(int[3]));
+       loadmodel->surfmesh.data_element3i = Mem_Alloc(loadmodel->mempool, numtriangles * sizeof(int[3]));
        // allocate vertex hash structures to build an optimal vertex subset
        vertexhashsize = numtriangles*2;
-       vertexhashtable = (int *)Mem_Alloc(loadmodel->mempool, sizeof(int) * vertexhashsize);
+       vertexhashtable = Mem_Alloc(loadmodel->mempool, sizeof(int) * vertexhashsize);
        memset(vertexhashtable, 0xFF, sizeof(int) * vertexhashsize);
-       vertexhashdata = (objvertex_t *)Mem_Alloc(loadmodel->mempool, sizeof(*vertexhashdata) * numtriangles*3);
+       vertexhashdata = Mem_Alloc(loadmodel->mempool, sizeof(*vertexhashdata) * numtriangles*3);
        vertexhashcount = 0;
 
        // gather surface stats for assigning vertex/triangle ranges
index 146ac008b539bf69613c4dfa32a3b89727b6d00e..5cd6890da5ad6ca7847d28f4db9a9a8df968aed0 100644 (file)
@@ -701,7 +701,7 @@ void Mod_BuildTriangleNeighbors(int *neighbors, const int *elements, int numtria
        edgehashentry_t *edgehashentries, *hash;
        if (!numtriangles)
                return;
-       edgehash = (edgehashentry_t **)Mem_Alloc(tempmempool, TRIANGLEEDGEHASH * sizeof(*edgehash));
+       edgehash = Mem_Alloc(tempmempool, TRIANGLEEDGEHASH * sizeof(*edgehash));
        // if there are too many triangles for the stack array, allocate larger buffer
        edgehashentries = (edgehashentry_t *)Mem_Alloc(tempmempool, numtriangles * 3 * sizeof(edgehashentry_t));
        // find neighboring triangles
@@ -3250,7 +3250,7 @@ void Mod_AllocLightmap_Init(mod_alloclightmap_state_t *state, int width, int hei
        state->width = width;
        state->height = height;
        state->currentY = 0;
-       state->rows = (mod_alloclightmap_row_t *)Mem_Alloc(loadmodel->mempool, state->height * sizeof(*state->rows));
+       state->rows = Mem_Alloc(loadmodel->mempool, state->height * sizeof(*state->rows));
        for (y = 0;y < state->height;y++)
        {
                state->rows[y].currentX = 0;
@@ -3482,7 +3482,7 @@ static void Mod_GenerateLightmaps_CreateLights_ComputeSVBSP(dp_model_t *model, l
        VectorSet(mins, lightinfo->origin[0] - lightinfo->radius, lightinfo->origin[1] - lightinfo->radius, lightinfo->origin[2] - lightinfo->radius);
        VectorSet(maxs, lightinfo->origin[0] + lightinfo->radius, lightinfo->origin[1] + lightinfo->radius, lightinfo->origin[2] + lightinfo->radius);
        VectorCopy(lightinfo->origin, origin);
-       nodes = (svbsp_node_t *)Mem_Alloc(tempmempool, maxnodes * sizeof(*nodes));
+       nodes = Mem_Alloc(tempmempool, maxnodes * sizeof(*nodes));
        for (;;)
        {
                SVBSP_Init(&svbsp, origin, maxnodes, nodes);
@@ -3496,14 +3496,14 @@ static void Mod_GenerateLightmaps_CreateLights_ComputeSVBSP(dp_model_t *model, l
                                return;
                        }
                        Mem_Free(nodes);
-                       nodes = (svbsp_node_t *)Mem_Alloc(tempmempool, maxnodes * sizeof(*nodes));
+                       nodes = Mem_Alloc(tempmempool, maxnodes * sizeof(*nodes));
                }
                else
                        break;
        }
        if (svbsp.numnodes > 0)
        {
-               svbsp.nodes = (svbsp_node_t *)Mem_Alloc(tempmempool, svbsp.numnodes * sizeof(*nodes));
+               svbsp.nodes = Mem_Alloc(tempmempool, svbsp.numnodes * sizeof(*nodes));
                memcpy(svbsp.nodes, nodes, svbsp.numnodes * sizeof(*nodes));
                lightinfo->svbsp = svbsp;
        }
@@ -3529,7 +3529,7 @@ static void Mod_GenerateLightmaps_CreateLights(dp_model_t *model)
        }
        if (mod_generatelightmaps_numlights > 0)
        {
-               mod_generatelightmaps_lightinfo = (lightmaplight_t *)Mem_Alloc(tempmempool, mod_generatelightmaps_numlights * sizeof(*mod_generatelightmaps_lightinfo));
+               mod_generatelightmaps_lightinfo = Mem_Alloc(tempmempool, mod_generatelightmaps_numlights * sizeof(*mod_generatelightmaps_lightinfo));
                lightinfo = mod_generatelightmaps_lightinfo;
                for (index = 0;;index++)
                {
@@ -3880,7 +3880,7 @@ static void Mod_GenerateLightmaps_CreateTriangleInformation(dp_model_t *model)
        const int *e;
        lightmaptriangle_t *triangle;
        // generate lightmap triangle structs
-       mod_generatelightmaps_lightmaptriangles = (lightmaptriangle_t *)Mem_Alloc(model->mempool, model->surfmesh.num_triangles * sizeof(lightmaptriangle_t));
+       mod_generatelightmaps_lightmaptriangles = Mem_Alloc(model->mempool, model->surfmesh.num_triangles * sizeof(lightmaptriangle_t));
        for (surfaceindex = 0;surfaceindex < model->num_surfaces;surfaceindex++)
        {
                surface = model->data_surfaces + surfaceindex;
@@ -4035,10 +4035,10 @@ static void Mod_GenerateLightmaps_CreateLightmaps(dp_model_t *model)
        model->brushq3.deluxemapping_modelspace = true;
        model->brushq3.deluxemapping = true;
        model->brushq3.num_mergedlightmaps = lightmapnumber;
-       model->brushq3.data_lightmaps = (rtexture_t **)Mem_Alloc(model->mempool, model->brushq3.num_mergedlightmaps * sizeof(rtexture_t *));
-       model->brushq3.data_deluxemaps = (rtexture_t **)Mem_Alloc(model->mempool, model->brushq3.num_mergedlightmaps * sizeof(rtexture_t *));
-       lightmappixels = (unsigned char *)Mem_Alloc(tempmempool, model->brushq3.num_mergedlightmaps * lm_texturesize * lm_texturesize * 4);
-       deluxemappixels = (unsigned char *)Mem_Alloc(tempmempool, model->brushq3.num_mergedlightmaps * lm_texturesize * lm_texturesize * 4);
+       model->brushq3.data_lightmaps = Mem_Alloc(model->mempool, model->brushq3.num_mergedlightmaps * sizeof(rtexture_t *));
+       model->brushq3.data_deluxemaps = Mem_Alloc(model->mempool, model->brushq3.num_mergedlightmaps * sizeof(rtexture_t *));
+       lightmappixels = Mem_Alloc(tempmempool, model->brushq3.num_mergedlightmaps * lm_texturesize * lm_texturesize * 4);
+       deluxemappixels = Mem_Alloc(tempmempool, model->brushq3.num_mergedlightmaps * lm_texturesize * lm_texturesize * 4);
        for (surfaceindex = 0;surfaceindex < model->num_surfaces;surfaceindex++)
        {
                surface = model->data_surfaces + surfaceindex;
index 20f06119cdf96879b73baafeced6edaf75ad924c..9417e076164c10dc9f31cc637bb0123d7512dd36 100644 (file)
@@ -188,7 +188,7 @@ void VM_UpdateEdictSkeleton(prvm_edict_t *ed, const dp_model_t *edmodel, const f
                ed->priv.server->skeleton.model = edmodel;
        }
        if (!ed->priv.server->skeleton.relativetransforms && ed->priv.server->skeleton.model && ed->priv.server->skeleton.model->num_bones)
-               ed->priv.server->skeleton.relativetransforms = (matrix4x4_t *)Mem_Alloc(prog->progs_mempool, ed->priv.server->skeleton.model->num_bones * sizeof(matrix4x4_t));
+               ed->priv.server->skeleton.relativetransforms = Mem_Alloc(prog->progs_mempool, ed->priv.server->skeleton.model->num_bones * sizeof(matrix4x4_t));
        if (ed->priv.server->skeleton.relativetransforms)
        {
                int skeletonindex = -1;
@@ -6366,13 +6366,13 @@ void animatemodel(dp_model_t *model, prvm_edict_t *ed)
        need |= (animatemodel_cache.model != model);
        VM_GenerateFrameGroupBlend(ed->priv.server->framegroupblend, ed);
        VM_FrameBlendFromFrameGroupBlend(ed->priv.server->frameblend, ed->priv.server->framegroupblend, model);
-       need |= (memcmp(&animatemodel_cache.frameblend, &ed->priv.server->frameblend, sizeof(ed->priv.server->frameblend))) != 0;
+       need |= (memcmp(&animatemodel_cache.frameblend, &ed->priv.server->frameblend, sizeof(ed->priv.server->frameblend)));
        if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.skeletonindex))) skeletonindex = (int)val->_float - 1;
        if (!(skeletonindex >= 0 && skeletonindex < MAX_EDICTS && (skeleton = prog->skeletons[skeletonindex]) && skeleton->model->num_bones == ed->priv.server->skeleton.model->num_bones))
                skeleton = NULL;
        need |= (animatemodel_cache.skeleton_p != skeleton);
        if(skeleton)
-               need |= (memcmp(&animatemodel_cache.skeleton, skeleton, sizeof(ed->priv.server->skeleton))) != 0;
+               need |= (memcmp(&animatemodel_cache.skeleton, skeleton, sizeof(ed->priv.server->skeleton)));
        if(!need)
                return;
        if(model->surfmesh.num_vertices > animatemodel_cache.max_vertices)
@@ -6382,10 +6382,10 @@ void animatemodel(dp_model_t *model, prvm_edict_t *ed)
                if(animatemodel_cache.buf_svector3f) Mem_Free(animatemodel_cache.buf_svector3f);
                if(animatemodel_cache.buf_tvector3f) Mem_Free(animatemodel_cache.buf_tvector3f);
                if(animatemodel_cache.buf_normal3f) Mem_Free(animatemodel_cache.buf_normal3f);
-               animatemodel_cache.buf_vertex3f = (float *)Mem_Alloc(prog->progs_mempool, sizeof(float[3]) * animatemodel_cache.max_vertices);
-               animatemodel_cache.buf_svector3f = (float *)Mem_Alloc(prog->progs_mempool, sizeof(float[3]) * animatemodel_cache.max_vertices);
-               animatemodel_cache.buf_tvector3f = (float *)Mem_Alloc(prog->progs_mempool, sizeof(float[3]) * animatemodel_cache.max_vertices);
-               animatemodel_cache.buf_normal3f = (float *)Mem_Alloc(prog->progs_mempool, sizeof(float[3]) * animatemodel_cache.max_vertices);
+               animatemodel_cache.buf_vertex3f = Mem_Alloc(prog->progs_mempool, sizeof(float[3]) * animatemodel_cache.max_vertices);
+               animatemodel_cache.buf_svector3f = Mem_Alloc(prog->progs_mempool, sizeof(float[3]) * animatemodel_cache.max_vertices);
+               animatemodel_cache.buf_tvector3f = Mem_Alloc(prog->progs_mempool, sizeof(float[3]) * animatemodel_cache.max_vertices);
+               animatemodel_cache.buf_normal3f = Mem_Alloc(prog->progs_mempool, sizeof(float[3]) * animatemodel_cache.max_vertices);
        }
        animatemodel_cache.data_vertex3f = animatemodel_cache.buf_vertex3f;
        animatemodel_cache.data_svector3f = animatemodel_cache.buf_svector3f;
index b46f636ec0e5430c370ef1f16ffd7442fe721a05..d93e979616b823c3f5b9f9ca84f199c5535fbff2 100644 (file)
@@ -1182,7 +1182,7 @@ void PRVM_ED_EdictGet_f(void)
        }
 
        v = (prvm_eval_t *)(ed->fields.vp + key->ofs);
-       s = PRVM_UglyValueString((etype_t)key->type, v);
+       s = PRVM_UglyValueString(key->type, v);
        if(Cmd_Argc() == 5)
        {
                cvar_t *cvar = Cvar_FindVar(Cmd_Argv(4));
@@ -1227,7 +1227,7 @@ void PRVM_ED_GlobalGet_f(void)
        }
 
        v = (prvm_eval_t *) &prog->globals.generic[key->ofs];
-       s = PRVM_UglyValueString((etype_t)key->type, v);
+       s = PRVM_UglyValueString(key->type, v);
        if(Cmd_Argc() == 4)
        {
                cvar_t *cvar = Cvar_FindVar(Cmd_Argv(3));
@@ -1896,7 +1896,7 @@ po_t *PRVM_PO_Load(const char *filename, mempool_t *pool)
        if(!buf)
                return NULL;
 
-       po = (po_t *)Mem_Alloc(pool, sizeof(*po));
+       po = Mem_Alloc(pool, sizeof(*po));
        memset(po, 0, sizeof(*po));
 
        p = buf;
@@ -1960,16 +1960,16 @@ po_t *PRVM_PO_Load(const char *filename, mempool_t *pool)
                {
                        if(thisstr.key)
                                Mem_Free(thisstr.key);
-                       thisstr.key = (char *)Mem_Alloc(pool, decodedpos + 1);
+                       thisstr.key = Mem_Alloc(pool, decodedpos + 1);
                        memcpy(thisstr.key, decodedbuf, decodedpos + 1);
                }
                else if(decodedpos > 0 && thisstr.key) // skip empty translation results
                {
-                       thisstr.value = (char *)Mem_Alloc(pool, decodedpos + 1);
+                       thisstr.value = Mem_Alloc(pool, decodedpos + 1);
                        memcpy(thisstr.value, decodedbuf, decodedpos + 1);
                        hashindex = CRC_Block((const unsigned char *) thisstr.key, strlen(thisstr.key)) % PO_HASHSIZE;
                        thisstr.nextonhashchain = po->hashtable[hashindex];
-                       po->hashtable[hashindex] = (po_string_t *)Mem_Alloc(pool, sizeof(thisstr));
+                       po->hashtable[hashindex] = Mem_Alloc(pool, sizeof(thisstr));
                        memcpy(po->hashtable[hashindex], &thisstr, sizeof(thisstr));
                        memset(&thisstr, 0, sizeof(thisstr));
                }
index d778e789b1eefbf4a6b30ca21cd302209bfc7ca9..9f0ee258ee132d278ae6b241aba74ba402b00f72 100644 (file)
@@ -2135,7 +2135,7 @@ static void R_Shadow_MakeShadowMap(int side, int size)
                Cvar_SetValueQuick(&r_shadow_deferred, 0);
        }
 }
-
+       
 void R_Shadow_RenderMode_ShadowMap(int side, int clear, int size)
 {
        float nearclip, farclip, bias;
diff --git a/r_sky.c b/r_sky.c
index 388316ac4fab05051befc2f4d6c9dd6df5755490..fd7e9ecb8cc952b162d3ee2cdac1aebbfd60db2d 100644 (file)
--- a/r_sky.c
+++ b/r_sky.c
@@ -109,13 +109,13 @@ int R_LoadSkyBox(void)
                success = 0;
                for (i=0; i<6; i++)
                {
-                       if (dpsnprintf(name, sizeof(name), "%s_%s", skyname, suffix[j][i].suffix) < 0 || !(image_buffer = loadimagepixelsbgra(name, false, false, r_texture_convertsRGB_skybox.integer != 0, NULL)))
+                       if (dpsnprintf(name, sizeof(name), "%s_%s", skyname, suffix[j][i].suffix) < 0 || !(image_buffer = loadimagepixelsbgra(name, false, false, r_texture_convertsRGB_skybox.integer, NULL)))
                        {
-                               if (dpsnprintf(name, sizeof(name), "%s%s", skyname, suffix[j][i].suffix) < 0 || !(image_buffer = loadimagepixelsbgra(name, false, false, r_texture_convertsRGB_skybox.integer != 0, NULL)))
+                               if (dpsnprintf(name, sizeof(name), "%s%s", skyname, suffix[j][i].suffix) < 0 || !(image_buffer = loadimagepixelsbgra(name, false, false, r_texture_convertsRGB_skybox.integer, NULL)))
                                {
-                                       if (dpsnprintf(name, sizeof(name), "env/%s%s", skyname, suffix[j][i].suffix) < 0 || !(image_buffer = loadimagepixelsbgra(name, false, false, r_texture_convertsRGB_skybox.integer != 0, NULL)))
+                                       if (dpsnprintf(name, sizeof(name), "env/%s%s", skyname, suffix[j][i].suffix) < 0 || !(image_buffer = loadimagepixelsbgra(name, false, false, r_texture_convertsRGB_skybox.integer, NULL)))
                                        {
-                                               if (dpsnprintf(name, sizeof(name), "gfx/env/%s%s", skyname, suffix[j][i].suffix) < 0 || !(image_buffer = loadimagepixelsbgra(name, false, false, r_texture_convertsRGB_skybox.integer != 0, NULL)))
+                                               if (dpsnprintf(name, sizeof(name), "gfx/env/%s%s", skyname, suffix[j][i].suffix) < 0 || !(image_buffer = loadimagepixelsbgra(name, false, false, r_texture_convertsRGB_skybox.integer, NULL)))
                                                        continue;
                                        }
                                }
index 35cb8beed1a93bd463875344772d14e7ad04847d..698d6a452472ba3c870234ecd2dce3b22e60f253 100644 (file)
@@ -2838,7 +2838,7 @@ static void VM_SV_skel_create(void)
                        break;
        if (i == MAX_EDICTS)
                return;
-       prog->skeletons[i] = skeleton = (skeleton_t *)Mem_Alloc(cls.levelmempool, sizeof(skeleton_t) + model->num_bones * sizeof(matrix4x4_t));
+       prog->skeletons[i] = skeleton = Mem_Alloc(cls.levelmempool, sizeof(skeleton_t) + model->num_bones * sizeof(matrix4x4_t));
        PRVM_G_FLOAT(OFS_RETURN) = i + 1;
        skeleton->model = model;
        skeleton->relativetransforms = (matrix4x4_t *)(skeleton+1);
index ce45820b4c689ca705d97f3d5956cb38e4cd0cbd..e9211f424ac9c86d282200045aba41e571c807ef 100644 (file)
@@ -10,7 +10,6 @@
 # include <windows.h>
 # include <mmsystem.h> // timeGetTime
 # include <time.h> // localtime
-#pragma comment(lib, "winmm.lib")
 #else
 # include <unistd.h>
 # include <fcntl.h>
diff --git a/vid.h b/vid.h
index 540a0c429286cc1923ac1610937b8ed3822b3c0d..b5ffc050a953e86c32ce67b9edb100bb97041868 100644 (file)
--- a/vid.h
+++ b/vid.h
@@ -182,7 +182,7 @@ extern qboolean isG200;
 extern qboolean isRagePro;
 
 void *GL_GetProcAddress(const char *name);
-qboolean GL_CheckExtension(const char *minglver_or_ext, const dllfunction_t *funcs, const char *disableparm, int silent);
+int GL_CheckExtension(const char *minglver_or_ext, const dllfunction_t *funcs, const char *disableparm, int silent);
 
 void VID_Shared_Init(void);
 
index 20f2b3e1dd3dd8f74e0b5d2226c8924b1cc98bc5..eb6c56d47acbd0aa5d099c70a1a2cbb268f92e57 100644 (file)
@@ -389,7 +389,7 @@ void (GLAPIENTRY *qglGetQueryObjectuivARB)(GLuint qid, GLenum pname, GLuint *par
 #define sscanf sscanf_s
 #endif
 
-qboolean GL_CheckExtension(const char *minglver_or_ext, const dllfunction_t *funcs, const char *disableparm, int silent)
+int GL_CheckExtension(const char *minglver_or_ext, const dllfunction_t *funcs, const char *disableparm, int silent)
 {
        int failed = false;
        const dllfunction_t *func;
@@ -1227,13 +1227,13 @@ int VID_Mode(int fullscreen, int width, int height, int bpp, float refreshrate,
 {
        viddef_mode_t mode;
        memset(&mode, 0, sizeof(mode));
-       mode.fullscreen = fullscreen != 0;
+       mode.fullscreen = fullscreen;
        mode.width = width;
        mode.height = height;
        mode.bitsperpixel = bpp;
        mode.refreshrate = vid_userefreshrate.integer ? max(1, refreshrate) : 0;
-       mode.userefreshrate = vid_userefreshrate.integer != 0;
-       mode.stereobuffer = stereobuffer != 0;
+       mode.userefreshrate = vid_userefreshrate.integer;
+       mode.stereobuffer = stereobuffer;
        mode.samples = samples;
        cl_ignoremousemoves = 2;
        if (VID_InitMode(&mode))
index 1b9e758d3dcb524d09833a1bd044b4bdbd8e7c23..1902eef76d7a3c1f71296175105f979621d3a255 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -19,8 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 // vid_wgl.c -- NT GL vid component
 
-#pragma comment(lib, "comctl32.lib")
-
 #ifdef SUPPORTDIRECTX
 // Include DX libs
 #pragma comment(lib, "dinput8.lib")
diff --git a/zone.c b/zone.c
index 7c601cf0918986fd3aec2590ea740b5ee9813d79..43774da6468fbaaeeec60ec8993944a245772ed7 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -860,7 +860,7 @@ void Memory_Init (void)
 {
        static union {unsigned short s;unsigned char b[2];} u;
        u.s = 0x100;
-       mem_bigendian = u.b[0] != 0;
+       mem_bigendian = u.b[0];
 
        sentinel_seed = rand();
        poolchain = NULL;