Radiant:
misc... * extradebug_quicker BUILD mode (defines _DEBUG_QUICKER = no slowing down debug renderables) * draw bbox for having model + selected entities
This commit is contained in:
parent
969b901abe
commit
bc5dcc1699
12
Makefile
12
Makefile
|
|
@ -5,7 +5,7 @@ MAKEFILE_CONF ?= Makefile.conf
|
|||
# user customizable stuf
|
||||
# you may override this in Makefile.conf or the environment
|
||||
BUILD ?= debug
|
||||
# or: release, or: debug, or: extradebug, or: profile, or: native
|
||||
# or: release, or: debug, or: extradebug, or: extradebug_quicker, or: profile, or: native
|
||||
OS ?= $(shell uname)
|
||||
# or: Linux, Win32, Darwin
|
||||
LDFLAGS ?=
|
||||
|
|
@ -137,6 +137,15 @@ endif
|
|||
LDFLAGS_COMMON +=
|
||||
else
|
||||
|
||||
ifeq ($(BUILD),extradebug_quicker)
|
||||
ifeq ($(findstring $(CFLAGS),-g),)
|
||||
CFLAGS_COMMON += -g3
|
||||
# only add -g3 if no -g flag is in $(CFLAGS)
|
||||
endif
|
||||
CPPFLAGS_COMMON += -D_DEBUG -D_DEBUG_QUICKER
|
||||
LDFLAGS_COMMON +=
|
||||
else
|
||||
|
||||
ifeq ($(BUILD),profile)
|
||||
ifeq ($(findstring $(CFLAGS),-g),)
|
||||
CFLAGS_COMMON += -g
|
||||
|
|
@ -176,6 +185,7 @@ endif
|
|||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
INSTALLDIR_BASE := $(INSTALLDIR)
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ inline void aabb_draw_wire( const Vector3 points[8] ){
|
|||
glBegin( GL_LINES );
|
||||
for ( std::size_t i = 0; i < sizeof( indices ) / sizeof( indices[0] ); ++i )
|
||||
{
|
||||
glVertex3fv( points[indices[i]] );
|
||||
glVertex3fv( vector3_to_array( points[indices[i]] ) );
|
||||
}
|
||||
glEnd();
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1191,4 +1191,12 @@ inline void matrix4_pivoted_transform_by_euler_xyz_degrees( Matrix4& self, const
|
|||
}
|
||||
|
||||
|
||||
template<typename TextOutputStreamType>
|
||||
inline TextOutputStreamType& ostream_write( TextOutputStreamType& ostream, const Matrix4& m ){
|
||||
return ostream << "[ " << m[0] << " " << m[1] << " " << m[2] << " " << m[3] << " ]*[ "
|
||||
<< m[4] << " " << m[5] << " " << m[6] << " " << m[7] << " ]*[ "
|
||||
<< m[8] << " " << m[9] << " " << m[10] << " " << m[11] << " ]*[ "
|
||||
<< m[12] << " " << m[13] << " " << m[14] << " " << m[15] << " ]";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -54,6 +54,10 @@
|
|||
|
||||
#include "entity.h"
|
||||
|
||||
inline void read_aabb( AABB& aabb, const EntityClass& eclass ){
|
||||
aabb = aabb_for_minmax( eclass.mins, eclass.maxs );
|
||||
}
|
||||
|
||||
class EclassModel :
|
||||
public Snappable
|
||||
{
|
||||
|
|
@ -76,10 +80,16 @@ RenderablePivot m_renderOrigin;
|
|||
RenderableNamedEntity m_renderName;
|
||||
ModelSkinKey m_skin;
|
||||
|
||||
AABB m_aabb_local;
|
||||
RenderableWireframeAABB m_aabb_wire;
|
||||
Matrix4 m_translation;
|
||||
|
||||
Callback m_transformChanged;
|
||||
Callback m_evaluateTransform;
|
||||
|
||||
void construct(){
|
||||
read_aabb( m_aabb_local, m_entity.getEntityClass() );
|
||||
|
||||
default_rotation( m_rotation );
|
||||
|
||||
m_keyObservers.insert( "classname", ClassnameFilter::ClassnameChangedCaller( m_filter ) );
|
||||
|
|
@ -104,6 +114,8 @@ void updateTransform(){
|
|||
m_transform.localToParent() = g_matrix4_identity;
|
||||
matrix4_translate_by_vec3( m_transform.localToParent(), m_origin );
|
||||
|
||||
m_translation = m_transform.localToParent();
|
||||
|
||||
if ( g_gameType == eGameTypeDoom3 ) {
|
||||
matrix4_multiply_by_matrix4( m_transform.localToParent(), rotation_toMatrix( m_rotation ) );
|
||||
}
|
||||
|
|
@ -154,6 +166,8 @@ EclassModel( EntityClass* eclass, scene::Node& node, const Callback& transformCh
|
|||
m_nameKeys( m_entity ),
|
||||
m_renderName( m_named, g_vector3_identity ),
|
||||
m_skin( SkinChangedCaller( *this ) ),
|
||||
m_aabb_wire( m_aabb_local ),
|
||||
m_translation( g_matrix4_identity ),
|
||||
m_transformChanged( transformChanged ),
|
||||
m_evaluateTransform( evaluateTransform ){
|
||||
construct();
|
||||
|
|
@ -170,6 +184,8 @@ EclassModel( const EclassModel& other, scene::Node& node, const Callback& transf
|
|||
m_nameKeys( m_entity ),
|
||||
m_renderName( m_named, g_vector3_identity ),
|
||||
m_skin( SkinChangedCaller( *this ) ),
|
||||
m_aabb_wire( m_aabb_local ),
|
||||
m_translation( g_matrix4_identity ),
|
||||
m_transformChanged( transformChanged ),
|
||||
m_evaluateTransform( evaluateTransform ){
|
||||
construct();
|
||||
|
|
@ -228,8 +244,14 @@ 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 );
|
||||
}
|
||||
|
||||
renderer.PushState();
|
||||
renderer.Highlight( Renderer::ePrimitive, false );
|
||||
renderer.SetState( m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly );
|
||||
renderer.SetState( m_entity.getEntityClass().m_state_wire, Renderer::eFullMaterials );
|
||||
renderer.addRenderable( m_aabb_wire, m_translation );
|
||||
renderer.PopState();
|
||||
}
|
||||
renderer.SetState( m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly );
|
||||
}
|
||||
void renderWireframe( Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected ) const {
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ public:
|
|||
void updateTransform(){
|
||||
m_transform.localToParent() = g_matrix4_identity;
|
||||
matrix4_translate_by_vec3( m_transform.localToParent(), m_origin );
|
||||
//matrix4_transform_by_euler_xyz_degrees( m_transform.localToParent(), m_origin, m_angles, Vector3( 1, 1, 1 ) );
|
||||
m_transformChanged();
|
||||
}
|
||||
typedef MemberCaller<GenericEntity, &GenericEntity::updateTransform> UpdateTransformCaller;
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ void render( RenderStateFlags state ) const {
|
|||
glEnd();
|
||||
#endif
|
||||
|
||||
#if defined( _DEBUG )
|
||||
#if defined( _DEBUG ) && !defined( _DEBUG_QUICKER )
|
||||
glBegin( GL_LINES );
|
||||
|
||||
for ( VertexBuffer<ArbitraryMeshVertex>::const_iterator i = m_vertices.begin(); i != m_vertices.end(); ++i )
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ void render( RenderStateFlags state ) const {
|
|||
glVertexPointer( 3, GL_FLOAT, sizeof( ArbitraryMeshVertex ), &m_vertices.data()->vertex );
|
||||
glDrawElements( GL_TRIANGLES, GLsizei( m_indices.size() ), RenderIndexTypeID, m_indices.data() );
|
||||
|
||||
#if defined( _DEBUG )
|
||||
#if defined( _DEBUG ) && !defined( _DEBUG_QUICKER )
|
||||
GLfloat modelview[16];
|
||||
glGetFloatv( GL_MODELVIEW_MATRIX, modelview ); // I know this is slow as hell, but hey - we're in _DEBUG
|
||||
Matrix4 modelview_inv(
|
||||
|
|
|
|||
|
|
@ -83,13 +83,6 @@ enum EBrushType
|
|||
#define BRUSH_CONNECTIVITY_DEBUG 0
|
||||
#define BRUSH_DEGENERATE_DEBUG 0
|
||||
|
||||
template<typename TextOuputStreamType>
|
||||
inline TextOuputStreamType& ostream_write( TextOuputStreamType& ostream, const Matrix4& m ){
|
||||
return ostream << "(" << m[0] << " " << m[1] << " " << m[2] << " " << m[3] << ", "
|
||||
<< m[4] << " " << m[5] << " " << m[6] << " " << m[7] << ", "
|
||||
<< m[8] << " " << m[9] << " " << m[10] << " " << m[11] << ", "
|
||||
<< m[12] << " " << m[13] << " " << m[14] << " " << m[15] << ")";
|
||||
}
|
||||
|
||||
inline void print_vector3( const Vector3& v ){
|
||||
globalOutputStream() << "( " << v.x() << " " << v.y() << " " << v.z() << " )\n";
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ void render( RenderStateFlags state ) const {
|
|||
}
|
||||
}
|
||||
|
||||
#if defined( _DEBUG )
|
||||
#if defined( _DEBUG ) && !defined( _DEBUG_QUICKER )
|
||||
RenderNormals();
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ inline float angle_between( const Vector3& a, const Vector3& b ){
|
|||
}
|
||||
|
||||
|
||||
#if defined( _DEBUG )
|
||||
#if defined( _DEBUG ) && !defined( _DEBUG_QUICKER )
|
||||
class test_quat
|
||||
{
|
||||
public:
|
||||
|
|
@ -626,7 +626,7 @@ void add_one(){
|
|||
}
|
||||
};
|
||||
|
||||
#if defined( _DEBUG )
|
||||
#if defined( _DEBUG ) && !defined( _DEBUG_QUICKER )
|
||||
#define DEBUG_SELECTION
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -2216,6 +2216,7 @@ GtkWidget* TextureBrowser_constructWindow( GtkWindow* toplevel ){
|
|||
gtk_entry_set_icon_from_stock( GTK_ENTRY( entry ), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR );
|
||||
gtk_entry_set_icon_sensitive( GTK_ENTRY( entry ), GTK_ENTRY_ICON_SECONDARY, FALSE );
|
||||
TextureBrowser_filterSetModeIcon( GTK_ENTRY( entry ) );
|
||||
gtk_entry_set_icon_tooltip_text( GTK_ENTRY( entry ), GTK_ENTRY_ICON_PRIMARY, "toggle match mode ( start / any position )" );
|
||||
gtk_widget_show( entry );
|
||||
g_TextureBrowser.m_filter_entry = entry;
|
||||
g_signal_connect( G_OBJECT( entry ), "changed", G_CALLBACK( TextureBrowser_filterChanged ), &g_TextureBrowser );
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#include "math/frustum.h"
|
||||
|
||||
|
||||
#if defined( _DEBUG )
|
||||
#if defined( _DEBUG ) && !defined( _DEBUG_QUICKER )
|
||||
#define DEBUG_CULLING
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
<!-- generated by Radiant setup, modify at your own risks -->
|
||||
<links>
|
||||
<!--item name="NetRadiant website" url="http://www.icculus.org/netradiant/"/-->
|
||||
<item name="Mouse Shortcuts" url="docs/Mouse Shortcuts.txt"/>
|
||||
<item name="q3map2 handbook (web)" url="http://en.wikibooks.org/wiki/Category:Q3Map2"/>
|
||||
<item name="Shader Manual (web)" url="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html"/>
|
||||
<item name="Shader Manual (offline+fixed)" url="docs/shaderManual/contents.html"/>
|
||||
<item name="Mouse Shortcuts" url="docs/Mouse Shortcuts.txt"/>
|
||||
<item name="Additional map compiler features" url="docs/Additional_map_compiler_features.htm"/>
|
||||
<item name="Additional map editor features" url="docs/Additional_map_editor_features.htm"/>
|
||||
<item name="Complete list of Q3map2 command line parameters" url="docs/Complete_list_of_command_line_parameters.htm"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user