TextureBrowser_Tracking_MouseUp( textureBrowser );
}
textureBrowser.m_move_started = true;
- textureBrowser.m_freezePointer.freeze_pointer( textureBrowser.m_parent, textureBrowser.m_gl_widget, TextureBrowser_trackingDelta, &textureBrowser );
+ /* NetRadiantCustom did this instead:
+ textureBrowser.m_freezePointer.freeze_pointer( textureBrowser.m_parent, textureBrowser.m_gl_widget, TextureBrowser_trackingDelta, &textureBrowser ); */
+ textureBrowser.m_freezePointer.freeze_pointer( textureBrowser.m_gl_widget, TextureBrowser_trackingDelta, &textureBrowser );
}
- void TextureBrowser_Selection_MouseDown( TextureBrowser& textureBrowser, guint32 flags, int pointx, int pointy ){
- SelectTexture( textureBrowser, pointx, textureBrowser.height - 1 - pointy, flags );
+ void TextureBrowser_Selection_MouseDown( TextureBrowser& textureBrowser, guint32 flags, int pointx, int pointy, bool texturizeSelection ){
+ SelectTexture( textureBrowser, pointx, textureBrowser.height - 1 - pointy, flags, texturizeSelection );
}
void TextureBrowser_Selection_MouseUp( TextureBrowser& textureBrowser, guint32 flags, int pointx, int pointy ){
if ( event->type == GDK_BUTTON_PRESS ) {
gtk_widget_grab_focus( widget );
if ( event->button == 3 ) {
- if ( GlobalTextureBrowser().m_tags ) {
+ if ( textureBrowser->m_tags ) {
textureBrowser->m_rmbSelected = true;
- TextureBrowser_Selection_MouseDown( *textureBrowser, event->state, static_cast<int>( event->x ), static_cast<int>( event->y ) );
+ TextureBrowser_Selection_MouseDown( *textureBrowser, event->state, static_cast<int>( event->x ), static_cast<int>( event->y ), false );
BuildStoreAssignedTags( textureBrowser->m_assigned_store, textureBrowser->shader.c_str(), textureBrowser );
BuildStoreAvailableTags( textureBrowser->m_available_store, textureBrowser->m_assigned_store, textureBrowser->m_all_tags, textureBrowser );
TextureBrowser_Tracking_MouseDown( *textureBrowser );
}
}
- else if ( event->button == 1 ) {
- TextureBrowser_Selection_MouseDown( *textureBrowser, event->state, static_cast<int>( event->x ), static_cast<int>( event->y ) );
+ else if ( event->button == 1 || event->button == 2 ) {
+ TextureBrowser_Selection_MouseDown( *textureBrowser, event->state, static_cast<int>( event->x ), static_cast<int>( event->y ), event->button == 2 );
- if ( GlobalTextureBrowser().m_tags ) {
+ if ( textureBrowser->m_tags ) {
textureBrowser->m_rmbSelected = false;
textureBrowser->m_tag_frame.hide();
}
TextureDirectory_loadTexture( path.c_str(), name.c_str() );
}
}
- TextureBrowser_SetHideUnused( g_TextureBrowser, false );
- g_TextureBrowser.m_searchedTags = true;
++ TextureBrowser_SetHideUnused( textureBrowser, false );
+ textureBrowser.m_searchedTags = true;
g_TextureBrowser_currentDirectory = tags_searched;
- g_TextureBrowser.m_nTotalHeight = 0;
- TextureBrowser_setOriginY( g_TextureBrowser, 0 );
- TextureBrowser_heightChanged( g_TextureBrowser );
+ textureBrowser.m_nTotalHeight = 0;
+ TextureBrowser_setOriginY( textureBrowser, 0 );
+ TextureBrowser_heightChanged( textureBrowser );
TextureBrowser_updateTitle();
}
g_slist_free( selected );
}
}
+void XYWnd::Redraw() {
+ if ( glwidget_make_current( m_gl_widget ) != FALSE ) {
+ if ( Map_Valid( g_map ) && ScreenUpdates_Enabled() ) {
+ GlobalOpenGL_debugAssertNoErrors();
+ XY_Draw();
+ GlobalOpenGL_debugAssertNoErrors();
+
+ m_XORRectangle.set( rectangle_t() );
+ }
+ glwidget_swap_buffers( m_gl_widget );
+ }
+}
+
+ void XYWnd::FocusOnBounds( AABB& bounds ){
+ SetOrigin( bounds.origin );
+ int nDim1 = ( m_viewType == YZ ) ? 1 : 0;
+ int nDim2 = ( m_viewType == XY ) ? 1 : 2;
+ if( bounds.extents[ nDim1 ] < 128.f )
+ bounds.extents[ nDim1 ] = 128.f;
+ if( bounds.extents[ nDim2 ] < 128.f )
+ bounds.extents[ nDim2 ] = 128.f;
+ float scale1 = Width() / ( 3.f * bounds.extents[ nDim1 ] );
+ float scale2 = Height() / ( 3.f * bounds.extents[ nDim2 ] );
+ SetScale( MIN( scale1, scale2 ) );
+
+ }
+
VIEWTYPE GlobalXYWnd_getCurrentViewType(){
ASSERT_NOTNULL( g_pParentWnd );
ASSERT_NOTNULL( g_pParentWnd->ActiveXY() );