* -brightness 0..alot, def 1: mimics q3map_lightmapBrightness, but globally + affects vertexlight
	* -contrast -255..255, def 0: lighting contrast
	* packer improvements

Radiant:

binds...
	* entity inspector: Tab enters Key field, toggles between key/value fields; Del deletes keys; Esc quits

misc...
	* improved mwheel 2d zoom by Neumond
	* +makeRoom: like hollow, but extrudes faces outwards; for making rooms
	* deactivating tex dirs tree after loading dir, so SPACE and ENTER aren't broken for 2D after that
	* Regular, RegularLeft layouts: smaller console, bigger tex browser
	* Rotate, Scale dialogs: values aren't erased on Enter, OK, Apply (are on cancel, esc)
	* Rotate dialog: fix: new value in focused field wasn't taking in account on Enter
	* +updating texture directories list on 'flush and reload shaders' (reloading shaderlist aswell)
	* NumLock perspective window fix
	* ctrl+k(ConnectEntities): friendlier to complex connections, takes in account existing keys
		(priority: target > targetname > none)
	* +'all Supported formats' default option in open dialogs
	* defaulted show light radii
	* camera fov: 90->110
	* cubic clip: off by default; bigger def dist; fixed button's shortcut tip
	* prefs: Min & Max texture thumbnail size + dependant on scale;
		def = *scale .5, min 48, max 160 (makes range 96-320 visually differentiated)
This commit is contained in:
Garux
2017-08-01 13:57:26 +03:00
parent 7d7436ec3d
commit 0fb65a91c7
23 changed files with 402 additions and 139 deletions

View File

@@ -29,26 +29,13 @@
#include "brushmanip.h"
#include "brushnode.h"
#include "grid.h"
/*
void Face_makeBrush( Face& face, const Brush& brush, brush_vector_t& out, float offset ){
if ( face.contributes() ) {
out.push_back( new Brush( brush ) );
Face* newFace = out.back()->addFace( face );
if ( newFace != 0 ) {
newFace->flipWinding();
newFace->getPlane().offset( offset );
newFace->planeChanged();
}
}
}
*/
void Face_makeBrush( Face& face, const Brush& brush, brush_vector_t& out, float offset ){
if ( face.contributes() ) {
out.push_back( new Brush( brush ) );
//face.getPlane().offset( -offset );
//face.planeChanged();
Face* newFace = out.back()->addFace( face );
face.getPlane().offset( -offset );
face.planeChanged();
if ( newFace != 0 ) {
newFace->flipWinding();
newFace->getPlane().offset( offset );
@@ -57,30 +44,51 @@ void Face_makeBrush( Face& face, const Brush& brush, brush_vector_t& out, float
}
}
void Face_extrude( Face& face, const Brush& brush, brush_vector_t& out, float offset ){
if ( face.contributes() ) {
face.getPlane().offset( offset );
out.push_back( new Brush( brush ) );
face.getPlane().offset( -offset );
Face* newFace = out.back()->addFace( face );
if ( newFace != 0 ) {
newFace->flipWinding();
newFace->planeChanged();
}
}
}
class FaceMakeBrush
{
const Brush& brush;
brush_vector_t& out;
float offset;
bool room;
public:
FaceMakeBrush( const Brush& brush, brush_vector_t& out, float offset )
: brush( brush ), out( out ), offset( offset ){
FaceMakeBrush( const Brush& brush, brush_vector_t& out, float offset, bool room )
: brush( brush ), out( out ), offset( offset ), room( room ){
}
void operator()( Face& face ) const {
Face_makeBrush( face, brush, out, offset );
if( room ){
Face_extrude( face, brush, out, offset );
}
else{
Face_makeBrush( face, brush, out, offset );
}
}
};
void Brush_makeHollow( const Brush& brush, brush_vector_t& out, float offset ){
Brush_forEachFace( brush, FaceMakeBrush( brush, out, offset ) );
void Brush_makeHollow( const Brush& brush, brush_vector_t& out, float offset, bool room ){
Brush_forEachFace( brush, FaceMakeBrush( brush, out, offset, room ) );
}
class BrushHollowSelectedWalker : public scene::Graph::Walker
{
float m_offset;
bool room;
public:
BrushHollowSelectedWalker( float offset )
: m_offset( offset ){
BrushHollowSelectedWalker( float offset, bool room )
: m_offset( offset ), room( room ){
}
bool pre( const scene::Path& path, scene::Instance& instance ) const {
if ( path.top().get().visible() ) {
@@ -89,7 +97,7 @@ bool pre( const scene::Path& path, scene::Instance& instance ) const {
&& Instance_getSelectable( instance )->isSelected()
&& path.size() > 1 ) {
brush_vector_t out;
Brush_makeHollow( *brush, out, m_offset );
Brush_makeHollow( *brush, out, m_offset, room );
for ( brush_vector_t::const_iterator i = out.begin(); i != out.end(); ++i )
{
( *i )->removeEmptyFaces();
@@ -143,8 +151,8 @@ void post( const scene::Path& path, scene::Instance& instance ) const {
}
};
void Scene_BrushMakeHollow_Selected( scene::Graph& graph ){
GlobalSceneGraph().traverse( BrushHollowSelectedWalker( GetGridSize() ) );
void Scene_BrushMakeHollow_Selected( scene::Graph& graph, bool room ){
GlobalSceneGraph().traverse( BrushHollowSelectedWalker( GetGridSize(), room ) );
GlobalSceneGraph().traverse( BrushDeleteSelected() );
}
@@ -157,7 +165,15 @@ void Scene_BrushMakeHollow_Selected( scene::Graph& graph ){
void CSG_MakeHollow( void ){
UndoableCommand undo( "brushHollow" );
Scene_BrushMakeHollow_Selected( GlobalSceneGraph() );
Scene_BrushMakeHollow_Selected( GlobalSceneGraph(), false );
SceneChangeNotify();
}
void CSG_MakeRoom( void ){
UndoableCommand undo( "makeRoom" );
Scene_BrushMakeHollow_Selected( GlobalSceneGraph(), true );
SceneChangeNotify();
}