diff --git a/Makefile b/Makefile index 48081b15..73d40ec0 100644 --- a/Makefile +++ b/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) diff --git a/libs/entitylib.h b/libs/entitylib.h index 7f1bb0c1..2b358dcf 100644 --- a/libs/entitylib.h +++ b/libs/entitylib.h @@ -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 diff --git a/libs/math/matrix.h b/libs/math/matrix.h index 95ecfac0..a2ab45d1 100644 --- a/libs/math/matrix.h +++ b/libs/math/matrix.h @@ -1191,4 +1191,12 @@ inline void matrix4_pivoted_transform_by_euler_xyz_degrees( Matrix4& self, const } +template +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 diff --git a/plugins/entity/eclassmodel.cpp b/plugins/entity/eclassmodel.cpp index 855fc923..d20538cb 100644 --- a/plugins/entity/eclassmodel.cpp +++ b/plugins/entity/eclassmodel.cpp @@ -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 { diff --git a/plugins/entity/generic.cpp b/plugins/entity/generic.cpp index bfdd22e8..143e10b0 100644 --- a/plugins/entity/generic.cpp +++ b/plugins/entity/generic.cpp @@ -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 UpdateTransformCaller; diff --git a/plugins/md3model/model.h b/plugins/md3model/model.h index ee760064..42bfccd5 100644 --- a/plugins/md3model/model.h +++ b/plugins/md3model/model.h @@ -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::const_iterator i = m_vertices.begin(); i != m_vertices.end(); ++i ) diff --git a/plugins/model/model.cpp b/plugins/model/model.cpp index defa472a..e67d9662 100644 --- a/plugins/model/model.cpp +++ b/plugins/model/model.cpp @@ -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( diff --git a/radiant/brush.h b/radiant/brush.h index a7229119..0024557b 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -83,13 +83,6 @@ enum EBrushType #define BRUSH_CONNECTIVITY_DEBUG 0 #define BRUSH_DEGENERATE_DEBUG 0 -template -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"; diff --git a/radiant/patch.h b/radiant/patch.h index 32f59165..19e70383 100644 --- a/radiant/patch.h +++ b/radiant/patch.h @@ -317,7 +317,7 @@ void render( RenderStateFlags state ) const { } } -#if defined( _DEBUG ) +#if defined( _DEBUG ) && !defined( _DEBUG_QUICKER ) RenderNormals(); #endif } diff --git a/radiant/selection.cpp b/radiant/selection.cpp index c10710f7..68a2ab76 100644 --- a/radiant/selection.cpp +++ b/radiant/selection.cpp @@ -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 diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 5d79e24a..33e0fcfe 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -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 ); diff --git a/radiant/view.h b/radiant/view.h index 9800464f..6b0578b0 100644 --- a/radiant/view.h +++ b/radiant/view.h @@ -26,7 +26,7 @@ #include "math/frustum.h" -#if defined( _DEBUG ) +#if defined( _DEBUG ) && !defined( _DEBUG_QUICKER ) #define DEBUG_CULLING #endif diff --git a/setup/data/tools/global.xlink b/setup/data/tools/global.xlink index 17fa8456..9d66de02 100644 --- a/setup/data/tools/global.xlink +++ b/setup/data/tools/global.xlink @@ -2,10 +2,10 @@ + -