Add a filter for Quetoo's CONTENTS_ATMOSPHERIC.

This commit is contained in:
Jay Dolan 2022-01-24 20:24:02 -05:00
parent c649323971
commit ce321bf04b
5 changed files with 31 additions and 0 deletions

View file

@ -144,6 +144,7 @@ bfilter_t *FilterAddBase( bfilter_t *pFilter ){
pFilter = FilterAddImpl( pFilter,1,0,"caulk",EXCLUDE_CAULK,true ); pFilter = FilterAddImpl( pFilter,1,0,"caulk",EXCLUDE_CAULK,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_LIQUIDS,true ); pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_LIQUIDS,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_MIST,true ); pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_MIST,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_ATMOSPHERIC,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_HINTSSKIPS,true ); pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_HINTSSKIPS,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_TRANSLUCENT,true ); pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_TRANSLUCENT,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_AREAPORTALS,true ); pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_AREAPORTALS,true );
@ -346,6 +347,11 @@ bool FilterBrush( brush_t *pb ){
if ( f->texdef.contents & CONTENTS_MIST ) { if ( f->texdef.contents & CONTENTS_MIST ) {
filterbrush = true; filterbrush = true;
} }
break;
case EXCLUDE_ATMOSPHERIC:
if ( f->texdef.contents & CONTENTS_ATMOSPHERIC ) {
filterbrush = true;
}
if ( strstr( f->pShader->getName(), "common/fog" ) ) { if ( strstr( f->pShader->getName(), "common/fog" ) ) {
filterbrush = true; filterbrush = true;
} }

View file

@ -273,6 +273,7 @@ SCommandInfo g_Commands[] =
{"FilterLiquids", '5', RAD_ALT, ID_FILTER_LIQUIDS, "menu_filter_liquids"}, {"FilterLiquids", '5', RAD_ALT, ID_FILTER_LIQUIDS, "menu_filter_liquids"},
{"FilterLiquids", GDK_KEY_5, RAD_ALT, ID_FILTER_LIQUIDS, "menu_filter_liquids"}, {"FilterLiquids", GDK_KEY_5, RAD_ALT, ID_FILTER_LIQUIDS, "menu_filter_liquids"},
{"FilterMist", GDK_KEY_M, RAD_ALT, ID_FILTER_MIST, "menu_filter_mist"}, {"FilterMist", GDK_KEY_M, RAD_ALT, ID_FILTER_MIST, "menu_filter_mist"},
{"FilterAtmospheric", GDK_KEY_A, RAD_ALT, ID_FILTER_ATMOSPHERIC, "menu_filter_atmospheric"},
{"FilterCaulk", '6', RAD_ALT, ID_FILTER_CAULK, "menu_filter_caulk"}, {"FilterCaulk", '6', RAD_ALT, ID_FILTER_CAULK, "menu_filter_caulk"},
{"FilterCaulk", GDK_KEY_6, RAD_ALT, ID_FILTER_CAULK, "menu_filter_caulk"}, {"FilterCaulk", GDK_KEY_6, RAD_ALT, ID_FILTER_CAULK, "menu_filter_caulk"},
{"FilterClips", '7', RAD_ALT, ID_FILTER_CLIPS, "menu_filter_clips"}, {"FilterClips", '7', RAD_ALT, ID_FILTER_CLIPS, "menu_filter_clips"},
@ -657,6 +658,7 @@ gint HandleCommand( GtkWidget *widget, gpointer data ){
case ID_FILTER_LIGHTS: g_pParentWnd->OnFilterLights(); break; case ID_FILTER_LIGHTS: g_pParentWnd->OnFilterLights(); break;
case ID_FILTER_LIQUIDS: g_pParentWnd->OnFilterLiquids(); break; case ID_FILTER_LIQUIDS: g_pParentWnd->OnFilterLiquids(); break;
case ID_FILTER_MIST: g_pParentWnd->OnFilterMist(); break; case ID_FILTER_MIST: g_pParentWnd->OnFilterMist(); break;
case ID_FILTER_ATMOSPHERIC: g_pParentWnd->OnFilterAtmospheric(); break;
case ID_FILTER_MODELS: g_pParentWnd->OnFilterModels(); break; case ID_FILTER_MODELS: g_pParentWnd->OnFilterModels(); break;
case ID_FILTER_PATCHES: g_pParentWnd->OnFilterPatches(); break; case ID_FILTER_PATCHES: g_pParentWnd->OnFilterPatches(); break;
case ID_FILTER_TRANSLUCENT: g_pParentWnd->OnFilterTranslucent(); break; case ID_FILTER_TRANSLUCENT: g_pParentWnd->OnFilterTranslucent(); break;
@ -1137,6 +1139,7 @@ void MainFrame::create_main_menu( GtkWidget *window, GtkWidget *vbox ){
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Translucent" ), G_CALLBACK( HandleCommand ), ID_FILTER_TRANSLUCENT, FALSE ); create_check_menu_item_with_mnemonic( menu_in_menu, _( "Translucent" ), G_CALLBACK( HandleCommand ), ID_FILTER_TRANSLUCENT, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Liquids" ), G_CALLBACK( HandleCommand ), ID_FILTER_LIQUIDS, FALSE ); create_check_menu_item_with_mnemonic( menu_in_menu, _( "Liquids" ), G_CALLBACK( HandleCommand ), ID_FILTER_LIQUIDS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Mist" ), G_CALLBACK( HandleCommand ), ID_FILTER_MIST, FALSE ); create_check_menu_item_with_mnemonic( menu_in_menu, _( "Mist" ), G_CALLBACK( HandleCommand ), ID_FILTER_MIST, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Atmospheric" ), G_CALLBACK( HandleCommand ), ID_FILTER_ATMOSPHERIC, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Sky" ), G_CALLBACK( HandleCommand ), ID_FILTER_SKY, FALSE ); create_check_menu_item_with_mnemonic( menu_in_menu, _( "Sky" ), G_CALLBACK( HandleCommand ), ID_FILTER_SKY, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Caulk" ), G_CALLBACK( HandleCommand ), ID_FILTER_CAULK, FALSE ); create_check_menu_item_with_mnemonic( menu_in_menu, _( "Caulk" ), G_CALLBACK( HandleCommand ), ID_FILTER_CAULK, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Clips" ), G_CALLBACK( HandleCommand ), ID_FILTER_CLIPS, FALSE ); create_check_menu_item_with_mnemonic( menu_in_menu, _( "Clips" ), G_CALLBACK( HandleCommand ), ID_FILTER_CLIPS, FALSE );
@ -3984,6 +3987,9 @@ void MainFrame::SetButtonMenuStates(){
item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_mist" ) ); item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_mist" ) );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ),
( g_qeglobals.d_savedinfo.exclude & EXCLUDE_MIST ) != 0 ); ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_MIST ) != 0 );
item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_atmospheric" ) );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ),
( g_qeglobals.d_savedinfo.exclude & EXCLUDE_ATMOSPHERIC ) != 0 );
item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_caulk" ) ); item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_caulk" ) );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ),
( g_qeglobals.d_savedinfo.exclude & EXCLUDE_CAULK ) != 0 ); ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_CAULK ) != 0 );
@ -7780,6 +7786,20 @@ void MainFrame::OnFilterMist(){
Sys_UpdateWindows( W_XY | W_CAMERA ); Sys_UpdateWindows( W_XY | W_CAMERA );
} }
void MainFrame::OnFilterAtmospheric(){
GtkWidget *item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_atmosperic" ) );
g_bIgnoreCommands++;
if ( ( g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_ATMOSPHERIC ) & EXCLUDE_ATMOSPHERIC ) {
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), TRUE );
}
else{
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), FALSE );
}
g_bIgnoreCommands--;
PerformFiltering();
Sys_UpdateWindows( W_XY | W_CAMERA );
}
void MainFrame::OnFilterModels(){ void MainFrame::OnFilterModels(){
GtkWidget *item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_models" ) ); GtkWidget *item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_models" ) );
g_bIgnoreCommands++; g_bIgnoreCommands++;

View file

@ -413,6 +413,8 @@ struct SKeyInfo
#define ID_COLORS_MAJOR_ALT 40231 #define ID_COLORS_MAJOR_ALT 40231
#define ID_SELECT_FUNC_GROUP 40233 #define ID_SELECT_FUNC_GROUP 40233
#define ID_FILTER_ATMOSPHERIC 40234
// those must have their own ID chunk ID_GRID_025 <= ID_GRID <= ID_GRID_256 // those must have their own ID chunk ID_GRID_025 <= ID_GRID <= ID_GRID_256
#define ID_GRID_025 40300 #define ID_GRID_025 40300
@ -896,6 +898,7 @@ void OnFilterHintsskips();
void OnFilterLights(); void OnFilterLights();
void OnFilterLiquids(); void OnFilterLiquids();
void OnFilterMist(); void OnFilterMist();
void OnFilterAtmospheric();
void OnFilterModels(); void OnFilterModels();
void OnFilterPatches(); void OnFilterPatches();
void OnFilterTranslucent(); void OnFilterTranslucent();

View file

@ -86,6 +86,7 @@
#define EXCLUDE_BOTCLIP 0x00040000 #define EXCLUDE_BOTCLIP 0x00040000
#define EXCLUDE_SKY 0x00080000 #define EXCLUDE_SKY 0x00080000
#define EXCLUDE_MIST 0x00100000 #define EXCLUDE_MIST 0x00100000
#define EXCLUDE_ATMOSPHERIC 0x00200000
#define INCLUDE_EASY 0x00000001 #define INCLUDE_EASY 0x00000001
#define INCLUDE_NORMAL 0x00000002 #define INCLUDE_NORMAL 0x00000002

View file

@ -362,6 +362,7 @@ typedef struct
#define CONTENTS_MIST 64 #define CONTENTS_MIST 64
#define LAST_VISIBLE_CONTENTS 64 #define LAST_VISIBLE_CONTENTS 64
#define CONTENTS_ATMOSPHERIC 0x80
#define CONTENTS_AREAPORTAL 0x8000 #define CONTENTS_AREAPORTAL 0x8000
// remaining contents are non-visible, and don't eat brushes // remaining contents are non-visible, and don't eat brushes