diff --git a/docs/Complete_list_of_command_line_parameters.htm b/docs/Complete_list_of_command_line_parameters.htm
index b6599809..b1f78a82 100644
--- a/docs/Complete_list_of_command_line_parameters.htm
+++ b/docs/Complete_list_of_command_line_parameters.htm
@@ -401,7 +401,7 @@ td.formatted_questions ol { margin-top: 0px; margin-bottom: 0px; }
PK3 creation¶
- -pk3 ... filename.bsp: Creates a pk3 for the BSP (complete Q3 support). Using file 'gamename.exclude' to exclude vanilla game resources.
+ -pk3 ... filename.bsp .. filenameN.bsp: Creates a pk3 for the BSP(s) (complete Q3 support). Using file 'gamename.exclude' to exclude vanilla game resources.
-complevel N: Set compression level (-1 .. 10); 0 = uncompressed, -1 = 6, 10 = ultra zlib incompatible preset
-dbg: Print wall of debug text, useful for .exclude file creation
-png: include png textures, at highest priority; taking tga, jpg by default
@@ -410,7 +410,7 @@ td.formatted_questions ol { margin-top: 0px; margin-bottom: 0px; }
Maps repack creation¶
- -repack ... filename.bsp or filenames.txt: Creates repack of BSP(s) (complete Q3 support). Rips off only used shaders to new shader file. Using file 'gamename.exclude' to exclude vanilla game resources and 'repack.exclude' to exclude resources of existing repack.
+ -repack ... filename.bsp .. filenameN.bsp or filenames.txt: Creates repack of BSP(s) (complete Q3 support). Rips off only used shaders to new shader file. Using file 'gamename.exclude' to exclude vanilla game resources and 'repack.exclude' to exclude resources of existing repack.
-analyze: Only print bsp resource references and exit
-complevel N: Set compression level (-1 .. 10); 0 = uncompressed, -1 = 6, 10 = ultra zlib incompatible preset
-dbg: Print wall of debug text
diff --git a/libs/os/path.h b/libs/os/path.h
index 14f17c07..aef9ce14 100644
--- a/libs/os/path.h
+++ b/libs/os/path.h
@@ -280,4 +280,30 @@ TextOutputStreamType& ostream_write( TextOutputStreamType& ostream, const Direct
}
+template
+class PathDefaultExtension
+{
+public:
+ static_assert( std::is_same_v || std::is_same_v );
+ const SRC& m_path;
+ const char* m_extension;
+ PathDefaultExtension( const SRC& path, const char* extension ) : m_path( path ), m_extension( extension ) {}
+};
+
+/// \brief Writes \p path to \p ostream and appends extension, if there is none.
+template
+TextOutputStreamType& ostream_write( TextOutputStreamType& ostream, const PathDefaultExtension& path ){
+ ostream << path.m_path;
+ if constexpr ( std::is_same_v ){
+ if( strEmpty( path_get_extension( path.m_path.m_path ) ) )
+ ostream << path.m_extension;
+ }
+ else if constexpr ( std::is_same_v ){
+ if( strEmpty( path_get_extension( path.m_path ) ) )
+ ostream << path.m_extension;
+ }
+ return ostream;
+}
+
+
#endif
diff --git a/tools/quake3/common/stringfixedsize.h b/tools/quake3/common/stringfixedsize.h
index d8dd134f..800e17ca 100644
--- a/tools/quake3/common/stringfixedsize.h
+++ b/tools/quake3/common/stringfixedsize.h
@@ -38,6 +38,13 @@ public:
StringFixedSize() {
clear();
}
+ explicit StringFixedSize( const char* string ){
+ operator()( string );
+ }
+ StringFixedSize( const StringFixedSize& ) = default;
+ StringFixedSize( StringFixedSize&& ) noexcept = default;
+ StringFixedSize& operator=( const StringFixedSize& ) = default;
+ StringFixedSize& operator=( StringFixedSize&& ) noexcept = default;
std::size_t write( const char* buffer, std::size_t length ) override {
if( m_length + length < SIZE ){
for( auto i = length; i != 0; --i )
diff --git a/tools/quake3/q3map2/autopk3.cpp b/tools/quake3/q3map2/autopk3.cpp
index fa9a4b91..64cb1db3 100644
--- a/tools/quake3/q3map2/autopk3.cpp
+++ b/tools/quake3/q3map2/autopk3.cpp
@@ -29,46 +29,27 @@
#include "q3map2.h"
#include "autopk3.h"
+#include