* View->Show->Entity Connections option
This commit is contained in:
@@ -114,6 +114,7 @@ Counter* EntityKeyValues::m_counter = 0;
|
||||
|
||||
bool g_showNames = true;
|
||||
bool g_showBboxes = false;
|
||||
bool g_showConnections = true;
|
||||
int g_showNamesDist = 512;
|
||||
int g_showNamesRatio = 64;
|
||||
bool g_showTargetNames = false;
|
||||
@@ -278,6 +279,12 @@ void setShowBboxes( bool showBboxes ){
|
||||
bool getShowBboxes(){
|
||||
return g_showBboxes;
|
||||
}
|
||||
void setShowConnections( bool showConnections ){
|
||||
g_showConnections = showConnections;
|
||||
}
|
||||
bool getShowConnections(){
|
||||
return g_showConnections;
|
||||
}
|
||||
void setShowNamesDist( int dist ){
|
||||
g_showNamesDist = dist;
|
||||
}
|
||||
@@ -409,6 +416,7 @@ 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_ShowConnections", BoolImportStringCaller( g_showConnections ), BoolExportStringCaller( g_showConnections ) );
|
||||
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 ) );
|
||||
|
||||
@@ -41,6 +41,7 @@ void Entity_Destroy();
|
||||
|
||||
extern bool g_showNames;
|
||||
extern bool g_showBboxes;
|
||||
extern bool g_showConnections;
|
||||
extern int g_showNamesDist;
|
||||
extern int g_showNamesRatio;
|
||||
extern bool g_showTargetNames;
|
||||
|
||||
@@ -34,4 +34,4 @@ targetables_t* getTargetables( const char* targetname ){
|
||||
return &g_targetnames[targetname];
|
||||
}
|
||||
|
||||
Shader* RenderableTargetingEntity::m_state;
|
||||
//Shader* RenderableTargetingEntity::m_state;
|
||||
|
||||
@@ -289,7 +289,7 @@ const TargetingEntities& get() const {
|
||||
};
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
class RenderableTargetingEntity
|
||||
{
|
||||
TargetingEntity& m_targets;
|
||||
@@ -314,13 +314,13 @@ void render( Renderer& renderer, const VolumeTest& volume, const Vector3& world_
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
class RenderableTargetingEntities
|
||||
{
|
||||
const TargetingEntities& m_targets;
|
||||
mutable RenderablePointVector m_target_lines;
|
||||
public:
|
||||
static Shader* m_state;
|
||||
//static Shader* m_state;
|
||||
|
||||
RenderableTargetingEntities( const TargetingEntities& targets )
|
||||
: m_targets( targets ), m_target_lines( GL_LINES ){
|
||||
@@ -416,6 +416,7 @@ const TargetingEntities& getTargeting() const {
|
||||
}
|
||||
};
|
||||
|
||||
#include "entity.h"
|
||||
|
||||
class RenderableConnectionLines : public Renderable
|
||||
{
|
||||
@@ -432,10 +433,12 @@ void detach( TargetableInstance& instance ){
|
||||
}
|
||||
|
||||
void renderSolid( Renderer& renderer, const VolumeTest& volume ) const {
|
||||
for ( TargetableInstances::const_iterator i = m_instances.begin(); i != m_instances.end(); ++i )
|
||||
{
|
||||
if ( ( *i )->path().top().get().visible() ) {
|
||||
( *i )->render( renderer, volume );
|
||||
if( g_showConnections ){
|
||||
for ( TargetableInstances::const_iterator i = m_instances.begin(); i != m_instances.end(); ++i )
|
||||
{
|
||||
if ( ( *i )->path().top().get().visible() ) {
|
||||
( *i )->render( renderer, volume );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user