This commit is contained in:
jdolan 2013-07-07 01:57:35 -04:00
commit e485edc236
12 changed files with 100 additions and 237 deletions

3
.gitignore vendored
View file

@ -6,6 +6,7 @@
/install/q3map2 /install/q3map2
/install/q3map2_urt /install/q3map2_urt
/install/radiant.bin /install/radiant.bin
/install/share
/packs /packs
/site.sconf /site.sconf
/.sconsign.dblite /.sconsign.dblite
@ -13,3 +14,5 @@
*.so *.so
.settings .settings
.DS_Store .DS_Store
*.obj
*.tlog

View file

@ -789,8 +789,7 @@ void CSynapseClient::Shutdown(){
APIDescriptor_t *pAPI = *iAPI; APIDescriptor_t *pAPI = *iAPI;
if ( pAPI->mRefCount != 0 ) { if ( pAPI->mRefCount != 0 ) {
Syn_Printf( "WARNING: ~CSynapseClient '%s' has non-zero ref count for interface '%s' '%s'\n", GetInfo(), pAPI->major_name, pAPI->minor_name ); Syn_Printf( "WARNING: ~CSynapseClient '%s' has non-zero ref count for interface '%s' '%s'\n", GetInfo(), pAPI->major_name, pAPI->minor_name );
} } else {
else{
delete pAPI; delete pAPI;
} }
*iAPI = NULL; *iAPI = NULL;

View file

@ -204,13 +204,8 @@ gboolean WINAPI gtk_glwidget_make_current( GtkWidget *widget ){
// Think about rewriting this font stuff to use OpenGL display lists and glBitmap(). // Think about rewriting this font stuff to use OpenGL display lists and glBitmap().
// Bit maps together with display lists may offer a performance increase, but // Bit maps together with display lists may offer a performance increase, but
// they would not allow antialiased fonts. // they would not allow antialiased fonts.
#ifdef _WIN32 static const char font_string[] = "Monospace bold";
static const char font_string[] = "Courier bold";
static const int font_height = 9;
#else
static const char font_string[] = "Monospace";
static const int font_height = 10; static const int font_height = 10;
#endif
static int font_ascent = -1; static int font_ascent = -1;
static int font_descent = -1; static int font_descent = -1;
static int y_offset_bitmap_render_pango_units = -1; static int y_offset_bitmap_render_pango_units = -1;

View file

@ -172,21 +172,6 @@ static gint timer( gpointer data ){
return TRUE; return TRUE;
} }
//! GtkGLExt port.
/*
static void create_context (GtkWidget *widget, gpointer data)
{
if (g_qeglobals_gui.d_glBase == NULL)
g_qeglobals_gui.d_glBase = widget;
}
static void destroy_context (GtkWidget *widget, gpointer data)
{
if (g_qeglobals_gui.d_glBase == widget)
g_qeglobals_gui.d_glBase = NULL;
}
*/
#if GTK_CHECK_VERSION( 1,3,0 ) #if GTK_CHECK_VERSION( 1,3,0 )
static gint scroll_event( GtkWidget *widget, static gint scroll_event( GtkWidget *widget,
GdkEventScroll *event, GdkEventScroll *event,
@ -204,7 +189,7 @@ static gint scroll_event( GtkWidget *widget,
//#define DBG_GLWINDOW //#define DBG_GLWINDOW
#endif #endif
GLWindow::GLWindow ( bool zbuffer ){ GLWindow::GLWindow( bool zbuffer ) {
m_nTimer = 0; m_nTimer = 0;
m_bMouseCapture = FALSE; m_bMouseCapture = FALSE;
m_pParent = NULL; m_pParent = NULL;
@ -216,12 +201,9 @@ GLWindow::GLWindow ( bool zbuffer ){
Sys_Printf( "GLWindow::GLWindow m_pWidget = %p\n", m_pWidget ); Sys_Printf( "GLWindow::GLWindow m_pWidget = %p\n", m_pWidget );
#endif #endif
//! GtkGLExt port.
//#if defined (__linux__) || defined (__APPLE__)
if ( g_qeglobals_gui.d_glBase == NULL ) { if ( g_qeglobals_gui.d_glBase == NULL ) {
g_qeglobals_gui.d_glBase = m_pWidget; g_qeglobals_gui.d_glBase = m_pWidget;
} }
//#endif
#if GTK_CHECK_VERSION( 1,3,0 ) #if GTK_CHECK_VERSION( 1,3,0 )
gtk_widget_set_events( m_pWidget, GDK_DESTROY | GDK_EXPOSURE_MASK | gtk_widget_set_events( m_pWidget, GDK_DESTROY | GDK_EXPOSURE_MASK |
@ -238,9 +220,6 @@ GLWindow::GLWindow ( bool zbuffer ){
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button_press_event", GTK_SIGNAL_FUNC( button_press ), this ); gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button_press_event", GTK_SIGNAL_FUNC( button_press ), this );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button_release_event",GTK_SIGNAL_FUNC( button_release ), this ); gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button_release_event",GTK_SIGNAL_FUNC( button_release ), this );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "size_allocate", GTK_SIGNAL_FUNC( resize ), this ); gtk_signal_connect( GTK_OBJECT( m_pWidget ), "size_allocate", GTK_SIGNAL_FUNC( resize ), this );
//! GtkGLExt port.
// gtk_signal_connect (GTK_OBJECT (m_pWidget), "create_context", GTK_SIGNAL_FUNC (create_context), this);
// gtk_signal_connect (GTK_OBJECT (m_pWidget), "destroy_context", GTK_SIGNAL_FUNC (destroy_context), this);
#if GTK_CHECK_VERSION( 1,3,0 ) #if GTK_CHECK_VERSION( 1,3,0 )
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "scroll_event", GTK_SIGNAL_FUNC( scroll_event ), this ); gtk_signal_connect( GTK_OBJECT( m_pWidget ), "scroll_event", GTK_SIGNAL_FUNC( scroll_event ), this );
#endif #endif

View file

@ -31,72 +31,56 @@
#ifndef _GLWINDOW_H_ #ifndef _GLWINDOW_H_
#define _GLWINDOW_H_ #define _GLWINDOW_H_
class GLWindow class GLWindow {
{
public: public:
GLWindow ( bool zbuffer ); GLWindow( bool zbuffer );
virtual ~GLWindow (); virtual ~GLWindow ();
bool MakeCurrent(); bool MakeCurrent();
void SwapBuffers(); void SwapBuffers();
void SetTimer( guint millisec ); void SetTimer( guint millisec );
void KillTimer(); void KillTimer();
bool HasTimer() bool HasTimer() { return m_nTimer != 0; }
{ return m_nTimer != 0; } void DestroyContext();
void DestroyContext(); void CreateContext();
void CreateContext();
virtual void OnCreate() { } virtual void OnCreate() { }
virtual void OnExpose() { } virtual void OnExpose() { }
virtual void OnLButtonDown( guint32 flags, int x, int y ) { } virtual void OnLButtonDown( guint32 flags, int x, int y ) { }
virtual void OnRButtonDown( guint32 flags, int x, int y ) { } virtual void OnRButtonDown( guint32 flags, int x, int y ) { }
virtual void OnMButtonDown( guint32 flags, int x, int y ) { } virtual void OnMButtonDown( guint32 flags, int x, int y ) { }
virtual void OnLButtonUp( guint32 flags, int pointx, int pointy ) { } virtual void OnLButtonUp( guint32 flags, int pointx, int pointy ) { }
virtual void OnRButtonUp( guint32 flags, int pointx, int pointy ) { } virtual void OnRButtonUp( guint32 flags, int pointx, int pointy ) { }
virtual void OnMButtonUp( guint32 flags, int pointx, int pointy ) { } virtual void OnMButtonUp( guint32 flags, int pointx, int pointy ) { }
virtual void OnMouseMove( guint32 flags, int pointx, int pointy ) { } virtual void OnMouseMove( guint32 flags, int pointx, int pointy ) { }
virtual void OnSize( int cx, int cy ) { }
virtual void OnTimer() { }
virtual void OnSize( int cx, int cy ) { } virtual void OnMouseWheel( bool bUp ) { }
virtual void OnTimer() { }
virtual void OnMouseWheel( bool bUp ) { } void RedrawWindow() { gtk_widget_queue_draw( m_pWidget ); }
void RedrawWindow(){ void SetFocus() { /* gdk_window_raise (m_pWidget->window); */ }
gtk_widget_queue_draw( m_pWidget );
}
void SetFocus(){ void SetCapture() { m_bMouseCapture = TRUE; }
/* gdk_window_raise (m_pWidget->window); */ void ReleaseCapture() { m_bMouseCapture = FALSE; }
}
void SetCapture(){ bool HasCapture() { return m_bMouseCapture; }
m_bMouseCapture = TRUE;
}
void ReleaseCapture(){ GtkWidget * GetWidget() { return m_pWidget; }
m_bMouseCapture = FALSE;
}
bool HasCapture(){
return m_bMouseCapture;
}
GtkWidget* GetWidget(){
return m_pWidget;
}
// member variables // member variables
public: public:
GtkWidget* m_pParent; // for floating windows only GtkWidget* m_pParent; // for floating windows only
protected: protected:
bool m_bMouseCapture; bool m_bMouseCapture;
GtkWidget* m_pWidget; GtkWidget* m_pWidget;
private: private:
guint m_nTimer; // only one timer supported guint m_nTimer; // only one timer supported
}; };
#endif //_GLWINDOW_H_ #endif //_GLWINDOW_H_

View file

@ -656,35 +656,36 @@ void SetInspectorMode( int iType ){
} }
} }
switch ( iType ) switch ( iType ) {
{
case W_ENTITY: case W_ENTITY:
// entity is always first in the inspector // entity is always first in the inspector
gtk_window_set_title( GTK_WINDOW( g_qeglobals_gui.d_entity ), "Entities" ); gtk_window_set_title( GTK_WINDOW( g_qeglobals_gui.d_entity ), "Entities" );
gtk_notebook_set_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 0 ); gtk_notebook_set_current_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 0 );
break; break;
case W_TEXTURE: case W_TEXTURE:
g_pParentWnd->GetTexWnd()->FocusEdit(); g_pParentWnd->GetTexWnd()->FocusEdit();
gtk_window_set_title( GTK_WINDOW( g_qeglobals_gui.d_entity ), "Textures" ); gtk_window_set_title( GTK_WINDOW( g_qeglobals_gui.d_entity ), "Textures" );
if ( g_pParentWnd->FloatingGroupDialog() ) { if ( g_pParentWnd->FloatingGroupDialog() ) {
gtk_notebook_set_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 1 ); // if the notebook page is already at 1, no expose event fires up on the embedded GLWindow, leading in the texture window not drawing
// I did witness an expose event on the notebook widget though, but for some reason it's not traveling down..
// so when hiding the group dialog, we are setting the page to 0, the page switch does an expose and triggers drawing.. (see OnDialogKey)
gtk_notebook_set_current_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 1 );
} }
break; break;
case W_CONSOLE: case W_CONSOLE:
gtk_window_set_title( GTK_WINDOW( g_qeglobals_gui.d_entity ), "Console" ); gtk_window_set_title( GTK_WINDOW( g_qeglobals_gui.d_entity ), "Console" );
if ( g_pParentWnd->FloatingGroupDialog() ) { if ( g_pParentWnd->FloatingGroupDialog() ) {
gtk_notebook_set_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 2 ); gtk_notebook_set_current_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 2 );
} }
break; break;
case W_GROUP: case W_GROUP:
if ( g_pParentWnd->FloatingGroupDialog() ) { if ( g_pParentWnd->FloatingGroupDialog() ) {
gtk_notebook_set_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 3 ); gtk_notebook_set_current_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 3 );
} } else {
else{ gtk_notebook_set_current_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 1 );
gtk_notebook_set_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 1 );
} }
break; break;
@ -1097,34 +1098,7 @@ static gint entityentry_keypress( GtkWidget* widget, GdkEventKey* event, gpointe
return FALSE; return FALSE;
} }
/*
// add a new group, put all selected brushes into the group
static void groupdlg_add (GtkWidget *widget, gpointer data)
{
char* name = DoNameDlg ("New Group");
if (name != NULL)
{
// create a new group node
GtkCTreeNode *item;
item = gtk_ctree_insert_node (GTK_CTREE (g_wndGroup.m_pTree), g_pGroupDlg->m_hWorld, NULL, &name, 0,
tree_pixmaps[IMG_GROUP], tree_masks[IMG_GROUP],
tree_pixmaps[IMG_GROUP], tree_masks[IMG_GROUP], FALSE, TRUE);
// create a new group
group_t *g = Group_Alloc (name);
g->itemOwner = item;
g->next = g_pGroups;
g_pGroups = g;
// now add the selected brushes
// NOTE: it would be much faster to give the group_t for adding
// but Select_AddToGroup is the standard way for all other cases
Select_AddToGroup (name);
g_free (name);
}
}
*/
static void switch_page( GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data ){ static void switch_page( GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data ){
char *text; char *text;
gtk_label_get( GTK_LABEL( gtk_notebook_get_tab_label( notebook, gtk_notebook_get_nth_page( notebook, page_num ) ) ), &text ); gtk_label_get( GTK_LABEL( gtk_notebook_get_tab_label( notebook, gtk_notebook_get_nth_page( notebook, page_num ) ) ), &text );
@ -1164,18 +1138,43 @@ static void switch_page( GtkNotebook *notebook, GtkNotebookPage *page, guint pag
// NOTE: when a key is hit with group window focused, we catch in this handler but it gets propagated to mainframe too // NOTE: when a key is hit with group window focused, we catch in this handler but it gets propagated to mainframe too
// therefore the message will be intercepted and used as a ID_SELECTION_DESELECT // therefore the message will be intercepted and used as a ID_SELECTION_DESELECT
static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ){ static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ) {
#ifdef DBG_PI // make the "ViewTextures" and "ViewEntityInfo" keys that normally bring this dialog up hide it as well - copypasta from mainframe_keypress
Sys_Printf( "OnDialogKey\n" ); // NOTE: maybe we could also check the state of the notebook, see if those are actually displayed .. if they are not, then switch the notebook pages rather than hiding?
#endif bool hide = false;
if ( ( event->keyval == GDK_Escape ) && ( g_pParentWnd->CurrentStyle() != MainFrame::eFloating ) ) { unsigned int code = gdk_keyval_to_upper( event->keyval );
// toggle off the group view (whatever part of it is currently displayed) for ( int i = 0; i < g_nCommandCount; i++ ) {
// this used to be done with a g_pParentWnd->OnViewEntity(); but it had bad consequences if ( g_Commands[i].m_nKey == code ) { // find a match?
// http://fenris.lokigames.com/show_bug.cgi?id=2773 // check modifiers
widget_delete_hide( g_qeglobals_gui.d_entity ); unsigned int nState = 0;
return TRUE; if ( Sys_AltDown() ) {
} nState |= RAD_ALT;
return FALSE; }
if ( ( event->state & GDK_CONTROL_MASK ) != 0 ) {
nState |= RAD_CONTROL;
}
if ( ( event->state & GDK_SHIFT_MASK ) != 0 ) {
nState |= RAD_SHIFT;
}
if ( ( g_Commands[i].m_nModifiers & 0x7 ) == nState ) {
Sys_Printf( "Floating group dialog: %s\n", g_Commands[i].m_strCommand );
if ( g_Commands[i].m_nCommand == ID_VIEW_TEXTURE || g_Commands[i].m_nCommand == ID_VIEW_ENTITY ) {
hide = true;
}
break;
}
}
}
if ( g_pParentWnd->CurrentStyle() != MainFrame::eFloating && ( hide || event->keyval == GDK_Escape ) ) {
// toggle off the group view (whatever part of it is currently displayed)
// this used to be done with a g_pParentWnd->OnViewEntity(); but it had bad consequences
gtk_widget_hide( widget );
// set the group notebook page back to 0, so that when we recall the texture view there is an expose event coming up
gtk_notebook_set_current_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 0 );
return TRUE;
}
return FALSE;
} }
GroupDlg::GroupDlg (){ GroupDlg::GroupDlg (){
@ -1205,6 +1204,7 @@ void GroupDlg::Create(){
gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", GTK_SIGNAL_FUNC( widget_delete_hide ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", GTK_SIGNAL_FUNC( widget_delete_hide ), NULL );
// catch 'Esc' // catch 'Esc'
gtk_signal_connect( GTK_OBJECT( dlg ), "key_press_event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "key_press_event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL );
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) );
g_qeglobals_gui.d_entity = dlg; g_qeglobals_gui.d_entity = dlg;
@ -1316,33 +1316,21 @@ void GroupDlg::Create(){
GtkWidget *check = gtk_check_button_new_with_label( _( "!Easy" ) ); GtkWidget *check = gtk_check_button_new_with_label( _( "!Easy" ) );
gtk_widget_show( check ); gtk_widget_show( check );
gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL ); gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL );
/* gtk_table_attach (GTK_TABLE (table), check, 2, 3, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);*/
EntWidgets[EntCheck17] = check; EntWidgets[EntCheck17] = check;
check = gtk_check_button_new_with_label( _( "!Medium" ) ); check = gtk_check_button_new_with_label( _( "!Medium" ) );
gtk_widget_show( check ); gtk_widget_show( check );
gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL ); gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL );
/* gtk_table_attach (GTK_TABLE (table), check, 2, 3, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);*/
EntWidgets[EntCheck18] = check; EntWidgets[EntCheck18] = check;
check = gtk_check_button_new_with_label( _( "!Hard" ) ); check = gtk_check_button_new_with_label( _( "!Hard" ) );
gtk_widget_show( check ); gtk_widget_show( check );
gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL ); gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL );
/* gtk_table_attach (GTK_TABLE (table), check, 2, 3, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);*/
EntWidgets[EntCheck19] = check; EntWidgets[EntCheck19] = check;
check = gtk_check_button_new_with_label( _( "!DeathMatch" ) ); check = gtk_check_button_new_with_label( _( "!DeathMatch" ) );
gtk_widget_show( check ); gtk_widget_show( check );
gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL ); gtk_signal_connect( GTK_OBJECT( check ), "toggled", GTK_SIGNAL_FUNC( entity_check ), NULL );
/* gtk_table_attach (GTK_TABLE (table), check, 2, 3, 3, 4,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);*/
EntWidgets[EntCheck20] = check; EntWidgets[EntCheck20] = check;
} }
} }
@ -1619,63 +1607,8 @@ void GroupDlg::Create(){
} }
} }
//++timo NOTE: this part for grouping code, don't remove! (we'll put it back in sometime soon)
/*
vbox = gtk_vbox_new (FALSE, 5);
gtk_widget_show (vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 3);
scr = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scr);
gtk_box_pack_start (GTK_BOX (vbox), scr, TRUE, TRUE, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scr), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
ctree = gtk_ctree_new (1, 0);
gtk_widget_show (ctree);
gtk_container_add (GTK_CONTAINER (scr), ctree);
gtk_clist_column_titles_hide (GTK_CLIST (ctree));
m_pTree = ctree;
hbox = gtk_hbox_new (FALSE, 5);
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
button = gtk_button_new_with_label (_("Add..."));
gtk_widget_show (button);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (groupdlg_add), NULL);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_set_usize (button, 60, -2);
button = gtk_button_new_with_label (_("Edit..."));
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_set_usize (button, 60, -2);
button = gtk_button_new_with_label (_("Delete"));
gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_set_usize (button, 60, -2);
label = gtk_label_new (_("Groups"));
gtk_widget_show (label);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label);
*/
inspector_mode = W_ENTITY; inspector_mode = W_ENTITY;
// gtk_window_set_title (GTK_WINDOW (dlg), _("Entities"));
m_pWidget = dlg; m_pWidget = dlg;
/*
load_pixmap ("grouptree1.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[0], &tree_masks[0]);
load_pixmap ("grouptree2.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[1], &tree_masks[1]);
load_pixmap ("grouptree3.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[2], &tree_masks[2]);
load_pixmap ("grouptree4.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[3], &tree_masks[3]);
load_pixmap ("grouptree5.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[4], &tree_masks[4]);
load_pixmap ("grouptree6.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[5], &tree_masks[5]);
load_pixmap ("grouptree7.bmp", g_pParentWnd->m_pWidget, &tree_pixmaps[6], &tree_masks[6]);
Group_Init();
*/
g_signal_connect( G_OBJECT( notebook ), "switch_page", G_CALLBACK( switch_page ), dlg ); g_signal_connect( G_OBJECT( notebook ), "switch_page", G_CALLBACK( switch_page ), dlg );
} }
} }

View file

@ -86,19 +86,17 @@ extern GtkWidget* EntWidgets[EntLast];
class GroupDlg class GroupDlg
{ {
public: public:
GroupDlg (); GroupDlg();
void Create(); void Create();
void Show() void Show() { gtk_widget_show( m_pWidget ); }
{ gtk_widget_show( m_pWidget ); }; void Hide() { gtk_widget_hide( m_pWidget ); }
void Hide()
{ gtk_widget_hide( m_pWidget ); };
public: public:
GtkWidget* m_pNotebook; GtkWidget* m_pNotebook;
GtkWidget* m_pWidget; GtkWidget* m_pWidget;
GtkWidget* m_pTree; GtkWidget* m_pTree;
GtkCTreeNode* m_hWorld; //leo: not used keeping because of the win32 version GtkCTreeNode* m_hWorld; //leo: not used keeping because of the win32 version
}; };
extern GroupDlg *g_pGroupDlg; extern GroupDlg *g_pGroupDlg;

View file

@ -2816,8 +2816,6 @@ void MainFrame::Create(){
} }
} }
// g_qeglobals_gui.d_edit = NULL;
{ {
m_pTexWnd = new TexWnd(); m_pTexWnd = new TexWnd();
GtkWidget* frame = create_framed_texwnd( m_pTexWnd ); GtkWidget* frame = create_framed_texwnd( m_pTexWnd );
@ -2830,7 +2828,6 @@ void MainFrame::Create(){
} }
m_pTexWnd->m_pParent = g_pGroupDlg->m_pWidget; m_pTexWnd->m_pParent = g_pGroupDlg->m_pWidget;
// gtk_widget_realize (m_pTexWnd->GetWidget ());
m_pZWnd = create_floating_zwnd( this ); m_pZWnd = create_floating_zwnd( this );
while ( gtk_events_pending() ) while ( gtk_events_pending() )
@ -2864,7 +2861,6 @@ void MainFrame::Create(){
g_pParentWnd->OnEntitiesSetViewAs( 0 ); g_pParentWnd->OnEntitiesSetViewAs( 0 );
// m_wndTextureBar.Create (vbox);
create_main_statusbar( window, vbox ); create_main_statusbar( window, vbox );
LoadCommandMap(); LoadCommandMap();
@ -2888,9 +2884,6 @@ void MainFrame::Create(){
gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), g_PrefsDlg.m_bTexturesShaderlistOnly ? TRUE : FALSE ); gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), g_PrefsDlg.m_bTexturesShaderlistOnly ? TRUE : FALSE );
g_bIgnoreCommands--; g_bIgnoreCommands--;
// if (g_PrefsDlg.m_bTextureBar)
// gtk_widget_show (m_wndTextureBar.m_pWidget);
SetActiveXY( m_pXYWnd ); SetActiveXY( m_pXYWnd );
s_idle_id = gtk_timeout_add( 25, mainframe_idle, this ); s_idle_id = gtk_timeout_add( 25, mainframe_idle, this );

View file

@ -75,9 +75,6 @@ static void OnSelchangeComboColRow( GtkWidget *widget, gpointer data ){
if ( !g_PatchDialog.m_bListenChanged ) { if ( !g_PatchDialog.m_bListenChanged ) {
return; return;
} }
#ifdef DBG_PI
Sys_Printf( "OnSelchangeComboColRow\n" );
#endif
// retrieve the current m_nRow and m_nCol, other params are not relevant // retrieve the current m_nRow and m_nCol, other params are not relevant
// (NOTE: UpdateData has a mechanism to avoid inifinite looping) // (NOTE: UpdateData has a mechanism to avoid inifinite looping)
g_PatchDialog.UpdateData( TRUE ); g_PatchDialog.UpdateData( TRUE );
@ -205,9 +202,6 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
adj->value = 0; adj->value = 0;
#ifdef DBG_PI
Sys_Printf( "Patch_SetTextureInfo: %g %g %g %g %g\n", td.shift[0], td.shift[1],td.scale[0],td.scale[1],td.rotate );
#endif
// will scale shift rotate the patch accordingly // will scale shift rotate the patch accordingly
Patch_SetTextureInfo( &td ); Patch_SetTextureInfo( &td );
// update the point-by-point view // update the point-by-point view
@ -216,9 +210,6 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
} }
static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ){ static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ){
#ifdef DBG_PI
Sys_Printf( "OnDialogKey\n" );
#endif
if ( event->keyval == GDK_Return ) { if ( event->keyval == GDK_Return ) {
OnApply( NULL, NULL ); OnApply( NULL, NULL );
return TRUE; return TRUE;

View file

@ -24,10 +24,6 @@
#include "dialog.h" #include "dialog.h"
#ifdef _DEBUG
//#define DBG_PI
#endif
class PatchDialog : public Dialog class PatchDialog : public Dialog
{ {
public: public:

View file

@ -688,8 +688,7 @@ extern qboolean g_bShowAllShaders;
// //
// texwindow.cpp // texwindow.cpp
// //
//++timo TODO: we can probably raise the MAX_TEXTUREDIRS limit? #define MAX_TEXTUREDIRS 1024
#define MAX_TEXTUREDIRS 256
extern CPtrArray g_lstSkinCache; extern CPtrArray g_lstSkinCache;
qtexture_t *QERApp_LoadTextureRGBA( unsigned char* pPixels, int nWidth, int nHeight ); qtexture_t *QERApp_LoadTextureRGBA( unsigned char* pPixels, int nWidth, int nHeight );

View file

@ -54,11 +54,6 @@ static unsigned tex_palette[256];
#define FONT_HEIGHT 10 #define FONT_HEIGHT 10
//int texture_mode = GL_NEAREST;
//int texture_mode = GL_NEAREST_MIPMAP_NEAREST;
//int texture_mode = GL_NEAREST_MIPMAP_LINEAR;
//int texture_mode = GL_LINEAR;
//int texture_mode = GL_LINEAR_MIPMAP_NEAREST;
int texture_mode = GL_LINEAR_MIPMAP_LINEAR; int texture_mode = GL_LINEAR_MIPMAP_LINEAR;
int g_nTextureOffset = 0; int g_nTextureOffset = 0;
@ -124,8 +119,7 @@ int GetTextureExtensionCount(){
// hardcoded hack for png support // hardcoded hack for png support
if ( g_pGameDescription->mGameFile == "sof2.game" ) { if ( g_pGameDescription->mGameFile == "sof2.game" ) {
return 3; return 3;
} } else {
else{
return 2; return 2;
} }
} }
@ -1667,8 +1661,7 @@ void TexWnd::OnCreate(){
if ( g_PrefsDlg.m_bTextureScrollbar ) { if ( g_PrefsDlg.m_bTextureScrollbar ) {
gtk_widget_show( g_qeglobals_gui.d_texture_scroll ); gtk_widget_show( g_qeglobals_gui.d_texture_scroll );
} } else {
else{
gtk_widget_hide( g_qeglobals_gui.d_texture_scroll ); gtk_widget_hide( g_qeglobals_gui.d_texture_scroll );
} }
m_bNeedRange = true; m_bNeedRange = true;
@ -1695,7 +1688,7 @@ void TexWnd::OnSize( int cx, int cy ){
m_bNeedRange = true; m_bNeedRange = true;
} }
void TexWnd::OnExpose(){ void TexWnd::OnExpose() {
int nOld = g_qeglobals.d_texturewin.m_nTotalHeight; int nOld = g_qeglobals.d_texturewin.m_nTotalHeight;
if ( !MakeCurrent() ) { if ( !MakeCurrent() ) {
Sys_Printf( "ERROR: glXMakeCurrent failed..\n " ); Sys_Printf( "ERROR: glXMakeCurrent failed..\n " );
@ -1785,9 +1778,9 @@ void TexWnd::UpdatePrefs(){
RedrawWindow(); RedrawWindow();
} }
void TexWnd::FocusEdit(){ void TexWnd::FocusEdit() {
if ( GTK_WIDGET_VISIBLE( m_pFilter ) ) { if ( GTK_WIDGET_VISIBLE( m_pFilter ) ) {
gtk_window_set_focus( GTK_WINDOW( g_pParentWnd->m_pWidget ), m_pFilter ); gtk_window_set_focus( GTK_WINDOW( g_pParentWnd->m_pWidget ), m_pFilter );
} }
} }