mirror of
https://github.com/Garux/netradiant-custom.git
synced 2026-09-28 00:00:03 +02:00
Radiant:
menus... * view->show->Entity boxes (always show bbox for ents with model) misc... FBO support * preferences->display->entities->Names Display Ratio (2D): hide names, if view_size/bbox_size > value; def = 64
This commit is contained in:
@@ -363,7 +363,7 @@ void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& l
|
||||
renderer.addRenderable( m_curveCatmullRom.m_renderCurve, localToWorld );
|
||||
}
|
||||
|
||||
if ( g_showNames || selected || childSelected ) {
|
||||
if ( selected || childSelected || ( g_showNames && ( volume.fill() || aabb_fits_view( aabb_for_oriented_aabb( childBounds, volume.GetModelview() ), volume.GetViewport(), g_showNamesRatio ) ) ) ) {
|
||||
// draw models as usual
|
||||
if ( !isModel() ) {
|
||||
// don't draw the name for worldspawn
|
||||
|
||||
@@ -242,8 +242,9 @@ void detach( scene::Traversable::Observer* observer ){
|
||||
}
|
||||
|
||||
void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected ) const {
|
||||
if ( selected ) {
|
||||
m_renderOrigin.render( renderer, volume, localToWorld );
|
||||
if ( selected || g_showBboxes ) {
|
||||
if( selected )
|
||||
m_renderOrigin.render( renderer, volume, localToWorld );
|
||||
|
||||
renderer.PushState();
|
||||
renderer.Highlight( Renderer::ePrimitive, false );
|
||||
@@ -253,7 +254,7 @@ void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& l
|
||||
renderer.PopState();
|
||||
}
|
||||
renderer.SetState( m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly );
|
||||
if ( g_showNames || selected ) {
|
||||
if ( selected || ( g_showNames && ( volume.fill() || aabb_fits_view( aabb_for_oriented_aabb( m_aabb_local, volume.GetModelview() ), volume.GetViewport(), g_showNamesRatio ) ) ) ) {
|
||||
m_renderName.render( renderer, volume, localToWorld, selected );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,9 @@ EntityCreator::KeyValueChangedFunc KeyValue::m_entityKeyValueChanged = 0;
|
||||
Counter* EntityKeyValues::m_counter = 0;
|
||||
|
||||
bool g_showNames = true;
|
||||
bool g_showBboxes = false;
|
||||
int g_showNamesDist = 512;
|
||||
int g_showNamesRatio = 64;
|
||||
bool g_showTargetNames = false;
|
||||
bool g_showAngles = true;
|
||||
bool g_lightRadii = true;
|
||||
@@ -267,12 +269,24 @@ void setShowNames( bool showNames ){
|
||||
bool getShowNames(){
|
||||
return g_showNames;
|
||||
}
|
||||
void setShowBboxes( bool showBboxes ){
|
||||
g_showBboxes = showBboxes;
|
||||
}
|
||||
bool getShowBboxes(){
|
||||
return g_showBboxes;
|
||||
}
|
||||
void setShowNamesDist( int dist ){
|
||||
g_showNamesDist = dist;
|
||||
}
|
||||
int getShowNamesDist(){
|
||||
return g_showNamesDist;
|
||||
}
|
||||
void setShowNamesRatio( int ratio ){
|
||||
g_showNamesRatio = ratio;
|
||||
}
|
||||
int getShowNamesRatio(){
|
||||
return g_showNamesRatio;
|
||||
}
|
||||
void setShowTargetNames( bool showNames ){
|
||||
g_showTargetNames = showNames;
|
||||
}
|
||||
@@ -383,7 +397,9 @@ void Entity_Construct( EGameType gameType ){
|
||||
}
|
||||
|
||||
GlobalPreferenceSystem().registerPreference( "SI_ShowNames", BoolImportStringCaller( g_showNames ), BoolExportStringCaller( g_showNames ) );
|
||||
GlobalPreferenceSystem().registerPreference( "SI_ShowBboxes", BoolImportStringCaller( g_showBboxes ), BoolExportStringCaller( g_showBboxes ) );
|
||||
GlobalPreferenceSystem().registerPreference( "SI_ShowNamesDist", IntImportStringCaller( g_showNamesDist ), IntExportStringCaller( g_showNamesDist ) );
|
||||
GlobalPreferenceSystem().registerPreference( "SI_ShowNamesRatio", IntImportStringCaller( g_showNamesRatio ), IntExportStringCaller( g_showNamesRatio ) );
|
||||
GlobalPreferenceSystem().registerPreference( "SI_ShowTargetNames", BoolImportStringCaller( g_showTargetNames ), BoolExportStringCaller( g_showTargetNames ) );
|
||||
GlobalPreferenceSystem().registerPreference( "SI_ShowAngles", BoolImportStringCaller( g_showAngles ), BoolExportStringCaller( g_showAngles ) );
|
||||
GlobalPreferenceSystem().registerPreference( "LightRadiuses", BoolImportStringCaller( g_lightRadii ), BoolExportStringCaller( g_lightRadii ) );
|
||||
|
||||
@@ -39,7 +39,9 @@ void Entity_Construct( EGameType gameType = eGameTypeQuake3 );
|
||||
void Entity_Destroy();
|
||||
|
||||
extern bool g_showNames;
|
||||
extern bool g_showBboxes;
|
||||
extern int g_showNamesDist;
|
||||
extern int g_showNamesRatio;
|
||||
extern bool g_showTargetNames;
|
||||
extern bool g_showAngles;
|
||||
extern bool g_lightRadii;
|
||||
|
||||
@@ -227,7 +227,7 @@ void renderWireframe( Renderer& renderer, const VolumeTest& volume, const Matrix
|
||||
renderer.SetState( m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly );
|
||||
renderer.addRenderable( m_aabb_wire, localToWorld );
|
||||
renderArrow( renderer, volume, localToWorld );
|
||||
if ( g_showNames || selected ) {
|
||||
if ( selected || ( g_showNames && aabb_fits_view( aabb_for_oriented_aabb( m_aabb_local, volume.GetModelview() ), volume.GetViewport(), g_showNamesRatio ) ) ) {
|
||||
m_renderName.render( renderer, volume, localToWorld, selected );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ void detach( scene::Traversable::Observer* observer ){
|
||||
|
||||
void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected, bool childSelected, const AABB& childBounds ) const {
|
||||
renderer.SetState( m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly );
|
||||
if ( g_showNames || selected || childSelected ) {
|
||||
if ( selected || childSelected || ( g_showNames && ( volume.fill() || aabb_fits_view( aabb_for_oriented_aabb( childBounds, volume.GetModelview() ), volume.GetViewport(), g_showNamesRatio ) ) ) ) {
|
||||
// don't draw the name for worldspawn
|
||||
if ( !strcmp( m_entity.getEntityClass().name(), "worldspawn" ) ) {
|
||||
return;
|
||||
|
||||
@@ -1460,7 +1460,7 @@ void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& l
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( g_showNames || selected ) && !string_equal( m_named.name(), "light" ) ) {
|
||||
if ( ( selected || ( g_showNames && ( volume.fill() || aabb_fits_view( aabb_for_oriented_aabb( m_aabb_light, volume.GetModelview() ), volume.GetViewport(), g_showNamesRatio ) ) ) ) && !string_equal( m_named.name(), "light" ) ) {
|
||||
m_renderName.render( renderer, volume, localToWorld, selected );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& l
|
||||
m_renderOrigin.render( renderer, volume, localToWorld );
|
||||
}
|
||||
renderer.SetState( m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly );
|
||||
if ( ( g_showNames || selected ) && !string_equal( m_named.name(), "misc_model" ) ) {
|
||||
if ( ( selected || ( g_showNames && ( volume.fill() || aabb_fits_view( aabb_for_oriented_aabb( AABB( Vector3( 0, 0, 0 ), Vector3( 32, 32, 32 ) ), volume.GetModelview() ), volume.GetViewport(), g_showNamesRatio ) ) ) ) && !string_equal( m_named.name(), "misc_model" ) ) {
|
||||
m_renderName.render( renderer, volume, localToWorld, selected );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user