mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-25 02:41:22 +00:00
- Entity names are now drawn for group entities in Doom3 and Quake 3 mode (namespace)
- Fixed translucent brushes becoming invisible when selected (Shaderman) git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@123 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
7174c79dc2
commit
0a9ca16033
7 changed files with 49 additions and 17 deletions
5
CHANGES
5
CHANGES
|
@ -1,6 +1,11 @@
|
|||
This is the changelog for developers, != changelog for the end user
|
||||
that we distribute with the binaries. (see changelog)
|
||||
|
||||
08/12/2006
|
||||
namespace
|
||||
- Entity names are now drawn for group entities in Doom3 and Quake 3 mode (namespace)
|
||||
- Fixed translucent brushes becoming invisible when selected (Shaderman)
|
||||
|
||||
06/11/2006
|
||||
namespace
|
||||
- (TODO) Texture sizes sometimes vary wildly. New texture browser option: View -> Fixed Size.
|
||||
|
|
|
@ -328,6 +328,9 @@ struct Colour4b
|
|||
}
|
||||
};
|
||||
|
||||
const Colour4b colour_vertex(0, 255, 0, 255);
|
||||
const Colour4b colour_selected(0, 0, 255, 255);
|
||||
|
||||
inline bool operator<(const Colour4b& self, const Colour4b& other)
|
||||
{
|
||||
if(self.r != other.r)
|
||||
|
|
|
@ -148,9 +148,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
const Colour4b colour_vertex(0, 255, 0, 255);
|
||||
const Colour4b colour_selected(0, 0, 255, 255);
|
||||
|
||||
class ControlPointAdd
|
||||
{
|
||||
RenderablePointVector& m_points;
|
||||
|
|
|
@ -82,6 +82,7 @@ class Doom3Group :
|
|||
SingletonModel m_model;
|
||||
OriginKey m_originKey;
|
||||
Vector3 m_origin;
|
||||
|
||||
RotationKey m_rotationKey;
|
||||
Float9 m_rotation;
|
||||
|
||||
|
@ -92,6 +93,7 @@ class Doom3Group :
|
|||
Doom3GroupOrigin m_funcStaticOrigin;
|
||||
RenderablePivot m_renderOrigin;
|
||||
RenderableNamedEntity m_renderName;
|
||||
mutable Vector3 m_name_origin;
|
||||
ModelSkinKey m_skin;
|
||||
|
||||
public:
|
||||
|
@ -276,7 +278,8 @@ public:
|
|||
m_named(m_entity),
|
||||
m_nameKeys(m_entity),
|
||||
m_funcStaticOrigin(m_traverse, m_origin),
|
||||
m_renderName(m_named, g_vector3_identity),
|
||||
m_renderName(m_named, m_name_origin),
|
||||
m_name_origin(g_vector3_identity),
|
||||
m_skin(SkinChangedCaller(*this)),
|
||||
m_curveNURBS(boundsChanged),
|
||||
m_curveCatmullRom(boundsChanged),
|
||||
|
@ -399,11 +402,24 @@ public:
|
|||
renderer.addRenderable(m_curveCatmullRom.m_renderCurve, localToWorld);
|
||||
}
|
||||
}
|
||||
void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected) const
|
||||
|
||||
void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected, const AABB& childBounds) const
|
||||
{
|
||||
renderSolid(renderer, volume, localToWorld, selected);
|
||||
if(g_showNames && isModel())
|
||||
|
||||
if(g_showNames)
|
||||
{
|
||||
// draw models as usual
|
||||
if(!isModel())
|
||||
{
|
||||
// don't draw the name for worldspawn
|
||||
if(!strcmp(m_entity.getEntityClass().name(), "worldspawn"))
|
||||
return;
|
||||
|
||||
// place name in the middle of the "children cloud"
|
||||
m_name_origin = childBounds.origin;
|
||||
}
|
||||
|
||||
renderer.addRenderable(m_renderName, localToWorld);
|
||||
}
|
||||
}
|
||||
|
@ -546,7 +562,7 @@ public:
|
|||
}
|
||||
void renderWireframe(Renderer& renderer, const VolumeTest& volume) const
|
||||
{
|
||||
m_contained.renderWireframe(renderer, volume, Instance::localToWorld(), getSelectable().isSelected());
|
||||
m_contained.renderWireframe(renderer, volume, Instance::localToWorld(), getSelectable().isSelected(), Instance::childBounds());
|
||||
|
||||
m_curveNURBS.renderComponentsSelected(renderer, volume, localToWorld());
|
||||
m_curveCatmullRom.renderComponentsSelected(renderer, volume, localToWorld());
|
||||
|
|
|
@ -59,6 +59,7 @@ class Group
|
|||
NameKeys m_nameKeys;
|
||||
|
||||
RenderableNamedEntity m_renderName;
|
||||
mutable Vector3 m_name_origin;
|
||||
|
||||
Callback m_transformChanged;
|
||||
|
||||
|
@ -74,7 +75,8 @@ public:
|
|||
m_filter(m_entity, node),
|
||||
m_named(m_entity),
|
||||
m_nameKeys(m_entity),
|
||||
m_renderName(m_named, g_vector3_identity),
|
||||
m_renderName(m_named, m_name_origin),
|
||||
m_name_origin(g_vector3_identity),
|
||||
m_transformChanged(transformChanged)
|
||||
{
|
||||
construct();
|
||||
|
@ -151,15 +153,22 @@ public:
|
|||
{
|
||||
renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly);
|
||||
}
|
||||
void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld) const
|
||||
|
||||
void renderWireframe(Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, const AABB& childBounds) const
|
||||
{
|
||||
renderSolid(renderer, volume, localToWorld);
|
||||
#if 0
|
||||
if(g_showNames)
|
||||
|
||||
if(g_showNames)
|
||||
{
|
||||
renderer.addRenderable(m_renderName, m_transform.localToParent());
|
||||
// don't draw the name for worldspawn
|
||||
if(!strcmp(m_entity.getEntityClass().name(), "worldspawn"))
|
||||
return;
|
||||
|
||||
// place name in the middle of the "children cloud"
|
||||
m_name_origin = childBounds.origin;
|
||||
|
||||
renderer.addRenderable(m_renderName, localToWorld);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -280,7 +289,7 @@ public:
|
|||
}
|
||||
void renderWireframe(Renderer& renderer, const VolumeTest& volume) const
|
||||
{
|
||||
m_contained.renderWireframe(renderer, volume, Instance::localToWorld());
|
||||
m_contained.renderWireframe(renderer, volume, Instance::localToWorld(), Instance::childBounds());
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -201,8 +201,6 @@ inline void Winding_Draw(const Winding& winding, const Vector3& normal, RenderSt
|
|||
#endif
|
||||
}
|
||||
|
||||
const Colour4b colour_vertex(0, 255, 0, 255);
|
||||
|
||||
|
||||
#include "shaderlib.h"
|
||||
|
||||
|
|
|
@ -2387,7 +2387,11 @@ void OpenGLShader::construct(const char* name)
|
|||
state.m_colour[2] = 0;
|
||||
state.m_colour[3] = 0.3f;
|
||||
state.m_state = RENDER_FILL|RENDER_DEPTHTEST|RENDER_CULLFACE|RENDER_BLEND|RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
|
||||
state.m_sort = OpenGLState::eSortHighlight;
|
||||
|
||||
// The bug "Selecting translucent brushes, such as clip, cause them to disappear leaving
|
||||
// only the red selection box." seems to be fixed by removing the next line.
|
||||
|
||||
// state.m_sort = OpenGLState::eSortHighlight;
|
||||
state.m_depthfunc = GL_LEQUAL;
|
||||
}
|
||||
else if(string_equal(name+1, "CAM_OVERLAY"))
|
||||
|
|
Loading…
Reference in a new issue