]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix compile errors and warnings in MSVC
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 1 Nov 2011 03:32:36 +0000 (03:32 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 1 Nov 2011 03:32:36 +0000 (03:32 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11503 d7cf8633-e32d-0410-b094-e92efae38249

csprogs.c
darkplaces-dedicated.vcproj
darkplaces-sdl.vcproj
darkplaces-wgl.vcproj
gl_rmain.c
gl_textures.c
snd_main.c
sys_shared.c
vid_shared.c

index 79af0570f09565a1f0f247f9d648e60766db6a2a..732b6517c9b7df33f9974e2dc5c6f1a3b781c7bf 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -967,9 +967,9 @@ extern cvar_t csqc_usedemoprogs;
 void CL_VM_Init (void)
 {
        prvm_prog_t *prog = CLVM_prog;
-       const char* csprogsfn;
+       const char* csprogsfn = NULL;
        unsigned char *csprogsdata = NULL;
-       fs_offset_t csprogsdatasize;
+       fs_offset_t csprogsdatasize = 0;
        int csprogsdatacrc, requiredcrc;
        int requiredsize;
        char vabuf[1024];
index 3910650f62c9863f93a0f4e8a690c3c4e907a3f1..b96bdd594a03f4a4456c684e61b22d8658da8e79 100755 (executable)
                                RelativePath=".\cl_dyntexture.c"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath=".\cl_gecko.c"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath=".\cl_input.c"\r
                                >\r
index 123c8384e1918649bd76f685ab06f12c4bf99a5b..aeebb0d8d6b99361952369d15db8d7cde1d2ced4 100755 (executable)
                                RelativePath=".\cl_dyntexture.c"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath=".\cl_gecko.c"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath=".\cl_input.c"\r
                                >\r
index fd905ff23088966780285a4b215296bc40fc1887..00a9beadb8ab6d3007a08c53bddec6372d46f0d5 100644 (file)
                                RelativePath=".\cl_dyntexture.c"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath=".\cl_gecko.c"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath=".\cl_input.c"\r
                                >\r
index 5dbeea5002c4a509d062ba2b61aee88cd74a4353..1142ef25fae0477e1112c08a077d7c69e196da8c 100644 (file)
@@ -2656,7 +2656,7 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting,
                if (permutation & SHADERPERMUTATION_DEFERREDLIGHTMAP  ) R_Mesh_TexBind(GL20TU_SCREENSPECULAR    , r_shadow_prepasslightingspeculartexture             );
                if (rsurface.rtlight || (r_shadow_usingshadowmaportho && !(rsurface.ent_flags & RENDER_NOSELFSHADOW)))
                {
-                       R_Mesh_TexBind(GL20TU_SHADOWMAP2D, r_shadow_shadowmap2dcolortexture);
+                       R_Mesh_TexBind(GL20TU_SHADOWMAP2D, r_shadow_shadowmap2ddepthtexture);
                        if (rsurface.rtlight)
                        {
                                if (permutation & SHADERPERMUTATION_CUBEFILTER        ) R_Mesh_TexBind(GL20TU_CUBE              , rsurface.rtlight->currentcubemap                    );
@@ -3028,9 +3028,9 @@ void R_SetupShader_DeferredLight(const rtlight_t *rtlight)
                R_SetupShader_SetPermutationHLSL(mode, permutation);
                hlslPSSetParameter3f(D3DPSREGISTER_LightPosition, viewlightorigin[0], viewlightorigin[1], viewlightorigin[2]);
                hlslPSSetParameter16f(D3DPSREGISTER_ViewToLight, viewtolight16f);
-               hlslPSSetParameter3f(D3DPSREGISTER_DeferredColor_Ambient , lightcolorbase[0] * ambientscale  * range, lightcolorbase[1] * ambientscale  * range, lightcolorbase[2] * ambientscale  * range);
-               hlslPSSetParameter3f(D3DPSREGISTER_DeferredColor_Diffuse , lightcolorbase[0] * diffusescale  * range, lightcolorbase[1] * diffusescale  * range, lightcolorbase[2] * diffusescale  * range);
-               hlslPSSetParameter3f(D3DPSREGISTER_DeferredColor_Specular, lightcolorbase[0] * specularscale * range, lightcolorbase[1] * specularscale * range, lightcolorbase[2] * specularscale * range);
+               hlslPSSetParameter3f(D3DPSREGISTER_DeferredColor_Ambient , lightcolorbase[0] * ambientscale , lightcolorbase[1] * ambientscale , lightcolorbase[2] * ambientscale );
+               hlslPSSetParameter3f(D3DPSREGISTER_DeferredColor_Diffuse , lightcolorbase[0] * diffusescale , lightcolorbase[1] * diffusescale , lightcolorbase[2] * diffusescale );
+               hlslPSSetParameter3f(D3DPSREGISTER_DeferredColor_Specular, lightcolorbase[0] * specularscale, lightcolorbase[1] * specularscale, lightcolorbase[2] * specularscale);
                hlslPSSetParameter2f(D3DPSREGISTER_ShadowMap_TextureScale, r_shadow_shadowmap_texturescale[0], r_shadow_shadowmap_texturescale[1]);
                hlslPSSetParameter4f(D3DPSREGISTER_ShadowMap_Parameters, r_shadow_shadowmap_parameters[0], r_shadow_shadowmap_parameters[1], r_shadow_shadowmap_parameters[2], r_shadow_shadowmap_parameters[3]);
                hlslPSSetParameter1f(D3DPSREGISTER_SpecularPower, (r_shadow_gloss.integer == 2 ? r_shadow_gloss2exponent.value : r_shadow_glossexponent.value) * (r_shadow_glossexact.integer ? 0.25f : 1.0f) - 1.0f);
@@ -3040,7 +3040,7 @@ void R_SetupShader_DeferredLight(const rtlight_t *rtlight)
                R_Mesh_TexBind(GL20TU_ATTENUATION        , r_shadow_attenuationgradienttexture                 );
                R_Mesh_TexBind(GL20TU_SCREENNORMALMAP    , r_shadow_prepassgeometrynormalmaptexture            );
                R_Mesh_TexBind(GL20TU_CUBE               , rsurface.rtlight->currentcubemap                    );
-               R_Mesh_TexBind(GL20TU_SHADOWMAP2D        , r_shadow_shadowmap2dcolortexture                    );
+               R_Mesh_TexBind(GL20TU_SHADOWMAP2D        , r_shadow_shadowmap2ddepthtexture                    );
                R_Mesh_TexBind(GL20TU_CUBEPROJECTION     , r_shadow_shadowmapvsdcttexture                      );
 #endif
                break;
@@ -5974,7 +5974,7 @@ static void R_Bloom_StartFrame(void)
        switch (vid.renderpath)
        {
        case RENDERPATH_GL20:
-               r_fb.usedepthtextures = r_usedepthtextures.integer;
+               r_fb.usedepthtextures = r_usedepthtextures.integer != 0;
                if (vid.support.ext_framebuffer_object)
                {
                        if (r_viewfbo.integer == 2) textype = TEXTYPE_COLORBUFFER16F;
index a24c9067b8dfac780cd2542734237fa982a15b7b..37c135edc45807fd14b62908a691e65ae55fe7c4 100644 (file)
@@ -1964,7 +1964,9 @@ rtexture_t *R_LoadTextureRenderBuffer(rtexturepool_t *rtexturepool, const char *
                        case TEXTYPE_COLORBUFFER: d3dformat = D3DFMT_A8R8G8B8;glt->d3disrendertargetsurface = true;break;
                        case TEXTYPE_COLORBUFFER16F: d3dformat = D3DFMT_A16B16G16R16F;glt->d3disrendertargetsurface = true;break;
                        case TEXTYPE_COLORBUFFER32F: d3dformat = D3DFMT_A32B32G32R32F;glt->d3disrendertargetsurface = true;break;
-                       case TEXTYPE_DEPTHBUFFER: d3dformat = D3DFMT_D24S8;glt->d3disdepthstencilsurface = true;break;
+                       case TEXTYPE_DEPTHBUFFER16: d3dformat = D3DFMT_D16;glt->d3disdepthstencilsurface = true;break;
+                       case TEXTYPE_DEPTHBUFFER24: d3dformat = D3DFMT_D24X8;glt->d3disdepthstencilsurface = true;break;
+                       case TEXTYPE_DEPTHBUFFER24STENCIL8: d3dformat = D3DFMT_D24S8;glt->d3disdepthstencilsurface = true;break;
                        default: d3dformat = D3DFMT_A8R8G8B8;Sys_Error("R_LoadTextureRenderbuffer: unsupported texture type %i when picking D3DFMT", (int)textype);break;
                        }
                        glt->d3dformat = d3dformat;
index 09a132926145c3e7734188b16be3b3ee710253aa..23f1bca77213635bb98057989ba9f59cfb193a50 100644 (file)
@@ -1476,7 +1476,7 @@ static void SND_Spatialize_WithSfx(channel_t *ch, qboolean isstatic, sfx_t *sfx)
                f = dist * ch->distfade;
 
                f =
-                       ((snd_attenuation_exponent.value == 0) ? 1.0 : pow(1.0 - min(1.0, f), snd_attenuation_exponent.value))
+                       ((snd_attenuation_exponent.value == 0) ? 1.0 : pow(1.0 - min(1.0, f), (double)snd_attenuation_exponent.value))
                        *
                        ((snd_attenuation_decibel.value == 0) ? 1.0 : pow(0.1, 0.1 * snd_attenuation_decibel.value * f));
 
index bcbc727d902e04074befee164b481592563ea36d..d033323a9d0f161be28698dea7bf3ef0d0bac411 100644 (file)
@@ -450,6 +450,7 @@ void Sys_PrintfToTerminal(const char *fmt, ...)
        Sys_PrintToTerminal(msg);
 }
 
+#ifndef WIN32
 static const char *Sys_FindInPATH(const char *name, char namesep, const char *PATH, char pathsep, char *buf, size_t bufsize)
 {
        const char *p = PATH;
@@ -472,6 +473,7 @@ static const char *Sys_FindInPATH(const char *name, char namesep, const char *PA
        }
        return name;
 }
+#endif
 
 static const char *Sys_FindExecutableName(void)
 {
index f9c56e2c4c44291d78284d87fcc8ea835a99aadb..85d3ec372091a986ddc3a655de0d39d54a441541 100644 (file)
@@ -1411,7 +1411,7 @@ void VID_BuildGammaTables(unsigned short *ramps, int rampsize)
        {
                int i;
                for(i = 0; i < 3*rampsize; ++i)
-                       ramps[i] = (int)floor(bound(0.0f, Image_sRGBFloatFromLinearFloat(ramps[i] / 65535.0), 1.0f) * 65535.0 + 0.5);
+                       ramps[i] = (int)floor(bound(0.0f, Image_sRGBFloatFromLinearFloat(ramps[i] / 65535.0f), 1.0f) * 65535.0f + 0.5f);
        }
 
        // LordHavoc: this code came from Ben Winslow and Zinx Verituse, I have