Merge pull request #661 from jdolan/master

Quake2 and Quetoo filter improvements
This commit is contained in:
Jay Dolan 2020-12-28 21:54:04 -05:00 committed by GitHub
commit 46abf34850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 397 additions and 83 deletions

View File

@ -14,11 +14,15 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.macosx.base.958479956" name="Default" optionalBuildProperties="" parent="org.eclipse.cdt.build.core.emptycfg">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.macosx.base.958479956" name="Default" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.macosx.base.958479956.566033986" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.macosx.base.2129596837" name="MacOSX GCC" superClass="cdt.managedbuild.toolchain.gnu.macosx.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.MachO64" id="cdt.managedbuild.target.gnu.platform.macosx.base.304166810" name="Debug Platform" osList="macosx" superClass="cdt.managedbuild.target.gnu.platform.macosx.base"/>
<builder command="scons" id="cdt.managedbuild.target.gnu.builder.macosx.base.349109252" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.base"/>
<builder command="scons" id="cdt.managedbuild.target.gnu.builder.macosx.base.349109252" incrementalBuildTarget="-j8 --no-packs" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="false" superClass="cdt.managedbuild.target.gnu.builder.macosx.base">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="outputPath" name="build"/>
</outputEntries>
</builder>
<tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.base.887305901" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.base"/>
<tool id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.base.214613746" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.base">
<inputType id="cdt.managedbuild.tool.macosx.cpp.linker.input.87826061" superClass="cdt.managedbuild.tool.macosx.cpp.linker.input">
@ -31,6 +35,15 @@
<listOptionValue builtIn="false" value="/opt/local/include"/>
<listOptionValue builtIn="false" value="/opt/local/include/gtk-2.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/glib-2.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/pango-1.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/gtkglext-1.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/atk-1.0"/>
<listOptionValue builtIn="false" value="/opt/local/lib/gtk-2.0/include"/>
<listOptionValue builtIn="false" value="/opt/local/lib/glib-2.0/include"/>
<listOptionValue builtIn="false" value="/opt/local/include/cairo"/>
<listOptionValue builtIn="false" value="/opt/local/include/gdk-pixbuf-2.0"/>
<listOptionValue builtIn="false" value="/opt/local/lib/gtkglext-1.0/include"/>
<listOptionValue builtIn="false" value="/opt/local/include/freetype2"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1915738802" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
@ -38,8 +51,20 @@
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.base.1684548729" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.base">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.2127499811" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/local/include"/>
<listOptionValue builtIn="false" value="/opt/local/include/gtk-2.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/atk-1.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/cairo"/>
<listOptionValue builtIn="false" value="/opt/local/include/freetype2"/>
<listOptionValue builtIn="false" value="/opt/local/include/gdk-pixbuf-2.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/glib-2.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/gtk-2.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/gtkglext-1.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/pango-1.0"/>
<listOptionValue builtIn="false" value="/opt/local/lib/glib-2.0/include"/>
<listOptionValue builtIn="false" value="/opt/local/lib/gtk-2.0/include"/>
<listOptionValue builtIn="false" value="/opt/local/lib/gtkglext-1.0/include"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.1564792194" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_DEBUG=1"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.392813833" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
@ -48,11 +73,30 @@
<listOptionValue builtIn="false" value="/opt/local/include"/>
<listOptionValue builtIn="false" value="/opt/local/include/gtk-2.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/glib-2.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/pango-1.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/gtkglext-1.0"/>
<listOptionValue builtIn="false" value="/opt/local/include/atk-1.0"/>
<listOptionValue builtIn="false" value="/opt/local/lib/gtk-2.0/include"/>
<listOptionValue builtIn="false" value="/opt/local/lib/glib-2.0/include"/>
<listOptionValue builtIn="false" value="/opt/local/include/cairo"/>
<listOptionValue builtIn="false" value="/opt/local/include/gdk-pixbuf-2.0"/>
<listOptionValue builtIn="false" value="/opt/local/lib/gtkglext-1.0/include"/>
<listOptionValue builtIn="false" value="/opt/local/include/freetype2"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1269203563" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_DEBUG=1"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1349737716" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="contrib"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="include"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="libs"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="plugins"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="radiant"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
@ -89,4 +133,5 @@
<resource resourceType="PROJECT" workspacePath="/GtkRadiant"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cproject>

View File

@ -7,7 +7,7 @@
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>full,incremental,</triggers>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>

View File

@ -45,7 +45,7 @@ CCamera *firstCam = NULL; // double linked list
CCamera *firstFreeCam = NULL; // single linked list
CCamera *currentCam = NULL; // single item
bool g_bEditOn = false;
int g_iEditMode = 0; // 0: editting points 1: adding points
int g_iEditMode = 0; // 0: editing points 1: adding points
int g_iActiveTarget = -1;
int g_iPreviewRunning = 0; // 0: no preview 1: start preview 2: preview in progress

View File

@ -724,7 +724,10 @@ struct bfilter_t //c++ style
// 4=brush->owner->eclass->nShowFlags
// 5=brush->face->texdef.flags (q2)
// 6=brush->face->texdef.contents (q2)
// 7=!brush->face->texdef.contents (q2)
// 8 idTech2 materials (q2 and quetoo)
int mask;
int exclude;
const char *string;
bool active;
};

View File

@ -45,7 +45,7 @@ class CShader : public IShader
{
int refCount;
qtexture_t *m_pTexture;
// name is shader / texture name (if not a real shader) reletive to "textures/" directory
// name is shader / texture name (if not a real shader) relative to "textures/" directory
char m_Name[QER_MAX_NAMELEN];
char m_ShaderFileName[QER_MAX_NAMELEN];
int m_nFlags;

View File

@ -3094,6 +3094,9 @@ void Brush_FaceDraw( face_t *face, int nGLState ){
#define Q2_SURF_TRANS33 0x00000010
#define Q2_SURF_TRANS66 0x00000020
#define QUETOO_SURF_TRANS100 0x00000040
#define QUETOO_SURF_ALPHA_TEST 0x00000400
void Brush_Draw( brush_t *b ){
face_t *face;
int order;
@ -3132,6 +3135,16 @@ void Brush_Draw( brush_t *b ){
bTrans = true;
transVal = 0.66f;
}
else if ( g_pGameDescription->mGameFile == "quetoo.game" ) {
if ( face->texdef.flags & QUETOO_SURF_TRANS100 ) {
bTrans = true;
transVal = 1.f;
}
else if ( face->texdef.flags & QUETOO_SURF_ALPHA_TEST ) {
bTrans = true;
transVal = 1.f;
}
}
}
if ( bTrans && !( nGLState & DRAW_GL_BLEND ) ) {

View File

@ -54,6 +54,10 @@ typedef enum
#define MOVE_ROTLEFT 0x008
#define MOVE_STRAFERIGHT 0x010
#define MOVE_STRAFELEFT 0x020
#define MOVE_UP 0x040
#define MOVE_DOWN 0x080
#define MOVE_ROTUP 0x100
#define MOVE_ROTDOWN 0x200
typedef struct
{

View File

@ -430,31 +430,75 @@ void CamWnd::Cam_MouseControl( float dtime ){
}
void CamWnd::Cam_KeyControl( float dtime ) {
static vec3_t avelocity;
static vec3_t velocity;
// Update angles
if ( m_Camera.movementflags & MOVE_ROTLEFT ) {
m_Camera.angles[YAW] += 15 * dtime * g_PrefsDlg.m_nAngleSpeed;
avelocity[YAW] += dtime * g_PrefsDlg.m_nAngleSpeed;
}
if ( m_Camera.movementflags & MOVE_ROTRIGHT ) {
m_Camera.angles[YAW] -= 15 * dtime * g_PrefsDlg.m_nAngleSpeed;
avelocity[YAW] -= dtime * g_PrefsDlg.m_nAngleSpeed;
}
if ( m_Camera.movementflags & MOVE_ROTUP ) {
avelocity[PITCH] += dtime * g_PrefsDlg.m_nAngleSpeed;
}
if ( m_Camera.movementflags & MOVE_ROTDOWN ) {
avelocity[PITCH] -= dtime * g_PrefsDlg.m_nAngleSpeed;
}
// Update position
// Now rotate the angles by the scaled velocity
VectorMA( m_Camera.angles, dtime, avelocity, m_Camera.angles );
if ( m_Camera.angles[PITCH] > 90.f ) {
m_Camera.angles[PITCH] = 90.f;
} else if ( m_Camera.angles[PITCH] < -90.f) {
m_Camera.angles[PITCH] = -90.f;
}
// And then add some friction to slow us down
VectorScale( avelocity, 1.f - dtime, avelocity );
if ( VectorLength( avelocity ) < 1.f ) {
VectorClear( avelocity );
}
// Update velocity
if ( m_Camera.movementflags & MOVE_FORWARD ) {
VectorMA( m_Camera.origin, dtime * g_PrefsDlg.m_nMoveSpeed, m_Camera.forward, m_Camera.origin );
VectorMA( velocity, dtime * g_PrefsDlg.m_nMoveSpeed, m_Camera.forward, velocity );
}
if ( m_Camera.movementflags & MOVE_BACK ) {
VectorMA( m_Camera.origin, -dtime * g_PrefsDlg.m_nMoveSpeed, m_Camera.forward, m_Camera.origin );
VectorMA( velocity, -dtime * g_PrefsDlg.m_nMoveSpeed, m_Camera.forward, velocity );
}
if ( m_Camera.movementflags & MOVE_STRAFELEFT ) {
VectorMA( m_Camera.origin, -dtime * g_PrefsDlg.m_nMoveSpeed, m_Camera.right, m_Camera.origin );
VectorMA( velocity, -dtime * g_PrefsDlg.m_nMoveSpeed, m_Camera.right, velocity );
}
if ( m_Camera.movementflags & MOVE_STRAFERIGHT ) {
VectorMA( m_Camera.origin, dtime * g_PrefsDlg.m_nMoveSpeed, m_Camera.right, m_Camera.origin );
VectorMA( velocity, dtime * g_PrefsDlg.m_nMoveSpeed, m_Camera.right, velocity );
}
if ( m_Camera.movementflags & MOVE_UP ) {
VectorMA( velocity, dtime * g_PrefsDlg.m_nMoveSpeed, (vec3_t) { 0, 0, 1 }, velocity);
}
if ( m_Camera.movementflags & MOVE_DOWN ) {
VectorMA( velocity, -dtime * g_PrefsDlg.m_nMoveSpeed, (vec3_t) { 0, 0, 1 }, velocity);
}
// Now move the origin by the scaled velocity
VectorMA( m_Camera.origin, dtime, velocity, m_Camera.origin);
// And then add some friction to slow us down
VectorScale( velocity, 1.f - dtime, velocity );
if ( VectorLength( velocity ) < 1.f ) {
VectorClear( velocity );
}
// Save a screen update
if (!VectorCompare( vec3_origin, velocity ) || !VectorCompare( vec3_origin, avelocity ) ) {
// When m_bFreeMove is enabled, mousecontrol does the update
if ( m_bFreeMove ) {
return;
}
// Save a screen update (when m_bFreeMove is enabled, mousecontrol does the update)
if ( !m_bFreeMove && m_Camera.movementflags ) {
int nUpdate = ( g_PrefsDlg.m_bCamXYUpdate ) ? ( W_CAMERA | W_XY ) : ( W_CAMERA );
Sys_UpdateWindows( nUpdate );
g_pParentWnd->OnTimer();

View File

@ -71,6 +71,11 @@ bfilter_t *FilterAddImpl( bfilter_t *pFilter, int type, int bmask, const char *s
if ( type == 2 || type == 4 || type == 5 || type == 6 || type == 7 ) {
pNew->mask = bmask;
}
if ( type == 8 ) {
pNew->string = str;
pNew->mask = bmask;
}
pNew->exclude = exclude;
if ( g_qeglobals.d_savedinfo.exclude & exclude ) {
pNew->active = true;
}
@ -89,12 +94,13 @@ bfilter_t *FilterAddImpl( bfilter_t *pFilter, int type, int bmask, const char *s
}
// type 1 = texture filter (name)
// type 3 = entity filter (name)
// type 2 = QER_* shader flags
// type 3 = entity filter (name)
// type 4 = entity classes
// type 5 = surface flags (q2)
// type 6 = content flags (q2)
// type 7 = content flags - no match (q2)
// type 8 = idTech2 materials (q2 and quetoo)
bfilter_t *FilterAdd( bfilter_t *pFilter, int type, int bmask, const char *str, int exclude ){
return FilterAddImpl( pFilter, type, bmask, str, exclude, false );
}
@ -131,10 +137,28 @@ bfilter_t *FilterListDelete( bfilter_t *pFilter ){
bfilter_t *FilterAddBase( bfilter_t *pFilter ){
if ( g_pGameDescription->idTech2 ) {
pFilter = FilterAddImpl( pFilter,1,0,"clip",EXCLUDE_CLIP,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_MIST,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_AREAPORTALS,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_SKY,true );
pFilter = FilterAddImpl( pFilter,3,0,"trigger",EXCLUDE_TRIGGERS,true );
pFilter = FilterAddImpl( pFilter,4,ECLASS_LIGHT,NULL,EXCLUDE_LIGHTS,true );
pFilter = FilterAddImpl( pFilter,4,ECLASS_PATH,NULL,EXCLUDE_PATHS,true );
} else {
pFilter = FilterAddImpl( pFilter,1,0,"clip",EXCLUDE_CLIP,true );
pFilter = FilterAddImpl( pFilter,1,0,"caulk",EXCLUDE_CAULK,true );
pFilter = FilterAddImpl( pFilter,1,0,"liquids",EXCLUDE_LIQUIDS,true );
pFilter = FilterAddImpl( pFilter,1,0,"hint",EXCLUDE_HINTSSKIPS,true );
pFilter = FilterAddImpl( pFilter,1,0,"sky",EXCLUDE_SKY,true );
pFilter = FilterAddImpl( pFilter,1,0,"clusterportal",EXCLUDE_CLUSTERPORTALS,true );
pFilter = FilterAddImpl( pFilter,1,0,"areaportal",EXCLUDE_AREAPORTALS,true );
pFilter = FilterAddImpl( pFilter,2,QER_TRANS,NULL,EXCLUDE_TRANSLUCENT,true );
@ -145,6 +169,8 @@ bfilter_t *FilterAddBase( bfilter_t *pFilter ){
pFilter = FilterAddImpl( pFilter,1,0,"lightgrid",EXCLUDE_LIGHTGRID,true );
pFilter = FilterAddImpl( pFilter,1,0,"botclip",EXCLUDE_BOTCLIP,true );
pFilter = FilterAddImpl( pFilter,1,0,"clipmonster",EXCLUDE_BOTCLIP,true );
}
return pFilter;
}
@ -201,7 +227,7 @@ bool FilterBrush( brush_t *pb ){
if ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_DETAILS ) {
if ( !pb->patchBrush && pb->brush_faces->texdef.contents & CONTENTS_DETAIL ) {
if ( !pb->patchBrush && ( pb->brush_faces->texdef.contents & CONTENTS_DETAIL ) ) {
return TRUE;
}
}
@ -212,7 +238,9 @@ bool FilterBrush( brush_t *pb ){
}
// if brush belongs to world entity or a brushmodel entity and is not a patch
if ( ( strcmp( pb->owner->eclass->name, "worldspawn" ) == 0
if ( ( !strcmp( pb->owner->eclass->name, "worldspawn" )
|| !strcmp( pb->owner->eclass->name, "misc_fog")
|| !strcmp( pb->owner->eclass->name, "misc_dust")
|| !strncmp( pb->owner->eclass->name, "func", 4 )
|| !strncmp( pb->owner->eclass->name, "trigger", 7 ) ) && !pb->patchBrush ) {
bool filterbrush = false;
@ -239,16 +267,16 @@ bool FilterBrush( brush_t *pb ){
filterbrush = true;
break;
}
// quake2 - 5 == surface flags, 6 == content flags
}
// quake2 - 5 == surface flags, 6 == content flags, 7 == !content flags
else if ( filters->attribute == 5 ) {
if ( f->texdef.flags && f->texdef.flags & filters->mask ) {
if ( f->texdef.flags && ( f->texdef.flags & filters->mask ) ) {
filterbrush = true;
break;
}
}
else if ( filters->attribute == 6 ) {
if ( f->texdef.contents && f->texdef.contents & filters->mask ) {
if ( f->texdef.contents && ( f->texdef.contents & filters->mask ) ) {
filterbrush = true;
break;
}
@ -259,6 +287,75 @@ bool FilterBrush( brush_t *pb ){
break;
}
}
// idTech2 material filters
else if ( filters->attribute == 8 ) {
switch ( filters->exclude ) {
case EXCLUDE_LIQUIDS:
if ( f->texdef.contents & (CONTENTS_WATER | CONTENTS_LAVA | CONTENTS_SLIME ) ) {
filterbrush = true;
}
if ( strstr( f->pShader->getName(), "water" ) ||
strstr( f->pShader->getName(), "lava" ) ||
strstr( f->pShader->getName(), "slime" ) ) {
filterbrush = true;
}
break;
case EXCLUDE_HINTSSKIPS:
if ( f->texdef.flags & (SURF_HINT | SURF_SKIP) ) {
filterbrush = true;
}
if ( strstr( f->pShader->getName(), "hint" ) ||
strstr( f->pShader->getName(), "skip" ) ) {
filterbrush = true;
}
break;
case EXCLUDE_AREAPORTALS:
if ( f->texdef.contents & CONTENTS_AREAPORTAL ) {
filterbrush = true;
}
if (strstr( f->pShader->getName(), "common/occlude" ) ) {
filterbrush = true;
}
break;
case EXCLUDE_TRANSLUCENT:
if ( f->texdef.contents & CONTENTS_WINDOW ) {
filterbrush = true;
}
if ( f->texdef.flags & (SURF_TRANS33 | SURF_TRANS66) ) {
filterbrush = true;
}
if ( g_pGameDescription->mGameFile == "quetoo.game" ) {
if (f->texdef.flags & ( SURF_TRANS100 | SURF_ALPHA_TEST )) {
filterbrush = true;
}
}
if ( strstr( f->pShader->getName(), "glass" ) ||
strstr( f->pShader->getName(), "window" ) ) {
filterbrush = true;
}
break;
case EXCLUDE_SKY:
if ( f->texdef.flags & SURF_SKY ) {
filterbrush = true;
}
if ( strstr( f->pShader->getName(), "sky" ) ) {
filterbrush = true;
}
break;
case EXCLUDE_MIST:
if ( f->texdef.contents & CONTENTS_MIST ) {
filterbrush = true;
}
if ( strstr( f->pShader->getName(), "common/fog" ) ) {
filterbrush = true;
}
if ( strstr( f->pShader->getName(), "common/dust" ) ) {
filterbrush = true;
}
break;
}
}
}
if ( !filterbrush ) {
break;

View File

@ -272,11 +272,12 @@ SCommandInfo g_Commands[] =
{"FilterTranslucent", GDK_KEY_4, RAD_ALT, ID_FILTER_TRANSLUCENT, "menu_filter_translucent"},
{"FilterLiquids", '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"},
{"FilterCaulk", '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", GDK_KEY_7, RAD_ALT, ID_FILTER_CLIPS, "menu_filter_clips"},
{"FilterBotClips", GDK_KEY_M, RAD_ALT, ID_FILTER_BOTCLIPS, "menu_filter_botclips"},
{"FilterBotClips", GDK_KEY_B, RAD_ALT, ID_FILTER_BOTCLIPS, "menu_filter_botclips"},
{"FilterPaths", '8', RAD_ALT, ID_FILTER_PATHS, "menu_filter_paths"},
{"FilterPaths", GDK_KEY_8, RAD_ALT, ID_FILTER_PATHS, "menu_filter_paths"},
{"FilterClusterportals", '9', RAD_ALT, ID_FILTER_CLUSTERPORTALS, "menu_filter_clusterportals"},
@ -287,6 +288,7 @@ SCommandInfo g_Commands[] =
{"FilterDetails", GDK_KEY_D, RAD_CONTROL, ID_FILTER_DETAILS, "menu_filter_details"},
{"FilterStructural", GDK_KEY_D, RAD_CONTROL | RAD_SHIFT, ID_FILTER_STRUCTURAL, "menu_filter_structural"},
{"FilterHintsSkips", GDK_KEY_H, RAD_CONTROL, ID_FILTER_HINTSSKIPS, "menu_filter_hintsskips"},
{"FilterSky", GDK_KEY_S, RAD_ALT, ID_FILTER_SKY, "menu_filter_sky"},
{"FilterModels", GDK_KEY_M, RAD_SHIFT, ID_FILTER_MODELS, "menu_filter_models"},
{"FilterTriggers", GDK_KEY_T, RAD_CONTROL | RAD_SHIFT, ID_FILTER_TRIGGERS, "menu_filter_triggers"},
{"LoadPointfile", GDK_KEY_L, RAD_SHIFT, ID_FILE_POINTFILE, "menu_load_pointfile"},
@ -377,6 +379,10 @@ void HandleKeyUp( GtkWidget *widget, gpointer data ){
case ID_CAMERA_RIGHT: g_pParentWnd->OnCameraRight( FALSE ); break;
case ID_CAMERA_STRAFELEFT: g_pParentWnd->OnCameraStrafeleft( FALSE ); break;
case ID_CAMERA_STRAFERIGHT: g_pParentWnd->OnCameraStraferight( FALSE ); break;
case ID_CAMERA_UP: g_pParentWnd->OnCameraUp( FALSE ); break;
case ID_CAMERA_DOWN: g_pParentWnd->OnCameraDown( FALSE ); break;
case ID_CAMERA_ANGLEUP: g_pParentWnd->OnCameraAngleup( FALSE ); break;
case ID_CAMERA_ANGLEDOWN: g_pParentWnd->OnCameraAngledown( FALSE ); break;
}
}
@ -647,8 +653,10 @@ gint HandleCommand( GtkWidget *widget, gpointer data ){
case ID_FILTER_DETAILS: g_pParentWnd->OnFilterDetails(); break;
case ID_FILTER_ENTITIES: g_pParentWnd->OnFilterEntities(); break;
case ID_FILTER_HINTSSKIPS: g_pParentWnd->OnFilterHintsskips(); break;
case ID_FILTER_SKY: g_pParentWnd->OnFilterSky(); break;
case ID_FILTER_LIGHTS: g_pParentWnd->OnFilterLights(); break;
case ID_FILTER_LIQUIDS: g_pParentWnd->OnFilterLiquids(); break;
case ID_FILTER_MIST: g_pParentWnd->OnFilterMist(); break;
case ID_FILTER_MODELS: g_pParentWnd->OnFilterModels(); break;
case ID_FILTER_PATCHES: g_pParentWnd->OnFilterPatches(); break;
case ID_FILTER_TRANSLUCENT: g_pParentWnd->OnFilterTranslucent(); break;
@ -693,10 +701,10 @@ gint HandleCommand( GtkWidget *widget, gpointer data ){
case ID_CAMERA_BACK: g_pParentWnd->OnCameraBack( TRUE ); break;
case ID_CAMERA_LEFT: g_pParentWnd->OnCameraLeft( TRUE ); break;
case ID_CAMERA_RIGHT: g_pParentWnd->OnCameraRight( TRUE ); break;
case ID_CAMERA_UP: g_pParentWnd->OnCameraUp(); break;
case ID_CAMERA_DOWN: g_pParentWnd->OnCameraDown(); break;
case ID_CAMERA_ANGLEUP: g_pParentWnd->OnCameraAngleup(); break;
case ID_CAMERA_ANGLEDOWN: g_pParentWnd->OnCameraAngledown(); break;
case ID_CAMERA_UP: g_pParentWnd->OnCameraUp( TRUE ); break;
case ID_CAMERA_DOWN: g_pParentWnd->OnCameraDown( TRUE ); break;
case ID_CAMERA_ANGLEUP: g_pParentWnd->OnCameraAngleup( TRUE ); break;
case ID_CAMERA_ANGLEDOWN: g_pParentWnd->OnCameraAngledown( TRUE ); break;
case ID_CAMERA_STRAFELEFT: g_pParentWnd->OnCameraStrafeleft( TRUE ); break;
case ID_CAMERA_STRAFERIGHT: g_pParentWnd->OnCameraStraferight( TRUE ); break;
case ID_GRID_TOGGLE: g_pParentWnd->OnGridToggle(); break;
@ -830,9 +838,9 @@ static gint mainframe_keypress( GtkWidget* widget, GdkEventKey* event, gpointer
static gint mainframe_keyrelease( GtkWidget* widget, GdkEventKey* event, gpointer data ){
unsigned int code = gdk_keyval_to_upper( event->keyval );
if ( gtk_accelerator_valid( event->keyval, (GdkModifierType)0 ) ) {
return TRUE;
}
// if ( gtk_accelerator_valid( event->keyval, (GdkModifierType)0 ) ) {
// return TRUE;
// }
for ( int i = 0; i < g_nCommandCount; i++ )
{
@ -847,6 +855,10 @@ static gint mainframe_keyrelease( GtkWidget* widget, GdkEventKey* event, gpointe
case ID_CAMERA_RIGHT:
case ID_CAMERA_STRAFELEFT:
case ID_CAMERA_STRAFERIGHT:
case ID_CAMERA_UP:
case ID_CAMERA_DOWN:
case ID_CAMERA_ANGLEUP:
case ID_CAMERA_ANGLEDOWN:
{
HandleKeyUp( NULL, GINT_TO_POINTER( g_Commands[i].m_nCommand ) );
g_signal_stop_emission_by_name( G_OBJECT( widget ), "key-release-event" );
@ -1119,25 +1131,28 @@ void MainFrame::create_main_menu( GtkWidget *window, GtkWidget *vbox ){
g_object_set_data( G_OBJECT( window ), "menu_view_showworkzone", item );
menu_in_menu = create_menu_in_menu_with_mnemonic( menu, _( "Filter" ) );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "World" ), G_CALLBACK( HandleCommand ), ID_FILTER_WORLD, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Entities" ), G_CALLBACK( HandleCommand ), ID_FILTER_ENTITIES, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Areaportals" ), G_CALLBACK( HandleCommand ), ID_FILTER_AREAPORTALS, 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, _( "Mist" ), G_CALLBACK( HandleCommand ), ID_FILTER_MIST, 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, _( "Clips" ), G_CALLBACK( HandleCommand ), ID_FILTER_CLIPS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Paths" ), G_CALLBACK( HandleCommand ), ID_FILTER_PATHS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Clusterportals" ), G_CALLBACK( HandleCommand ), ID_FILTER_CLUSTERPORTALS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Bot clips" ), G_CALLBACK( HandleCommand ), ID_FILTER_BOTCLIPS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Lights" ), G_CALLBACK( HandleCommand ), ID_FILTER_LIGHTS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Structural" ), G_CALLBACK( HandleCommand ), ID_FILTER_STRUCTURAL, FALSE );
item = create_check_menu_item_with_mnemonic( menu_in_menu, _( "Lightgrid" ), G_CALLBACK( HandleCommand ), ID_FILTER_LIGHTGRID, FALSE );
g_object_set_data( G_OBJECT( window ), "menu_filter_lightgrid", item );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Patches" ), G_CALLBACK( HandleCommand ), ID_FILTER_PATCHES, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Details" ), G_CALLBACK( HandleCommand ), ID_FILTER_DETAILS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Hints" ), G_CALLBACK( HandleCommand ), ID_FILTER_HINTSSKIPS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Models" ), G_CALLBACK( HandleCommand ), ID_FILTER_MODELS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Areaportals" ), G_CALLBACK( HandleCommand ), ID_FILTER_AREAPORTALS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Clusterportals" ), G_CALLBACK( HandleCommand ), ID_FILTER_CLUSTERPORTALS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Triggers" ), G_CALLBACK( HandleCommand ), ID_FILTER_TRIGGERS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Botclips" ), G_CALLBACK( HandleCommand ), ID_FILTER_BOTCLIPS, FALSE );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Paths" ), G_CALLBACK( HandleCommand ), ID_FILTER_PATHS, FALSE );
item = create_check_menu_item_with_mnemonic( menu_in_menu, _( "Lightgrid" ), G_CALLBACK( HandleCommand ), ID_FILTER_LIGHTGRID, FALSE );
g_object_set_data( G_OBJECT( window ), "menu_filter_lightgrid", item );
create_check_menu_item_with_mnemonic( menu_in_menu, _( "Patches" ), G_CALLBACK( HandleCommand ), ID_FILTER_PATCHES, FALSE );
menu_separator( menu );
menu_in_menu = create_menu_in_menu_with_mnemonic( menu, _( "Hide/Show" ) );
@ -3966,6 +3981,9 @@ void MainFrame::SetButtonMenuStates(){
item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_liquids" ) );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ),
( g_qeglobals.d_savedinfo.exclude & EXCLUDE_LIQUIDS ) != 0 );
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 ),
( g_qeglobals.d_savedinfo.exclude & EXCLUDE_MIST ) != 0 );
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 ),
( g_qeglobals.d_savedinfo.exclude & EXCLUDE_CAULK ) != 0 );
@ -3999,12 +4017,16 @@ void MainFrame::SetButtonMenuStates(){
item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_hintsskips" ) );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ),
( g_qeglobals.d_savedinfo.exclude & EXCLUDE_HINTSSKIPS ) != 0 );
item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_sky" ) );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ),
( g_qeglobals.d_savedinfo.exclude & EXCLUDE_SKY ) != 0 );
item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_models" ) );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ),
( g_qeglobals.d_savedinfo.exclude & EXCLUDE_MODELS ) != 0 );
item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_triggers" ) );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ),
( g_qeglobals.d_savedinfo.exclude & EXCLUDE_TRIGGERS ) != 0 );
item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_toggle_lock" ) );
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), ( g_PrefsDlg.m_bTextureLock ) ? TRUE : FALSE );
item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_toggle_rotatelock" ) );
@ -7246,33 +7268,81 @@ void MainFrame::OnCameraRight( bool keydown ){
}
}
void MainFrame::OnCameraUp(){
void MainFrame::OnCameraUp( bool keydown ){
if ( g_PrefsDlg.m_bCamDiscrete ) {
if ( keydown ) {
m_pCamWnd->Camera()->origin[2] += SPEED_MOVE;
int nUpdate = ( g_PrefsDlg.m_bCamXYUpdate ) ? ( W_CAMERA | W_XY | W_Z ) : ( W_CAMERA );
int nUpdate = ( g_PrefsDlg.m_bCamXYUpdate ) ? ( W_CAMERA | W_XY ) : ( W_CAMERA );
Sys_UpdateWindows( nUpdate );
}
}
else {
if ( keydown ) {
m_pCamWnd->Camera()->movementflags |= MOVE_UP;
}
else{
m_pCamWnd->Camera()->movementflags &= ~MOVE_UP;
}
}
}
void MainFrame::OnCameraDown(){
void MainFrame::OnCameraDown( bool keydown ){
if ( g_PrefsDlg.m_bCamDiscrete ) {
if ( keydown ) {
m_pCamWnd->Camera()->origin[2] -= SPEED_MOVE;
int nUpdate = ( g_PrefsDlg.m_bCamXYUpdate ) ? ( W_CAMERA | W_XY | W_Z ) : ( W_CAMERA );
int nUpdate = ( g_PrefsDlg.m_bCamXYUpdate ) ? ( W_CAMERA | W_XY ) : ( W_CAMERA );
Sys_UpdateWindows( nUpdate );
}
}
else {
if ( keydown ) {
m_pCamWnd->Camera()->movementflags |= MOVE_DOWN;
}
else{
m_pCamWnd->Camera()->movementflags &= ~MOVE_DOWN;
}
}
}
void MainFrame::OnCameraAngleup(){
m_pCamWnd->Camera()->angles[0] += SPEED_TURN;
if ( m_pCamWnd->Camera()->angles[0] > 85 ) {
m_pCamWnd->Camera()->angles[0] = 85;
void MainFrame::OnCameraAngleup( bool keydown ){
if ( g_PrefsDlg.m_bCamDiscrete ) {
if ( keydown ) {
m_pCamWnd->Camera()->angles[PITCH] += SPEED_TURN;
if ( m_pCamWnd->Camera()->angles[PITCH] > 85 ) {
m_pCamWnd->Camera()->angles[PITCH] = 85;
}
Sys_UpdateWindows( W_CAMERA | W_XY_OVERLAY );
}
}
else {
if ( keydown ) {
m_pCamWnd->Camera()->movementflags |= MOVE_ROTUP;
}
else{
m_pCamWnd->Camera()->movementflags &= ~MOVE_ROTUP;
}
}
}
void MainFrame::OnCameraAngledown(){
m_pCamWnd->Camera()->angles[0] -= SPEED_TURN;
if ( m_pCamWnd->Camera()->angles[0] < -85 ) {
m_pCamWnd->Camera()->angles[0] = -85;
void MainFrame::OnCameraAngledown( bool keydown ){
if ( g_PrefsDlg.m_bCamDiscrete ) {
if ( keydown ) {
m_pCamWnd->Camera()->angles[PITCH] -= SPEED_TURN;
if ( m_pCamWnd->Camera()->angles[PITCH] < -85 ) {
m_pCamWnd->Camera()->angles[PITCH] = -85;
}
Sys_UpdateWindows( W_CAMERA | W_XY_OVERLAY );
}
}
else {
if ( keydown ) {
m_pCamWnd->Camera()->movementflags |= MOVE_ROTDOWN;
}
else{
m_pCamWnd->Camera()->movementflags &= ~MOVE_ROTDOWN;
}
}
}
void MainFrame::OnCameraStrafeleft( bool keydown ){
// FIXME: as soon as gtk supports proper keyup/down support, remove this bit
@ -7696,6 +7766,20 @@ void MainFrame::OnFilterLiquids(){
Sys_UpdateWindows( W_XY | W_CAMERA );
}
void MainFrame::OnFilterMist(){
GtkWidget *item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_mist" ) );
g_bIgnoreCommands++;
if ( ( g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_MIST ) & EXCLUDE_MIST ) {
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(){
GtkWidget *item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_models" ) );
g_bIgnoreCommands++;
@ -7808,6 +7892,20 @@ void MainFrame::OnFilterWorld(){
Sys_UpdateWindows( W_XY | W_CAMERA );
}
void MainFrame::OnFilterSky(){
GtkWidget *item = GTK_WIDGET( g_object_get_data( G_OBJECT( m_pWidget ), "menu_filter_sky" ) );
g_bIgnoreCommands++;
if ( ( g_qeglobals.d_savedinfo.exclude ^= EXCLUDE_SKY ) & EXCLUDE_SKY ) {
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 );
}

View File

@ -402,6 +402,8 @@ struct SKeyInfo
#define ID_FILTER_LIGHTGRID 40225
#define ID_FILTER_STRUCTURAL 40226
#define ID_FILTER_BOTCLIPS 40227
#define ID_FILTER_SKY 40228
#define ID_FILTER_MIST 40229
#define ID_CURVE_REDISPERSE_INTERMEDIATE_COLS 40230
#define ID_CURVE_REDISPERSE_INTERMEDIATE_ROWS 40231
@ -702,16 +704,16 @@ void OnHelpLinks();
void OnHelpBugreport();
void OnViewClipper();
void OnToggleDetail();
void OnCameraAngledown();
void OnCameraAngleup();
void OnCameraAngledown( bool keydown );
void OnCameraAngleup( bool keydown );
void OnCameraBack( bool keydown );
void OnCameraDown();
void OnCameraDown( bool keydown );
void OnCameraForward( bool keydown );
void OnCameraLeft( bool keydown );
void OnCameraRight( bool keydown );
void OnCameraStrafeleft( bool keydown );
void OnCameraStraferight( bool keydown );
void OnCameraUp();
void OnCameraUp( bool keydown );
void OnGridToggle();
void OnPrefs();
void OnTogglecamera();
@ -893,11 +895,13 @@ void OnFilterEntities();
void OnFilterHintsskips();
void OnFilterLights();
void OnFilterLiquids();
void OnFilterMist();
void OnFilterModels();
void OnFilterPatches();
void OnFilterTranslucent();
void OnFilterTriggers();
void OnFilterWorld();
void OnFilterSky();
void OnFilterPaths();
void OnFilterClusterportals();
void OnFilterLightgrid();

View File

@ -84,6 +84,8 @@
#define EXCLUDE_LIGHTGRID 0x00010000
#define EXCLUDE_STRUCTURAL 0x00020000
#define EXCLUDE_BOTCLIP 0x00040000
#define EXCLUDE_SKY 0x00080000
#define EXCLUDE_MIST 0x00100000
#define INCLUDE_EASY 0x00000001
#define INCLUDE_NORMAL 0x00000002

View File

@ -362,6 +362,8 @@ typedef struct
#define CONTENTS_MIST 64
#define LAST_VISIBLE_CONTENTS 64
#define CONTENTS_AREAPORTAL 0x8000
// remaining contents are non-visible, and don't eat brushes
#define CONTENTS_PLAYERCLIP 0x10000
#define CONTENTS_MONSTERCLIP 0x20000
@ -408,15 +410,17 @@ typedef struct texinfo_s
#define SURF_LIGHT 0x1 // value will hold the light strength
#define SURF_SLICK 0x2 // effects game physics
#define SURF_SKY 0x4 // don't draw, but add to skybox
#define SURF_WARP 0x8 // turbulent water warp
#define SURF_TRANS33 0x10
#define SURF_TRANS66 0x20
#define SURF_FLOWING 0x40 // scroll towards angle
#define SURF_TRANS100 0x40 // quetoo provides texture alpha via overriding SURF_FLOWING
#define SURF_NODRAW 0x80 // don't bother referencing the texture
#define SURF_HINT 0x100
#define SURF_SKIP 0x200
#define SURF_ALPHA_TEST 0x400
#define SURF_PATCH 0x20000000
#define SURF_CURVE_FAKE 0x40000000