return string_equal_n( string, start.first, start.last - start.first );
}
-typedef std::set<CopiedString> TextureGroups;
+typedef std::set<std::string> TextureGroups;
void TextureGroups_addWad( TextureGroups& groups, const char* archive ){
if ( extension_equal( path_get_extension( archive ), "wad" ) ) {
#if 1
groups.insert( archive );
#else
- CopiedString archiveBaseName( path_get_filename_start( archive ), path_get_filename_base_end( archive ) );
+ std::string archiveBaseName( path_get_filename_start( archive ), path_get_filename_base_end( archive ) );
groups.insert( archiveBaseName );
#endif
}
if ( texture != shaderName ) {
const char* last = path_remove_directory( texture );
if ( !string_empty( last ) ) {
- groups.insert( CopiedString( StringRange( texture, --last ) ) );
+ groups.insert( std::string( StringRange( texture, --last ) ) );
}
}
}
int originy;
int m_nTotalHeight;
-CopiedString shader;
+std::string shader;
GtkWindow* m_parent;
GtkWidget* m_gl_widget;
GtkWidget* m_search_button;
GtkWidget* m_shader_info_item;
-std::set<CopiedString> m_all_tags;
+std::set<std::string> m_all_tags;
GtkListStore* m_all_tags_list;
-std::vector<CopiedString> m_copied_tags;
-std::set<CopiedString> m_found_shaders;
+std::vector<std::string> m_copied_tags;
+std::set<std::string> m_found_shaders;
ToggleItem m_hideunused_item;
ToggleItem m_showshaders_item;
// disable the menu item "shader info" if no shader was selected
IShader* ishader = QERApp_Shader_ForName( shader );
- CopiedString filename = ishader->getShaderFileName();
+ std::string filename = ishader->getShaderFileName();
if ( filename.empty() ) {
if ( textureBrowser.m_shader_info_item != NULL ) {
}
-CopiedString g_TextureBrowser_currentDirectory;
+std::string g_TextureBrowser_currentDirectory;
/*
============================================================================
}
bool TextureSearch_IsShown( const char* name ){
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
iter = GlobalTextureBrowser().m_found_shaders.find( name );
}
}
-CopiedString g_notex;
-CopiedString g_shadernotex;
+std::string g_notex;
+std::string g_shadernotex;
// if texture_showinuse jump over non in-use textures
bool Texture_IsShown( IShader* shader, bool show_shaders, bool hideUnused ){
}
if ( g_TextureBrowser_currentDirectory == "Untagged" ) {
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
iter = GlobalTextureBrowser().m_found_shaders.find( shader->getName() );
{
public:
void visit( const char* name ){
- IShader* shader = QERApp_Shader_ForName( CopiedString( StringRange( name, path_get_filename_base_end( name ) ) ).c_str() );
+ IShader* shader = QERApp_Shader_ForName( std::string( StringRange( name, path_get_filename_base_end( name ) ) ).c_str() );
shader->DecRef();
}
};
gtk_list_store_clear( store );
- std::vector<CopiedString> assigned_tags;
+ std::vector<std::string> assigned_tags;
TagBuilder.GetShaderTags( shader, assigned_tags );
for ( size_t i = 0; i < assigned_tags.size(); i++ )
void BuildStoreAvailableTags( GtkListStore* storeAvailable,
GtkListStore* storeAssigned,
- const std::set<CopiedString>& allTags,
+ const std::set<std::string>& allTags,
TextureBrowser* textureBrowser ){
GtkTreeIter iterAssigned;
GtkTreeIter iterAvailable;
- std::set<CopiedString>::const_iterator iterAll;
+ std::set<std::string>::const_iterator iterAll;
gchar* tag_assigned;
gtk_list_store_clear( storeAvailable );
&& next != groups.end()
&& string_equal_start( ( *next ).c_str(), dirRoot ) ) {
gtk_tree_store_append( store, &iter, NULL );
- gtk_tree_store_set( store, &iter, 0, CopiedString( StringRange( dirName, firstUnderscore ) ).c_str(), -1 );
+ gtk_tree_store_set( store, &iter, 0, std::string( StringRange( dirName, firstUnderscore ) ).c_str(), -1 );
// keep going...
while ( i != groups.end() && string_equal_start( ( *i ).c_str(), dirRoot ) )
TextureGroups groups = TextureGroups_constructTreeView();
GtkTreeStore* store = gtk_tree_store_new( 1, G_TYPE_STRING );
TextureGroups_constructTreeModel( groups, store );
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
GtkTreeModel* model = GTK_TREE_MODEL( store );
if ( !TagBuilder.CheckShaderTag( g_TextureBrowser.shader.c_str() ) ) {
// create a custom shader/texture entry
IShader* ishader = QERApp_Shader_ForName( g_TextureBrowser.shader.c_str() );
- CopiedString filename = ishader->getShaderFileName();
+ std::string filename = ishader->getShaderFileName();
if ( filename.empty() ) {
// it's a texture
GtkTreeIter treeIter;
gtk_list_store_clear( g_TextureBrowser.m_all_tags_list );
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
for ( iter = g_TextureBrowser.m_all_tags.begin(); iter != g_TextureBrowser.m_all_tags.end(); ++iter )
{
globalOutputStream() << "Found " << (unsigned int)shaders_found << " textures and shaders with " << tags_searched << "\n";
ScopeDisableScreenUpdates disableScreenUpdates( "Searching...", "Loading Textures" );
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
for ( iter = g_TextureBrowser.m_found_shaders.begin(); iter != g_TextureBrowser.m_found_shaders.end(); iter++ )
{
void TextureBrowser_checkTagFile(){
const char SHADERTAG_FILE[] = "shadertags.xml";
- CopiedString default_filename, rc_filename;
+ std::string default_filename, rc_filename;
StringOutputStream stream( 256 );
stream << LocalRcPath_get();
name << GlobalRadiant().getAppPath() << "bitmaps/notex.png";
g_notex = name.c_str();
- name = NULL;
+ name = StringOutputStream();
name << GlobalRadiant().getAppPath() << "bitmaps/shadernotex.png";
g_shadernotex = name.c_str();
}
}
void TextureBrowser_addTag(){
- CopiedString tag;
+ std::string tag;
EMessageBoxReturn result = DoShaderTagDlg( &tag, "Add shader tag" );
gtk_tree_selection_selected_foreach( selection, GtkTreeSelectionForeachFunc( TextureBrowser_selectionHelper ), &selected );
if ( g_slist_length( selected ) == 1 ) { // we only rename a single tag
- CopiedString newTag;
+ std::string newTag;
EMessageBoxReturn result = DoShaderTagDlg( &newTag, "Rename shader tag" );
if ( result == eIDOK && !newTag.empty() ) {
TagBuilder.RenameShaderTag( oldTag, newTag.c_str() );
- g_TextureBrowser.m_all_tags.erase( (CopiedString)oldTag );
+ g_TextureBrowser.m_all_tags.erase( (std::string)oldTag );
g_TextureBrowser.m_all_tags.insert( newTag );
BuildStoreAssignedTags( g_TextureBrowser.m_assigned_store, g_TextureBrowser.shader.c_str(), &g_TextureBrowser );
}
TagBuilder.DeleteTag( tagSelected );
- g_TextureBrowser.m_all_tags.erase( (CopiedString)tagSelected );
+ g_TextureBrowser.m_all_tags.erase( (std::string)tagSelected );
BuildStoreAssignedTags( g_TextureBrowser.m_assigned_store, g_TextureBrowser.shader.c_str(), &g_TextureBrowser );
BuildStoreAvailableTags( g_TextureBrowser.m_available_store, g_TextureBrowser.m_assigned_store, g_TextureBrowser.m_all_tags, &g_TextureBrowser );
void TextureBrowser_pasteTag(){
IShader* ishader = QERApp_Shader_ForName( g_TextureBrowser.shader.c_str() );
- CopiedString shader = g_TextureBrowser.shader.c_str();
+ std::string shader = g_TextureBrowser.shader.c_str();
if ( !TagBuilder.CheckShaderTag( shader.c_str() ) ) {
- CopiedString shaderFile = ishader->getShaderFileName();
+ std::string shaderFile = ishader->getShaderFileName();
if ( shaderFile.empty() ) {
// it's a texture
TagBuilder.AddShaderNode( shader.c_str(), CUSTOM, TEXTURE );
if ( result == eIDYES ) {
g_TextureBrowser.m_found_shaders.clear();
TagBuilder.GetUntagged( g_TextureBrowser.m_found_shaders );
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
ScopeDisableScreenUpdates disableScreenUpdates( "Searching untagged textures...", "Loading Textures" );