]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge pull request #49 from mrwonko/FloatingWindowWorkaround
authorTimothee "TTimo" Besset <ttimo@ttimo.net>
Sun, 6 May 2012 18:20:31 +0000 (11:20 -0700)
committerTimothee "TTimo" Besset <ttimo@ttimo.net>
Sun, 6 May 2012 18:20:31 +0000 (11:20 -0700)
Workaround for broken floating windows

plugins/model/cpicosurface.cpp
radiant/preferences.cpp
radiant/preferences.h

index da88eb58a6ad6d518ed0661d5af513d1c938305b..470623fa65670aeb7124f7267a4e853e86b00f6c 100644 (file)
@@ -48,12 +48,18 @@ void CPicoSurface::Draw( int state, IShader *pShader, int rflags ){
 
        if ( !( rflags & ( DRAW_RF_SEL_OUTLINE | DRAW_RF_SEL_FILL | DRAW_RF_XY ) ) ) {
                if ( state & DRAW_GL_TEXTURE_2D ) {
+                       bool bTrans = ( pShader->getFlags() & QER_TRANS ) == QER_TRANS;
+                       bool bDrawBlend = ( state & DRAW_GL_BLEND ) == DRAW_GL_BLEND;
+                       //only draw transparent stuff when in transparent stuff pass and vice versa
+                       if(bTrans != bDrawBlend) {
+                               return;
+                       }
                        g_QglTable.m_pfn_qglBindTexture( GL_TEXTURE_2D, pShader->getTexture()->texture_number );
                        if ( ( rflags & DRAW_RF_CAM ) && ( pShader->getFlags() & QER_ALPHAFUNC ) ) {
                                int nFunc = 0;
                                float fRef = 0.f;
 
-                               g_QglTable.m_pfn_qglColor4f( 1.f, 1.f, 1.f, 1.f ); // identity
+                               g_QglTable.m_pfn_qglColor4f( 1.f, 1.f, 1.f, pShader->getTrans() ); // transparency
 
                                g_QglTable.m_pfn_qglEnable( GL_ALPHA_TEST );
 
index 430c751fac7136b18ea300825b1817e697102d6f..9d70e344661caf6998a80f378c8952360a0e0e02 100644 (file)
@@ -2701,7 +2701,7 @@ void PrefsDlg::BuildDialog(){
 
 // end new prefs dialog
 
-void PrefsDlg::LoadTexdefPref( texdef_t* pTexdef, char* pName ){
+void PrefsDlg::LoadTexdefPref( texdef_t* pTexdef, const char* pName ){
        char buffer[256];
 
        memset( pTexdef, 0, sizeof( texdef_t ) );
@@ -3411,8 +3411,40 @@ void CGameInstall::Run() {
        if(CheckFile(gameFilePath) != PATH_DIRECTORY) {
                radCreateDirectory(gameFilePath);
        }
-       gameFilePath += m_strName.GetBuffer();
-       gameFilePath += ".game";
+
+       switch ( m_availGames[ m_nComboSelect ] ) {
+       case GAME_Q2:
+               gameFilePath += "q2.game";
+               break;
+       case GAME_Q3:
+               gameFilePath += "q3.game";
+               break;
+       case GAME_URT:
+               gameFilePath += "urt.game";
+               break;
+       case GAME_UFOAI:
+               gameFilePath += "ufoai.game";
+               break;
+       case GAME_Q2W:
+               gameFilePath += "q2w.game";
+               break;
+       case GAME_WARSOW:
+               gameFilePath += "warsow.game";
+               break;
+       case GAME_NEXUIZ:
+               gameFilePath += "nexuiz.game";
+               break;
+       case GAME_TREMULOUS:
+               gameFilePath += "tremulous.game";
+               break;
+       case GAME_JA:
+               gameFilePath += "ja.game";
+               break;
+       case GAME_REACTION:
+               gameFilePath += "reaction.game";
+               break;
+       }
+
        Sys_Printf( "game file: %s\n", gameFilePath.GetBuffer() );
 
        FILE * fg = fopen( gameFilePath.GetBuffer(), "w" );
index 9a120766d6531b55fcc91d7295fe12b42c7b1e78..6aad97dde5c653a909b20b708f088efcfef8c3da 100644 (file)
@@ -494,7 +494,7 @@ void UpdateNvidiaAeroHack();
 
 void LoadPrefs();
 void SavePrefs();
-void LoadTexdefPref( texdef_t* pTexdef, char* pName );
+void LoadTexdefPref( texdef_t* pTexdef, const char* pName );
 
 PrefsDlg ();
 virtual ~PrefsDlg (){