diff --git a/include/qerplugin.h b/include/qerplugin.h index a4389408..48f877c8 100644 --- a/include/qerplugin.h +++ b/include/qerplugin.h @@ -476,7 +476,7 @@ typedef void* (WINAPI * PFN_QERAPP_GETENTITYHANDLE)(int nIndex); // but you don't have a clean epair read/write query // and you rely on the C structs directly, which might go away soon // ok now, stop using, it's bad for your karma (see iepairs.h instead) -typedef epair_t* (WINAPI * PFN_QERAPP_ALLOCATEEPAIR)( char*, char* ); +typedef epair_t* (WINAPI * PFN_QERAPP_ALLOCATEEPAIR)( const char*, const char* ); typedef int (WINAPI * PFN_QERAPP_ALLOCATEENTITYBRUSHHANDLES)(void* vp); typedef void (WINAPI * PFN_QERAPP_RELEASEENTITYBRUSHHANDLES)(); typedef void* (WINAPI * PFN_QERAPP_GETENTITYBRUSHHANDLE)(int nIndex); diff --git a/plugins/model/remap.cpp b/plugins/model/remap.cpp index 73468ac5..7f1cac2d 100644 --- a/plugins/model/remap.cpp +++ b/plugins/model/remap.cpp @@ -224,13 +224,18 @@ private: const char* surfShaderName = m_model->GetShaderNameForSurface(j); IShader* shader = shader_for_remap(surfShaderName); // m_shaders.push_back((shader) ? shader : (global_shader) ? global_shader : QERApp_Shader_ForName(surfShaderName)); - if( shader ) { - m_shaders.push_back(shader); - } else if( global_shader ) { - m_shaders.push_back(global_shader); - } else { - m_shaders.push_back(QERApp_Shader_ForName(surfShaderName)); + // Determine which shader it is going to be + if( !shader ) { + if( global_shader ) { + shader = global_shader; + } else { + shader = QERApp_Shader_ForName(surfShaderName); + } } + // Add reference + shader->IncRef(); + // Done, continue + m_shaders.push_back( shader ); } } diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index da91fc25..d87f2919 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -3697,9 +3697,13 @@ static void editor_save (GtkWidget *widget, gpointer data) return; } - char *str = gtk_editable_get_chars (GTK_EDITABLE (text), 0, -1); + GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text)); + GtkTextIter start, end; + gtk_text_buffer_get_bounds ( buffer, &start, &end); + char *str = gtk_text_buffer_get_text(buffer, &start, &end, FALSE); fwrite (str, 1, strlen (str), f); fclose (f); + g_free(str); } static void editor_close (GtkWidget *widget, gpointer data) diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 6050c49b..9a71c25b 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -3359,6 +3359,9 @@ void CGameInstall::BuildDialog() { void CGameInstall::Run() { ScanGames(); + if (m_availGames[0] == GAME_NONE) { + return; + } if ( DoModal() == IDCANCEL ) { Sys_Printf( "game dialog cancelled\n" ); return; @@ -3535,5 +3538,7 @@ void CGameInstall::ScanGames() { m_availGames[ iGame++ ] = GAME_JA; } } + Sys_Printf("No installable games found in: %s\n", + pakPaths.GetBuffer() ); }