From af4e2d29cfd3a54b44eb09e4289f3fa3f29412c9 Mon Sep 17 00:00:00 2001 From: Garux Date: Tue, 1 Aug 2017 13:50:06 +0300 Subject: [PATCH] Q3map2: * shot down spammy warning about samplesize for lmsize<=128; -debugsamplesize to show * numBspModels ('brusmodels') stat emitting Radiant: misc... * filters toolbar (disableable) * fix: shift + m1 click in tex browser to open shader in internal/external editor; defaulted internal; focuses on wanted shader; correct opening/saving * fix: angles "0 x 0" autoconvert to angle "x" on transform (was getting deleted w/o a trace) --- plugins/entity/angles.h | 3 +- radiant/gtkdlgs.cpp | 83 +++++++++++++++++---- radiant/gtkdlgs.h | 2 +- radiant/mainframe.cpp | 36 ++++++++- radiant/preferences.cpp | 2 +- radiant/shaders.cpp | 68 +++++++++++++++-- setup/data/tools/bitmaps/f-areaportal.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-caulk.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-clip.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-decals.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-details.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-entities.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-hint.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-invert.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-liquids.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-models.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-reset.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-structural.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-translucent.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-triggers.bmp | Bin 0 -> 1334 bytes setup/data/tools/bitmaps/f-world.bmp | Bin 0 -> 1334 bytes tools/quake3/q3map2/bsp.c | 2 + tools/quake3/q3map2/light.c | 4 + tools/quake3/q3map2/lightmaps_ydnar.c | 41 +++++++--- tools/quake3/q3map2/main.c | 6 +- tools/quake3/q3map2/q3map2.h | 6 +- 26 files changed, 212 insertions(+), 41 deletions(-) create mode 100644 setup/data/tools/bitmaps/f-areaportal.bmp create mode 100644 setup/data/tools/bitmaps/f-caulk.bmp create mode 100644 setup/data/tools/bitmaps/f-clip.bmp create mode 100644 setup/data/tools/bitmaps/f-decals.bmp create mode 100644 setup/data/tools/bitmaps/f-details.bmp create mode 100644 setup/data/tools/bitmaps/f-entities.bmp create mode 100644 setup/data/tools/bitmaps/f-hint.bmp create mode 100644 setup/data/tools/bitmaps/f-invert.bmp create mode 100644 setup/data/tools/bitmaps/f-liquids.bmp create mode 100644 setup/data/tools/bitmaps/f-models.bmp create mode 100644 setup/data/tools/bitmaps/f-reset.bmp create mode 100644 setup/data/tools/bitmaps/f-structural.bmp create mode 100644 setup/data/tools/bitmaps/f-translucent.bmp create mode 100644 setup/data/tools/bitmaps/f-triggers.bmp create mode 100644 setup/data/tools/bitmaps/f-world.bmp diff --git a/plugins/entity/angles.h b/plugins/entity/angles.h index 85f08aa8..1ace81ea 100644 --- a/plugins/entity/angles.h +++ b/plugins/entity/angles.h @@ -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 { diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 7bdea67d..b01965af 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -82,6 +82,9 @@ #include "url.h" #include "cmdlib.h" +#include "qerplugin.h" +#include "os/file.h" + // ============================================================================= @@ -708,12 +711,13 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){ // master window widget static GtkWidget *text_editor = 0; static GtkWidget *text_widget; // slave, text widget from the gtk editor +static GtkTextBuffer* text_buffer_; static gint editor_delete( GtkWidget *widget, gpointer data ){ - if ( gtk_MessageBox( widget, "Close the shader editor ?", "Radiant", eMB_YESNO, eMB_ICONQUESTION ) == eIDNO ) { +/* if ( gtk_MessageBox( widget, "Close the shader editor ?", "Radiant", eMB_YESNO, eMB_ICONQUESTION ) == eIDNO ) { return TRUE; } - +*/ gtk_widget_hide( text_editor ); return TRUE; @@ -721,23 +725,33 @@ static gint editor_delete( GtkWidget *widget, gpointer data ){ static void editor_save( GtkWidget *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 ) { gtk_MessageBox( GTK_WIDGET( data ), "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( GtkWidget *widget, gpointer data ){ - if ( gtk_MessageBox( text_editor, "Close the shader editor ?", "Radiant", eMB_YESNO, eMB_ICONQUESTION ) == eIDNO ) { +/* if ( gtk_MessageBox( text_editor, "Close the shader editor ?", "Radiant", eMB_YESNO, eMB_ICONQUESTION ) == eIDNO ) { return; } - +*/ gtk_widget_hide( text_editor ); } @@ -749,7 +763,7 @@ static void CreateGtkTextEditor(){ g_signal_connect( G_OBJECT( dlg ), "delete_event", G_CALLBACK( editor_delete ), 0 ); - gtk_window_set_default_size( GTK_WINDOW( dlg ), 600, 300 ); + gtk_window_set_default_size( GTK_WINDOW( dlg ), 400, 600 ); vbox = gtk_vbox_new( FALSE, 5 ); gtk_widget_show( vbox ); @@ -790,7 +804,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 @@ -815,7 +829,7 @@ static void DoGtkTextEditor( const char* filename, guint cursorpos ){ gtk_window_set_title( GTK_WINDOW( text_editor ), filename ); GtkTextBuffer* text_buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW( 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 ) { @@ -839,12 +853,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); } #ifdef WIN32 gtk_widget_queue_draw( text_widget ); #endif + text_buffer_ = text_buffer; free( buf ); fclose( f ); } @@ -1040,18 +1056,55 @@ EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, char* #ifdef WIN32 // 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 ){ #ifdef WIN32 if ( g_TextEditor_useWin32Editor ) { - globalOutputStream() << "opening file '" << filename << "' (line " << cursorpos << " info ignored)\n"; - ShellExecute( (HWND)GDK_WINDOW_HWND( GTK_WIDGET( MainFrame_getWindow() )->window ), "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( MainFrame_getWindow() )->window ), "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( MainFrame_getWindow() )->window ), "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 @@ -1071,7 +1124,7 @@ void DoTextEditor( const char* filename, int cursorpos ){ return; } } -#endif - DoGtkTextEditor( filename, cursorpos ); + DoGtkTextEditor( filename, cursorpos, length ); +#endif } diff --git a/radiant/gtkdlgs.h b/radiant/gtkdlgs.h index 0ff194e6..a0ad7401 100644 --- a/radiant/gtkdlgs.h +++ b/radiant/gtkdlgs.h @@ -38,7 +38,7 @@ EMessageBoxReturn DoLightIntensityDlg( int *intensity ); EMessageBoxReturn DoShaderTagDlg( CopiedString *tag, char* title ); EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, 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(); diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 53878054..6c4e1382 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -1793,6 +1793,7 @@ LatchedInt g_Layout_viewStyle( 0, "Window Layout" ); LatchedBool g_Layout_enableDetachableMenus( true, "Detachable Menus" ); LatchedBool g_Layout_enablePatchToolbar( true, "Patch Toolbar" ); LatchedBool g_Layout_enablePluginToolbar( true, "Plugin Toolbar" ); +LatchedBool g_Layout_enableFilterToolbar( true, "Filter Toolbar" ); @@ -2390,7 +2391,7 @@ GtkToolbar* create_main_toolbar( MainFrame::EViewStyle style ){ gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); - toolbar_append_toggle_button( toolbar, "Texture Lock (SHIFT +T)", "texture_lock.bmp", "TogTexLock" ); + toolbar_append_toggle_button( toolbar, "Texture Lock (SHIFT + T)", "texture_lock.bmp", "TogTexLock" ); gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); @@ -2779,6 +2780,32 @@ void MainFrame::Create(){ if ( !g_Layout_enablePluginToolbar.m_value ) { gtk_widget_hide( GTK_WIDGET( plugin_toolbar ) ); } + + if ( g_Layout_enableFilterToolbar.m_value ) { + gtk_toolbar_append_space( GTK_TOOLBAR( plugin_toolbar ) ); + gtk_toolbar_append_space( GTK_TOOLBAR( plugin_toolbar ) ); + 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.bmp", "FilterPatches" ); + gtk_toolbar_append_space( GTK_TOOLBAR( plugin_toolbar ) ); + 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" ); + gtk_toolbar_append_space( GTK_TOOLBAR( plugin_toolbar ) ); + toolbar_append_toggle_button( plugin_toolbar, "Entities (ALT + 2)", "f-entities.bmp", "FilterEntities" ); + toolbar_append_toggle_button( plugin_toolbar, "Lights (ALT + 0)", "lightinspector.bmp", "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" ); + gtk_toolbar_append_space( GTK_TOOLBAR( plugin_toolbar ) ); + toolbar_append_button( plugin_toolbar, "InvertFilters", "f-invert.bmp", "InvertFilters" ); + toolbar_append_button( plugin_toolbar, "ResetFilters", "f-reset.bmp", "ResetFilters" ); + } gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( plugin_toolbar ), FALSE, FALSE, 0 ); GtkWidget* main_statusbar = create_main_statusbar( m_pStatusLabel ); @@ -3178,6 +3205,11 @@ void Layout_constructPreferences( PreferencesPage& page ){ LatchedBoolImportCaller( g_Layout_enablePluginToolbar ), BoolExportCaller( g_Layout_enablePluginToolbar.m_latched ) ); + page.appendCheckBox( + "", "Filter Toolbar", + LatchedBoolImportCaller( g_Layout_enableFilterToolbar ), + BoolExportCaller( g_Layout_enableFilterToolbar.m_latched ) + ); } void Layout_constructPage( PreferenceGroup& group ){ @@ -3320,6 +3352,7 @@ void MainFrame_Construct(){ GlobalPreferenceSystem().registerPreference( "DetachableMenus", BoolImportStringCaller( g_Layout_enableDetachableMenus.m_latched ), BoolExportStringCaller( g_Layout_enableDetachableMenus.m_latched ) ); GlobalPreferenceSystem().registerPreference( "PatchToolBar", BoolImportStringCaller( g_Layout_enablePatchToolbar.m_latched ), BoolExportStringCaller( g_Layout_enablePatchToolbar.m_latched ) ); GlobalPreferenceSystem().registerPreference( "PluginToolBar", BoolImportStringCaller( g_Layout_enablePluginToolbar.m_latched ), BoolExportStringCaller( g_Layout_enablePluginToolbar.m_latched ) ); + GlobalPreferenceSystem().registerPreference( "FilterToolBar", BoolImportStringCaller( g_Layout_enableFilterToolbar.m_latched ), BoolExportStringCaller( g_Layout_enableFilterToolbar.m_latched ) ); GlobalPreferenceSystem().registerPreference( "QE4StyleWindows", IntImportStringCaller( g_Layout_viewStyle.m_latched ), IntExportStringCaller( g_Layout_viewStyle.m_latched ) ); GlobalPreferenceSystem().registerPreference( "XYHeight", IntImportStringCaller( g_layout_globals.nXYHeight ), IntExportStringCaller( g_layout_globals.nXYHeight ) ); GlobalPreferenceSystem().registerPreference( "XYWidth", IntImportStringCaller( g_layout_globals.nXYWidth ), IntExportStringCaller( g_layout_globals.nXYWidth ) ); @@ -3360,6 +3393,7 @@ void MainFrame_Construct(){ g_Layout_enableDetachableMenus.useLatched(); g_Layout_enablePatchToolbar.useLatched(); g_Layout_enablePluginToolbar.useLatched(); + g_Layout_enableFilterToolbar.useLatched(); Layout_registerPreferencesPage(); Paths_registerPreferencesPage(); diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index c4584e81..a5538349 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -71,7 +71,7 @@ void Global_constructPreferences( PreferencesPage& page ){ void Interface_constructPreferences( PreferencesPage& page ){ #ifdef WIN32 - page.appendCheckBox( "", "Default Text Editor", g_TextEditor_useWin32Editor ); + page.appendCheckBox( "", "External Shader Editor", g_TextEditor_useWin32Editor ); #else { GtkWidget* use_custom = page.appendCheckBox( "Text Editor", "Custom", g_TextEditor_useCustomEditor ); diff --git a/radiant/shaders.cpp b/radiant/shaders.cpp index d6748c07..f62e3f61 100644 --- a/radiant/shaders.cpp +++ b/radiant/shaders.cpp @@ -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( nOffset ) ); + DoTextEditor( pFile, static_cast( nOffset ), length ); } diff --git a/setup/data/tools/bitmaps/f-areaportal.bmp b/setup/data/tools/bitmaps/f-areaportal.bmp new file mode 100644 index 0000000000000000000000000000000000000000..e0c95b7e3aca292ac1a6475afb40a573caff557a GIT binary patch literal 1334 zcmZ?rHDhG}12Yx|1`Qxf0E!tII3N;0@(3RUGcW=Z0}Ffh=X5BDg90RZLo1}^{r literal 0 HcmV?d00001 diff --git a/setup/data/tools/bitmaps/f-caulk.bmp b/setup/data/tools/bitmaps/f-caulk.bmp new file mode 100644 index 0000000000000000000000000000000000000000..a021277abc963210c5229bb750ce22ef33c2c635 GIT binary patch literal 1334 zcmZ?rHDhG}12Yx|1`Qxf0E!tII3N;0@(3RUGcW=@~ literal 0 HcmV?d00001 diff --git a/setup/data/tools/bitmaps/f-clip.bmp b/setup/data/tools/bitmaps/f-clip.bmp new file mode 100644 index 0000000000000000000000000000000000000000..85f421362926aac750e456269a351a0a32b1c52a GIT binary patch literal 1334 zcmZ?rHDhG}12Yx|1`Qxf0E!tII3N;0@(3RUGcW=L?CT0i7srj3HHFEAn7lQLs!43RGGiN*{hec{A_x{8%!PDYB1>5I5SMIb$zJXMarx{QB-xu~@0aY7&)t3RlFQ|CH4Um1$*!rA zC6XdB%i1GJvhP(x^oq1sNRmV$lAI(ZSt=z}CL>*zLgxMqveMF#XQrdf%phAXN2ySd ztIVVDfSgm=3i1ysDauiDGAEnkxjCFTe2CKgJcR4TNpaCW6EVN)zo3oUcjKK z<9efxj(Q#Di?wv=YOprcVb#~;&^OZGd==s56@(iGtnDrIi3}T>7&bQJHtO+oTw}!4 z!kDQIuc;MRS34f_ExZ;ZcP*W`9G!UWU5wc*1f^akQoZFM&Zjp&>i5K?||b0b;Ix7Vq>iKkDS3>o)W55f)ue7Cb{Ndz>O} zmc4G`<0CwFyI2f*c{uGQ?sM_E-^2RkI8OuPOv(cMEP2ig$*;VWyyQ<2B=B&`$66%F z>SC05(9ctmtkAP!V-da-Ni2j(+@Ime zQk1RFq9m4MBvzLAcI7_LR+sqh(WiW~_JG9t3SY%n+1^;=hs`y9+)nU(Ym;BZ_+tBO ze*b=l-+tQRkDX_TAN4=~u^R~gWDen?Ap5&vyEhr@?2o>=R~a3dx-&EFnOHDNcPsw- zxx4cNky-PF)*FJ5nynpgxz!U6j&*!|`AG6U_ebhsgUdVE*4?B#`r7NJtCp@n^_AP# ze0>$o=ME>8>E3o;|M0D2H>*CW9cs4<=g+?L{_#_d%F>3WkiJBmpMNOpK+b7ZM$M%& x#WqprrDeWb`N7He4i*%Z%SCM$Qqv3fJ8W+#>Le+e-Gy>@y&&|S*h~H;`~{KE3+Mm< literal 0 HcmV?d00001 diff --git a/setup/data/tools/bitmaps/f-details.bmp b/setup/data/tools/bitmaps/f-details.bmp new file mode 100644 index 0000000000000000000000000000000000000000..d5f9b36ce9969c5f46667ebc4b81994f8e8d32c4 GIT binary patch literal 1334 zcmZ?rHDhG}12Yx|1`Qxf0E!tII3N;0@(mjVGcW=$lNbZ9>6bl0Y60-#< literal 0 HcmV?d00001 diff --git a/setup/data/tools/bitmaps/f-entities.bmp b/setup/data/tools/bitmaps/f-entities.bmp new file mode 100644 index 0000000000000000000000000000000000000000..a4bc42aecb22e2b5241005e0fd42efb9d1abc29e GIT binary patch literal 1334 zcmZ?rHDhG}12Yx|1`Qxf0E!tII3N;0@(mjVGcW=z{ZCu2C4+hBdH;e4>gch<{|lrfeGe#2+afl@LUE@ literal 0 HcmV?d00001 diff --git a/setup/data/tools/bitmaps/f-hint.bmp b/setup/data/tools/bitmaps/f-hint.bmp new file mode 100644 index 0000000000000000000000000000000000000000..a8cfa524364f8a6702ec643f9cc864e7912f0228 GIT binary patch literal 1334 zcmZ?rHDhG}12Yx|1`Qxf0E!tII3N;0@(3RUGcW=Y4=B literal 0 HcmV?d00001 diff --git a/setup/data/tools/bitmaps/f-liquids.bmp b/setup/data/tools/bitmaps/f-liquids.bmp new file mode 100644 index 0000000000000000000000000000000000000000..9f982084f5d212f8c356a24e0a202791689bacab GIT binary patch literal 1334 zcmZ?rHDhG}12Yx|1`Qxf0E!tII3N;0@(mjVGcW=Qzw{(}&h3F408(J&ZI10y93 fFcJd5fB+U0)B!M)U^Gdlg4_Xg2!td_CqBgh5|0Kn literal 0 HcmV?d00001 diff --git a/setup/data/tools/bitmaps/f-models.bmp b/setup/data/tools/bitmaps/f-models.bmp new file mode 100644 index 0000000000000000000000000000000000000000..b96fc248f2bea57b38954cdb22d7c5803d465a0e GIT binary patch literal 1334 zcmZ?rHDhG}12Yx|1`Qxf0E!tII3N;0@(3RUGcW=g!IHa`W^Hh_(Km2Z(>QR!`W@AR9hPA2LD&gKsy*CD`ol46^~Eh3Ij?? S{K9oW%DG8MB~-(+BC!iBcLsF; literal 0 HcmV?d00001 diff --git a/setup/data/tools/bitmaps/f-structural.bmp b/setup/data/tools/bitmaps/f-structural.bmp new file mode 100644 index 0000000000000000000000000000000000000000..fca065ded5d1a5850b0b133e35be0287e67c7c7f GIT binary patch literal 1334 zcmZ?rHDhG}12Yx|1`Qxf0E!tII3N;0@(mjVGcW=GY3xq literal 0 HcmV?d00001 diff --git a/setup/data/tools/bitmaps/f-world.bmp b/setup/data/tools/bitmaps/f-world.bmp new file mode 100644 index 0000000000000000000000000000000000000000..0b5b72ceb20db0b6b51e09f47b0ae011702fc93e GIT binary patch literal 1334 zcmeHH+YNvq47`FG`Ev{>U;zK!e+hS}eJBR~;a?iAaNLnlAZ&XcVUY)5mCeJ>3V;d335glfgm?5a=x^X3Z@|9*xorsampleSize && 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 */ @@ -1202,6 +1219,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++ ) { diff --git a/tools/quake3/q3map2/main.c b/tools/quake3/q3map2/main.c index 98d77ef9..66dcf64d 100644 --- a/tools/quake3/q3map2/main.c +++ b/tools/quake3/q3map2/main.c @@ -60,7 +60,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 */ @@ -1471,8 +1471,7 @@ int ScaleBSPMain( int argc, char **argv ){ /* 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 ){ @@ -1949,6 +1948,7 @@ int main( int argc, char **argv ){ numthreads = atoi( argv[ i ] ); argv[ i ] = NULL; } + else if( !strcmp( argv[ i ], "-nocmdline" ) ) { Sys_Printf( "noCmdLine\n" ); diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 6d2189ce..8960347c 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -383,7 +383,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 { @@ -397,7 +397,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; @@ -2293,6 +2293,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 ); -- 2.39.2