}
};
+namespace{
+bool DoingSearch( const char *repl ){
+ return ( repl == NULL || ( strcmp( "textures/", repl ) == 0 ) );
+}
+}
void Scene_PatchFindReplaceShader( scene::Graph& graph, const char* find, const char* replace ){
- Scene_forEachVisiblePatch( PatchFindReplaceShader( find, replace ) );
+ if( DoingSearch( replace ) ){
+ Scene_forEachVisiblePatchInstance( PatchSelectByShader( find ) );
+ }
+ else{
+ Scene_forEachVisiblePatch( PatchFindReplaceShader( find, replace ) );
+ }
}
void Scene_PatchFindReplaceShader_Selected( scene::Graph& graph, const char* find, const char* replace ){
- Scene_forEachVisibleSelectedPatch( PatchFindReplaceShader( find, replace ) );
+ if( DoingSearch( replace ) ){
+ //do nothing, because alternative is replacing to notex
+ //perhaps deselect ones with not matching shaders here?
+ }
+ else{
+ Scene_forEachVisibleSelectedPatch( PatchFindReplaceShader( find, replace ) );
+ }
}
filter_patch_all g_filter_patch_all;
-filter_patch_shader g_filter_patch_clip( "textures/common/clip" );
+filter_patch_flags g_filter_patch_clip( QER_CLIP );
+filter_patch_shader g_filter_patch_commonclip( "textures/common/clip" );
filter_patch_shader g_filter_patch_weapclip( "textures/common/weapclip" );
-filter_patch_flags g_filter_patch_translucent( QER_TRANS );
+filter_patch_flags g_filter_patch_translucent( QER_TRANS | QER_ALPHATEST );
void PatchFilters_construct(){
add_patch_filter( g_filter_patch_all, EXCLUDE_CURVES );
add_patch_filter( g_filter_patch_clip, EXCLUDE_CLIP );
+ add_patch_filter( g_filter_patch_commonclip, EXCLUDE_CLIP );
add_patch_filter( g_filter_patch_weapclip, EXCLUDE_CLIP );
add_patch_filter( g_filter_patch_translucent, EXCLUDE_TRANSLUCENT );
}