From 02a3b9c026c63ec5bdd85325dfbb77c567388f85 Mon Sep 17 00:00:00 2001 From: Garux Date: Sat, 18 Sep 2021 15:30:11 +0300 Subject: [PATCH] use ostream_write( CopiedString ) --- libs/eclasslib.h | 4 ++-- libs/entitylib.h | 2 +- libs/gtkutil/filechooser.cpp | 2 +- libs/gtkutil/image.cpp | 4 ++-- plugins/archivepak/archive.cpp | 2 +- plugins/archivezip/archive.cpp | 6 +++--- plugins/assmodel/model.cpp | 4 ++-- plugins/entity/namedentity.h | 2 +- plugins/mapq3/plugin.cpp | 2 +- plugins/shaders/shaders.cpp | 20 ++++++++++---------- radiant/autosave.cpp | 2 +- radiant/build.cpp | 6 +++--- radiant/commands.cpp | 2 +- radiant/eclass_doom3.cpp | 16 ++++++++-------- radiant/eclass_fgd.cpp | 10 +++++----- radiant/eclass_xml.cpp | 2 +- radiant/entity.cpp | 4 ++-- radiant/entityinspector.cpp | 8 ++++---- radiant/environment.cpp | 2 +- radiant/findtexturedialog.cpp | 2 +- radiant/gtkdlgs.cpp | 4 ++-- radiant/help.cpp | 2 +- radiant/main.cpp | 6 +++--- radiant/mainframe.cpp | 15 +++++++-------- radiant/map.cpp | 8 ++++---- radiant/modelwindow.cpp | 6 +++--- radiant/patchdialog.cpp | 2 +- radiant/preferences.cpp | 8 ++++---- radiant/preferences.h | 2 +- radiant/referencecache.cpp | 6 +++--- radiant/renderstate.cpp | 2 +- radiant/textures.cpp | 4 ++-- radiant/texwindow.cpp | 8 ++++---- radiant/undo.cpp | 4 ++-- radiant/xywindow.cpp | 4 ++-- tools/quake3/common/vfs.cpp | 6 +++--- tools/quake3/q3map2/autopk3.cpp | 16 ++++++++-------- tools/quake3/q3map2/model.cpp | 2 +- tools/quake3/q3map2/shaders.cpp | 2 +- 39 files changed, 104 insertions(+), 105 deletions(-) diff --git a/libs/eclasslib.h b/libs/eclasslib.h index f70da50f..481f17fe 100644 --- a/libs/eclasslib.h +++ b/libs/eclasslib.h @@ -87,14 +87,14 @@ typedef std::list EntityClassAttributes; typedef std::list StringList; inline const char* EntityClassAttributePair_getName( const EntityClassAttributePair& attributePair ){ - if ( !string_empty( attributePair.second.m_name.c_str() ) ) { + if ( !attributePair.second.m_name.empty() ) { return attributePair.second.m_name.c_str(); } return attributePair.first.c_str(); } inline const char* EntityClassAttributePair_getDescription( const EntityClassAttributePair& attributePair ){ - if ( !string_empty( attributePair.second.m_description.c_str() ) ) { + if ( !attributePair.second.m_description.empty() ) { return attributePair.second.m_description.c_str(); } return EntityClassAttributePair_getName( attributePair ); diff --git a/libs/entitylib.h b/libs/entitylib.h index 94e61d29..f0fbed3e 100644 --- a/libs/entitylib.h +++ b/libs/entitylib.h @@ -356,7 +356,7 @@ public: m_observers.erase( observer ); } const char* c_str() const { - if ( string_empty( m_string.c_str() ) ) { + if ( m_string.empty() ) { return m_empty; } return m_string.c_str(); diff --git a/libs/gtkutil/filechooser.cpp b/libs/gtkutil/filechooser.cpp index 27621ecd..79dacec4 100644 --- a/libs/gtkutil/filechooser.cpp +++ b/libs/gtkutil/filechooser.cpp @@ -96,7 +96,7 @@ public: std::size_t len = strlen( ( *i ).m_name.c_str() ) + strlen( ( *i ).m_pattern.c_str() ) + 3; StringOutputStream buffer( len + 1 ); // length + null char - buffer << ( *i ).m_name.c_str() << " <" << ( *i ).m_pattern.c_str() << ">"; + buffer << ( *i ).m_name << " <" << ( *i ).m_pattern << ">"; m_masks.push_back( buffer.c_str() ); } diff --git a/libs/gtkutil/image.cpp b/libs/gtkutil/image.cpp index 97bd0bff..e4122c84 100644 --- a/libs/gtkutil/image.cpp +++ b/libs/gtkutil/image.cpp @@ -77,6 +77,6 @@ GtkImage* new_image( const char* filename ){ GtkImage* new_local_image( const char* filename ){ StringOutputStream fullPath( 256 ); - fullPath << g_bitmapsPath.c_str() << filename; - return new_image( fullPath.c_str() ); + fullPath << g_bitmapsPath << filename; + return new_image( fullPath ); } diff --git a/plugins/archivepak/archive.cpp b/plugins/archivepak/archive.cpp index ec88f15f..d560e7d1 100644 --- a/plugins/archivepak/archive.cpp +++ b/plugins/archivepak/archive.cpp @@ -92,7 +92,7 @@ public: PakFileSystem::entry_type& file = m_filesystem[entry.filename]; if ( !file.is_directory() ) { - globalWarningStream() << "Warning: pak archive " << makeQuoted( m_name.c_str() ) << " contains duplicated file: " << makeQuoted( entry.filename ) << "\n"; + globalWarningStream() << "Warning: pak archive " << makeQuoted( m_name ) << " contains duplicated file: " << makeQuoted( entry.filename ) << "\n"; } else { diff --git a/plugins/archivezip/archive.cpp b/plugins/archivezip/archive.cpp index c79c334b..4dfd7e02 100644 --- a/plugins/archivezip/archive.cpp +++ b/plugins/archivezip/archive.cpp @@ -161,7 +161,7 @@ class ZipArchive final : public Archive { ZipFileSystem::entry_type& file = m_filesystem[filename.data()]; if ( !file.is_directory() ) { - globalWarningStream() << "Warning: zip archive " << makeQuoted( m_name.c_str() ) << " contains duplicated file: " << makeQuoted( filename.data() ) << "\n"; + globalWarningStream() << "Warning: zip archive " << makeQuoted( m_name ) << " contains duplicated file: " << makeQuoted( filename.data() ) << "\n"; } else { @@ -225,7 +225,7 @@ public: zip_file_header file_header; istream_read_zip_file_header( m_istream, file_header ); if ( file_header.z_magic != zip_file_header_magic ) { - globalErrorStream() << "error reading zip file " << makeQuoted( m_name.c_str() ); + globalErrorStream() << "error reading zip file " << makeQuoted( m_name ); return 0; } @@ -248,7 +248,7 @@ public: zip_file_header file_header; istream_read_zip_file_header( m_istream, file_header ); if ( file_header.z_magic != zip_file_header_magic ) { - globalErrorStream() << "error reading zip file " << makeQuoted( m_name.c_str() ); + globalErrorStream() << "error reading zip file " << makeQuoted( m_name ); return 0; } diff --git a/plugins/assmodel/model.cpp b/plugins/assmodel/model.cpp index 1d70dff9..bb496ca1 100644 --- a/plugins/assmodel/model.cpp +++ b/plugins/assmodel/model.cpp @@ -249,7 +249,7 @@ private: const CopiedString oldShader( m_shader ); if( strchr( m_shader.c_str(), '/' ) == nullptr ){ /* texture is likely in the folder, where model is */ - m_shader = StringOutputStream()( scene.m_rootPath, m_shader.c_str() ); + m_shader = StringOutputStream()( scene.m_rootPath, m_shader ); } else{ const char *name = m_shader.c_str(); @@ -266,7 +266,7 @@ private: } if( oldShader != m_shader ) - globalOutputStream() << "substituting: " << oldShader.c_str() << " -> " << m_shader.c_str() << "\n"; + globalOutputStream() << "substituting: " << oldShader << " -> " << m_shader << "\n"; } m_vertices.resize( mesh->mNumVertices ); diff --git a/plugins/entity/namedentity.h b/plugins/entity/namedentity.h index 86e6c3a2..fa465b68 100644 --- a/plugins/entity/namedentity.h +++ b/plugins/entity/namedentity.h @@ -58,7 +58,7 @@ public: NamedEntity( EntityKeyValues& entity ) : m_entity( entity ){ } const char* name() const { - if ( string_empty( m_name.c_str() ) ) { + if ( m_name.empty() ) { return m_entity.getClassName(); } return m_name.c_str(); diff --git a/plugins/mapq3/plugin.cpp b/plugins/mapq3/plugin.cpp index 21332e12..6df55007 100644 --- a/plugins/mapq3/plugin.cpp +++ b/plugins/mapq3/plugin.cpp @@ -607,7 +607,7 @@ void VMF_parseBlock( Tokeniser& tokeniser, const VMFBlock& block ){ tokeniser.nextLine(); if ( string_equal( value, "{" ) ) { VMFBlock::const_iterator i = VMFBlock_find( block, tmp.c_str() ); - ASSERT_MESSAGE( i != block.end(), "error parsing vmf block " << makeQuoted( block.name() ) << ": unknown block: " << makeQuoted( tmp.c_str() ) ); + ASSERT_MESSAGE( i != block.end(), "error parsing vmf block " << makeQuoted( block.name() ) << ": unknown block: " << makeQuoted( tmp ) ); if ( string_equal( tmp.c_str(), "solid" ) ) { ++g_vmf_brushes; } diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index fa1f8e3e..9c8acff1 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -458,7 +458,7 @@ bool parseShaderParameters( Tokeniser& tokeniser, ShaderParameters& params ){ bool ShaderTemplate::parseTemplate( Tokeniser& tokeniser ){ m_Name = tokeniser.getToken(); if ( !parseShaderParameters( tokeniser, m_params ) ) { - globalErrorStream() << "shader template: " << makeQuoted( m_Name.c_str() ) << ": parameter parse failed\n"; + globalErrorStream() << "shader template: " << makeQuoted( m_Name ) << ": parameter parse failed\n"; return false; } @@ -502,7 +502,7 @@ bool ShaderTemplate::parseDoom3( Tokeniser& tokeniser ){ else if ( currentLayer.m_type == LAYER_SPECULARMAP ) { m_specular = currentLayer.m_texture; } - else if ( !string_empty( currentLayer.m_texture.c_str() ) ) { + else if ( !currentLayer.m_texture.empty() ) { m_layers.push_back( MapLayerTemplate( currentLayer.m_texture.c_str(), currentLayer.m_blendFunc, @@ -664,7 +664,7 @@ bool ShaderTemplate::parseDoom3( Tokeniser& tokeniser ){ } } - if ( string_empty( m_textureName.c_str() ) ) { + if ( m_textureName.empty() ) { m_textureName = m_diffuse; } @@ -706,18 +706,18 @@ bool parseTemplateInstance( Tokeniser& tokeniser, const char* filename ){ const char* templateName = tokeniser.getToken(); ShaderTemplate* shaderTemplate = findTemplate( templateName ); if ( shaderTemplate == 0 ) { - globalErrorStream() << "shader instance: " << makeQuoted( name.c_str() ) << ": shader template not found: " << makeQuoted( templateName ) << "\n"; + globalErrorStream() << "shader instance: " << makeQuoted( name ) << ": shader template not found: " << makeQuoted( templateName ) << "\n"; } ShaderArguments args; if ( !parseShaderParameters( tokeniser, args ) ) { - globalErrorStream() << "shader instance: " << makeQuoted( name.c_str() ) << ": argument parse failed\n"; + globalErrorStream() << "shader instance: " << makeQuoted( name ) << ": argument parse failed\n"; return false; } if ( shaderTemplate != 0 ) { if ( !g_shaderDefinitions.insert( ShaderDefinitionMap::value_type( name, ShaderDefinition( shaderTemplate, args, filename ) ) ).second ) { - globalErrorStream() << "shader instance: " << makeQuoted( name.c_str() ) << ": already exists, second definition ignored\n"; + globalErrorStream() << "shader instance: " << makeQuoted( name ) << ": already exists, second definition ignored\n"; } } return true; @@ -1092,7 +1092,7 @@ public: } qtexture_t* lightFalloffImage() const { - if ( !string_empty( m_template.m_lightFalloffImage.c_str() ) ) { + if ( !m_template.m_lightFalloffImage.empty() ) { return m_pLightFalloffImage; } return 0; @@ -1146,7 +1146,7 @@ void FreeShaders(){ bool ShaderTemplate::parseQuake3( Tokeniser& tokeniser ){ // name of the qtexture_t we'll use to represent this shader (this one has the "textures\" before) - m_textureName = m_Name.c_str(); + m_textureName = m_Name; tokeniser.nextLine(); @@ -1552,7 +1552,7 @@ void ShaderList_addShaderFile( const char* dirstring ){ { if ( string_equal_nocase( dirstring, sh.c_str() ) ) { found = true; - globalOutputStream() << "duplicate entry \"" << sh.c_str() << "\" in shaderlist.txt\n"; + globalOutputStream() << "duplicate entry \"" << sh << "\" in shaderlist.txt\n"; break; } } @@ -1677,7 +1677,7 @@ void Shaders_Load(){ StringOutputStream shadername( 256 ); for( const CopiedString& sh : l_shaderfiles ) { - shadername << path.c_str() << sh.c_str(); + shadername << path.c_str() << sh; LoadShaderFile( shadername.c_str() ); shadername.clear(); } diff --git a/radiant/autosave.cpp b/radiant/autosave.cpp index fb9c9775..ca976524 100644 --- a/radiant/autosave.cpp +++ b/radiant/autosave.cpp @@ -143,7 +143,7 @@ void QE_CheckAutoSave( void ){ { if ( Map_Unnamed( g_map ) ) { StringOutputStream autosave( 256 ); - autosave << g_qeglobals.m_userGamePath.c_str() << "maps/"; + autosave << g_qeglobals.m_userGamePath << "maps/"; Q_mkdir( autosave.c_str() ); autosave << "autosave.map"; Map_SaveFile( autosave.c_str() ); diff --git a/radiant/build.cpp b/radiant/build.cpp index cc6256e9..9887221b 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -769,7 +769,7 @@ gboolean project_key_press( GtkWidget* widget, GdkEventKey* event, ProjectList* else if ( event_is_copy( event ) && x != project.end() ) { g_buildpair_copied = ( *x ); } - else if ( event_is_paste( event ) && string_not_empty( g_buildpair_copied.first.c_str() ) ) { + else if ( event_is_paste( event ) && !g_buildpair_copied.first.empty() ) { projectList->m_changed = true; project.insert( x, g_buildpair_copied ); Build_refreshMenu( g_bsp_menu ); @@ -1020,7 +1020,7 @@ GtkWindow* BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi } StringOutputStream stream; for( Variables::iterator i = g_build_variables.begin(); i != g_build_variables.end(); ++i ){ - stream << "[" << ( *i ).first.c_str() << "] = " << ( *i ).second.c_str() << "\n"; + stream << "[" << ( *i ).first << "] = " << ( *i ).second << "\n"; } build_clear_variables(); @@ -1144,7 +1144,7 @@ const char* g_buildMenuFullPah(){ static StringOutputStream buffer( 256 ); buffer.clear(); - buffer << SettingsPath_get() << g_pGameDescription->mGameFile.c_str() << "/" << g_buildMenu.c_str(); + buffer << SettingsPath_get() << g_pGameDescription->mGameFile << "/" << g_buildMenu; return buffer.c_str(); } } diff --git a/radiant/commands.cpp b/radiant/commands.cpp index fe3b5446..288a9da6 100644 --- a/radiant/commands.cpp +++ b/radiant/commands.cpp @@ -63,7 +63,7 @@ void GlobalShortcuts_register( const char* name, int type ){ void GlobalShortcuts_reportUnregistered(){ for ( auto& pair : g_shortcuts ) if ( pair.second.accelerator.key != 0 && pair.second.type == 0 ) - globalWarningStream() << "shortcut not registered: " << pair.first.c_str() << "\n"; + globalWarningStream() << "shortcut not registered: " << pair.first << "\n"; } typedef std::map Commands; diff --git a/radiant/eclass_doom3.cpp b/radiant/eclass_doom3.cpp index 82f27feb..35e51a3e 100644 --- a/radiant/eclass_doom3.cpp +++ b/radiant/eclass_doom3.cpp @@ -170,10 +170,10 @@ void Model_resolveInheritance( const char* name, Model& model ){ if ( model.m_resolved == false ) { model.m_resolved = true; - if ( !string_empty( model.m_parent.c_str() ) ) { + if ( !model.m_parent.empty() ) { Models::iterator i = g_models.find( model.m_parent ); if ( i == g_models.end() ) { - globalErrorStream() << "model " << name << " inherits unknown model " << model.m_parent.c_str() << "\n"; + globalErrorStream() << "model " << name << " inherits unknown model " << model.m_parent << "\n"; } else { @@ -512,7 +512,7 @@ static bool EntityClass_parse( EntityClass& entityClass, Tokeniser& tokeniser ){ const char* value; PARSE_RETURN_FALSE_IF_FAIL( EntityClassDoom3_parseString( tokeniser, value ) ); if ( string_equal( value, "}" ) ) { // hack for quake4 powerups.def bug - globalErrorStream() << "entityDef " << makeQuoted( entityClass.name() ) << " key " << makeQuoted( tmp.c_str() ) << " has no value\n"; + globalErrorStream() << "entityDef " << makeQuoted( entityClass.name() ) << " key " << makeQuoted( tmp ) << " has no value\n"; break; } else @@ -604,7 +604,7 @@ bool EntityClassDoom3_parse( TextInputStream& inputStream, const char* filename } CopiedString tmp( blockType ); if ( !EntityClassDoom3_parseBlock( tokeniser, tmp.c_str() ) ) { - globalErrorStream() << GlobalFileSystem().findFile( filename ) << filename << ":" << (unsigned int)tokeniser.getLine() << ": " << tmp.c_str() << " parse failed, skipping rest of file\n"; + globalErrorStream() << GlobalFileSystem().findFile( filename ) << filename << ":" << (unsigned int)tokeniser.getLine() << ": " << tmp << " parse failed, skipping rest of file\n"; return false; } } @@ -656,7 +656,7 @@ void EntityClass_resolveInheritance( EntityClass* derivedClass ){ derivedClass->inheritanceResolved = true; EntityClasses::iterator i = g_EntityClassDoom3_classes.find( derivedClass->m_parent.front().c_str() ); if ( i == g_EntityClassDoom3_classes.end() ) { - globalErrorStream() << "failed to find entityDef " << makeQuoted( derivedClass->m_parent.front().c_str() ) << " inherited by " << makeQuoted( derivedClass->name() ) << "\n"; + globalErrorStream() << "failed to find entityDef " << makeQuoted( derivedClass->m_parent.front() ) << " inherited by " << makeQuoted( derivedClass->name() ) << "\n"; } else { @@ -703,7 +703,7 @@ public: for ( EntityClasses::iterator i = g_EntityClassDoom3_classes.begin(); i != g_EntityClassDoom3_classes.end(); ++i ) { EntityClass_resolveInheritance( ( *i ).second ); - if ( !string_empty( ( *i ).second->m_modelpath.c_str() ) ) { + if ( !( *i ).second->m_modelpath.empty() ) { Models::iterator j = g_models.find( ( *i ).second->m_modelpath ); if ( j != g_models.end() ) { ( *i ).second->m_modelpath = ( *j ).second.m_mesh; @@ -716,8 +716,8 @@ public: usage << "-------- NOTES --------\n"; - if ( !string_empty( ( *i ).second->m_comments.c_str() ) ) { - usage << ( *i ).second->m_comments.c_str() << "\n"; + if ( !( *i ).second->m_comments.empty() ) { + usage << ( *i ).second->m_comments << "\n"; } usage << "\n-------- KEYS --------\n"; diff --git a/radiant/eclass_fgd.cpp b/radiant/eclass_fgd.cpp index bb39cd49..8b440391 100644 --- a/radiant/eclass_fgd.cpp +++ b/radiant/eclass_fgd.cpp @@ -395,7 +395,7 @@ void EntityClassFGD_parseClass( Tokeniser& tokeniser, bool fixedsize, bool isBas tokeniser.nextLine(); StringOutputStream listTypeName( 64 ); - listTypeName << entityClass->name() << "_" << attribute.m_name.c_str(); + listTypeName << entityClass->name() << "_" << attribute.m_name; attribute.m_type = listTypeName.c_str(); ListAttributeType& listType = g_listTypesFGD[listTypeName.c_str()]; @@ -429,7 +429,7 @@ void EntityClassFGD_parseClass( Tokeniser& tokeniser, bool fixedsize, bool isBas for ( ListAttributeType::const_iterator i = listType.begin(); i != listType.end(); ++i ) { if ( string_equal( attribute.m_value.c_str(), ( *i ).first.c_str() ) ) { - attribute.m_value = ( *i ).second.c_str(); + attribute.m_value = ( *i ).second; } } @@ -504,7 +504,7 @@ void EntityClassFGD_parseClass( Tokeniser& tokeniser, bool fixedsize, bool isBas } else { - ERROR_MESSAGE( "unknown key type: " << makeQuoted( type.c_str() ) ); + ERROR_MESSAGE( "unknown key type: " << makeQuoted( type ) ); } tokeniser.nextLine(); } @@ -669,7 +669,7 @@ public: } for( const auto& [ name, path ] : name_path ){ - EntityClassFGD_loadFile( StringOutputStream()( path, name.c_str() ) ); + EntityClassFGD_loadFile( StringOutputStream()( path, name ) ); } } @@ -677,7 +677,7 @@ public: for ( EntityClasses::iterator i = g_EntityClassFGD_classes.begin(); i != g_EntityClassFGD_classes.end(); ++i ) { EntityClassFGD_resolveInheritance( ( *i ).second ); - if ( ( *i ).second->fixedsize && string_empty( ( *i ).second->m_modelpath.c_str() ) ) { + if ( ( *i ).second->fixedsize && ( *i ).second->m_modelpath.empty() ) { if ( !( *i ).second->sizeSpecified ) { globalErrorStream() << "size not specified for entity class: " << makeQuoted( ( *i ).second->name() ) << '\n'; } diff --git a/radiant/eclass_xml.cpp b/radiant/eclass_xml.cpp index 5b4a6d07..4ed73b6a 100644 --- a/radiant/eclass_xml.cpp +++ b/radiant/eclass_xml.cpp @@ -245,7 +245,7 @@ public: desc = StringRange( data, data + length ); } else{ // in case of special symbols, e.g. ", &apos, <, >, &, xml writes in a few steps - desc = StringOutputStream()( desc.c_str(), StringRange( data, data + length ) ); + desc = StringOutputStream()( desc, StringRange( data, data + length ) ); } return m_comment.write( data, length ); diff --git a/radiant/entity.cpp b/radiant/entity.cpp index 71b7ce42..2128b275 100644 --- a/radiant/entity.cpp +++ b/radiant/entity.cpp @@ -595,12 +595,12 @@ const char* misc_model_dialog( GtkWidget* parent, const char* filepath ){ buffer << root << filepath; } if( buffer.empty() ){ - buffer << g_qeglobals.m_userGamePath.c_str() << "models/"; + buffer << g_qeglobals.m_userGamePath << "models/"; if ( !file_readable( buffer.c_str() ) ) { // just go to fsmain buffer.clear(); - buffer << g_qeglobals.m_userGamePath.c_str(); + buffer << g_qeglobals.m_userGamePath; } } diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 8b62a1d9..3d57fa50 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -314,12 +314,12 @@ const char* browse_sound( GtkWidget* parent, const char* filepath ){ buffer << root << filepath; } if( buffer.empty() ){ - buffer << g_qeglobals.m_userGamePath.c_str() << "sound/"; + buffer << g_qeglobals.m_userGamePath << "sound/"; if ( !file_readable( buffer.c_str() ) ) { // just go to fsmain buffer.clear(); - buffer << g_qeglobals.m_userGamePath.c_str(); + buffer << g_qeglobals.m_userGamePath; } } @@ -1221,9 +1221,9 @@ void EntityInspector_updateKeyValues(){ GtkTreeIter iter; gtk_list_store_append( store, &iter ); StringOutputStream key( 64 ); - key << ( *i ).first.c_str(); + key << ( *i ).first; StringOutputStream value( 64 ); - value << ( *i ).second.c_str(); + value << ( *i ).second; gtk_list_store_set( store, &iter, 0, key.c_str(), 1, value.c_str(), -1 ); } diff --git a/radiant/environment.cpp b/radiant/environment.cpp index c5b0e5dc..d37941f2 100644 --- a/radiant/environment.cpp +++ b/radiant/environment.cpp @@ -186,7 +186,7 @@ const char* environment_get_app_filepath(){ bool portable_app_setup(){ StringOutputStream confdir( 256 ); - confdir << app_path.c_str() << "settings/"; + confdir << app_path << "settings/"; if ( file_exists( confdir.c_str() ) ) { home_path = confdir.c_str(); return true; diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index 2a12d4b9..73af64a0 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -79,7 +79,7 @@ static bool g_bFindActive = true; namespace { void FindTextureDialog_apply(){ - const auto find = StringOutputStream( 256 )( "textures/", g_FindTextureDialog.m_strFind.c_str() ); + const auto find = StringOutputStream( 256 )( "textures/", g_FindTextureDialog.m_strFind ); const auto replace = StringOutputStream( 256 )( "textures/", PathCleaned( g_FindTextureDialog.m_strReplace.c_str() ) ); FindReplaceTextures( find.c_str(), replace.c_str(), g_FindTextureDialog.m_bSelectedOnly ); } diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index bdf07d89..ca1787b7 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -803,7 +803,7 @@ class TextEditor gtk_widget_set_sensitive( self->m_button, modified ); StringOutputStream str( 256 ); - str << ( modified? "*" : "" ) << self->m_filename.c_str(); + str << ( modified? "*" : "" ) << self->m_filename; gtk_window_set_title( GTK_WINDOW( self->m_window ), str.c_str() ); } @@ -1074,7 +1074,7 @@ void DoShaderView( const char *shaderFileName, const char *shaderName, bool exte } else{ StringOutputStream command( 256 ); - command << g_TextEditor_editorCommand.c_str() << " \"" << pathFull.c_str() << "\""; + command << g_TextEditor_editorCommand << " \"" << pathFull.c_str() << "\""; globalOutputStream() << "Launching: " << command.c_str() << "\n"; // note: linux does not return false if the command failed so it will assume success if ( !Q_Exec( 0, const_cast( command.c_str() ), 0, true, false ) ) diff --git a/radiant/help.cpp b/radiant/help.cpp index ce818665..cf011121 100644 --- a/radiant/help.cpp +++ b/radiant/help.cpp @@ -119,7 +119,7 @@ void create_game_help_menu( GtkMenu *menu ){ #if 1 filename.clear(); - filename << g_pGameDescription->mGameToolsPath.c_str() << "game.xlink"; + filename << g_pGameDescription->mGameToolsPath << "game.xlink"; process_xlink( filename.c_str(), g_pGameDescription->getRequiredKeyValue( "name" ), g_pGameDescription->mGameToolsPath.c_str(), menu ); #else for ( std::list::iterator iGame = g_GamesDialog.mGames.begin(); iGame != g_GamesDialog.mGames.end(); ++iGame ) diff --git a/radiant/main.cpp b/radiant/main.cpp index eb087745..6bd1f844 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -354,7 +354,7 @@ void paths_init(){ // (for now I had to create symlinks) { StringOutputStream path( 256 ); - path << g_strAppPath.c_str() << "bitmaps/"; + path << g_strAppPath << "bitmaps/"; BitmapsPath_set( path.c_str() ); } @@ -486,7 +486,7 @@ void remove_global_pid(){ */ void create_local_pid(){ StringOutputStream g_pidGameFile( 256 ); ///< the game-specific .pid file - g_pidGameFile << SettingsPath_get() << g_pGameDescription->mGameFile.c_str() << "/radiant-game.pid"; + g_pidGameFile << SettingsPath_get() << g_pGameDescription->mGameFile << "/radiant-game.pid"; FILE *pid = fopen( g_pidGameFile.c_str(), "r" ); if ( pid != 0 ) { @@ -535,7 +535,7 @@ void create_local_pid(){ */ void remove_local_pid(){ StringOutputStream g_pidGameFile( 256 ); - g_pidGameFile << SettingsPath_get() << g_pGameDescription->mGameFile.c_str() << "/radiant-game.pid"; + g_pidGameFile << SettingsPath_get() << g_pGameDescription->mGameFile << "/radiant-game.pid"; remove( g_pidGameFile.c_str() ); } diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 5e729378..fef31110 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -252,10 +252,10 @@ void HomePaths_Realise(){ { StringOutputStream path( 256 ); - path << g_qeglobals.m_userEnginePath.c_str() << gamename_get() << '/'; + path << g_qeglobals.m_userEnginePath << gamename_get() << '/'; g_qeglobals.m_userGamePath = path.c_str(); } - ASSERT_MESSAGE( !string_empty( g_qeglobals.m_userGamePath.c_str() ), "HomePaths_Realise: user-game-path is empty" ); + ASSERT_MESSAGE( !g_qeglobals.m_userGamePath.empty(), "HomePaths_Realise: user-game-path is empty" ); Q_mkdir( g_qeglobals.m_userGamePath.c_str() ); } @@ -382,7 +382,7 @@ const char* LocalRcPath_get(){ static CopiedString rc_path; if ( rc_path.empty() ) { StringOutputStream stream( 256 ); - stream << GlobalRadiant().getSettingsPath() << g_pGameDescription->mGameFile.c_str() << "/"; + stream << GlobalRadiant().getSettingsPath() << g_pGameDescription->mGameFile << "/"; rc_path = stream.c_str(); } return rc_path.c_str(); @@ -499,11 +499,10 @@ const char* basegame_get(){ } const char* gamename_get(){ - const char* gamename = g_gamename.c_str(); - if ( string_empty( gamename ) ) { + if ( g_gamename.empty() ) { return basegame_get(); } - return gamename; + return g_gamename.c_str(); } void gamename_set( const char* gamename ){ @@ -2971,14 +2970,14 @@ gboolean toolbar_redirect_scroll( GtkWidget* widget, GdkEventScroll* event, gpoi void user_shortcuts_init(){ StringOutputStream path( 256 ); - path << SettingsPath_get() << g_pGameDescription->mGameFile.c_str() << '/'; + path << SettingsPath_get() << g_pGameDescription->mGameFile << '/'; LoadCommandMap( path.c_str() ); SaveCommandMap( path.c_str() ); } void user_shortcuts_save(){ StringOutputStream path( 256 ); - path << SettingsPath_get() << g_pGameDescription->mGameFile.c_str() << '/'; + path << SettingsPath_get() << g_pGameDescription->mGameFile << '/'; SaveCommandMap( path.c_str() ); } diff --git a/radiant/map.cpp b/radiant/map.cpp index 97cdae84..84b2230c 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -1149,7 +1149,7 @@ void Map_LoadFile( const char *filename ){ } globalOutputStream() << "--- LoadMapFile ---\n"; - globalOutputStream() << g_map.m_name.c_str() << "\n"; + globalOutputStream() << g_map.m_name << "\n"; globalOutputStream() << Unsigned( g_brushCount.get() + g_patchCount.get() ) << " primitives\n"; globalOutputStream() << Unsigned( g_entityCount.get() ) << " entities\n"; @@ -2446,7 +2446,7 @@ void map_autocaulk_selected(){ str << AppPath_get() << "q3map2." << RADIANT_EXECUTABLE << " -game quake3" << " -fs_basepath \"" << EnginePath_get() - << "\" -fs_homepath \"" << g_qeglobals.m_userEnginePath.c_str() + << "\" -fs_homepath \"" << g_qeglobals.m_userEnginePath << "\" -fs_game " << gamename_get() << " -autocaulk -fulldetail" << " \"" << filename.c_str() << "\""; @@ -2597,9 +2597,9 @@ public: } void realise(){ if ( --m_unrealised == 0 ) { - ASSERT_MESSAGE( !string_empty( g_qeglobals.m_userGamePath.c_str() ), "maps_directory: user-game-path is empty" ); + ASSERT_MESSAGE( !g_qeglobals.m_userGamePath.empty(), "maps_directory: user-game-path is empty" ); StringOutputStream buffer( 256 ); - buffer << g_qeglobals.m_userGamePath.c_str() << "maps/"; + buffer << g_qeglobals.m_userGamePath << "maps/"; Q_mkdir( buffer.c_str() ); g_mapsPath = buffer.c_str(); } diff --git a/radiant/modelwindow.cpp b/radiant/modelwindow.cpp index f08c5d32..6b0edd1b 100644 --- a/radiant/modelwindow.cpp +++ b/radiant/modelwindow.cpp @@ -1032,7 +1032,7 @@ gboolean ModelBrowser_button_press( GtkWidget* widget, GdkEventButton* event, Mo Instance_setSelected( instance, true ); StringOutputStream sstream( 128 ); - sstream << modelBrowser->m_currentFolderPath.c_str() << std::next( modelBrowser->m_currentFolder->m_files.begin(), modelBrowser->m_currentModelId )->c_str(); + sstream << modelBrowser->m_currentFolderPath << std::next( modelBrowser->m_currentFolder->m_files.begin(), modelBrowser->m_currentModelId )->c_str(); Node_getEntity( node )->setKeyValue( entityClass->miscmodel_key(), sstream.c_str() ); } return FALSE; @@ -1045,7 +1045,7 @@ gboolean ModelBrowser_button_release( GtkWidget* widget, GdkEventButton* event, } if ( event->button == 1 && modelBrowser->m_move_amount < 16 && modelBrowser->m_currentFolder != nullptr && modelBrowser->m_currentModelId >= 0 ) { // assign model to selected entity nodes StringOutputStream sstream( 128 ); - sstream << modelBrowser->m_currentFolderPath.c_str() << std::next( modelBrowser->m_currentFolder->m_files.begin(), modelBrowser->m_currentModelId )->c_str(); + sstream << modelBrowser->m_currentFolderPath << std::next( modelBrowser->m_currentFolder->m_files.begin(), modelBrowser->m_currentModelId )->c_str(); class EntityVisitor : public SelectionSystem::Visitor { const char* m_filePath; @@ -1100,7 +1100,7 @@ static void TreeView_onRowActivated( GtkTreeView* treeview, GtkTreePath* path, G { for( const CopiedString& filename : g_ModelBrowser.m_currentFolder->m_files ){ sstream.clear(); - sstream << g_ModelBrowser.m_currentFolderPath.c_str() << filename.c_str(); + sstream << g_ModelBrowser.m_currentFolderPath << filename; ModelNode *modelNode = new ModelNode; modelNode->setModel( sstream.c_str() ); NodeSmartReference node( modelNode->node() ); diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index ce23b080..0fb023a3 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -319,7 +319,7 @@ static void OnApply( GtkWidget *widget, gpointer data ){ g_PatchInspector.m_Patch->undoSave(); if ( !texdef_name_valid( g_PatchInspector.m_strName.c_str() ) ) { - globalErrorStream() << "invalid texture name '" << g_PatchInspector.m_strName.c_str() << "'\n"; + globalErrorStream() << "invalid texture name '" << g_PatchInspector.m_strName << "'\n"; g_PatchInspector.m_strName = texdef_name_default(); } g_PatchInspector.m_Patch->SetShader( g_PatchInspector.m_strName.c_str() ); diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 8ec4126f..1b2f7876 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -93,11 +93,11 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const CopiedString& gameFile { StringOutputStream path( 256 ); - path << AppPath_get() << gameFile.c_str() << "/"; + path << AppPath_get() << gameFile << "/"; mGameToolsPath = path.c_str(); } - ASSERT_MESSAGE( file_exists( mGameToolsPath.c_str() ), "game directory not found: " << makeQuoted( mGameToolsPath.c_str() ) ); + ASSERT_MESSAGE( file_exists( mGameToolsPath.c_str() ), "game directory not found: " << makeQuoted( mGameToolsPath ) ); mGameFile = gameFile; @@ -116,10 +116,10 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const CopiedString& gameFile } void CGameDescription::Dump(){ - globalOutputStream() << "game description file: " << makeQuoted( mGameFile.c_str() ) << "\n"; + globalOutputStream() << "game description file: " << makeQuoted( mGameFile ) << "\n"; for ( GameDescription::iterator i = m_gameDescription.begin(); i != m_gameDescription.end(); ++i ) { - globalOutputStream() << ( *i ).first.c_str() << " = " << makeQuoted( ( *i ).second.c_str() ) << "\n"; + globalOutputStream() << ( *i ).first << " = " << makeQuoted( ( *i ).second ) << "\n"; } } diff --git a/radiant/preferences.h b/radiant/preferences.h index 5f143cae..7be2ca6c 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -204,7 +204,7 @@ public: if ( i != m_gameDescription.end() ) { return ( *i ).second.c_str(); } - ERROR_MESSAGE( "game attribute " << makeQuoted( key ) << " not found in " << makeQuoted( mGameFile.c_str() ) ); + ERROR_MESSAGE( "game attribute " << makeQuoted( key ) << " not found in " << makeQuoted( mGameFile ) ); return ""; } diff --git a/radiant/referencecache.cpp b/radiant/referencecache.cpp index 72338039..603745c7 100644 --- a/radiant/referencecache.cpp +++ b/radiant/referencecache.cpp @@ -348,7 +348,7 @@ struct ModelResource : public Resource if ( realised() ) { unrealise(); } - ASSERT_MESSAGE( !realised(), "ModelResource::~ModelResource: resource reference still realised: " << makeQuoted( m_name.c_str() ) ); + ASSERT_MESSAGE( !realised(), "ModelResource::~ModelResource: resource reference still realised: " << makeQuoted( m_name ) ); } // NOT COPYABLE ModelResource( const ModelResource& ) = delete; @@ -475,8 +475,8 @@ struct ModelResource : public Resource } std::time_t modified() const { StringOutputStream fullpath( 256 ); - fullpath << m_path.c_str() << m_name.c_str(); - return file_modified( fullpath.c_str() ); + fullpath << m_path << m_name; + return file_modified( fullpath ); } void mapSave(){ m_modified = modified(); diff --git a/radiant/renderstate.cpp b/radiant/renderstate.cpp index 200d8381..c85a09ab 100644 --- a/radiant/renderstate.cpp +++ b/radiant/renderstate.cpp @@ -1173,7 +1173,7 @@ public: ~OpenGLShaderCache(){ for ( Shaders::iterator i = m_shaders.begin(); i != m_shaders.end(); ++i ) { - globalOutputStream() << "leaked shader: " << makeQuoted( ( *i ).key.c_str() ) << "\n"; + globalOutputStream() << "leaked shader: " << makeQuoted( ( *i ).key ) << "\n"; } } Shader* capture( const char* name ){ diff --git a/radiant/textures.cpp b/radiant/textures.cpp index aa7dcb84..c82e0ab9 100644 --- a/radiant/textures.cpp +++ b/radiant/textures.cpp @@ -341,12 +341,12 @@ void qtexture_realise( qtexture_t& texture, const TextureKey& key ){ texture.contentFlags = image->getContentFlags(); texture.value = image->getValue(); image->release(); - globalOutputStream() << "Loaded Texture: \"" << key.second.c_str() << "\"\n"; + globalOutputStream() << "Loaded Texture: \"" << key.second << "\"\n"; GlobalOpenGL_debugAssertNoErrors(); } else { - globalErrorStream() << "Texture load failed: \"" << key.second.c_str() << "\"\n"; + globalErrorStream() << "Texture load failed: \"" << key.second << "\"\n"; } } } diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 8de970ce..51cd8221 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -1962,7 +1962,7 @@ void TextureBrowser_checkTagFile(){ else { // load default tagfile - auto default_filename = StringOutputStream( 256 )( g_pGameDescription->mGameToolsPath.c_str(), SHADERTAG_FILE ); + auto default_filename = StringOutputStream( 256 )( g_pGameDescription->mGameToolsPath, SHADERTAG_FILE ); if ( file_exists( default_filename ) ) { g_TextureBrowser.m_tags = TagBuilder.OpenXmlDoc( default_filename, rc_filename ); @@ -2452,7 +2452,7 @@ void TextureBrowser_copyTag(){ void TextureBrowser_pasteTag(){ IShader* ishader = QERApp_Shader_ForName( g_TextureBrowser.shader.c_str() ); - CopiedString shader = g_TextureBrowser.shader.c_str(); + const CopiedString shader = g_TextureBrowser.shader; if ( !TagBuilder.CheckShaderTag( shader.c_str() ) ) { CopiedString shaderFile = ishader->getShaderFileName(); @@ -2593,8 +2593,8 @@ void TextureBrowser_filter_searchFromStart(){ void TextureBrowser_exportTitle( const StringImportCallback& importer ){ StringOutputStream buffer( 64 ); buffer << "Textures: "; - if ( !string_empty( g_TextureBrowser_currentDirectory.c_str() ) ) { - buffer << g_TextureBrowser_currentDirectory.c_str(); + if ( !g_TextureBrowser_currentDirectory.empty() ) { + buffer << g_TextureBrowser_currentDirectory; } else { diff --git a/radiant/undo.cpp b/radiant/undo.cpp index 4ccfc713..878ec9bb 100644 --- a/radiant/undo.cpp +++ b/radiant/undo.cpp @@ -308,7 +308,7 @@ public: else { Operation* operation = m_undo_stack.back(); - globalOutputStream() << "Undo: " << operation->m_command.c_str() << "\n"; + globalOutputStream() << "Undo: " << operation->m_command << "\n"; startRedo(); trackersUndo(); @@ -324,7 +324,7 @@ public: else { Operation* operation = m_redo_stack.back(); - globalOutputStream() << "Redo: " << operation->m_command.c_str() << "\n"; + globalOutputStream() << "Redo: " << operation->m_command << "\n"; startUndo(); trackersRedo(); diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 26dea4d4..3b036f0b 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -1344,12 +1344,12 @@ void BackgroundImage::render( const VIEWTYPE viewtype ){ const char* BackgroundImage::background_image_dialog(){ StringOutputStream buffer( 1024 ); - buffer << g_qeglobals.m_userGamePath.c_str() << "textures/"; + buffer << g_qeglobals.m_userGamePath << "textures/"; if ( !file_readable( buffer.c_str() ) ) { // just go to fsmain buffer.clear(); - buffer << g_qeglobals.m_userGamePath.c_str(); + buffer << g_qeglobals.m_userGamePath; } const char *filename = file_dialog( GTK_WIDGET( MainFrame_getWindow() ), true, "Background Image", buffer.c_str() ); diff --git a/tools/quake3/common/vfs.cpp b/tools/quake3/common/vfs.cpp index cceac5f5..de105909 100644 --- a/tools/quake3/common/vfs.cpp +++ b/tools/quake3/common/vfs.cpp @@ -195,10 +195,10 @@ void vfsInitDirectory( const char *path ){ const char *ext = path_get_filename_base_end( name ); if ( striEqual( ext, ".pk3" ) ) { - paks.push_back( StringOutputStream( 256 )( pathCleaned.c_str(), name ) ); + paks.push_back( StringOutputStream( 256 )( pathCleaned, name ) ); } else if ( striEqual( ext, ".pk3dir" ) ) { - g_strDirs.emplace_back( StringOutputStream( 256 )( pathCleaned.c_str(), name, '/' ) ); + g_strDirs.emplace_back( StringOutputStream( 256 )( pathCleaned, name, '/' ) ); } } g_dir_close( dir ); @@ -229,7 +229,7 @@ std::vector vfsListShaderFiles( const char *shaderPath ){ }; /* search in dirs */ for ( const auto& strdir : g_strDirs ){ - GDir *dir = g_dir_open( StringOutputStream( 256 )( strdir.c_str(), shaderPath, "/" ), 0, NULL ); + GDir *dir = g_dir_open( StringOutputStream( 256 )( strdir, shaderPath, "/" ), 0, NULL ); if ( dir != NULL ) { const char* name; diff --git a/tools/quake3/q3map2/autopk3.cpp b/tools/quake3/q3map2/autopk3.cpp index 2b9fd406..1ada2595 100644 --- a/tools/quake3/q3map2/autopk3.cpp +++ b/tools/quake3/q3map2/autopk3.cpp @@ -646,9 +646,9 @@ int pk3BSPMain( int argc, char **argv ){ } /* make a pack */ - auto packname = StringOutputStream( 256 )( g_enginePath, nameOFmap.c_str(), "_autopacked.pk3" ); + auto packname = StringOutputStream( 256 )( g_enginePath, nameOFmap, "_autopacked.pk3" ); remove( packname ); - auto packFailName = StringOutputStream( 256 )( g_enginePath, nameOFmap.c_str(), "_FAILEDpack.pk3" ); + auto packFailName = StringOutputStream( 256 )( g_enginePath, nameOFmap, "_FAILEDpack.pk3" ); remove( packFailName ); Sys_Printf( "\n--- ZipZip ---\n" ); @@ -712,7 +712,7 @@ int pk3BSPMain( int argc, char **argv ){ Sys_Printf( "\n\t.bsp and stuff\n" ); - stream( "maps/", nameOFmap.c_str(), ".bsp" ); + stream( "maps/", nameOFmap, ".bsp" ); //if ( vfsPackFile( stream, packname, compLevel ) ){ if ( vfsPackFile_Absolute_Path( source, stream, packname, compLevel ) ){ Sys_Printf( "++%s\n", stream.c_str() ); @@ -722,15 +722,15 @@ int pk3BSPMain( int argc, char **argv ){ packFAIL = true; } - stream( "maps/", nameOFmap.c_str(), ".aas" ); + stream( "maps/", nameOFmap, ".aas" ); if ( !packResource( stream, packname, compLevel ) ) Sys_Printf( " ~fail %s\n", stream.c_str() ); - stream( "scripts/", nameOFmap.c_str(), ".arena" ); + stream( "scripts/", nameOFmap, ".arena" ); if ( !packResource( stream, packname, compLevel ) ) Sys_Printf( " ~fail %s\n", stream.c_str() ); - stream( "scripts/", nameOFmap.c_str(), ".defi" ); + stream( "scripts/", nameOFmap, ".defi" ); if ( !packResource( stream, packname, compLevel ) ) Sys_Printf( " ~fail %s\n", stream.c_str() ); @@ -1387,14 +1387,14 @@ int repackBSPMain( int argc, char **argv ){ } /* write shader */ - stream( g_enginePath, nameOFrepack.c_str(), "_strippedBYrepacker.shader" ); + stream( g_enginePath, nameOFrepack, "_strippedBYrepacker.shader" ); FILE *f = fopen( stream, "wb" ); fwrite( allShaders, sizeof( char ), allShaders.end() - allShaders.begin(), f ); fclose( f ); Sys_Printf( "Shaders saved to %s\n", stream.c_str() ); /* make a pack */ - stream( g_enginePath, nameOFrepack.c_str(), "_repacked.pk3" ); + stream( g_enginePath, nameOFrepack, "_repacked.pk3" ); remove( stream ); Sys_Printf( "\n--- ZipZip ---\n" ); diff --git a/tools/quake3/q3map2/model.cpp b/tools/quake3/q3map2/model.cpp index 3080ec89..8487d477 100644 --- a/tools/quake3/q3map2/model.cpp +++ b/tools/quake3/q3map2/model.cpp @@ -219,7 +219,7 @@ struct AssModel const CopiedString oldShader( m_shader ); if( strchr( m_shader.c_str(), '/' ) == nullptr ){ /* texture is likely in the folder, where model is */ - m_shader = StringOutputStream()( rootPath, m_shader.c_str() ); + m_shader = StringOutputStream()( rootPath, m_shader ); } else{ const char *name = m_shader.c_str(); diff --git a/tools/quake3/q3map2/shaders.cpp b/tools/quake3/q3map2/shaders.cpp index 77b6e2d5..fb9bebca 100644 --- a/tools/quake3/q3map2/shaders.cpp +++ b/tools/quake3/q3map2/shaders.cpp @@ -2029,7 +2029,7 @@ void LoadShaderInfo( void ){ /* parse the shader files */ for ( const CopiedString& file : shaderFiles ) { - ParseShaderFile( StringOutputStream( 64 )( g_game->shaderPath, '/', file.c_str() ) ); + ParseShaderFile( StringOutputStream( 64 )( g_game->shaderPath, '/', file ) ); } /* emit some statistics */