- Updated Windows build doc, very slight revision. Changed 37 targets to 38.
authorrambetter <rambetter>
Thu, 3 Mar 2011 15:51:44 +0000 (15:51 +0000)
committerrambetter <rambetter>
Thu, 3 Mar 2011 15:51:44 +0000 (15:51 +0000)
- Added plugins/imagehl to list of modules built (both Windows and Linux).
    Not really sure what this does, but it's the only module (as defined by
    stuff in plugins/ or contrib/) that exists and isn't currently part of the
    build.
- The code to disable desktop composition in Windows has been moved from start
    of main() to an option in Preferences.  The pref reads as follows:
    "NVIDIA/Aero bug - disable Windows composition".  It is enabled by default.
- Color themes controlled by "Misc" -> "Colors" -> "Themes" options are now
    saved as soon as you select them.  The color theme is no longer clobbered
    when opening Preferences.
- The ATI broken driver (bug #802) pref has been reworded since it applies to
    Intel cards as well.  Before:
    "ATI cards with broken drivers - bug #802".  After:
    "ATI and Intel cards w/ buggy drivers (disappearing polygons)".

git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@479 8a3a26a2-13c4-0310-b231-cf6edde360e5

config.py
plugins/imagehl/imagehl.def
plugins/imagehl/imagehl.vcproj [new file with mode: 0644]
plugins/imagehl/imagehl.vcproj.out-of-date [deleted file]
radiant.sln
radiant/main.cpp
radiant/mainframe.cpp
radiant/preferences.cpp
radiant/preferences.h
windows_compile_guide/index.html

index ae94c878c5ad0bc5548c711ca84bec01f624b020..fa042a7e282f329281150f328ab689ff31c80d3e 100644 (file)
--- a/config.py
+++ b/config.py
@@ -105,6 +105,7 @@ class Config:
                                         'plugins/model/model.vcproj',
                                         'plugins/imagepng/imagepng.vcproj',
                                         'plugins/imagewal/imagewal.vcproj',
+                                        'plugins/imagehl/imagehl.vcproj',
                                         'plugins/imagem8/imagem8.vcproj',
                                         'plugins/spritemodel/spritemodel.vcproj',
                                         'plugins/textool/textool.vcproj',
index 0e4eb0812ee5c4d490fb45b8cb3f64b038031111..518667f3cf5a89ca5bd39f81edc3e0114908b5c9 100644 (file)
@@ -1,7 +1,6 @@
 ; hlimage.def : Declares the module parameters for the DLL.
 
 LIBRARY      "ImageHL"
-DESCRIPTION  'ImageHL Windows Dynamic Link Library'
 
 EXPORTS
     ; Explicit exports can go here
diff --git a/plugins/imagehl/imagehl.vcproj b/plugins/imagehl/imagehl.vcproj
new file mode 100644 (file)
index 0000000..e30ec13
--- /dev/null
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="imagehl"\r
+       ProjectGUID="{BA1BC409-744B-4270-8E47-BA10872313AD}"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="0"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)\install\modules"\r
+                       IntermediateDirectory="$(SolutionDir)\build\intermediate\$(ConfigurationName)\$(ProjectName)"\r
+                       ConfigurationType="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\..\STLport-5.2.1\stlport&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\include\libxml2&quot;"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IMAGEHL_EXPORTS;"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                               DisableSpecificWarnings="4996;4101"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="glib-2.0.lib libxml2.lib synapse.lib"\r
+                               AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\gtk-2.16.6\lib&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"\r
+                               ModuleDefinitionFile="imagehl.def"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)\install\modules"\r
+                       IntermediateDirectory="$(SolutionDir)\build\intermediate\$(ConfigurationName)\$(ProjectName)"\r
+                       ConfigurationType="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               AdditionalIncludeDirectories="&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\..\STLport-5.2.1\stlport&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk-2.16.6\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\include\libxml2&quot;"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IMAGEHL_EXPORTS;"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                               DisableSpecificWarnings="4996;4101"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="glib-2.0.lib libxml2.lib synapse.lib"\r
+                               AdditionalLibraryDirectories="&quot;$(SolutionDir)\..\gtk-2.16.6\lib&quot;;&quot;$(SolutionDir)\..\libxml2-2.7.3\lib&quot;;&quot;$(SolutionDir)\build\$(ConfigurationName)\libs&quot;"\r
+                               ModuleDefinitionFile="imagehl.def"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="src"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\imagehl.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\imagehl.def"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\lbmlib.cpp"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/plugins/imagehl/imagehl.vcproj.out-of-date b/plugins/imagehl/imagehl.vcproj.out-of-date
deleted file mode 100644 (file)
index 82301e0..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" ?><VisualStudioProject Name="imagehl" ProjectGUID="{65D02375-63EE-4A8A-9F8E-504B1D5A1D02}" ProjectType="Visual C++" RootNamespace="imagehl" Version="8.00">
-       <Platforms>
-               <Platform Name="Win32"/>
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration CharacterSet="2" ConfigurationType="1" IntermediateDirectory="$(ConfigurationName)" Name="Debug|Win32" OutputDirectory="$(SolutionDir)\install\modules">
-                       <Tool Name="VCPreBuildEventTool"/>
-                       <Tool Name="VCCustomBuildTool"/>
-                       <Tool Name="VCXMLDataGeneratorTool"/>
-                       <Tool Name="VCWebServiceProxyGeneratorTool"/>
-                       <Tool Name="VCMIDLTool"/>
-                       <Tool AdditionalIncludeDirectories="&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\..\STLPort\stlport&quot;;&quot;$(SolutionDir)\..\gtk2\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\libxml2\include&quot;" BasicRuntimeChecks="3" DebugInformationFormat="4" Detect64BitPortabilityProblems="true" DisableSpecificWarnings="4996;4244;4267" MinimalRebuild="true" Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="3" WarningLevel="3"/>
-                       <Tool Name="VCManagedResourceCompilerTool"/>
-                       <Tool Name="VCResourceCompilerTool"/>
-                       <Tool Name="VCPreLinkEventTool"/>
-                       <Tool GenerateDebugInformation="true" Name="VCLinkerTool" TargetMachine="1"/>
-                       <Tool Name="VCALinkTool"/>
-                       <Tool Name="VCManifestTool"/>
-                       <Tool Name="VCXDCMakeTool"/>
-                       <Tool Name="VCBscMakeTool"/>
-                       <Tool Name="VCFxCopTool"/>
-                       <Tool Name="VCAppVerifierTool"/>
-                       <Tool Name="VCWebDeploymentTool"/>
-                       <Tool Name="VCPostBuildEventTool"/>
-               </Configuration>
-               <Configuration CharacterSet="2" ConfigurationType="1" IntermediateDirectory="$(ConfigurationName)" Name="Release|Win32" OutputDirectory="$(SolutionDir)\install\modules">
-                       <Tool Name="VCPreBuildEventTool"/>
-                       <Tool Name="VCCustomBuildTool"/>
-                       <Tool Name="VCXMLDataGeneratorTool"/>
-                       <Tool Name="VCWebServiceProxyGeneratorTool"/>
-                       <Tool Name="VCMIDLTool"/>
-                       <Tool AdditionalIncludeDirectories="&quot;$(SolutionDir)\include&quot;;&quot;$(SolutionDir)\libs&quot;;&quot;$(SolutionDir)\..\STLPort\stlport&quot;;&quot;$(SolutionDir)\..\gtk2\include&quot;;&quot;$(SolutionDir)\..\gtk2\include\glib-2.0&quot;;&quot;$(SolutionDir)\..\gtk2\lib\glib-2.0\include&quot;;&quot;$(SolutionDir)\..\libxml2\include&quot;" DebugInformationFormat="3" Detect64BitPortabilityProblems="true" DisableSpecificWarnings="4996;4244;4267" Name="VCCLCompilerTool" PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="2" WarningLevel="3"/>
-                       <Tool Name="VCManagedResourceCompilerTool"/>
-                       <Tool Name="VCResourceCompilerTool"/>
-                       <Tool Name="VCPreLinkEventTool"/>
-                       <Tool EnableCOMDATFolding="2" GenerateDebugInformation="true" Name="VCLinkerTool" OptimizeReferences="2" TargetMachine="1"/>
-                       <Tool Name="VCALinkTool"/>
-                       <Tool Name="VCManifestTool"/>
-                       <Tool Name="VCXDCMakeTool"/>
-                       <Tool Name="VCBscMakeTool"/>
-                       <Tool Name="VCFxCopTool"/>
-                       <Tool Name="VCAppVerifierTool"/>
-                       <Tool Name="VCWebDeploymentTool"/>
-                       <Tool Name="VCPostBuildEventTool"/>
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <Filter Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" Name="Source Files">
-                       <File RelativePath=".\imagehl.cpp">
-                       </File>
-                       <File RelativePath=".\imagehl.def">
-                       </File>
-                       <File RelativePath=".\lbmlib.cpp">
-                       </File>
-               </Filter>
-               <Filter Filter="h;hpp;hxx;hm;inl;fi;fd" Name="Header Files">
-                       <File RelativePath=".\imagehl.h">
-                       </File>
-                       <File RelativePath=".\lbmlib.h">
-                       </File>
-               </Filter>
-               <Filter Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;txt" Name="Resource Files">
-                       <File RelativePath=".\imagehl.txt">
-                       </File>
-               </Filter>
-               <File RelativePath=".\Conscript">
-               </File>
-       </Files>
-       <Globals>
-       </Globals>
-</VisualStudioProject>
\ No newline at end of file
index 9561a1db40a73e8c800ab1e1820ee161e5dca8ea..430e2bd5d8cc4a6839bca63db0c2eef1e5bd7cb2 100644 (file)
@@ -112,6 +112,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imagewal", "plugins\imagewa
                {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF}
        EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imagehl", "plugins\imagehl\imagehl.vcproj", "{BA1BC409-744B-4270-8E47-BA10872313AD}"
+       ProjectSection(ProjectDependencies) = postProject
+               {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF}
+       EndProjectSection
+EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imagem8", "plugins\imagem8\imagem8.vcproj", "{C6FA63AA-5F37-4D43-BE6B-09903E70C9E1}"
        ProjectSection(ProjectDependencies) = postProject
                {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF}
@@ -274,6 +279,10 @@ Global
                {8D3160AB-B386-4970-8146-826BC293CCB1}.Debug|Win32.Build.0 = Debug|Win32
                {8D3160AB-B386-4970-8146-826BC293CCB1}.Release|Win32.ActiveCfg = Release|Win32
                {8D3160AB-B386-4970-8146-826BC293CCB1}.Release|Win32.Build.0 = Release|Win32
+               {BA1BC409-744B-4270-8E47-BA10872313AD}.Debug|Win32.ActiveCfg = Debug|Win32
+               {BA1BC409-744B-4270-8E47-BA10872313AD}.Debug|Win32.Build.0 = Debug|Win32
+               {BA1BC409-744B-4270-8E47-BA10872313AD}.Release|Win32.ActiveCfg = Release|Win32
+               {BA1BC409-744B-4270-8E47-BA10872313AD}.Release|Win32.Build.0 = Release|Win32
                {C6FA63AA-5F37-4D43-BE6B-09903E70C9E1}.Debug|Win32.ActiveCfg = Debug|Win32
                {C6FA63AA-5F37-4D43-BE6B-09903E70C9E1}.Debug|Win32.Build.0 = Debug|Win32
                {C6FA63AA-5F37-4D43-BE6B-09903E70C9E1}.Release|Win32.ActiveCfg = Release|Win32
index a6e19296fa293d748107d692dee82ef830f75713..0d6d566871da140551184d90f52084f613c87672 100644 (file)
@@ -429,32 +429,6 @@ int main( int argc, char* argv[] ) {
        char *libgl, *ptr;
        int i, j, k;
 
-  /*
-    Rambetter on Fri Jan 21, 2011:
-
-    People with recent NVIDIA cards and Windows 7 (Aero) are complaining about "hall of mirrors"
-    effect in the OpenGL viewports.  The code below is borrowed from NetRadiant to address
-    this issue.  This change turns off desktop compositing (globally) while Radiant is running.
-    It's a real hack but the "correct" fix is very involving, so until the underlying problem
-    is addressed we need this code here.  I don't know for sure what the underlying problem is,
-    but I have a hunch it's the version of gtkglext.dll we're using.
-  */
-
-#ifdef _WIN32
-  HMODULE lib;
-  lib = LoadLibrary("dwmapi.dll");
-  if (lib != 0)
-  {
-    void (WINAPI *qDwmEnableComposition) (bool bEnable) =
-      (void (WINAPI *) (bool bEnable)) GetProcAddress(lib, "DwmEnableComposition");
-    if (qDwmEnableComposition)
-    {
-      qDwmEnableComposition(FALSE);
-    }
-    FreeLibrary(lib);
-  }
-#endif
-
 
   /*
     Rambetter on Sat Nov 13, 2010:
index b3d75c881947a095eea8a99eb331a55a5cb7e152..5c05dae9f25311cf4958abb032c9a953f2296877 100644 (file)
@@ -5960,6 +5960,7 @@ void MainFrame::OnColorSetoriginal()
   g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][1] = 0.0f;
   g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][2] = 0.0f;
 
+  g_PrefsDlg.SavePrefs();
   Sys_UpdateWindows (W_ALL);
 }
 
@@ -6002,6 +6003,7 @@ void MainFrame::OnColorSetqer()
   g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][1] = 0.0f;
   g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][2] = 0.0f;
 
+  g_PrefsDlg.SavePrefs();
   Sys_UpdateWindows (W_ALL);
 }
 
@@ -6047,6 +6049,7 @@ void MainFrame::OnColorSetblack()
   g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][1] = 0.0f;
   g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][2] = 0.0f;
 
+  g_PrefsDlg.SavePrefs();
   Sys_UpdateWindows (W_ALL);
 }
 
@@ -6090,6 +6093,7 @@ void MainFrame::OnColorSetydnar()
   g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][1] = 0.0f;
   g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES3D][2] = 0.0f;
 
+  g_PrefsDlg.SavePrefs();
   Sys_UpdateWindows (W_ALL);
 }
 
index 3ac20c260da0a3133548a74845aae09c6aaba9cd..f85075bdfdd6ae6a48164d6e31f6393d0b2a78fd 100644 (file)
@@ -148,7 +148,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define TEXTURECOMPRESSIONFORMAT_KEY "TextureCompressionFormat"
 #define LIGHTRADIUS_KEY "LightRadiuses"
 #define Q3MAP2TEX_KEY "Q3Map2Tex"
+
+#ifdef ATIHACK_812
 #define ATIHACK_KEY "ATIHack"
+#endif
+
+#ifdef NVIDIA_AERO_HACK
+#define NVAEROHACK_KEY "NvidiaAeroHack"
+#endif
 
 // window stuff
 #define ENTITYSPLIT1_KEY  "EntitySplit1"
@@ -687,7 +694,11 @@ PrefsDlg::PrefsDlg ()
   m_nLightRadiuses = 1;
   m_bQ3Map2Texturing = TRUE;
 #ifdef ATIHACK_812
-       m_bGlATIHack = FALSE;
+  m_bGlATIHack = FALSE;
+#endif
+#ifdef NVIDIA_AERO_HACK
+  m_bGlNvidiaAeroHack = TRUE;
+  m_bGlNvidiaAeroHackPrevState = -1; // -1 is uninitialized, 0 is FALSE, 1 is TRUE
 #endif
 }
 
@@ -1818,11 +1829,18 @@ void PrefsDlg::BuildDialog ()
   g_list_free (combo_list);
 
 #ifdef ATIHACK_812
-       // ATI bugs
-       check = gtk_check_button_new_with_label (_("ATI cards with broken drivers - bug #802"));
-       gtk_widget_show(check);
-       gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
-       AddDialogData(check, &m_bGlATIHack, DLG_CHECK_BOOL);
+  // ATI bugs
+  check = gtk_check_button_new_with_label (_("ATI and Intel cards w/ buggy drivers (disappearing polygons)"));
+  gtk_widget_show(check);
+  gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
+  AddDialogData(check, &m_bGlATIHack, DLG_CHECK_BOOL);
+#endif
+
+#ifdef NVIDIA_AERO_HACK
+  check = gtk_check_button_new_with_label (_("NVIDIA/Aero bug - disable Windows composition"));
+  gtk_widget_show(check);
+  gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
+  AddDialogData(check, &m_bGlNvidiaAeroHack, DLG_CHECK_BOOL);
 #endif
 
   // Add the page to the notebook
@@ -2859,6 +2877,40 @@ void PrefsDlg::UpdateATIHack() {
 }
 #endif
 
+#ifdef NVIDIA_AERO_HACK
+void PrefsDlg::UpdateNvidiaAeroHack() {
+  if (m_bGlNvidiaAeroHack && m_bGlNvidiaAeroHackPrevState == 1) { return; }
+  if ((!m_bGlNvidiaAeroHack) && m_bGlNvidiaAeroHackPrevState == 0) { return; }
+  if ((!m_bGlNvidiaAeroHack) && m_bGlNvidiaAeroHackPrevState < 0) {
+    // The hack state is uninitialized, meaning that this is the first call
+    // to this function.  I prefer not to explicitly enable composition because
+    // the user may have set the application to disable it, and I don't want to
+    // override that.  Leave the state of composition as-is if the hack checkbox
+    // isn't checked.
+    m_bGlNvidiaAeroHackPrevState = 0;
+    return;
+  }
+  HMODULE lib = LoadLibrary("dwmapi.dll");
+  if (lib) {
+    void (WINAPI *qDwmEnableComposition) (bool bEnable) =
+      (void (WINAPI *) (bool bEnable)) GetProcAddress(lib, "DwmEnableComposition");
+    if (qDwmEnableComposition) {
+      if (m_bGlNvidiaAeroHack) {
+        Sys_Printf("Disabling Windows composition\n");
+        qDwmEnableComposition(0);
+        m_bGlNvidiaAeroHackPrevState = 1;
+      }
+      else {
+        Sys_Printf("Enabling Windows composition\n");
+        qDwmEnableComposition(1);
+        m_bGlNvidiaAeroHackPrevState = 0;
+      }
+    }
+    FreeLibrary(lib);
+  }
+}
+#endif
+
 // TTimo: m_strEnginePath has a special status, if not found in registry we need to
 // initiliaze it for sure. It is not totally failsafe but we can use the same
 // code than in q3map, expecting to find some "quake" above us. If not, we prompt
@@ -3139,6 +3191,10 @@ void PrefsDlg::LoadPrefs ()
        mLocalPrefs.GetPref(ATIHACK_KEY, &m_bGlATIHack, FALSE);
 #endif
 
+#ifdef NVIDIA_AERO_HACK
+  mLocalPrefs.GetPref(NVAEROHACK_KEY, &m_bGlNvidiaAeroHack, TRUE);
+#endif
+
   Undo_SetMaxSize(m_nUndoLevels); // set it internally as well / FIXME: why not just have one global value?
 
   UpdateTextureCompression();
@@ -3147,6 +3203,10 @@ void PrefsDlg::LoadPrefs ()
   UpdateATIHack();
 #endif
 
+#ifdef NVIDIA_AERO_HACK
+  UpdateNvidiaAeroHack();
+#endif
+
   if (mLocalPrefs.mbEmpty)
   {
     mLocalPrefs.mbEmpty = false;
@@ -3191,9 +3251,12 @@ void PrefsDlg::PostModal (int code)
     SavePrefs();
     // make sure the logfile is ok
     Sys_LogFile();
-    #ifdef ATIHACK_812
-      UpdateATIHack();
-    #endif
+#ifdef ATIHACK_812
+    UpdateATIHack();
+#endif
+#ifdef NVIDIA_AERO_HACK
+    UpdateNvidiaAeroHack();
+#endif
     if (g_pParentWnd)
       g_pParentWnd->SetGridStatus();
     Sys_UpdateWindows(W_ALL);
index 1b2e0469b32f46b466a24a43adeb268e4c22541f..51c9ccb4e903247523be8038eff05af7d5390476 100644 (file)
@@ -26,6 +26,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "gtkr_list.h"
 //#include "profile.h"
 
+#ifdef _WIN32
+#define NVIDIA_AERO_HACK
+#endif
+
 #define MAX_TEXTURE_QUALITY 3
 
 enum PrefTypes_t
@@ -485,6 +489,10 @@ public:
   void UpdateATIHack();
 #endif
 
+#ifdef NVIDIA_AERO_HACK
+  void UpdateNvidiaAeroHack();
+#endif
+
   void LoadPrefs();
   void SavePrefs();
   void LoadTexdefPref(texdef_t* pTexdef, char* pName);
@@ -687,7 +695,12 @@ public:
   bool m_bQ3Map2Texturing;
 
 #ifdef ATIHACK_812
-       bool m_bGlATIHack;
+  bool m_bGlATIHack;
+#endif
+
+#ifdef NVIDIA_AERO_HACK
+  bool m_bGlNvidiaAeroHack;
+  int m_bGlNvidiaAeroHackPrevState;
 #endif
 
   void UpdateData (bool retrieve);
index ece766a95f708693e9c82ec67c984f572d788f78..bb850bc35e2772bba621427461d496e497335516 100644 (file)
@@ -313,7 +313,7 @@ $ <b>scons target=setup</b>
       of Visual C++:</p>
     <blockquote>
       <pre width="80" style="background: #CCCCCC; padding: 2mm; border-style: ridge">radiant - 0 error(s), 0 warning(s)
-========== Build: 37 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
+========== Build: 38 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
 </pre>
     </blockquote>
     <hr />