remove code

This commit is contained in:
Garux 2018-05-09 02:01:21 +03:00
parent 7088653115
commit 8339ebfb23
6 changed files with 7 additions and 493 deletions

View File

@ -144,7 +144,6 @@ struct layout_globals_t
}; };
layout_globals_t g_layout_globals; layout_globals_t g_layout_globals;
//glwindow_globals_t g_glwindow_globals;
// VFS // VFS
@ -1474,8 +1473,6 @@ void DragMode(){
g_currentToolMode = DragMode; g_currentToolMode = DragMode;
g_currentToolModeSupportsComponentEditing = true; g_currentToolModeSupportsComponentEditing = true;
// OnClipMode( false );
Sys_Status( c_ResizeMode_status ); Sys_Status( c_ResizeMode_status );
GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eDrag ); GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eDrag );
ToolChanged(); ToolChanged();
@ -1495,8 +1492,6 @@ void TranslateMode(){
g_currentToolMode = TranslateMode; g_currentToolMode = TranslateMode;
g_currentToolModeSupportsComponentEditing = true; g_currentToolModeSupportsComponentEditing = true;
// OnClipMode( false );
Sys_Status( c_TranslateMode_status ); Sys_Status( c_TranslateMode_status );
GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eTranslate ); GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eTranslate );
ToolChanged(); ToolChanged();
@ -1515,8 +1510,6 @@ void RotateMode(){
g_currentToolMode = RotateMode; g_currentToolMode = RotateMode;
g_currentToolModeSupportsComponentEditing = true; g_currentToolModeSupportsComponentEditing = true;
// OnClipMode( false );
Sys_Status( c_RotateMode_status ); Sys_Status( c_RotateMode_status );
GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eRotate ); GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eRotate );
ToolChanged(); ToolChanged();
@ -1535,8 +1528,6 @@ void ScaleMode(){
g_currentToolMode = ScaleMode; g_currentToolMode = ScaleMode;
g_currentToolModeSupportsComponentEditing = true; g_currentToolModeSupportsComponentEditing = true;
// OnClipMode( false );
Sys_Status( c_ScaleMode_status ); Sys_Status( c_ScaleMode_status );
GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eScale ); GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eScale );
ToolChanged(); ToolChanged();
@ -1555,8 +1546,6 @@ void SkewMode(){
g_currentToolMode = SkewMode; g_currentToolMode = SkewMode;
g_currentToolModeSupportsComponentEditing = true; g_currentToolModeSupportsComponentEditing = true;
// OnClipMode( false );
Sys_Status( c_SkewMode_status ); Sys_Status( c_SkewMode_status );
GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eSkew ); GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eSkew );
ToolChanged(); ToolChanged();
@ -1579,8 +1568,6 @@ void ClipperMode(){
SelectionSystem_DefaultMode(); SelectionSystem_DefaultMode();
// OnClipMode( true );
Sys_Status( c_ClipperMode_status ); Sys_Status( c_ClipperMode_status );
GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eClip ); GlobalSelectionSystem().SetManipulatorMode( SelectionSystem::eClip );
ToolChanged(); ToolChanged();
@ -1928,11 +1915,6 @@ void ModeChangeNotify(){
SceneChangeNotify(); SceneChangeNotify();
} }
void ClipperChangeNotify(){
GlobalCamera_UpdateWindow();
XY_UpdateAllWindows();
}
LatchedInt g_Layout_viewStyle( 0, "Window Layout" ); LatchedInt g_Layout_viewStyle( 0, "Window Layout" );
LatchedBool g_Layout_enableDetachableMenus( true, "Detachable Menus" ); LatchedBool g_Layout_enableDetachableMenus( true, "Detachable Menus" );
@ -3682,10 +3664,3 @@ void MainFrame_Destroy(){
g_brushCount.setCountChangedCallback( Callback() ); g_brushCount.setCountChangedCallback( Callback() );
} }
void GLWindow_Construct(){
// GlobalPreferenceSystem().registerPreference( "MouseButtons", IntImportStringCaller( g_glwindow_globals.m_nMouseType ), IntExportStringCaller( g_glwindow_globals.m_nMouseType ) );
}
void GLWindow_Destroy(){
}

View File

@ -136,26 +136,8 @@ bool FloatingGroupDialog(){
extern MainFrame* g_pParentWnd; extern MainFrame* g_pParentWnd;
GtkWindow* MainFrame_getWindow(); GtkWindow* MainFrame_getWindow();
/*
enum EMouseButtonMode
{
ETwoButton = 0,
EThreeButton = 1,
};
struct glwindow_globals_t
{
int m_nMouseType;
glwindow_globals_t() :
m_nMouseType( EThreeButton ){
}
};
*/
void GLWindow_Construct();
void GLWindow_Destroy();
//extern glwindow_globals_t g_glwindow_globals;
template<typename Value> template<typename Value>
class LatchedValue; class LatchedValue;
typedef LatchedValue<bool> LatchedBool; typedef LatchedValue<bool> LatchedBool;
@ -227,10 +209,8 @@ void XY_UpdateAllWindows();
void UpdateAllWindows(); void UpdateAllWindows();
void ClipperChangeNotify();
void ClipperMode(); void ClipperMode();
void DefaultMode();
const char* basegame_get(); const char* basegame_get();
const char* gamename_get(); const char* gamename_get();

View File

@ -234,7 +234,6 @@ Radiant(){
MultiMon_Construct(); MultiMon_Construct();
MRU_Construct(); MRU_Construct();
Pointfile_Construct(); Pointfile_Construct();
GLWindow_Construct();
BuildMenu_Construct(); BuildMenu_Construct();
Map_Construct(); Map_Construct();
EntityList_Construct(); EntityList_Construct();
@ -276,7 +275,6 @@ Radiant(){
EntityList_Destroy(); EntityList_Destroy();
Map_Destroy(); Map_Destroy();
BuildMenu_Destroy(); BuildMenu_Destroy();
GLWindow_Destroy();
Pointfile_Destroy(); Pointfile_Destroy();
MRU_Destroy(); MRU_Destroy();
MultiMon_Destroy(); MultiMon_Destroy();

View File

@ -72,13 +72,8 @@ void Global_constructPreferences( PreferencesPage& page ){
void Interface_constructPreferences( PreferencesPage& page ){ void Interface_constructPreferences( PreferencesPage& page ){
page.appendPathEntry( "Shader Editor Command", g_TextEditor_editorCommand, false ); page.appendPathEntry( "Shader Editor Command", g_TextEditor_editorCommand, false );
} }
#if 0
void Mouse_constructPreferences( PreferencesPage& page ){ void Mouse_constructPreferences( PreferencesPage& page ){
// {
// const char* buttons[] = { "2 button", "3 button", };
// page.appendRadio( "Mouse Type", g_glwindow_globals.m_nMouseType, STRING_ARRAY_RANGE( buttons ) );
// }
// page.appendCheckBox( "Right Button", "Activates Context Menu", g_xywindow_globals.m_bRightClick );
page.appendCheckBox( "", "Zoom to mouse pointer", g_xywindow_globals.m_bZoomInToPointer ); page.appendCheckBox( "", "Zoom to mouse pointer", g_xywindow_globals.m_bZoomInToPointer );
} }
void Mouse_constructPage( PreferenceGroup& group ){ void Mouse_constructPage( PreferenceGroup& group ){
@ -88,7 +83,7 @@ void Mouse_constructPage( PreferenceGroup& group ){
void Mouse_registerPreferencesPage(){ void Mouse_registerPreferencesPage(){
PreferencesDialog_addInterfacePage( FreeCaller1<PreferenceGroup&, Mouse_constructPage>() ); PreferencesDialog_addInterfacePage( FreeCaller1<PreferenceGroup&, Mouse_constructPage>() );
} }
#endif
/*! /*!
========================================================= =========================================================

View File

@ -77,276 +77,6 @@ void LoadTextureRGBA( qtexture_t* q, unsigned char* pPixels, int nWidth, int nHe
bool g_bCamEntityMenu = false; bool g_bCamEntityMenu = false;
//!\todo Rewrite.
class ClipPoint
{
public:
Vector3 m_ptClip; // the 3d point
Vector3 m_ptStart;
bool m_bSet;
ClipPoint(){
Reset();
};
void Reset(){
m_ptClip[0] = m_ptClip[1] = m_ptClip[2] = 0.f;
m_bSet = false;
}
bool Set(){
return m_bSet;
}
void Set( bool b ){
m_bSet = b;
}
operator Vector3&()
{
return m_ptClip;
};
/*! Draw clip/path point with rasterized number label */
void Draw( int num, float scale );
/*! Draw clip/path point with rasterized string label */
void Draw( const char *label, float scale );
};
VIEWTYPE g_clip_viewtype;
bool g_bSwitch = true;
bool g_clip_useCaulk = false;
bool g_quick_clipper = false;
ClipPoint g_Clip1;
ClipPoint g_Clip2;
ClipPoint g_Clip3;
ClipPoint* g_pMovingClip = 0;
GdkCursor* g_cursorClipper;
GdkCursor* g_cursorMoveClipper;
/* Drawing clip points */
void ClipPoint::Draw( int num, float scale ){
StringOutputStream label( 4 );
label << num;
Draw( label.c_str(), scale );
}
void ClipPoint::Draw( const char *label, float scale ){
// draw point
glPointSize( 4 );
glColor3fv( vector3_to_array( g_xywindow_globals.color_clipper ) );
glBegin( GL_POINTS );
glVertex3fv( vector3_to_array( m_ptClip ) );
glEnd();
glPointSize( 1 );
float offset = 2.0f / scale;
// draw label
glRasterPos3f( m_ptClip[0] + offset, m_ptClip[1] + offset, m_ptClip[2] + offset );
//glCallLists( GLsizei( strlen( label ) ), GL_UNSIGNED_BYTE, label ); //fails //new font rendering?
//glCallLists( GLsizei( strlen( label ) ), GL_UNSIGNED_BYTE, reinterpret_cast<const GLubyte*>( label ) ); //worx :o
GlobalOpenGL().drawString( label );
}
float fDiff( float f1, float f2 ){
if ( f1 > f2 ) {
return f1 - f2;
}
else{
return f2 - f1;
}
}
inline double ClipPoint_Intersect( const ClipPoint& clip, const Vector3& point, VIEWTYPE viewtype, float scale ){
int nDim1 = ( viewtype == YZ ) ? 1 : 0;
int nDim2 = ( viewtype == XY ) ? 1 : 2;
double screenDistanceSquared( vector2_length_squared( Vector2( fDiff( clip.m_ptClip[nDim1], point[nDim1] ) * scale, fDiff( clip.m_ptClip[nDim2], point[nDim2] ) * scale ) ) );
if ( screenDistanceSquared < 8 * 8 ) {
return screenDistanceSquared;
}
return FLT_MAX;
}
inline void ClipPoint_testSelect( ClipPoint& clip, const Vector3& point, VIEWTYPE viewtype, float scale, double& bestDistance, ClipPoint*& bestClip ){
if ( clip.Set() ) {
double distance = ClipPoint_Intersect( clip, point, viewtype, scale );
if ( distance < bestDistance ) {
bestDistance = distance;
bestClip = &clip;
}
}
}
inline ClipPoint* GlobalClipPoints_Find( const Vector3& point, VIEWTYPE viewtype, float scale ){
double bestDistance = FLT_MAX;
ClipPoint* bestClip = 0;
ClipPoint_testSelect( g_Clip1, point, viewtype, scale, bestDistance, bestClip );
ClipPoint_testSelect( g_Clip2, point, viewtype, scale, bestDistance, bestClip );
ClipPoint_testSelect( g_Clip3, point, viewtype, scale, bestDistance, bestClip );
return bestClip;
}
inline void GlobalClipPoints_Draw( float scale ){
// Draw clip points
if ( g_Clip1.Set() ) {
g_Clip1.Draw( 1, scale );
}
if ( g_Clip2.Set() ) {
g_Clip2.Draw( 2, scale );
}
if ( g_Clip3.Set() ) {
g_Clip3.Draw( 3, scale );
}
}
inline bool GlobalClipPoints_valid(){
return g_Clip1.Set() && g_Clip2.Set();
}
void PlanePointsFromClipPoints( Vector3 planepts[3], const AABB& bounds, VIEWTYPE viewtype ){
ASSERT_MESSAGE( GlobalClipPoints_valid(), "clipper points not initialised" );
planepts[0] = g_Clip1.m_ptClip;
planepts[1] = g_Clip2.m_ptClip;
planepts[2] = g_Clip3.m_ptClip;
Vector3 maxs( vector3_added( bounds.origin, bounds.extents ) );
Vector3 mins( vector3_subtracted( bounds.origin, bounds.extents ) );
if ( !g_Clip3.Set() ) {
int n = ( viewtype == XY ) ? 2 : ( viewtype == YZ ) ? 0 : 1;
int x = ( n == 0 ) ? 1 : 0;
int y = ( n == 2 ) ? 1 : 2;
if ( n == 1 ) { // on viewtype XZ, flip clip points
planepts[0][n] = maxs[n];
planepts[1][n] = maxs[n];
planepts[2][x] = g_Clip1.m_ptClip[x];
planepts[2][y] = g_Clip1.m_ptClip[y];
planepts[2][n] = mins[n];
}
else
{
planepts[0][n] = mins[n];
planepts[1][n] = mins[n];
planepts[2][x] = g_Clip1.m_ptClip[x];
planepts[2][y] = g_Clip1.m_ptClip[y];
planepts[2][n] = maxs[n];
}
}
}
void Clip_Update(){
Vector3 planepts[3];
if ( !GlobalClipPoints_valid() ) {
// Scene_BrushSetClipPlane( GlobalSceneGraph(), Plane3( 0, 0, 0, 0 ) );
}
else
{
AABB bounds( Vector3( 0, 0, 0 ), Vector3( 64, 64, 64 ) );
PlanePointsFromClipPoints( planepts, bounds, g_clip_viewtype );
if ( g_bSwitch ) {
std::swap( planepts[0], planepts[1] );
}
// Scene_BrushSetClipPlane( GlobalSceneGraph(), plane3_for_points( planepts[0], planepts[1], planepts[2] ) );
}
ClipperChangeNotify();
}
#include "filterbar.h"
const char* Clip_getShader(){
return g_clip_useCaulk ? GetCaulkShader() : TextureBrowser_GetSelectedShader( GlobalTextureBrowser() );
}
void Clip(){
if ( ClipMode() && GlobalClipPoints_valid() ) {
Vector3 planepts[3];
AABB bounds( Vector3( 0, 0, 0 ), Vector3( 64, 64, 64 ) );
PlanePointsFromClipPoints( planepts, bounds, g_clip_viewtype );
// Scene_BrushSplitByPlane( GlobalSceneGraph(), planepts[0], planepts[1], planepts[2], Clip_getShader(), ( !g_bSwitch ) ? eFront : eBack );
g_Clip1.Reset();
g_Clip2.Reset();
g_Clip3.Reset();
Clip_Update();
if( g_quick_clipper ){
g_quick_clipper = false;
ClipperMode();
}
}
}
void SplitClip(){
if ( ClipMode() && GlobalClipPoints_valid() ) {
Vector3 planepts[3];
AABB bounds( Vector3( 0, 0, 0 ), Vector3( 64, 64, 64 ) );
PlanePointsFromClipPoints( planepts, bounds, g_clip_viewtype );
// Scene_BrushSplitByPlane( GlobalSceneGraph(), planepts[0], planepts[1], planepts[2], Clip_getShader(), eFrontAndBack );
g_Clip1.Reset();
g_Clip2.Reset();
g_Clip3.Reset();
Clip_Update();
if( g_quick_clipper ){
g_quick_clipper = false;
ClipperMode();
}
}
}
void FlipClip(){
g_bSwitch = !g_bSwitch;
Clip_Update();
}
void OnClipMode( bool enabled ){
g_Clip1.Reset();
g_Clip2.Reset();
g_Clip3.Reset();
if ( !enabled && g_pMovingClip ) {
g_pMovingClip = 0;
}
if( g_pParentWnd ){
GdkCursor* cursor = enabled? g_cursorClipper : 0;
if( g_pParentWnd->GetXYWnd() ){
g_pParentWnd->GetXYWnd()->CursorSet( cursor );
}
if( g_pParentWnd->GetXZWnd() ){
g_pParentWnd->GetXZWnd()->CursorSet( cursor );
}
if( g_pParentWnd->GetYZWnd() ){
g_pParentWnd->GetYZWnd()->CursorSet( cursor );
}
}
Clip_Update();
}
bool ClipMode(){
return GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip;
}
void NewClipPoint( const Vector3& point ){
if ( g_Clip1.Set() == false ) {
g_Clip1.m_ptClip = g_Clip1.m_ptStart = point;
g_Clip1.Set( true );
}
else if ( g_Clip2.Set() == false ) {
g_Clip2.m_ptClip = g_Clip2.m_ptStart = point;
g_Clip2.Set( true );
}
else if ( g_Clip3.Set() == false ) {
g_Clip3.m_ptClip = g_Clip3.m_ptStart = point;
g_Clip3.Set( true );
}
else
{
g_Clip1.Reset();
g_Clip2.Reset();
g_Clip3.Reset();
g_Clip1.m_ptClip = g_Clip1.m_ptStart = point;
g_Clip1.Set( true );
}
Clip_Update();
}
struct xywindow_globals_private_t struct xywindow_globals_private_t
@ -365,7 +95,6 @@ struct xywindow_globals_private_t
bool show_blocks; bool show_blocks;
int blockSize; int blockSize;
// bool m_bCamXYUpdate;
bool m_bChaseMouse; bool m_bChaseMouse;
bool m_bSizePaint; bool m_bSizePaint;
@ -384,7 +113,6 @@ struct xywindow_globals_private_t
show_blocks( false ), show_blocks( false ),
// m_bCamXYUpdate( true ),
m_bChaseMouse( true ), m_bChaseMouse( true ),
m_bSizePaint( true ), m_bSizePaint( true ),
m_MSAA( 8 ){ m_MSAA( 8 ){
@ -873,10 +601,7 @@ gboolean xywnd_expose( GtkWidget* widget, GdkEventExpose* event, XYWnd* xywnd ){
void XYWnd_CameraMoved( XYWnd& xywnd ){ void XYWnd_CameraMoved( XYWnd& xywnd ){
// if ( g_xywindow_globals_private.m_bCamXYUpdate ) {
//XYWnd_Update( xywnd );
xywnd.UpdateCameraIcon(); xywnd.UpdateCameraIcon();
// }
} }
XYWnd::XYWnd() : XYWnd::XYWnd() :
@ -888,8 +613,6 @@ XYWnd::XYWnd() :
m_chasemouse_handler( 0 ), m_chasemouse_handler( 0 ),
m_fbo( 0 ) m_fbo( 0 )
{ {
m_cursorCurrent = 0;
m_bActive = false; m_bActive = false;
m_buttonstate = 0; m_buttonstate = 0;
@ -999,102 +722,6 @@ FBO* XYWnd::fbo_get(){
return m_fbo = m_fbo? m_fbo : GlobalOpenGL().support_ARB_framebuffer_object? new FBO : new FBO_fallback; return m_fbo = m_fbo? m_fbo : GlobalOpenGL().support_ARB_framebuffer_object? new FBO : new FBO_fallback;
} }
unsigned int Clipper_buttons(){
return RAD_LBUTTON;
}
unsigned int Clipper_quick_buttons(){
return RAD_LBUTTON | RAD_CONTROL;
}
void XYWnd::DropClipPoint( int pointx, int pointy ){
Vector3 point;
XY_ToPoint( pointx, pointy, point );
Vector3 mins, maxs;
Select_GetBounds( mins, maxs );
g_clip_viewtype = GetViewType();
const int nDim = ( g_clip_viewtype == YZ ) ? 0 : ( ( g_clip_viewtype == XZ ) ? 1 : 2 );
if( g_Clip2.Set() && !g_Clip3.Set() ){
point[nDim] = maxs[nDim];
}
else{
point[nDim] = mins[nDim];
}
vector3_snap( point, GetSnapGridSize() );
NewClipPoint( point );
}
Timer g_clipper_timer;
bool g_clipper_doubleclicked = false;
void XYWnd::Clipper_OnLButtonDown( int x, int y ){
bool doubleclick = g_clipper_timer.elapsed_msec() < 200;
Vector3 mousePosition;
XY_ToPoint( x, y, mousePosition );
g_pMovingClip = GlobalClipPoints_Find( mousePosition, m_viewType, m_fScale );
if ( !g_pMovingClip ) {
DropClipPoint( x, y );
}
else if( doubleclick ){
UndoableCommand undo( "clipperClip" );
Clip();
g_clipper_doubleclicked = true;
}
g_clipper_timer.start();
}
void XYWnd::Clipper_OnLButtonUp( int x, int y ){
if ( g_pMovingClip ) {
g_pMovingClip->m_ptStart = g_pMovingClip->m_ptClip;
g_pMovingClip = 0;
}
}
void XYWnd::Clipper_OnMouseMoved( int x, int y, bool snap ){
if ( g_pMovingClip ) {
XY_ToPoint( x, y, g_pMovingClip->m_ptClip );
XY_SnapToGrid( g_pMovingClip->m_ptClip );
if( snap ){
Vector3 diff = g_pMovingClip->m_ptClip - g_pMovingClip->m_ptStart;
int largest_index = ( fabs( diff[1] ) > fabs( diff[0] ) )
? ( fabs( diff[1] ) > fabs( diff[2] ) )
? 1
: 2
: ( fabs( diff[0] ) > fabs( diff[2] ) )
? 0
: 2;
g_pMovingClip->m_ptClip[( largest_index + 1 ) % 3] = g_pMovingClip->m_ptStart[( largest_index + 1 ) % 3];
g_pMovingClip->m_ptClip[( largest_index + 2 ) % 3] = g_pMovingClip->m_ptStart[( largest_index + 2 ) % 3];
}
Clip_Update();
}
}
void XYWnd::CursorSet( GdkCursor* cursor ){
if( m_cursorCurrent != cursor ){
m_cursorCurrent = cursor;
gdk_window_set_cursor( m_gl_widget->window, m_cursorCurrent );
}
}
void XYWnd::Clipper_Crosshair_OnMouseMoved( int x, int y ){
GdkCursor* cursor = 0;
if ( ClipMode() ) {
Vector3 mousePosition;
XY_ToPoint( x, y, mousePosition );
if( GlobalClipPoints_Find( mousePosition, m_viewType, m_fScale ) != 0 ){
cursor = g_cursorMoveClipper;
}
else{
cursor = g_cursorClipper;
}
}
CursorSet( cursor );
}
void XYWnd::SetCustomPivotOrigin( int pointx, int pointy ){ void XYWnd::SetCustomPivotOrigin( int pointx, int pointy ){
Vector3 point; Vector3 point;
XY_ToPoint( pointx, pointy, point ); XY_ToPoint( pointx, pointy, point );
@ -1108,7 +735,6 @@ void XYWnd::SetCustomPivotOrigin( int pointx, int pointy ){
} }
unsigned int MoveCamera_buttons(){ unsigned int MoveCamera_buttons(){
// return RAD_CONTROL | ( g_glwindow_globals.m_nMouseType == ETwoButton ? RAD_RBUTTON : RAD_MBUTTON );
return RAD_CONTROL | RAD_MBUTTON; return RAD_CONTROL | RAD_MBUTTON;
} }
@ -1120,9 +746,6 @@ void XYWnd_PositionCamera( XYWnd* xywnd, int x, int y, CamWnd& camwnd ){
} }
unsigned int OrientCamera_buttons(){ unsigned int OrientCamera_buttons(){
// if ( g_glwindow_globals.m_nMouseType == ETwoButton ) {
// return RAD_RBUTTON | RAD_SHIFT | RAD_CONTROL;
// }
return RAD_MBUTTON; return RAD_MBUTTON;
} }
@ -1380,10 +1003,6 @@ void addItem( const char* name, const char* next ){
}; };
void XYWnd::OnContextMenu(){ void XYWnd::OnContextMenu(){
// if ( g_xywindow_globals.m_bRightClick == false ) {
// return;
// }
if ( m_mnuDrop == 0 ) { // first time, load it up if ( m_mnuDrop == 0 ) { // first time, load it up
GtkMenu* menu = m_mnuDrop = GTK_MENU( gtk_menu_new() ); GtkMenu* menu = m_mnuDrop = GTK_MENU( gtk_menu_new() );
// menu_tearoff( menu ); // menu_tearoff( menu );
@ -1504,6 +1123,10 @@ void XYWnd::SetViewType( VIEWTYPE viewType ){
} }
bool ClipMode(){
return GlobalSelectionSystem().ManipulatorMode() == SelectionSystem::eClip;
}
void XYWnd::mouseDown( const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers ){ void XYWnd::mouseDown( const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers ){
XY_MouseDown( static_cast<int>( position.x() ), static_cast<int>( position.y() ), buttons_for_button_and_modifiers( button, modifiers ) ); XY_MouseDown( static_cast<int>( position.x() ), static_cast<int>( position.y() ), buttons_for_button_and_modifiers( button, modifiers ) );
} }
@ -1515,14 +1138,6 @@ void XYWnd::XY_MouseDown( int x, int y, unsigned int buttons ){
else if ( buttons == Zoom_buttons() ) { else if ( buttons == Zoom_buttons() ) {
Zoom_Begin( x, y ); Zoom_Begin( x, y );
} }
// else if ( ClipMode() && ( buttons == Clipper_buttons() || buttons == Clipper_quick_buttons() ) ) {
// Clipper_OnLButtonDown( x, y );
// }
else if ( !ClipMode() && buttons == Clipper_quick_buttons() ) {
ClipperMode();
g_quick_clipper = true;
Clipper_OnLButtonDown( x, y );
}
else if ( buttons == NewBrushDrag_buttons() && GlobalSelectionSystem().countSelected() == 0 && !ClipMode() ) { else if ( buttons == NewBrushDrag_buttons() && GlobalSelectionSystem().countSelected() == 0 && !ClipMode() ) {
NewBrushDrag_Begin( x, y ); NewBrushDrag_Begin( x, y );
} }
@ -1551,11 +1166,6 @@ void XYWnd::XY_MouseUp( int x, int y, unsigned int buttons ){
else if ( m_zoom_started ) { else if ( m_zoom_started ) {
Zoom_End(); Zoom_End();
} }
// else if ( ( ClipMode() && ( buttons == Clipper_buttons() || buttons == Clipper_quick_buttons() || g_pMovingClip ) ) ||
// g_clipper_doubleclicked ){ // handle mouse release, if quit quick clipper mode via doubleclick
// Clipper_OnLButtonUp( x, y );
// g_clipper_doubleclicked = false;
// }
else if ( m_bNewBrushDrag ) { else if ( m_bNewBrushDrag ) {
m_bNewBrushDrag = false; m_bNewBrushDrag = false;
NewBrushDrag_End( x, y ); NewBrushDrag_End( x, y );
@ -1578,9 +1188,6 @@ void XYWnd::XY_MouseMoved( int x, int y, unsigned int buttons ){
else if ( m_zoom_started ) { else if ( m_zoom_started ) {
} }
// else if ( ClipMode() && g_pMovingClip != 0 ) {
// Clipper_OnMouseMoved( x, y, buttons & RAD_SHIFT );
// }
// lbutton without selection = drag new brush // lbutton without selection = drag new brush
else if ( m_bNewBrushDrag ) { else if ( m_bNewBrushDrag ) {
NewBrushDrag( x, y, buttons & RAD_SHIFT, buttons & RAD_CONTROL ); NewBrushDrag( x, y, buttons & RAD_SHIFT, buttons & RAD_CONTROL );
@ -1619,10 +1226,6 @@ void XYWnd::XY_MouseMoved( int x, int y, unsigned int buttons ){
if ( g_bCrossHairs ) { if ( g_bCrossHairs ) {
XYWnd_Update( *this ); XYWnd_Update( *this );
} }
// if( ClipMode() ){
// Clipper_Crosshair_OnMouseMoved( x, y );
// }
} }
} }
@ -2805,10 +2408,6 @@ void XYWnd::XY_Draw(){
glEnd(); glEnd();
} }
// if ( ClipMode() ) {
// GlobalClipPoints_Draw( m_fScale );
// }
GlobalOpenGL_debugAssertNoErrors(); GlobalOpenGL_debugAssertNoErrors();
{ {
@ -3331,7 +2930,6 @@ void Orthographic_constructPreferences( PreferencesPage& page ){
page.appendCheckBox( "", "Solid selection boxes ( no stipple )", g_xywindow_globals.m_bNoStipple ); page.appendCheckBox( "", "Solid selection boxes ( no stipple )", g_xywindow_globals.m_bNoStipple );
//page.appendCheckBox( "", "Display size info", g_xywindow_globals_private.m_bSizePaint ); //page.appendCheckBox( "", "Display size info", g_xywindow_globals_private.m_bSizePaint );
page.appendCheckBox( "", "Chase mouse during drags", g_xywindow_globals_private.m_bChaseMouse ); page.appendCheckBox( "", "Chase mouse during drags", g_xywindow_globals_private.m_bChaseMouse );
// page.appendCheckBox( "", "Update views on camera move", g_xywindow_globals_private.m_bCamXYUpdate );
page.appendCheckBox( "", "Zoom In to Mouse pointer", g_xywindow_globals.m_bZoomInToPointer ); page.appendCheckBox( "", "Zoom In to Mouse pointer", g_xywindow_globals.m_bZoomInToPointer );
if( GlobalOpenGL().support_ARB_framebuffer_object ){ if( GlobalOpenGL().support_ARB_framebuffer_object ){
@ -3376,7 +2974,6 @@ void XYWindow_Construct(){
GlobalCommands_insert( "CenterXYView", FreeCaller<XY_Centralize>(), Accelerator( GDK_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); GlobalCommands_insert( "CenterXYView", FreeCaller<XY_Centralize>(), Accelerator( GDK_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalCommands_insert( "XYFocusOnSelected", FreeCaller<XY_Focus>(), Accelerator( GDK_grave ) ); GlobalCommands_insert( "XYFocusOnSelected", FreeCaller<XY_Focus>(), Accelerator( GDK_grave ) );
// GlobalPreferenceSystem().registerPreference( "NewRightClick", BoolImportStringCaller( g_xywindow_globals.m_bRightClick ), BoolExportStringCaller( g_xywindow_globals.m_bRightClick ) );
GlobalPreferenceSystem().registerPreference( "XYMSAA", IntImportStringCaller( g_xywindow_globals_private.m_MSAA ), IntExportStringCaller( g_xywindow_globals_private.m_MSAA ) ); GlobalPreferenceSystem().registerPreference( "XYMSAA", IntImportStringCaller( g_xywindow_globals_private.m_MSAA ), IntExportStringCaller( g_xywindow_globals_private.m_MSAA ) );
GlobalPreferenceSystem().registerPreference( "2DZoomInToPointer", BoolImportStringCaller( g_xywindow_globals.m_bZoomInToPointer ), BoolExportStringCaller( g_xywindow_globals.m_bZoomInToPointer ) ); GlobalPreferenceSystem().registerPreference( "2DZoomInToPointer", BoolImportStringCaller( g_xywindow_globals.m_bZoomInToPointer ), BoolExportStringCaller( g_xywindow_globals.m_bZoomInToPointer ) );
GlobalPreferenceSystem().registerPreference( "ChaseMouse", BoolImportStringCaller( g_xywindow_globals_private.m_bChaseMouse ), BoolExportStringCaller( g_xywindow_globals_private.m_bChaseMouse ) ); GlobalPreferenceSystem().registerPreference( "ChaseMouse", BoolImportStringCaller( g_xywindow_globals_private.m_bChaseMouse ), BoolExportStringCaller( g_xywindow_globals_private.m_bChaseMouse ) );
@ -3386,7 +2983,6 @@ void XYWindow_Construct(){
GlobalPreferenceSystem().registerPreference( "SI_ShowCoords", BoolImportStringCaller( g_xywindow_globals_private.show_coordinates ), BoolExportStringCaller( g_xywindow_globals_private.show_coordinates ) ); GlobalPreferenceSystem().registerPreference( "SI_ShowCoords", BoolImportStringCaller( g_xywindow_globals_private.show_coordinates ), BoolExportStringCaller( g_xywindow_globals_private.show_coordinates ) );
GlobalPreferenceSystem().registerPreference( "SI_ShowOutlines", BoolImportStringCaller( g_xywindow_globals_private.show_outline ), BoolExportStringCaller( g_xywindow_globals_private.show_outline ) ); GlobalPreferenceSystem().registerPreference( "SI_ShowOutlines", BoolImportStringCaller( g_xywindow_globals_private.show_outline ), BoolExportStringCaller( g_xywindow_globals_private.show_outline ) );
GlobalPreferenceSystem().registerPreference( "SI_ShowAxis", BoolImportStringCaller( g_xywindow_globals_private.show_axis ), BoolExportStringCaller( g_xywindow_globals_private.show_axis ) ); GlobalPreferenceSystem().registerPreference( "SI_ShowAxis", BoolImportStringCaller( g_xywindow_globals_private.show_axis ), BoolExportStringCaller( g_xywindow_globals_private.show_axis ) );
// GlobalPreferenceSystem().registerPreference( "CamXYUpdate", BoolImportStringCaller( g_xywindow_globals_private.m_bCamXYUpdate ), BoolExportStringCaller( g_xywindow_globals_private.m_bCamXYUpdate ) );
GlobalPreferenceSystem().registerPreference( "ShowWorkzone", BoolImportStringCaller( g_xywindow_globals_private.d_show_work ), BoolExportStringCaller( g_xywindow_globals_private.d_show_work ) ); GlobalPreferenceSystem().registerPreference( "ShowWorkzone", BoolImportStringCaller( g_xywindow_globals_private.d_show_work ), BoolExportStringCaller( g_xywindow_globals_private.d_show_work ) );
GlobalPreferenceSystem().registerPreference( "SI_AxisColors0", Vector3ImportStringCaller( g_xywindow_globals.AxisColorX ), Vector3ExportStringCaller( g_xywindow_globals.AxisColorX ) ); GlobalPreferenceSystem().registerPreference( "SI_AxisColors0", Vector3ImportStringCaller( g_xywindow_globals.AxisColorX ), Vector3ExportStringCaller( g_xywindow_globals.AxisColorX ) );
@ -3409,23 +3005,11 @@ void XYWindow_Construct(){
Orthographic_registerPreferencesPage(); Orthographic_registerPreferencesPage();
g_cursorMoveClipper = gdk_cursor_new( GDK_CROSSHAIR );
g_cursorClipper = gdk_cursor_new( GDK_HAND2 );
// cursor = gdk_cursor_new( GDK_FLEUR );
// gdk_cursor_unref( cursor );
//#include "gtkutil/image.h"
// GdkPixbuf* pixbuf = pixbuf_new_from_file_with_mask( "bitmaps/icon.png" );
// cursor = gdk_cursor_new_from_pixbuf( gdk_display_get_default(), pixbuf, 0, 0 );
// g_object_unref( pixbuf );
XYWnd::captureStates(); XYWnd::captureStates();
GlobalEntityClassManager().attach( g_EntityClassMenu ); GlobalEntityClassManager().attach( g_EntityClassMenu );
} }
void XYWindow_Destroy(){ void XYWindow_Destroy(){
gdk_cursor_unref( g_cursorMoveClipper );
gdk_cursor_unref( g_cursorClipper );
GlobalEntityClassManager().detach( g_EntityClassMenu ); GlobalEntityClassManager().detach( g_EntityClassMenu );
XYWnd::releaseStates(); XYWnd::releaseStates();
} }

View File

@ -45,13 +45,6 @@ class Node;
typedef struct _GtkWindow GtkWindow; typedef struct _GtkWindow GtkWindow;
typedef struct _GtkMenu GtkMenu; typedef struct _GtkMenu GtkMenu;
void FlipClip();
void SplitClip();
void Clip();
void OnClipMode( bool enabled );
bool ClipMode();
inline const char* ViewType_getTitle( VIEWTYPE viewtype ){ inline const char* ViewType_getTitle( VIEWTYPE viewtype ){
if ( viewtype == XY ) { if ( viewtype == XY ) {
return "XY Top"; return "XY Top";
@ -155,13 +148,6 @@ bool Active(){
void UpdateCameraIcon(); void UpdateCameraIcon();
void UpdateCameraIcon_(); void UpdateCameraIcon_();
void Clipper_OnLButtonDown( int x, int y );
void Clipper_OnLButtonUp( int x, int y );
void Clipper_OnMouseMoved( int x, int y, bool snap );
void Clipper_Crosshair_OnMouseMoved( int x, int y );
void DropClipPoint( int pointx, int pointy );
void SetCustomPivotOrigin( int pointx, int pointy ); void SetCustomPivotOrigin( int pointx, int pointy );
void SetViewType( VIEWTYPE n ); void SetViewType( VIEWTYPE n );
@ -219,10 +205,8 @@ int m_entityCreate_x, m_entityCreate_y;
bool m_entityCreate; bool m_entityCreate;
Timer m_render_time; Timer m_render_time;
GdkCursor* m_cursorCurrent;
public: public:
void CursorSet( GdkCursor* cursor );
void OnContextMenu(); void OnContextMenu();
void ButtonState_onMouseDown( unsigned int buttons ){ void ButtonState_onMouseDown( unsigned int buttons ){
//m_buttonstate |= buttons; //m_buttonstate |= buttons;
@ -281,7 +265,6 @@ struct xywindow_globals_t
Vector3 AxisColorY; Vector3 AxisColorY;
Vector3 AxisColorZ; Vector3 AxisColorZ;
// bool m_bRightClick;
bool m_bNoStipple; bool m_bNoStipple;
bool m_bZoomInToPointer; bool m_bZoomInToPointer;
@ -299,7 +282,6 @@ struct xywindow_globals_t
AxisColorX( 1.f, 0.f, 0.f ), AxisColorX( 1.f, 0.f, 0.f ),
AxisColorY( 0.f, 1.f, 0.f ), AxisColorY( 0.f, 1.f, 0.f ),
AxisColorZ( 0.f, 0.f, 1.f ), AxisColorZ( 0.f, 0.f, 1.f ),
// m_bRightClick( true ),
m_bNoStipple( true ), m_bNoStipple( true ),
m_bZoomInToPointer( true ){ m_bZoomInToPointer( true ){
} }