fix a severe texture corruption and crash case when using vid_dx9 1 is used with...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 17 Apr 2013 02:46:57 +0000 (02:46 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 17 Apr 2013 02:46:57 +0000 (02:46 +0000)
work around a crash when using vid_dx9 1 with vid_stereobuffer 1 (this needs a better fix, D3D9 does not support this)
fix a warning in C++ where a bit flag mask was being passed as a bool

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11942 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
gl_textures.c
snd_main.c

index 7d47664..2a7af7d 100644 (file)
@@ -2597,7 +2597,7 @@ void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup)
        if (qglDrawBuffer)
                qglDrawBuffer(GL_BACK);
        SCR_DrawLoadingScreen_SharedSetup(clear);
-       if (vid.stereobuffer)
+       if (vid.stereobuffer && qglDrawBuffer)
        {
                qglDrawBuffer(GL_BACK_LEFT);
                SCR_DrawLoadingScreen(clear);
index 57c257f..2dd11eb 100644 (file)
@@ -1624,7 +1624,7 @@ static rtexture_t *R_SetupTexture(rtexturepool_t *rtexturepool, const char *iden
                case TEXTYPE_SRGB_DXT1A:   textype = TEXTYPE_DXT1A  ;convertsRGB = true;break;
                case TEXTYPE_SRGB_DXT3:    textype = TEXTYPE_DXT3   ;convertsRGB = true;break;
                case TEXTYPE_SRGB_DXT5:    textype = TEXTYPE_DXT5   ;convertsRGB = true;break;
-               case TEXTYPE_SRGB_PALETTE: textype = TEXTYPE_PALETTE;convertsRGB = true;break;
+               case TEXTYPE_SRGB_PALETTE: textype = TEXTYPE_PALETTE;/*convertsRGB = true;*/break;
                case TEXTYPE_SRGB_RGBA:    textype = TEXTYPE_RGBA   ;convertsRGB = true;break;
                case TEXTYPE_SRGB_BGRA:    textype = TEXTYPE_BGRA   ;convertsRGB = true;break;
                default:
index 7788a77..ab3ff1a 100644 (file)
@@ -1695,7 +1695,7 @@ int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, ve
                                S_SetChannelSpeed(ch_idx, fspeed);
                                for(i = 1; i > 0 && (i <= flags || i <= (int) channels[ch_idx].flags); i <<= 1)
                                        if((flags ^ channels[ch_idx].flags) & i)
-                                               S_SetChannelFlag(ch_idx, i, flags & i);
+                                               S_SetChannelFlag(ch_idx, i, (flags & i) != 0);
                                ch->distfade = attenuation / snd_soundradius.value;
                                SND_Spatialize(ch, false);
                                return ch_idx;