]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge commit 'f3d0806dfea23aef768535ee2fc8e1fff9aebe9f' into master-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 20 Jun 2022 02:29:33 +0000 (04:29 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 20 Jun 2022 02:29:33 +0000 (04:29 +0200)
26 files changed:
plugins/entity/angles.h
radiant/gtkdlgs.cpp
radiant/gtkdlgs.h
radiant/mainframe.cpp
radiant/preferences.cpp
radiant/shaders.cpp
setup/data/tools/bitmaps/f-areaportal.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-caulk.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-clip.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-decals.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-details.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-entities.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-hint.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-invert.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-liquids.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-models.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-reset.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-structural.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-translucent.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-triggers.bmp [new file with mode: 0644]
setup/data/tools/bitmaps/f-world.bmp [new file with mode: 0644]
tools/quake3/q3map2/bsp.c
tools/quake3/q3map2/light.c
tools/quake3/q3map2/lightmaps_ydnar.c
tools/quake3/q3map2/main.c
tools/quake3/q3map2/q3map2.h

index 54f51f9bfe939efdbdd64f6e9ceafc63b64ea827..e44c6fcfc14ed006308f7f0e0f833f17ecab58f0 100644 (file)
@@ -73,8 +73,9 @@ inline void write_angles( const Vector3& angles, Entity* entity ){
                char value[64];
 
                if ( angles[0] == 0 && angles[1] == 0 ) {
+                       float yaw = angles[2];
                        entity->setKeyValue( "angles", "" );
-                       write_angle( angles[2], entity );
+                       write_angle( yaw, entity );
                }
                else
                {
index 7a32120388dfd24955b18a3d741ef282ff3df07f..9b6eb2d816ae638c622112282300cf74dec218ae 100644 (file)
@@ -69,6 +69,9 @@
 #include "url.h"
 #include "cmdlib.h"
 
+#include "qerplugin.h"
+#include "os/file.h"
+
 
 
 // =============================================================================
@@ -698,12 +701,13 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
 // master window widget
 static ui::Window text_editor{ui::null};
 static ui::Widget text_widget{ui::null}; // slave, text widget from the gtk editor
+static GtkTextBuffer* text_buffer_;
 
 static gint editor_delete( ui::Widget widget, gpointer data ){
-       if ( ui::alert( widget.window(), "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
+/*     if ( ui::alert( widget.window(), "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
                return TRUE;
        }
-
+*/
        text_editor.hide();
 
        return TRUE;
@@ -711,23 +715,33 @@ static gint editor_delete( ui::Widget widget, gpointer data ){
 
 static void editor_save( ui::Widget widget, gpointer data ){
        FILE *f = fopen( (char*)g_object_get_data( G_OBJECT( data ), "filename" ), "w" );
-       gpointer text = g_object_get_data( G_OBJECT( data ), "text" );
+       //gpointer text = g_object_get_data( G_OBJECT( data ), "text" );
 
        if ( f == 0 ) {
                ui::alert( ui::Widget::from(data).window(), "Error saving file !" );
                return;
        }
 
-       char *str = gtk_editable_get_chars( GTK_EDITABLE( text ), 0, -1 );
+       /* Obtain iters for the start and end of points of the buffer */
+       GtkTextIter start;
+       GtkTextIter end;
+       gtk_text_buffer_get_start_iter (text_buffer_, &start);
+       gtk_text_buffer_get_end_iter (text_buffer_, &end);
+
+       /* Get the entire buffer text. */
+       char *str = gtk_text_buffer_get_text (text_buffer_, &start, &end, FALSE);
+
+       //char *str = gtk_editable_get_chars( GTK_EDITABLE( text ), 0, -1 );
        fwrite( str, 1, strlen( str ), f );
        fclose( f );
+       g_free (str);
 }
 
 static void editor_close( ui::Widget widget, gpointer data ){
-       if ( ui::alert( text_editor.window(), "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
+/*     if ( ui::alert( text_editor.window(), "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
                return;
        }
-
+*/
        text_editor.hide();
 }
 
@@ -736,7 +750,7 @@ static void CreateGtkTextEditor(){
 
        dlg.connect( "delete_event",
                                          G_CALLBACK( editor_delete ), 0 );
-       gtk_window_set_default_size( dlg, 600, 300 );
+       gtk_window_set_default_size( dlg, 400, 300 );
 
        auto vbox = ui::VBox( FALSE, 5 );
        vbox.show();
@@ -777,7 +791,7 @@ static void CreateGtkTextEditor(){
        text_widget = text;
 }
 
-static void DoGtkTextEditor( const char* filename, guint cursorpos ){
+static void DoGtkTextEditor( const char* filename, guint cursorpos, int length ){
        if ( !text_editor ) {
                CreateGtkTextEditor(); // build it the first time we need it
 
@@ -802,7 +816,7 @@ static void DoGtkTextEditor( const char* filename, guint cursorpos ){
                gtk_window_set_title( text_editor, filename );
 
                auto text_buffer = gtk_text_view_get_buffer(ui::TextView::from(text_widget));
-               gtk_text_buffer_set_text( text_buffer, (char*)buf, len );
+               gtk_text_buffer_set_text( text_buffer, (char*)buf, length );
 
                old_filename = g_object_get_data( G_OBJECT( text_editor ), "filename" );
                if ( old_filename ) {
@@ -826,12 +840,14 @@ static void DoGtkTextEditor( const char* filename, guint cursorpos ){
                        // character offset, not byte offset
                        gtk_text_buffer_get_iter_at_offset( text_buffer, &text_iter, cursorpos );
                        gtk_text_buffer_place_cursor( text_buffer, &text_iter );
+                       gtk_text_view_scroll_to_iter( GTK_TEXT_VIEW( text_widget ), &text_iter, 0, TRUE, 0, 0);
                }
 
 #if GDEF_OS_WINDOWS
                gtk_widget_queue_draw( text_widget );
 #endif
 
+               text_buffer_ = text_buffer;
                free( buf );
                fclose( f );
        }
@@ -1025,18 +1041,55 @@ EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, const
 
 #if GDEF_OS_WINDOWS
 // use the file associations to open files instead of builtin Gtk editor
-bool g_TextEditor_useWin32Editor = true;
+bool g_TextEditor_useWin32Editor = false;
 #else
 // custom shader editor
 bool g_TextEditor_useCustomEditor = false;
 CopiedString g_TextEditor_editorCommand( "" );
 #endif
 
-void DoTextEditor( const char* filename, int cursorpos ){
+void DoTextEditor( const char* filename, int cursorpos, int length ){
 #if GDEF_OS_WINDOWS
        if ( g_TextEditor_useWin32Editor ) {
-               globalOutputStream() << "opening file '" << filename << "' (line " << cursorpos << " info ignored)\n";
-               ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( MainFrame_getWindow() ) ), "open", filename, 0, 0, SW_SHOW );
+               StringOutputStream path( 256 );
+               StringOutputStream modpath( 256 );
+               const char* gamename = GlobalRadiant().getGameName();
+               const char* basegame = GlobalRadiant().getRequiredGameDescriptionKeyValue( "basegame" );
+               const char* enginePath = GlobalRadiant().getEnginePath();
+               path << enginePath << basegame << '/' << filename;
+               modpath << enginePath << gamename << '/' << filename;
+               if ( file_exists( modpath.c_str() ) ){
+                       globalOutputStream() << "opening file '" << modpath.c_str() << "' (line " << cursorpos << " info ignored)\n";
+                       ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( MainFrame_getWindow() ) ), "open", modpath.c_str(), 0, 0, SW_SHOW );
+               }
+               else if ( file_exists( path.c_str() ) ){
+                       globalOutputStream() << "opening file '" << path.c_str() << "' (line " << cursorpos << " info ignored)\n";
+                       ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( MainFrame_getWindow() ) ), "open", path.c_str(), 0, 0, SW_SHOW );
+               }
+               else{
+                       globalOutputStream() << "Failed to open '" << filename << "\n";
+               }
+               return;
+       }
+       else{
+               StringOutputStream path( 256 );
+               StringOutputStream modpath( 256 );
+               const char* gamename = GlobalRadiant().getGameName();
+               const char* basegame = GlobalRadiant().getRequiredGameDescriptionKeyValue( "basegame" );
+               const char* enginePath = GlobalRadiant().getEnginePath();
+               path << enginePath << basegame << '/' << filename;
+               modpath << enginePath << gamename << '/' << filename;
+               if ( file_exists( modpath.c_str() ) ){
+                       globalOutputStream() << "opening file '" << modpath.c_str() << "' (line " << cursorpos << " info ignored)\n";
+                       DoGtkTextEditor( modpath.c_str(), cursorpos, length );
+               }
+               else if ( file_exists( path.c_str() ) ){
+                       globalOutputStream() << "opening file '" << path.c_str() << "' (line " << cursorpos << " info ignored)\n";
+                       DoGtkTextEditor( path.c_str(), cursorpos, length );
+               }
+               else{
+                       globalOutputStream() << "Failed to open '" << filename << "\n";
+               }
                return;
        }
 #else
@@ -1056,7 +1109,7 @@ void DoTextEditor( const char* filename, int cursorpos ){
                        return;
                }
        }
-#endif
 
-       DoGtkTextEditor( filename, cursorpos );
+       DoGtkTextEditor( filename, cursorpos, length );
+#endif
 }
index 0dad793a95552463b4fafb7a11df2530765b7ff1..78646534e04531ac1306a03a693306235c435a9c 100644 (file)
@@ -39,7 +39,7 @@ EMessageBoxReturn DoLightIntensityDlg( int *intensity );
 EMessageBoxReturn DoShaderTagDlg( CopiedString *tag, const char* title );
 EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, const char* title );
 EMessageBoxReturn DoTextureLayout( float *fx, float *fy );
-void DoTextEditor( const char* filename, int cursorpos );
+void DoTextEditor( const char* filename, int cursorpos, int length );
 
 void DoProjectSettings();
 
index 96a9566f6ecff765b097ff383c770cc62ab6a6c0..ea0ccd5ba221648329f0306486645723c88f602e 100644 (file)
@@ -2015,6 +2015,7 @@ LatchedValue<int> g_Layout_viewStyle( 0, "Window Layout" );
 LatchedValue<bool> g_Layout_enableDetachableMenus( true, "Detachable Menus" );
 LatchedValue<bool> g_Layout_enablePatchToolbar( true, "Patch Toolbar" );
 LatchedValue<bool> g_Layout_enablePluginToolbar( true, "Plugin Toolbar" );
+LatchedValue<bool> g_Layout_enableFilterToolbar( true, "Filter Toolbar" );
 
 
 ui::MenuItem create_file_menu(){
@@ -3015,6 +3016,37 @@ void MainFrame::Create(){
        if ( !g_Layout_enablePluginToolbar.m_value ) {
                plugin_toolbar.hide();
        }
+
+       if ( g_Layout_enableFilterToolbar.m_value ) {
+               auto space = [&]() {
+                       auto btn = gtk_separator_tool_item_new();
+                               gtk_widget_show(GTK_WIDGET(btn));
+                               gtk_container_add(GTK_CONTAINER(plugin_toolbar), GTK_WIDGET(btn));
+               };
+
+               space();
+               toolbar_append_toggle_button( plugin_toolbar, "World (ALT + 1)", "f-world.bmp", "FilterWorldBrushes" );
+               toolbar_append_toggle_button( plugin_toolbar, "Details (CTRL + D)", "f-details.bmp", "FilterDetails" );
+               toolbar_append_toggle_button( plugin_toolbar, "Structural (CTRL + SHIFT + D)", "f-structural.bmp", "FilterStructural" );
+               toolbar_append_toggle_button( plugin_toolbar, "Patches (CTRL + P)", "patch_wireframe.png", "FilterPatches" );
+               space();
+               toolbar_append_toggle_button( plugin_toolbar, "Areaportals (ALT + 3)", "f-areaportal.bmp", "FilterAreaportals" );
+               toolbar_append_toggle_button( plugin_toolbar, "Translucent (ALT + 4)", "f-translucent.bmp", "FilterTranslucent" );
+               toolbar_append_toggle_button( plugin_toolbar, "Liquids (ALT + 5)", "f-liquids.bmp", "FilterLiquids" );
+               toolbar_append_toggle_button( plugin_toolbar, "Caulk (ALT + 6)", "f-caulk.bmp", "FilterCaulk" );
+               toolbar_append_toggle_button( plugin_toolbar, "Clips (ALT + 7)", "f-clip.bmp", "FilterClips" );
+               toolbar_append_toggle_button( plugin_toolbar, "HintsSkips (CTRL + H)", "f-hint.bmp", "FilterHintsSkips" );
+               //toolbar_append_toggle_button( plugin_toolbar, "Paths (ALT + 8)", "texture_lock.bmp", "FilterPaths" );
+               space();
+               toolbar_append_toggle_button( plugin_toolbar, "Entities (ALT + 2)", "f-entities.bmp", "FilterEntities" );
+               toolbar_append_toggle_button( plugin_toolbar, "Lights (ALT + 0)", "lightinspector.png", "FilterLights" );
+               toolbar_append_toggle_button( plugin_toolbar, "Models (SHIFT + M)", "f-models.bmp", "FilterModels" );
+               toolbar_append_toggle_button( plugin_toolbar, "Triggers (CTRL + SHIFT + T)", "f-triggers.bmp", "FilterTriggers" );
+               toolbar_append_toggle_button( plugin_toolbar, "Decals (SHIFT + D)", "f-decals.bmp", "FilterDecals" );
+               space();
+               toolbar_append_button( plugin_toolbar, "InvertFilters", "f-invert.bmp", "InvertFilters" );
+               toolbar_append_button( plugin_toolbar, "ResetFilters", "f-reset.bmp", "ResetFilters" );
+       }
        vbox.pack_start( plugin_toolbar, FALSE, FALSE, 0 );
 
        ui::Widget main_statusbar = create_main_statusbar(reinterpret_cast<ui::Widget *>(m_pStatusLabel));
@@ -3477,6 +3509,10 @@ void Layout_constructPreferences( PreferencesPage& page ){
                "", "Plugin Toolbar",
                make_property( g_Layout_enablePluginToolbar )
                );
+       page.appendCheckBox(
+               "", "Filter Toolbar",
+               make_property( g_Layout_enableFilterToolbar )
+               );
 }
 
 void Layout_constructPage( PreferenceGroup& group ){
@@ -3618,6 +3654,7 @@ void MainFrame_Construct(){
        GlobalPreferenceSystem().registerPreference( "DetachableMenus", make_property_string( g_Layout_enableDetachableMenus.m_latched ) );
        GlobalPreferenceSystem().registerPreference( "PatchToolBar", make_property_string( g_Layout_enablePatchToolbar.m_latched ) );
        GlobalPreferenceSystem().registerPreference( "PluginToolBar", make_property_string( g_Layout_enablePluginToolbar.m_latched ) );
+       GlobalPreferenceSystem().registerPreference( "FilterToolBar", make_property_string( g_Layout_enableFilterToolbar.m_latched ) );
        GlobalPreferenceSystem().registerPreference( "QE4StyleWindows", make_property_string( g_Layout_viewStyle.m_latched ) );
        GlobalPreferenceSystem().registerPreference( "XYHeight", make_property_string( g_layout_globals.nXYHeight ) );
        GlobalPreferenceSystem().registerPreference( "XYWidth", make_property_string( g_layout_globals.nXYWidth ) );
@@ -3668,6 +3705,7 @@ void MainFrame_Construct(){
        g_Layout_enableDetachableMenus.useLatched();
        g_Layout_enablePatchToolbar.useLatched();
        g_Layout_enablePluginToolbar.useLatched();
+       g_Layout_enableFilterToolbar.useLatched();
 
        Layout_registerPreferencesPage();
        Paths_registerPreferencesPage();
index f308ebcf1e78226f80933ddb5f9439528b1372d9..4005dff25737f749e686635e1932c00c14474ad4 100644 (file)
@@ -59,7 +59,7 @@ void Global_constructPreferences( PreferencesPage& page ){
 
 void Interface_constructPreferences( PreferencesPage& page ){
 #if GDEF_OS_WINDOWS
-       page.appendCheckBox( "", "Default Text Editor", g_TextEditor_useWin32Editor );
+       page.appendCheckBox( "", "External Shader Editor", g_TextEditor_useWin32Editor );
 #else
        {
                ui::CheckButton use_custom = page.appendCheckBox( "Text Editor", "Custom", g_TextEditor_useCustomEditor );
index d6748c0704f8f803fd8df7cb4b225845b07e4097..f62e3f61c8db3103ab1d3d197c809a767f9957a3 100644 (file)
@@ -39,17 +39,65 @@ void ViewShader( const char *pFile, const char *pName ){
        StringOutputStream strFind( string_length( pName ) );
        strFind << LowerCase( pName );
        StringOutputStream strLook( string_length( pBuff ) );
-       strFind << LowerCase( pBuff );
+       strLook << LowerCase( pBuff );
        // offset used when jumping over commented out definitions
+       int length = string_length( pBuff );
        std::size_t nOffset = 0;
-       while ( true )
-       {
-               const char* substr = strstr( strFind.c_str() + nOffset, strFind.c_str() );
+       bool startOK = false;
+       bool endOK = false;
+       while ( !startOK || !endOK ){
+               const char* substr = strstr( strLook.c_str() + nOffset, strFind.c_str() );
                if ( substr == 0 ) {
                        break;
                }
                std::size_t nStart = substr - strLook.c_str();
-               // we have found something, maybe it's a commented out shader name?
+               startOK = endOK = false;
+               if ( nStart == 0 ){
+                       startOK = true;
+               }
+               //validate found one...
+               for ( const char* i = substr - 1; i > strLook.c_str(); i-- ){
+                       if( (strncmp( i, "\t", 1 ) == 0) || (strncmp( i, " ", 1 ) == 0) ){
+                               startOK = true;
+                               continue;
+                       }
+                       else if ( (strncmp( i, "\n", 1 ) == 0) || (strncmp( i, "\r", 1 ) == 0) ){
+                               startOK = true;
+                               break;
+                       }
+                       else{
+                               startOK = false;
+                               break;
+                       }
+               }
+               for ( const char* i = substr + strlen( strFind.c_str() ); i < strLook.c_str() + strlen( strLook.c_str() ); i++ ){
+                       if( (strncmp( i, "\t", 1 ) == 0) || (strncmp( i, " ", 1 ) == 0) ){
+                               endOK = true;
+                               continue;
+                       }
+                       else if ( (strncmp( i, "\n", 1 ) == 0) || (strncmp( i, "\r", 1 ) == 0) || (strncmp( i, "{", 1 ) == 0) || (strncmp( i, ":q3map", 6 ) == 0) ){
+                               endOK = true;
+                               break;
+                       }
+                       else{
+                               endOK = false;
+                               break;
+                       }
+               }
+               if( !startOK || !endOK ){
+                       nOffset = nStart + 1;
+               }
+               else{
+                       //globalErrorStream() << "Validated successfully" << "\n";
+                       nOffset = nStart;
+                       //fix cr+lf
+                       for ( const char* i = strLook.c_str(); i < substr ; i++ ){
+                               if ( (strncmp( i, "\r\n", 2 ) == 0) ){
+                               nOffset--;
+                               }
+                       }
+               }
+               /*// we have found something, maybe it's a commented out shader name?
                char *strCheck = new char[string_length( strLook.c_str() ) + 1];
                strcpy( strCheck, strLook.c_str() );
                strCheck[nStart] = 0;
@@ -62,10 +110,16 @@ void ViewShader( const char *pFile, const char *pName ){
                }
                delete[] strCheck;
                nOffset = nStart;
-               break;
+               break;*/
+       }
+       //fix up length
+       for ( const char* i = strLook.c_str(); i < strLook.c_str() + strlen( strLook.c_str() ) - 1; i++ ){
+               if ( (strncmp( i, "\r\n", 2 ) == 0) ){
+               length--;
+               }
        }
        // now close the file
        vfsFreeFile( pBuff );
 
-       DoTextEditor( pFile, static_cast<int>( nOffset ) );
+       DoTextEditor( pFile, static_cast<int>( nOffset ), length );
 }
diff --git a/setup/data/tools/bitmaps/f-areaportal.bmp b/setup/data/tools/bitmaps/f-areaportal.bmp
new file mode 100644 (file)
index 0000000..e0c95b7
Binary files /dev/null and b/setup/data/tools/bitmaps/f-areaportal.bmp differ
diff --git a/setup/data/tools/bitmaps/f-caulk.bmp b/setup/data/tools/bitmaps/f-caulk.bmp
new file mode 100644 (file)
index 0000000..a021277
Binary files /dev/null and b/setup/data/tools/bitmaps/f-caulk.bmp differ
diff --git a/setup/data/tools/bitmaps/f-clip.bmp b/setup/data/tools/bitmaps/f-clip.bmp
new file mode 100644 (file)
index 0000000..85f4213
Binary files /dev/null and b/setup/data/tools/bitmaps/f-clip.bmp differ
diff --git a/setup/data/tools/bitmaps/f-decals.bmp b/setup/data/tools/bitmaps/f-decals.bmp
new file mode 100644 (file)
index 0000000..9ccfcb7
Binary files /dev/null and b/setup/data/tools/bitmaps/f-decals.bmp differ
diff --git a/setup/data/tools/bitmaps/f-details.bmp b/setup/data/tools/bitmaps/f-details.bmp
new file mode 100644 (file)
index 0000000..d5f9b36
Binary files /dev/null and b/setup/data/tools/bitmaps/f-details.bmp differ
diff --git a/setup/data/tools/bitmaps/f-entities.bmp b/setup/data/tools/bitmaps/f-entities.bmp
new file mode 100644 (file)
index 0000000..a4bc42a
Binary files /dev/null and b/setup/data/tools/bitmaps/f-entities.bmp differ
diff --git a/setup/data/tools/bitmaps/f-hint.bmp b/setup/data/tools/bitmaps/f-hint.bmp
new file mode 100644 (file)
index 0000000..a8cfa52
Binary files /dev/null and b/setup/data/tools/bitmaps/f-hint.bmp differ
diff --git a/setup/data/tools/bitmaps/f-invert.bmp b/setup/data/tools/bitmaps/f-invert.bmp
new file mode 100644 (file)
index 0000000..7514af7
Binary files /dev/null and b/setup/data/tools/bitmaps/f-invert.bmp differ
diff --git a/setup/data/tools/bitmaps/f-liquids.bmp b/setup/data/tools/bitmaps/f-liquids.bmp
new file mode 100644 (file)
index 0000000..9f98208
Binary files /dev/null and b/setup/data/tools/bitmaps/f-liquids.bmp differ
diff --git a/setup/data/tools/bitmaps/f-models.bmp b/setup/data/tools/bitmaps/f-models.bmp
new file mode 100644 (file)
index 0000000..b96fc24
Binary files /dev/null and b/setup/data/tools/bitmaps/f-models.bmp differ
diff --git a/setup/data/tools/bitmaps/f-reset.bmp b/setup/data/tools/bitmaps/f-reset.bmp
new file mode 100644 (file)
index 0000000..373701c
Binary files /dev/null and b/setup/data/tools/bitmaps/f-reset.bmp differ
diff --git a/setup/data/tools/bitmaps/f-structural.bmp b/setup/data/tools/bitmaps/f-structural.bmp
new file mode 100644 (file)
index 0000000..fca065d
Binary files /dev/null and b/setup/data/tools/bitmaps/f-structural.bmp differ
diff --git a/setup/data/tools/bitmaps/f-translucent.bmp b/setup/data/tools/bitmaps/f-translucent.bmp
new file mode 100644 (file)
index 0000000..bae6919
Binary files /dev/null and b/setup/data/tools/bitmaps/f-translucent.bmp differ
diff --git a/setup/data/tools/bitmaps/f-triggers.bmp b/setup/data/tools/bitmaps/f-triggers.bmp
new file mode 100644 (file)
index 0000000..adcb341
Binary files /dev/null and b/setup/data/tools/bitmaps/f-triggers.bmp differ
diff --git a/setup/data/tools/bitmaps/f-world.bmp b/setup/data/tools/bitmaps/f-world.bmp
new file mode 100644 (file)
index 0000000..0b5b72c
Binary files /dev/null and b/setup/data/tools/bitmaps/f-world.bmp differ
index 168246266b6cb91497fb39d4c82298a183b7b3bf..7e504a6a2f8fee3bba0f43d6a84622989716a2fc 100644 (file)
@@ -637,6 +637,8 @@ void ProcessModels( const char *portalFilePath, const char *lineFilePath ){
        /* restore -v setting */
        verbose = oldVerbose;
 
+       Sys_FPrintf( SYS_VRB, "%9i bspModels in total\n", numBSPModels );
+
        /* write fogs */
        EmitFogs();
 
index 1d8cfb5e2a574afb189f205369ab33a32c90281f..93335d2f1ec871178c4c4dbb24ba53a7456eee68 100644 (file)
@@ -2833,6 +2833,10 @@ int LightMain( int argc, char **argv ){
                        i++;
                        Sys_Printf( "Lightmaps sample scale set to %d\n", sampleScale );
                }
+               else if ( !strcmp( argv[ i ],  "-debugsamplesize" ) ) {
+                       debugSampleSize = 1;
+                       Sys_Printf( "debugging Lightmaps SampleSize\n" );
+               }
                else if ( !strcmp( argv[ i ], "-novertex" ) ) {
                        noVertexLighting = 1;
                        if ( ( atof( argv[ i + 1 ] ) != 0 ) && ( atof( argv[ i + 1 ] )) < 1 ) {
index 82b0741f86ca73a52918c664cdebd725f3eb3cb5..7afb86a46633852d911973fa5fed0a48f3ce854d 100644 (file)
@@ -695,16 +695,33 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){
                }
        }
 
-       if ( sampleSize != lm->sampleSize && lmLimitSize == 0 ) {
-               Sys_FPrintf( SYS_VRB,"WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n",
-                                        info->mins[0],
-                                        info->mins[1],
-                                        info->mins[2],
-                                        info->maxs[0],
-                                        info->maxs[1],
-                                        info->maxs[2],
-                                        lm->sampleSize,
-                                        (int) sampleSize );
+       if ( sampleSize != lm->sampleSize && lmLimitSize == 0 ){
+               if ( debugSampleSize == 1 || lm->customWidth > 128 ){
+                       Sys_FPrintf( SYS_VRB,"WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n",
+                                               info->mins[0],
+                                               info->mins[1],
+                                               info->mins[2],
+                                               info->maxs[0],
+                                               info->maxs[1],
+                                               info->maxs[2],
+                                               lm->sampleSize,
+                                               (int) sampleSize );
+               }
+               else if ( debugSampleSize == 0 ){
+                       Sys_FPrintf( SYS_VRB,"WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n",
+                                               info->mins[0],
+                                               info->mins[1],
+                                               info->mins[2],
+                                               info->maxs[0],
+                                               info->maxs[1],
+                                               info->maxs[2],
+                                               lm->sampleSize,
+                                               (int) sampleSize );
+                       debugSampleSize--;
+               }
+               else{
+                       debugSampleSize--;
+               }
        }
 
        /* set actual sample size */
@@ -1197,6 +1214,10 @@ void SetupSurfaceLightmaps( void ){
                FinishRawLightmap( lm );
        }
 
+       if ( debugSampleSize < -1 ){
+               Sys_FPrintf( SYS_VRB, "+%d similar occurrences;\t-debugSampleSize to show ones\n", -debugSampleSize - 1 );
+       }
+
        /* allocate vertex luxel storage */
        for ( k = 0; k < MAX_LIGHTMAPS; k++ )
        {
index e3f5742b6f3b521ffeeee27a16dc70b620d43a2a..2a95c44ceb475f0b862b5f540c02a6f67eb10490 100644 (file)
@@ -59,7 +59,7 @@ char *Q_strncpyz( char *dst, const char *src, size_t len ) {
 
 
 char *Q_strcat( char *dst, size_t dlen, const char *src ) {
-       size_t n = strlen( dst  );
+       size_t n = strlen( dst );
 
        if ( n > dlen ) {
                abort(); /* buffer overflow */
@@ -95,8 +95,7 @@ static void ExitQ3Map( void ){
 
 /*
    ShiftBSPMain()
-   shifts a map: works correctly only with axial faces, placed in positive half of axis
-   for testing physics with huge coordinates
+   shifts a map: for testing physics with huge coordinates
  */
 
 int ShiftBSPMain( int argc, char **argv ){
@@ -356,6 +355,7 @@ int main( int argc, char **argv ){
                        numthreads = atoi( argv[ i ] );
                        argv[ i ] = NULL;
                }
+
                else if( !strcmp( argv[ i ], "-nocmdline" ) )
                {
                        Sys_Printf( "noCmdLine\n" );
index a26aa71696dad29860a6fe42174d4ddd35c75f88..da982c5ce495a84e85c0e2298fb689e44e88cf30 100644 (file)
@@ -395,7 +395,7 @@ typedef struct
 bspShader_t;
 
 
-/* planes x^1 is allways the opposite of plane x */
+/* planes x^1 is always the opposite of plane x */
 
 typedef struct
 {
@@ -409,7 +409,7 @@ typedef struct
 {
        int planeNum;
        int children[ 2 ];              /* negative numbers are -(leafs+1), not nodes */
-       int mins[ 3 ];                  /* for frustom culling */
+       int mins[ 3 ];                  /* for frustum culling */
        int maxs[ 3 ];
 }
 bspNode_t;
@@ -2349,6 +2349,8 @@ Q_EXTERN qboolean debugAxis Q_ASSIGN( qfalse );
 Q_EXTERN qboolean debugCluster Q_ASSIGN( qfalse );
 Q_EXTERN qboolean debugOrigin Q_ASSIGN( qfalse );
 Q_EXTERN qboolean lightmapBorder Q_ASSIGN( qfalse );
+//1=warn; 0=warn if lmsize>128
+Q_EXTERN int debugSampleSize Q_ASSIGN( 0 );
 
 /* longest distance across the map */
 Q_EXTERN float maxMapDistance Q_ASSIGN( 0 );