2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
\r
5 This file is part of GtkRadiant.
\r
7 GtkRadiant is free software; you can redistribute it and/or modify
\r
8 it under the terms of the GNU General Public License as published by
\r
9 the Free Software Foundation; either version 2 of the License, or
\r
10 (at your option) any later version.
\r
12 GtkRadiant is distributed in the hope that it will be useful,
\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 GNU General Public License for more details.
\r
17 You should have received a copy of the GNU General Public License
\r
18 along with GtkRadiant; if not, write to the Free Software
\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\r
23 // Surface Dialog Module
\r
27 // Nurail: Implemented to Module from the main Radiant Surface Dialog code
\r
31 #include <gtk/gtk.h>
\r
32 #include <gdk/gdkkeysyms.h>
\r
34 #include "surfdlg_plugin.h"
\r
42 #include "gtkr_vector.h"
\r
44 std::vector<texdef_to_face_t> g_texdef_face_vector;
\r
46 inline texdef_to_face_t* get_texdef_face_list()
\r
48 return &(*g_texdef_face_vector.begin());
\r
51 inline unsigned int texdef_face_list_empty()
\r
53 return g_texdef_face_vector.empty();
\r
56 inline unsigned int texdef_face_list_size()
\r
58 return g_texdef_face_vector.size();
\r
61 // For different faces having different values
\r
62 bool is_HShift_conflicting;
\r
63 bool is_VShift_conflicting;
\r
64 bool is_HScale_conflicting;
\r
65 bool is_VScale_conflicting;
\r
66 bool is_Rotate_conflicting;
\r
67 bool is_TextureName_conflicting;
\r
72 void GetTexMods(bool b_SetUndoPoint = FALSE);
\r
75 void InitDefaultIncrement(texdef_t *);
\r
76 void DoSnapTToGrid(float hscale, float vscale);
\r
77 // called to perform a fitting from the outside (shortcut key)
\r
78 void SurfaceDialogFitAll();
\r
80 // Heretic2 Flags Functions
\r
81 void SetFlagButtons_Heretic2(texdef_to_face_t *texdef_face_list, bool b_isListEmpty);
\r
82 void SetChangeInFlags_Face_Heretic2 (texdef_to_face_t *texdef_face_list);
\r
83 GtkWidget* Create_Heretic2FlagsDialog (GtkWidget* surfacedialog_widget);
\r
90 // 0 is invalid, otherwise it's the Id of the last 'do' we are responsible for
\r
94 texturewin_t *texturewin;
\r
95 texdef_t *l_pIncrement;
\r
96 texdef_t texdef_offset;
\r
97 texdef_t texdef_SI_values;
\r
99 // For Texture Entry, activate only on entry change
\r
100 char old_texture_entry[128];
\r
102 // the texdef to switch back to when the OnCancel is called
\r
103 texdef_t g_old_texdef;
\r
105 // when TRUE, this thing means the surface inspector is currently being displayed
\r
106 bool g_surfwin = FALSE;
\r
107 // turn on/off processing of the "changed" "value_changed" messages
\r
108 // (need to turn off when we are feeding data in)
\r
109 bool g_bListenChanged = true;
\r
110 // turn on/off listening of the update messages
\r
111 bool g_bListenUpdate = true;
\r
113 GtkWidget* create_SurfaceInspector (void);
\r
114 GtkWidget *SurfaceInspector = NULL;
\r
116 GtkWidget *m_pWidget;
\r
117 GtkWidget *GetWidget () { return SurfaceInspector; }
\r
118 GtkWidget *Get_SI_Module_Widget () { return SurfaceInspector; }
\r
119 void SetWidget(GtkWidget *new_widget) { m_pWidget = new_widget; }
\r
120 GtkWidget *GetDlgWidget (const char* name)
\r
121 { return GTK_WIDGET (g_object_get_data (G_OBJECT (SurfaceInspector), name)); }
\r
123 // Spins for FitTexture
\r
124 GtkWidget *spin_width;
\r
125 GtkWidget *spin_height;
\r
128 GtkWidget *texture_combo;
\r
129 GtkWidget *texture_combo_entry;
\r
131 GtkWidget *match_grid_button;
\r
132 GtkWidget *lock_valuechange_togglebutton;
\r
134 GtkObject *hshift_value_spinbutton_adj;
\r
135 GtkWidget *hshift_value_spinbutton;
\r
136 GtkObject *vshift_value_spinbutton_adj;
\r
137 GtkWidget *vshift_value_spinbutton;
\r
138 GtkObject *hscale_value_spinbutton_adj;
\r
139 GtkWidget *hscale_value_spinbutton;
\r
140 GtkObject *vscale_value_spinbutton_adj;
\r
141 GtkWidget *vscale_value_spinbutton;
\r
142 GtkObject *rotate_value_spinbutton_adj;
\r
143 GtkWidget *rotate_value_spinbutton;
\r
145 GtkObject *hshift_offset_spinbutton_adj;
\r
146 GtkWidget *hshift_offset_spinbutton;
\r
147 GtkObject *vshift_offset_spinbutton_adj;
\r
148 GtkWidget *vshift_offset_spinbutton;
\r
149 GtkObject *hscale_offset_spinbutton_adj;
\r
150 GtkWidget *hscale_offset_spinbutton;
\r
151 GtkObject *vscale_offset_spinbutton_adj;
\r
152 GtkWidget *vscale_offset_spinbutton;
\r
153 GtkObject *rotate_offset_spinbutton_adj;
\r
154 GtkWidget *rotate_offset_spinbutton;
\r
156 GtkObject *hshift_step_spinbutton_adj;
\r
157 GtkWidget *hshift_step_spinbutton;
\r
158 GtkObject *vshift_step_spinbutton_adj;
\r
159 GtkWidget *vshift_step_spinbutton;
\r
160 GtkObject *hscale_step_spinbutton_adj;
\r
161 GtkWidget *hscale_step_spinbutton;
\r
162 GtkObject *vscale_step_spinbutton_adj;
\r
163 GtkWidget *vscale_step_spinbutton;
\r
164 GtkObject *rotate_step_spinbutton_adj;
\r
165 GtkWidget *rotate_step_spinbutton;
\r
167 GtkObject *fit_width_spinbutton_adj;
\r
168 GtkWidget *fit_width_spinbutton;
\r
169 GtkObject *fit_height_spinbutton_adj;
\r
170 GtkWidget *fit_height_spinbutton;
\r
171 GtkWidget *fit_button;
\r
172 GtkWidget *axial_button;
\r
174 GtkWidget *done_button;
\r
175 GtkWidget *apply_button;
\r
176 GtkWidget *cancel_button;
\r
179 gboolean on_texture_combo_entry_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data);
\r
180 void on_texture_combo_entry_activate (GtkEntry *entry, gpointer user_data);
\r
182 static void on_match_grid_button_clicked (GtkButton *button, gpointer user_data);
\r
183 static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebutton, gpointer user_data);
\r
185 static void on_hshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
186 static void on_vshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
187 static void on_hscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
188 static void on_vscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
189 static void on_rotate_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
191 static void on_hshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
192 static void on_vshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
193 static void on_hscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
194 static void on_vscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
195 static void on_rotate_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
197 static void on_hshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
198 static void on_vshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
199 static void on_hscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
200 static void on_vscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
201 static void on_rotate_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
203 static void on_fit_width_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
204 static void on_fit_height_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data);
\r
205 static void on_fit_button_clicked (GtkButton *button, gpointer user_data);
\r
206 static void on_axial_button_clicked (GtkButton *button, gpointer user_data);
\r
208 static void on_done_button_clicked (GtkButton *button, gpointer user_data);
\r
209 static void on_apply_button_clicked (GtkButton *button, gpointer user_data);
\r
210 static void on_cancel_button_clicked (GtkButton *button, gpointer user_data);
\r
214 ===================================================
\r
218 ===================================================
\r
222 void IsFaceConflicting()
\r
224 texdef_t* tmp_texdef;
\r
225 texdef_to_face_t* temp_texdef_face_list;
\r
227 char texture_name[128];
\r
229 if (texdef_face_list_empty())
\r
231 gtk_entry_set_text( GTK_ENTRY (hshift_value_spinbutton), "");
\r
232 gtk_entry_set_text( GTK_ENTRY (vshift_value_spinbutton), "");
\r
233 gtk_entry_set_text( GTK_ENTRY (hscale_value_spinbutton), "");
\r
234 gtk_entry_set_text( GTK_ENTRY (vscale_value_spinbutton), "");
\r
235 gtk_entry_set_text( GTK_ENTRY (rotate_value_spinbutton), "");
\r
236 gtk_entry_set_text( GTK_ENTRY (texture_combo_entry), "");
\r
240 g_bListenChanged = FALSE;
\r
242 tmp_texdef = &get_texdef_face_list()->texdef;
\r
244 strcpy(texture_name, tmp_texdef->GetName() );
\r
246 texdef_SI_values.shift[0] = tmp_texdef->shift[0];
\r
247 texdef_SI_values.shift[1] = tmp_texdef->shift[1];
\r
248 texdef_SI_values.scale[0] = tmp_texdef->scale[0];
\r
249 texdef_SI_values.scale[1] = tmp_texdef->scale[1];
\r
250 texdef_SI_values.rotate = tmp_texdef->rotate;
\r
251 texdef_SI_values.SetName( texture_name );
\r
253 is_HShift_conflicting = FALSE;
\r
254 is_VShift_conflicting = FALSE;
\r
255 is_HScale_conflicting = FALSE;
\r
256 is_VScale_conflicting = FALSE;
\r
257 is_Rotate_conflicting = FALSE;
\r
258 is_TextureName_conflicting = FALSE;
\r
260 if (texdef_face_list_size() > 1)
\r
262 temp_texdef_face_list = get_texdef_face_list()->next;
\r
264 for (temp_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
266 tmp_texdef = &temp_texdef_face_list->texdef;
\r
267 if ( texdef_SI_values.shift[0] != tmp_texdef->shift[0] )
\r
268 is_HShift_conflicting = TRUE;
\r
270 if ( texdef_SI_values.shift[1] != tmp_texdef->shift[1] )
\r
271 is_VShift_conflicting = TRUE;
\r
273 if ( texdef_SI_values.scale[0] != tmp_texdef->scale[0] )
\r
274 is_HScale_conflicting = TRUE;
\r
276 if ( texdef_SI_values.scale[1] != tmp_texdef->scale[1] )
\r
277 is_VScale_conflicting = TRUE;
\r
279 if ( texdef_SI_values.rotate != tmp_texdef->rotate )
\r
280 is_Rotate_conflicting = TRUE;
\r
282 if ( strcmp( texture_name, tmp_texdef->GetName() ) )
\r
283 is_TextureName_conflicting = TRUE;
\r
287 if(is_HShift_conflicting)
\r
288 gtk_entry_set_text( GTK_ENTRY (hshift_value_spinbutton), "");
\r
290 gtk_spin_button_set_value( GTK_SPIN_BUTTON(hshift_value_spinbutton) , texdef_SI_values.shift[0] );
\r
292 if(is_VShift_conflicting)
\r
293 gtk_entry_set_text( GTK_ENTRY (vshift_value_spinbutton), "");
\r
295 gtk_spin_button_set_value( GTK_SPIN_BUTTON(vshift_value_spinbutton) , texdef_SI_values.shift[1] );
\r
297 if(is_HScale_conflicting)
\r
298 gtk_entry_set_text( GTK_ENTRY (hscale_value_spinbutton), "");
\r
300 gtk_spin_button_set_value( GTK_SPIN_BUTTON(hscale_value_spinbutton) , texdef_SI_values.scale[0] );
\r
302 if(is_VScale_conflicting)
\r
303 gtk_entry_set_text( GTK_ENTRY (vscale_value_spinbutton), "");
\r
305 gtk_spin_button_set_value( GTK_SPIN_BUTTON(vscale_value_spinbutton) , texdef_SI_values.scale[1] );
\r
307 if(is_Rotate_conflicting)
\r
308 gtk_entry_set_text( GTK_ENTRY (rotate_value_spinbutton), "");
\r
310 gtk_spin_button_set_value( GTK_SPIN_BUTTON(rotate_value_spinbutton) , texdef_SI_values.rotate );
\r
312 g_bListenChanged = TRUE;
\r
315 #define MAX_NUM_LIST_ITEMS 15
\r
316 static void PopulateTextureComboList()
\r
318 texdef_t* tmp_texdef;
\r
319 texdef_to_face_t* temp_texdef_face_list;
\r
321 GList *items = NULL;
\r
323 int num_of_list_items = 0;
\r
327 if (texdef_face_list_empty())
\r
329 items = g_list_append (items, (gpointer) blank);
\r
330 // For Texture Entry, activate only on entry change
\r
331 strcpy (old_texture_entry, blank);
\r
333 else if ( !is_TextureName_conflicting )
\r
335 temp_texdef_face_list = get_texdef_face_list();
\r
336 tmp_texdef = (texdef_t *) &get_texdef_face_list()->texdef;
\r
337 items = g_list_append( items, (gpointer) tmp_texdef->GetName() );
\r
338 // For Texture Entry, activate only on entry change
\r
339 strcpy (old_texture_entry, tmp_texdef->GetName());
\r
343 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
345 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
346 // Need to do a string compare, hence the custom search
\r
347 if (!( g_list_find_custom (items, tmp_texdef->GetName(), (GCompareFunc) strcmp ) ))
\r
349 items = g_list_append( items, (gpointer) tmp_texdef->GetName() );
\r
350 num_of_list_items++;
\r
352 // Make sure the combo list isn't too long
\r
353 if (num_of_list_items >= MAX_NUM_LIST_ITEMS)
\r
356 // If this isn't added last (to the top of the list), g_list_find freaks.
\r
357 items = g_list_prepend (items, (gpointer) blank);
\r
358 // For Texture Entry, activate only on entry change
\r
359 strcpy (old_texture_entry, blank);
\r
362 gtk_combo_set_popdown_strings (GTK_COMBO (texture_combo), items);
\r
363 g_list_free(items);
\r
367 static void ZeroOffsetValues()
\r
369 texdef_offset.shift[0] = 0.0;
\r
370 texdef_offset.shift[1] = 0.0;
\r
371 texdef_offset.scale[0] = 0.0;
\r
372 texdef_offset.scale[1] = 0.0;
\r
373 texdef_offset.rotate = 0.0;
\r
376 static void GetTexdefInfo_from_Radiant()
\r
378 g_texdef_face_vector.clear();
\r
380 unsigned int count = GetSelectedFaceCountfromBrushes();
\r
382 count = GetSelectedFaceCount();
\r
384 g_texdef_face_vector.resize(count);
\r
386 if (!texdef_face_list_empty())
\r
388 texdef_to_face_t* p = get_texdef_face_list();
\r
389 GetSelFacesTexdef( get_texdef_face_list() );
\r
392 IsFaceConflicting();
\r
393 PopulateTextureComboList();
\r
394 ZeroOffsetValues();
\r
395 if ( texdef_face_list_empty() )
\r
396 SetFlagButtons_Heretic2( get_texdef_face_list() , TRUE);
\r
398 SetFlagButtons_Heretic2( get_texdef_face_list() , FALSE);
\r
402 static gint delete_event_callback(GtkWidget *widget, GdkEvent* event, gpointer data)
\r
408 // make the shift increments match the grid settings
\r
409 // the objective being that the shift+arrows shortcuts move the texture by the corresponding grid size
\r
410 // this depends on a scale value if you have selected a particular texture on which you want it to work:
\r
411 // we move the textures in pixels, not world units. (i.e. increment values are in pixel)
\r
412 // depending on the texture scale it doesn't take the same amount of pixels to move of g_qeglobals.d_gridsize
\r
413 // increment * scale = gridsize
\r
414 // hscale and vscale are optional parameters, if they are zero they will be set to the default scale
\r
415 // NOTE: the default scale depends if you are using BP mode or regular.
\r
416 // For regular it's 0.5f (128 pixels cover 64 world units), for BP it's simply 1.0f
\r
417 // see fenris #2810
\r
418 void DoSnapTToGrid(float hscale, float vscale)
\r
420 l_pIncrement = Get_SI_Inc();
\r
422 if (hscale == 0.0f)
\r
426 if (vscale == 0.0f)
\r
431 Sys_Printf ("DoSnapTToGrid: hscale %g vscale %g\n", hscale, vscale);
\r
433 l_pIncrement->shift[0] = GridSize() / hscale;
\r
434 l_pIncrement->shift[1] = GridSize() / vscale;
\r
435 // now some update work
\r
436 // FIXME: doesn't look good here, seems to be called several times
\r
440 void UpdateSurfaceDialog()
\r
442 if (!g_bListenUpdate)
\r
445 if (!SurfaceInspector)
\r
448 // avoid long delays on slow computers
\r
449 while (gtk_events_pending ())
\r
450 gtk_main_iteration ();
\r
455 Sys_Printf("UpdateSurfaceDialog\n");
\r
457 GetTexdefInfo_from_Radiant();
\r
463 // DoSurface will always try to show the surface inspector
\r
464 // or update it because something new has been selected
\r
465 void DoSurface (void)
\r
468 Sys_Printf("DoSurface\n");
\r
470 if (!SurfaceInspector)
\r
471 create_SurfaceInspector ();
\r
477 void ToggleSurface()
\r
480 Sys_Printf("ToggleSurface Module\n");
\r
485 on_cancel_button_clicked(NULL, NULL);
\r
488 // NOTE: will raise and show the Surface inspector and exec fit for patches and brushes
\r
489 void SurfaceDlgFitAll()
\r
495 // =============================================================================
\r
496 // SurfaceDialog class
\r
501 if(!SurfaceInspector)
\r
502 create_SurfaceInspector();
\r
504 gtk_widget_show (SurfaceInspector);
\r
506 GetTexdefInfo_from_Radiant();
\r
507 GetTexMods(TRUE); // Set Initial Undo Point
\r
514 gtk_widget_hide (SurfaceInspector);
\r
518 // set default values for increments (shift scale and rot)
\r
519 // this is called by the prefs code if can't find the values
\r
520 void InitDefaultIncrement(texdef_t *tex)
\r
522 tex->SetName("foo");
\r
525 tex->scale[0] = 0.25;
\r
526 tex->scale[1] = 0.25;
\r
530 void BuildDialog ()
\r
532 if ( !SurfaceInspector )
\r
533 create_SurfaceInspector();
\r
540 Set the fields to the current texdef (i.e. map/texdef -> dialog widgets)
\r
547 GtkSpinButton *spin;
\r
548 GtkAdjustment *adjust;
\r
550 texturewin = Texturewin ();
\r
551 l_pIncrement = Get_SI_Inc();
\r
554 Sys_Printf("SurfaceDlg SetTexMods\n");
\r
560 pt = &texturewin->texdef;
\r
562 g_bListenChanged = false;
\r
564 if(strncmp(pt->GetName(), "textures/", 9) != 0)
\r
565 texdef_offset.SetName(SHADER_NOT_FOUND);
\r
568 spin = GTK_SPIN_BUTTON (hshift_offset_spinbutton);
\r
569 gtk_spin_button_set_value (spin, texdef_offset.shift[0]);
\r
570 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin));
\r
571 adjust->step_increment = l_pIncrement->shift[0];
\r
572 gtk_spin_button_set_value (GTK_SPIN_BUTTON(hshift_step_spinbutton), l_pIncrement->shift[0]);
\r
574 spin = GTK_SPIN_BUTTON (hshift_value_spinbutton);
\r
575 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin));
\r
576 adjust->step_increment = l_pIncrement->shift[0];
\r
579 spin = GTK_SPIN_BUTTON (vshift_offset_spinbutton);
\r
580 gtk_spin_button_set_value (spin, texdef_offset.shift[1]);
\r
581 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin));
\r
582 adjust->step_increment = l_pIncrement->shift[1];
\r
583 gtk_spin_button_set_value (GTK_SPIN_BUTTON(vshift_step_spinbutton), l_pIncrement->shift[1]);
\r
585 spin = GTK_SPIN_BUTTON (vshift_value_spinbutton);
\r
586 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin));
\r
587 adjust->step_increment = l_pIncrement->shift[1];
\r
590 spin = GTK_SPIN_BUTTON (hscale_offset_spinbutton);
\r
591 gtk_spin_button_set_value (spin, texdef_offset.scale[0]);
\r
592 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin));
\r
593 adjust->step_increment = l_pIncrement->scale[0];
\r
594 gtk_spin_button_set_value (GTK_SPIN_BUTTON(hscale_step_spinbutton), l_pIncrement->scale[0]);
\r
596 spin = GTK_SPIN_BUTTON (hscale_value_spinbutton);
\r
597 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin));
\r
598 adjust->step_increment = l_pIncrement->scale[0];
\r
601 spin = GTK_SPIN_BUTTON (vscale_offset_spinbutton);
\r
602 gtk_spin_button_set_value (spin, texdef_offset.scale[1]);
\r
603 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin));
\r
604 adjust->step_increment = l_pIncrement->scale[1];
\r
605 gtk_spin_button_set_value (GTK_SPIN_BUTTON(vscale_step_spinbutton), l_pIncrement->scale[1]);
\r
607 spin = GTK_SPIN_BUTTON (vscale_value_spinbutton);
\r
608 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin));
\r
609 adjust->step_increment = l_pIncrement->scale[1];
\r
612 spin = GTK_SPIN_BUTTON (rotate_offset_spinbutton);
\r
613 gtk_spin_button_set_value (spin, texdef_offset.rotate);
\r
614 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin));
\r
615 adjust->step_increment = l_pIncrement->rotate;
\r
616 gtk_spin_button_set_value (GTK_SPIN_BUTTON(rotate_step_spinbutton), l_pIncrement->rotate);
\r
618 spin = GTK_SPIN_BUTTON (rotate_value_spinbutton);
\r
619 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spin));
\r
620 adjust->step_increment = l_pIncrement->rotate;
\r
623 g_bListenChanged = true;
\r
625 // store the current texdef as our escape route if user hits OnCancel
\r
626 g_old_texdef = texturewin->texdef;
\r
633 Shows any changes to the main Radiant windows
\r
636 void GetTexMods(bool b_SetUndoPoint)
\r
640 Sys_Printf("SurfaceDlg GetTexMods\n");
\r
643 if ( !texdef_face_list_empty() )
\r
645 g_bListenUpdate=FALSE;
\r
646 SetChangeInFlags_Face_Heretic2 ( get_texdef_face_list() );
\r
647 SetTexdef_FaceList( get_texdef_face_list(), b_SetUndoPoint );
\r
648 g_bListenUpdate=TRUE;
\r
650 if (b_SetUndoPoint)
\r
651 m_nUndoId = Undo_GetUndoId();
\r
657 on_fit_button_clicked(NULL, NULL);
\r
661 ////////////////////////////////////////////////////////////////////
\r
665 ////////////////////////////////////////////////////////////////////
\r
667 GtkWidget* create_SurfaceInspector (void)
\r
671 GtkWidget *hseparator;
\r
672 GtkWidget *eventbox;
\r
674 GtkWidget *viewport8;
\r
675 GtkWidget *viewport9;
\r
676 GtkWidget *viewport2;
\r
677 GtkWidget *viewport7;
\r
678 GtkWidget *viewport5;
\r
679 GtkWidget *viewport6;
\r
680 GtkWidget *viewport10;
\r
687 GtkWidget *alignment1;
\r
688 GtkWidget *alignment2;
\r
689 GtkWidget *alignment3;
\r
702 GtkWidget *hbuttonbox1;
\r
704 SurfaceInspector = gtk_window_new (GTK_WINDOW_TOPLEVEL);
\r
705 gtk_container_set_border_width (GTK_CONTAINER (SurfaceInspector), 4);
\r
706 gtk_window_set_title (GTK_WINDOW (SurfaceInspector), "Surface Inspector");
\r
708 SetWinPos_from_Prefs(SurfaceInspector);
\r
710 viewport8 = gtk_viewport_new (NULL, NULL);
\r
711 gtk_widget_show (viewport8);
\r
712 gtk_container_add (GTK_CONTAINER (SurfaceInspector), viewport8);
\r
713 gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport8), GTK_SHADOW_NONE);
\r
715 vbox7 = gtk_vbox_new (FALSE, 0);
\r
716 gtk_widget_show (vbox7);
\r
717 gtk_container_add (GTK_CONTAINER (viewport8), vbox7);
\r
719 viewport9 = gtk_viewport_new (NULL, NULL);
\r
720 gtk_widget_show (viewport9);
\r
721 gtk_box_pack_start (GTK_BOX (vbox7), viewport9, FALSE, FALSE, 0);
\r
722 gtk_container_set_border_width (GTK_CONTAINER (viewport9), 2);
\r
723 gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport9), GTK_SHADOW_ETCHED_IN);
\r
725 hbox1 = gtk_hbox_new (FALSE, 0);
\r
726 gtk_widget_show (hbox1);
\r
727 gtk_container_add (GTK_CONTAINER (viewport9), hbox1);
\r
728 gtk_container_set_border_width (GTK_CONTAINER (hbox1), 4);
\r
730 label = gtk_label_new ("Texture: ");
\r
731 gtk_widget_show (label);
\r
732 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
\r
733 gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
\r
735 texture_combo = gtk_combo_new ();
\r
736 g_object_set_data (G_OBJECT (GTK_COMBO (texture_combo)->popwin),
\r
737 "KeepMeAround", texture_combo);
\r
738 gtk_combo_disable_activate ( (GtkCombo*) texture_combo);
\r
739 gtk_widget_show (texture_combo);
\r
740 gtk_box_pack_start (GTK_BOX (hbox1), texture_combo, TRUE, TRUE, 0);
\r
742 texture_combo_entry = GTK_COMBO (texture_combo)->entry;
\r
743 gtk_widget_show (texture_combo_entry);
\r
744 gtk_entry_set_max_length (GTK_ENTRY (texture_combo_entry), 128);
\r
746 viewport2 = gtk_viewport_new (NULL, NULL);
\r
747 gtk_widget_show (viewport2);
\r
748 gtk_box_pack_start (GTK_BOX (vbox7), viewport2, FALSE, TRUE, 0);
\r
749 gtk_container_set_border_width (GTK_CONTAINER (viewport2), 2);
\r
750 gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport2), GTK_SHADOW_ETCHED_IN);
\r
752 table1 = gtk_table_new (13, 4, FALSE);
\r
753 gtk_widget_show (table1);
\r
754 gtk_container_add (GTK_CONTAINER (viewport2), table1);
\r
756 hseparator = gtk_hseparator_new ();
\r
757 gtk_widget_show (hseparator);
\r
758 gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 1, 2,
\r
759 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
760 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
762 hseparator = gtk_hseparator_new ();
\r
763 gtk_widget_show (hseparator);
\r
764 gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 1, 2,
\r
765 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
766 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
768 hseparator = gtk_hseparator_new ();
\r
769 gtk_widget_show (hseparator);
\r
770 gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 1, 2,
\r
771 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
772 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
774 hseparator = gtk_hseparator_new ();
\r
775 gtk_widget_show (hseparator);
\r
776 gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 3, 4,
\r
777 (GtkAttachOptions) (GTK_FILL),
\r
778 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
780 hseparator = gtk_hseparator_new ();
\r
781 gtk_widget_show (hseparator);
\r
782 gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 3, 4,
\r
783 (GtkAttachOptions) (GTK_FILL),
\r
784 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
786 hseparator = gtk_hseparator_new ();
\r
787 gtk_widget_show (hseparator);
\r
788 gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 3, 4,
\r
789 (GtkAttachOptions) (GTK_FILL),
\r
790 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
792 hseparator = gtk_hseparator_new ();
\r
793 gtk_widget_show (hseparator);
\r
794 gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 5, 6,
\r
795 (GtkAttachOptions) (GTK_FILL),
\r
796 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
798 hseparator = gtk_hseparator_new ();
\r
799 gtk_widget_show (hseparator);
\r
800 gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 5, 6,
\r
801 (GtkAttachOptions) (GTK_FILL),
\r
802 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
804 hseparator = gtk_hseparator_new ();
\r
805 gtk_widget_show (hseparator);
\r
806 gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 5, 6,
\r
807 (GtkAttachOptions) (GTK_FILL),
\r
808 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
810 hseparator = gtk_hseparator_new ();
\r
811 gtk_widget_show (hseparator);
\r
812 gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 7, 8,
\r
813 (GtkAttachOptions) (GTK_FILL),
\r
814 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
816 hseparator = gtk_hseparator_new ();
\r
817 gtk_widget_show (hseparator);
\r
818 gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 7, 8,
\r
819 (GtkAttachOptions) (GTK_FILL),
\r
820 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
822 hseparator = gtk_hseparator_new ();
\r
823 gtk_widget_show (hseparator);
\r
824 gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 7, 8,
\r
825 (GtkAttachOptions) (GTK_FILL),
\r
826 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
828 hseparator = gtk_hseparator_new ();
\r
829 gtk_widget_show (hseparator);
\r
830 gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 9, 10,
\r
831 (GtkAttachOptions) (GTK_FILL),
\r
832 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
834 hseparator = gtk_hseparator_new ();
\r
835 gtk_widget_show (hseparator);
\r
836 gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 9, 10,
\r
837 (GtkAttachOptions) (GTK_FILL),
\r
838 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
840 hseparator = gtk_hseparator_new ();
\r
841 gtk_widget_show (hseparator);
\r
842 gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 9, 10,
\r
843 (GtkAttachOptions) (GTK_FILL),
\r
844 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
846 hseparator = gtk_hseparator_new ();
\r
847 gtk_widget_show (hseparator);
\r
848 gtk_table_attach (GTK_TABLE (table1), hseparator, 1, 2, 11, 12,
\r
849 (GtkAttachOptions) (GTK_FILL),
\r
850 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
852 hseparator = gtk_hseparator_new ();
\r
853 gtk_widget_show (hseparator);
\r
854 gtk_table_attach (GTK_TABLE (table1), hseparator, 2, 3, 11, 12,
\r
855 (GtkAttachOptions) (GTK_FILL),
\r
856 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
858 hseparator = gtk_hseparator_new ();
\r
859 gtk_widget_show (hseparator);
\r
860 gtk_table_attach (GTK_TABLE (table1), hseparator, 3, 4, 11, 12,
\r
861 (GtkAttachOptions) (GTK_FILL),
\r
862 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
864 label = gtk_label_new ("Offset");
\r
865 gtk_widget_show (label);
\r
866 gtk_table_attach (GTK_TABLE (table1), label, 2, 3, 0, 1,
\r
867 (GtkAttachOptions) (GTK_FILL),
\r
868 (GtkAttachOptions) (0), 0, 0);
\r
870 label = gtk_label_new ("Step");
\r
871 gtk_widget_show (label);
\r
872 gtk_table_attach (GTK_TABLE (table1), label, 3, 4, 0, 1,
\r
873 (GtkAttachOptions) (GTK_FILL),
\r
874 (GtkAttachOptions) (0), 0, 0);
\r
876 eventbox = gtk_event_box_new ();
\r
877 gtk_widget_show (eventbox);
\r
878 gtk_table_attach (GTK_TABLE (table1), eventbox, 3, 4, 12, 13,
\r
879 (GtkAttachOptions) (GTK_FILL),
\r
880 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
882 match_grid_button = gtk_button_new_with_mnemonic ("Match Grid");
\r
883 gtk_widget_show (match_grid_button);
\r
884 gtk_container_add (GTK_CONTAINER (eventbox), match_grid_button);
\r
886 label = gtk_label_new ("Value");
\r
887 gtk_widget_show (label);
\r
888 gtk_table_attach (GTK_TABLE (table1), label, 1, 2, 0, 1,
\r
889 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
890 (GtkAttachOptions) (0), 0, 0);
\r
891 gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1);
\r
893 hseparator = gtk_hseparator_new ();
\r
894 gtk_widget_show (hseparator);
\r
895 gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 3, 4,
\r
896 (GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
\r
897 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
899 hseparator = gtk_hseparator_new ();
\r
900 gtk_widget_show (hseparator);
\r
901 gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 5, 6,
\r
902 (GtkAttachOptions) (GTK_FILL),
\r
903 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
905 hseparator = gtk_hseparator_new ();
\r
906 gtk_widget_show (hseparator);
\r
907 gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 7, 8,
\r
908 (GtkAttachOptions) (GTK_FILL),
\r
909 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
911 hseparator = gtk_hseparator_new ();
\r
912 gtk_widget_show (hseparator);
\r
913 gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 9, 10,
\r
914 (GtkAttachOptions) (GTK_FILL),
\r
915 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
917 hseparator = gtk_hseparator_new ();
\r
918 gtk_widget_show (hseparator);
\r
919 gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 11, 12,
\r
920 (GtkAttachOptions) (GTK_FILL),
\r
921 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
923 eventbox = gtk_event_box_new ();
\r
924 gtk_widget_show (eventbox);
\r
925 gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 4, 5,
\r
926 (GtkAttachOptions) (GTK_FILL),
\r
927 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
929 label = gtk_label_new ("V Shift: ");
\r
930 gtk_widget_show (label);
\r
931 gtk_container_add (GTK_CONTAINER (eventbox), label);
\r
932 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
933 gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
\r
935 eventbox = gtk_event_box_new ();
\r
936 gtk_widget_show (eventbox);
\r
937 gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 6, 7,
\r
938 (GtkAttachOptions) (GTK_FILL),
\r
939 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
941 label = gtk_label_new (" H Scale: ");
\r
942 gtk_widget_show (label);
\r
943 gtk_container_add (GTK_CONTAINER (eventbox), label);
\r
944 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
945 gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
\r
947 eventbox = gtk_event_box_new ();
\r
948 gtk_widget_show (eventbox);
\r
949 gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 8, 9,
\r
950 (GtkAttachOptions) (GTK_FILL),
\r
951 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
953 label = gtk_label_new ("V Scale: ");
\r
954 gtk_widget_show (label);
\r
955 gtk_container_add (GTK_CONTAINER (eventbox), label);
\r
956 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
957 gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
\r
959 eventbox = gtk_event_box_new ();
\r
960 gtk_widget_show (eventbox);
\r
961 gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 10, 11,
\r
962 (GtkAttachOptions) (GTK_FILL),
\r
963 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
965 label = gtk_label_new ("Rotate: ");
\r
966 gtk_widget_show (label);
\r
967 gtk_container_add (GTK_CONTAINER (eventbox), label);
\r
968 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
969 gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
\r
971 eventbox = gtk_event_box_new ();
\r
972 gtk_widget_show (eventbox);
\r
973 gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 2, 3,
\r
974 (GtkAttachOptions) (GTK_FILL),
\r
975 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
977 label = gtk_label_new ("H Shift: ");
\r
978 gtk_widget_show (label);
\r
979 gtk_container_add (GTK_CONTAINER (eventbox), label);
\r
980 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
981 gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
\r
983 hseparator = gtk_hseparator_new ();
\r
984 gtk_widget_show (hseparator);
\r
985 gtk_table_attach (GTK_TABLE (table1), hseparator, 0, 1, 1, 2,
\r
986 (GtkAttachOptions) (GTK_FILL),
\r
987 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
989 eventbox = gtk_event_box_new ();
\r
990 gtk_widget_show (eventbox);
\r
991 gtk_table_attach (GTK_TABLE (table1), eventbox, 1, 2, 12, 13,
\r
992 (GtkAttachOptions) (GTK_FILL),
\r
993 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
995 lock_valuechange_togglebutton = gtk_toggle_button_new_with_mnemonic ("UNLOCK");
\r
996 gtk_widget_show (lock_valuechange_togglebutton);
\r
997 gtk_container_add (GTK_CONTAINER (eventbox), lock_valuechange_togglebutton);
\r
1000 hshift_value_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0);
\r
1001 hshift_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_value_spinbutton_adj), 1, 2);
\r
1002 gtk_widget_show (hshift_value_spinbutton);
\r
1003 gtk_table_attach (GTK_TABLE (table1), hshift_value_spinbutton, 1, 2, 2, 3,
\r
1004 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1005 (GtkAttachOptions) (0), 0, 0);
\r
1006 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_value_spinbutton), GTK_UPDATE_IF_VALID);
\r
1007 gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hshift_value_spinbutton), TRUE);
\r
1008 gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), FALSE );
\r
1010 vshift_value_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0);
\r
1011 vshift_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_value_spinbutton_adj), 1, 2);
\r
1012 gtk_widget_show (vshift_value_spinbutton);
\r
1013 gtk_table_attach (GTK_TABLE (table1), vshift_value_spinbutton, 1, 2, 4, 5,
\r
1014 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1015 (GtkAttachOptions) (0), 0, 0);
\r
1016 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_value_spinbutton), GTK_UPDATE_IF_VALID);
\r
1017 gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vshift_value_spinbutton), TRUE);
\r
1018 gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), FALSE );
\r
1020 hscale_value_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0);
\r
1021 hscale_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_value_spinbutton_adj), 1, 4);
\r
1022 gtk_widget_show (hscale_value_spinbutton);
\r
1023 gtk_table_attach (GTK_TABLE (table1), hscale_value_spinbutton, 1, 2, 6, 7,
\r
1024 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1025 (GtkAttachOptions) (0), 0, 0);
\r
1026 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_value_spinbutton), GTK_UPDATE_IF_VALID);
\r
1027 gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hscale_value_spinbutton), TRUE);
\r
1028 gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), FALSE );
\r
1030 vscale_value_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0);
\r
1031 vscale_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_value_spinbutton_adj), 1, 4);
\r
1032 gtk_widget_show (vscale_value_spinbutton);
\r
1033 gtk_table_attach (GTK_TABLE (table1), vscale_value_spinbutton, 1, 2, 8, 9,
\r
1034 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1035 (GtkAttachOptions) (0), 0, 0);
\r
1036 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_value_spinbutton), GTK_UPDATE_IF_VALID);
\r
1037 gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vscale_value_spinbutton), TRUE);
\r
1038 gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), FALSE );
\r
1040 rotate_value_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0);
\r
1041 rotate_value_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_value_spinbutton_adj), 1, 0);
\r
1042 gtk_widget_show (rotate_value_spinbutton);
\r
1043 gtk_table_attach (GTK_TABLE (table1), rotate_value_spinbutton, 1, 2, 10, 11,
\r
1044 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1045 (GtkAttachOptions) (0), 0, 0);
\r
1046 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_value_spinbutton), GTK_UPDATE_IF_VALID);
\r
1047 gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rotate_value_spinbutton), TRUE);
\r
1048 gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), FALSE );
\r
1051 hshift_offset_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0);
\r
1052 hshift_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_offset_spinbutton_adj), 0, 2);
\r
1053 gtk_widget_show (hshift_offset_spinbutton);
\r
1054 gtk_table_attach (GTK_TABLE (table1), hshift_offset_spinbutton, 2, 3, 2, 3,
\r
1055 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1056 (GtkAttachOptions) (0), 4, 0);
\r
1057 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (hshift_offset_spinbutton), TRUE);
\r
1058 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_offset_spinbutton), GTK_UPDATE_IF_VALID);
\r
1059 gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hshift_offset_spinbutton), TRUE);
\r
1061 vshift_offset_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0);
\r
1062 vshift_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_offset_spinbutton_adj), 0, 2);
\r
1063 gtk_widget_show (vshift_offset_spinbutton);
\r
1064 gtk_table_attach (GTK_TABLE (table1), vshift_offset_spinbutton, 2, 3, 4, 5,
\r
1065 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1066 (GtkAttachOptions) (0), 4, 0);
\r
1067 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (vshift_offset_spinbutton), TRUE);
\r
1068 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_offset_spinbutton), GTK_UPDATE_IF_VALID);
\r
1069 gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vshift_offset_spinbutton), TRUE);
\r
1071 hscale_offset_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0);
\r
1072 hscale_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_offset_spinbutton_adj), 0, 4);
\r
1073 gtk_widget_show (hscale_offset_spinbutton);
\r
1074 gtk_table_attach (GTK_TABLE (table1), hscale_offset_spinbutton, 2, 3, 6, 7,
\r
1075 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1076 (GtkAttachOptions) (0), 4, 0);
\r
1077 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (hscale_offset_spinbutton), TRUE);
\r
1078 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_offset_spinbutton), GTK_UPDATE_IF_VALID);
\r
1079 gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (hscale_offset_spinbutton), TRUE);
\r
1081 vscale_offset_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0);
\r
1082 vscale_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_offset_spinbutton_adj), 0, 4);
\r
1083 gtk_widget_show (vscale_offset_spinbutton);
\r
1084 gtk_table_attach (GTK_TABLE (table1), vscale_offset_spinbutton, 2, 3, 8, 9,
\r
1085 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1086 (GtkAttachOptions) (0), 4, 0);
\r
1087 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (vscale_offset_spinbutton), TRUE);
\r
1088 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_offset_spinbutton), GTK_UPDATE_IF_VALID);
\r
1089 gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (vscale_offset_spinbutton), TRUE);
\r
1091 rotate_offset_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0);
\r
1092 rotate_offset_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_offset_spinbutton_adj), 0, 2);
\r
1093 gtk_widget_show (rotate_offset_spinbutton);
\r
1094 gtk_table_attach (GTK_TABLE (table1), rotate_offset_spinbutton, 2, 3, 10, 11,
\r
1095 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1096 (GtkAttachOptions) (0), 4, 0);
\r
1097 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (rotate_offset_spinbutton), TRUE);
\r
1098 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_offset_spinbutton), GTK_UPDATE_IF_VALID);
\r
1099 gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rotate_offset_spinbutton), TRUE);
\r
1102 hshift_step_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0);
\r
1103 hshift_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hshift_step_spinbutton_adj), 1, 2);
\r
1104 gtk_widget_show (hshift_step_spinbutton);
\r
1105 gtk_table_attach (GTK_TABLE (table1), hshift_step_spinbutton, 3, 4, 2, 3,
\r
1106 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1107 (GtkAttachOptions) (0), 0, 0);
\r
1108 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hshift_step_spinbutton), GTK_UPDATE_IF_VALID);
\r
1110 vshift_step_spinbutton_adj = gtk_adjustment_new (0.0, -8192.0, 8192.0, 2.0, 8.0, 8.0);
\r
1111 vshift_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vshift_step_spinbutton_adj), 1, 2);
\r
1112 gtk_widget_show (vshift_step_spinbutton);
\r
1113 gtk_table_attach (GTK_TABLE (table1), vshift_step_spinbutton, 3, 4, 4, 5,
\r
1114 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1115 (GtkAttachOptions) (0), 0, 0);
\r
1116 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vshift_step_spinbutton), GTK_UPDATE_IF_VALID);
\r
1118 hscale_step_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0);
\r
1119 hscale_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (hscale_step_spinbutton_adj), 1, 4);
\r
1120 gtk_widget_show (hscale_step_spinbutton);
\r
1121 gtk_table_attach (GTK_TABLE (table1), hscale_step_spinbutton, 3, 4, 6, 7,
\r
1122 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1123 (GtkAttachOptions) (0), 0, 0);
\r
1124 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (hscale_step_spinbutton), GTK_UPDATE_IF_VALID);
\r
1126 vscale_step_spinbutton_adj = gtk_adjustment_new (0.0, -1024.0, 1024.0, 1.0, 4.0, 4.0);
\r
1127 vscale_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (vscale_step_spinbutton_adj), 1, 4);
\r
1128 gtk_widget_show (vscale_step_spinbutton);
\r
1129 gtk_table_attach (GTK_TABLE (table1), vscale_step_spinbutton, 3, 4, 8, 9,
\r
1130 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1131 (GtkAttachOptions) (0), 0, 0);
\r
1132 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (vscale_step_spinbutton), GTK_UPDATE_IF_VALID);
\r
1134 rotate_step_spinbutton_adj = gtk_adjustment_new (0.0, -360.0, 360.0, 1.0, 10.0, 10.0);
\r
1135 rotate_step_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (rotate_step_spinbutton_adj), 1, 2);
\r
1136 gtk_widget_show (rotate_step_spinbutton);
\r
1137 gtk_table_attach (GTK_TABLE (table1), rotate_step_spinbutton, 3, 4, 10, 11,
\r
1138 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1139 (GtkAttachOptions) (0), 0, 0);
\r
1140 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (rotate_step_spinbutton), GTK_UPDATE_IF_VALID);
\r
1142 eventbox = gtk_event_box_new ();
\r
1143 gtk_widget_show (eventbox);
\r
1144 gtk_table_attach (GTK_TABLE (table1), eventbox, 2, 3, 12, 13,
\r
1145 (GtkAttachOptions) (0),
\r
1146 (GtkAttachOptions) (0), 0, 0);
\r
1148 eventbox = gtk_event_box_new ();
\r
1149 gtk_widget_show (eventbox);
\r
1150 gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 12, 13,
\r
1151 (GtkAttachOptions) (0),
\r
1152 (GtkAttachOptions) (0), 0, 0);
\r
1154 eventbox = gtk_event_box_new ();
\r
1155 gtk_widget_show (eventbox);
\r
1156 gtk_table_attach (GTK_TABLE (table1), eventbox, 0, 1, 0, 1,
\r
1157 (GtkAttachOptions) (0),
\r
1158 (GtkAttachOptions) (0), 0, 0);
\r
1160 viewport7 = gtk_viewport_new (NULL, NULL);
\r
1161 gtk_widget_show (viewport7);
\r
1162 gtk_box_pack_start (GTK_BOX (vbox7), viewport7, FALSE, TRUE, 0);
\r
1163 gtk_container_set_border_width (GTK_CONTAINER (viewport7), 2);
\r
1164 gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport7), GTK_SHADOW_ETCHED_IN);
\r
1166 table4 = gtk_table_new (4, 7, FALSE);
\r
1167 gtk_widget_show (table4);
\r
1168 gtk_container_add (GTK_CONTAINER (viewport7), table4);
\r
1170 viewport5 = gtk_viewport_new (NULL, NULL);
\r
1171 gtk_widget_show (viewport5);
\r
1172 gtk_table_attach (GTK_TABLE (table4), viewport5, 1, 7, 0, 4,
\r
1173 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1174 (GtkAttachOptions) (0), 0, 0);
\r
1175 gtk_container_set_border_width (GTK_CONTAINER (viewport5), 6);
\r
1176 gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport5), GTK_SHADOW_ETCHED_OUT);
\r
1178 table5 = gtk_table_new (2, 3, FALSE);
\r
1179 gtk_widget_show (table5);
\r
1180 gtk_container_add (GTK_CONTAINER (viewport5), table5);
\r
1181 gtk_container_set_border_width (GTK_CONTAINER (table5), 5);
\r
1182 gtk_table_set_col_spacings (GTK_TABLE (table5), 2);
\r
1184 label = gtk_label_new ("Height");
\r
1185 gtk_widget_show (label);
\r
1186 gtk_table_attach (GTK_TABLE (table5), label, 2, 3, 0, 1,
\r
1187 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1188 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
1189 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
1190 gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1);
\r
1192 label = gtk_label_new ("Width");
\r
1193 gtk_widget_show (label);
\r
1194 gtk_table_attach (GTK_TABLE (table5), label, 1, 2, 0, 1,
\r
1195 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1196 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
1197 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
1198 gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1);
\r
1200 fit_width_spinbutton_adj = gtk_adjustment_new (1, 1, 32, 1, 10, 10);
\r
1201 fit_width_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (fit_width_spinbutton_adj), 1, 0);
\r
1202 gtk_widget_show (fit_width_spinbutton);
\r
1203 gtk_table_attach (GTK_TABLE (table5), fit_width_spinbutton, 1, 2, 1, 2,
\r
1204 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1205 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
1206 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fit_width_spinbutton), TRUE);
\r
1207 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fit_width_spinbutton), GTK_UPDATE_IF_VALID);
\r
1209 fit_height_spinbutton_adj = gtk_adjustment_new (1, 1, 32, 1, 10, 10);
\r
1210 fit_height_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (fit_height_spinbutton_adj), 1, 0);
\r
1211 gtk_widget_show (fit_height_spinbutton);
\r
1212 gtk_table_attach (GTK_TABLE (table5), fit_height_spinbutton, 2, 3, 1, 2,
\r
1213 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1214 (GtkAttachOptions) (GTK_FILL), 3, 0);
\r
1215 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fit_height_spinbutton), TRUE);
\r
1216 gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fit_height_spinbutton), GTK_UPDATE_IF_VALID);
\r
1218 eventbox = gtk_event_box_new ();
\r
1219 gtk_widget_show (eventbox);
\r
1220 gtk_table_attach (GTK_TABLE (table5), eventbox, 0, 1, 0, 1,
\r
1221 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1222 (GtkAttachOptions) (GTK_FILL), 0, 0);
\r
1224 eventbox = gtk_event_box_new ();
\r
1225 gtk_widget_show (eventbox);
\r
1226 gtk_table_attach (GTK_TABLE (table5), eventbox, 0, 1, 1, 2,
\r
1227 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1228 (GtkAttachOptions) (GTK_FILL), 4, 0);
\r
1230 fit_button = gtk_button_new_with_mnemonic (" Fit ");
\r
1231 gtk_widget_show (fit_button);
\r
1232 gtk_container_add (GTK_CONTAINER (eventbox), fit_button);
\r
1234 viewport6 = gtk_viewport_new (NULL, NULL);
\r
1235 gtk_widget_show (viewport6);
\r
1236 gtk_table_attach (GTK_TABLE (table4), viewport6, 0, 1, 0, 4,
\r
1237 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1238 (GtkAttachOptions) (0), 0, 0);
\r
1239 gtk_container_set_border_width (GTK_CONTAINER (viewport6), 4);
\r
1240 gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport6), GTK_SHADOW_NONE);
\r
1242 table7 = gtk_table_new (2, 1, FALSE);
\r
1243 gtk_widget_show (table7);
\r
1244 gtk_container_add (GTK_CONTAINER (viewport6), table7);
\r
1246 eventbox = gtk_event_box_new ();
\r
1247 gtk_widget_show (eventbox);
\r
1248 gtk_table_attach (GTK_TABLE (table7), eventbox, 0, 1, 0, 2,
\r
1249 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
\r
1250 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
\r
1252 axial_button = gtk_button_new_with_mnemonic ("Axial");
\r
1253 gtk_widget_show (axial_button);
\r
1254 gtk_container_add (GTK_CONTAINER (eventbox), axial_button);
\r
1255 gtk_widget_set_size_request (axial_button, 56, 29);
\r
1256 gtk_container_set_border_width (GTK_CONTAINER (axial_button), 4);
\r
1258 // Fit in Flags sub-dialog
\r
1259 Create_Heretic2FlagsDialog(vbox7);
\r
1261 viewport10 = gtk_viewport_new (NULL, NULL);
\r
1262 gtk_widget_show (viewport10);
\r
1263 gtk_box_pack_start (GTK_BOX (vbox7), viewport10, FALSE, TRUE, 0);
\r
1264 gtk_container_set_border_width (GTK_CONTAINER (viewport10), 2);
\r
1265 gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport10), GTK_SHADOW_ETCHED_IN);
\r
1267 hbuttonbox1 = gtk_hbutton_box_new ();
\r
1268 gtk_widget_show (hbuttonbox1);
\r
1269 gtk_container_add (GTK_CONTAINER (viewport10), hbuttonbox1);
\r
1270 gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 4);
\r
1271 gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD);
\r
1273 done_button = gtk_button_new ();
\r
1274 gtk_widget_show (done_button);
\r
1275 gtk_container_add (GTK_CONTAINER (hbuttonbox1), done_button);
\r
1276 GTK_WIDGET_SET_FLAGS (done_button, GTK_CAN_DEFAULT);
\r
1278 alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0);
\r
1279 gtk_widget_show (alignment1);
\r
1280 gtk_container_add (GTK_CONTAINER (done_button), alignment1);
\r
1282 hbox2 = gtk_hbox_new (FALSE, 2);
\r
1283 gtk_widget_show (hbox2);
\r
1284 gtk_container_add (GTK_CONTAINER (alignment1), hbox2);
\r
1286 image1 = gtk_image_new_from_stock ("gtk-yes", GTK_ICON_SIZE_BUTTON);
\r
1287 gtk_widget_show (image1);
\r
1288 gtk_box_pack_start (GTK_BOX (hbox2), image1, FALSE, FALSE, 0);
\r
1290 label = gtk_label_new_with_mnemonic ("Done");
\r
1291 gtk_widget_show (label);
\r
1292 gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
\r
1293 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
1295 apply_button = gtk_button_new ();
\r
1296 gtk_widget_show (apply_button);
\r
1297 gtk_container_add (GTK_CONTAINER (hbuttonbox1), apply_button);
\r
1298 GTK_WIDGET_SET_FLAGS (apply_button, GTK_CAN_DEFAULT);
\r
1300 alignment3 = gtk_alignment_new (0.5, 0.5, 0, 0);
\r
1301 gtk_widget_show (alignment3);
\r
1302 gtk_container_add (GTK_CONTAINER (apply_button), alignment3);
\r
1304 hbox4 = gtk_hbox_new (FALSE, 2);
\r
1305 gtk_widget_show (hbox4);
\r
1306 gtk_container_add (GTK_CONTAINER (alignment3), hbox4);
\r
1308 image3 = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON);
\r
1309 gtk_widget_show (image3);
\r
1310 gtk_box_pack_start (GTK_BOX (hbox4), image3, FALSE, FALSE, 0);
\r
1312 label = gtk_label_new_with_mnemonic ("Apply");
\r
1313 gtk_widget_show (label);
\r
1314 gtk_box_pack_start (GTK_BOX (hbox4), label, FALSE, FALSE, 0);
\r
1315 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
1317 cancel_button = gtk_button_new ();
\r
1318 gtk_widget_show (cancel_button);
\r
1319 gtk_container_add (GTK_CONTAINER (hbuttonbox1), cancel_button);
\r
1320 GTK_WIDGET_SET_FLAGS (cancel_button, GTK_CAN_DEFAULT);
\r
1322 alignment2 = gtk_alignment_new (0.5, 0.5, 0, 0);
\r
1323 gtk_widget_show (alignment2);
\r
1324 gtk_container_add (GTK_CONTAINER (cancel_button), alignment2);
\r
1326 hbox3 = gtk_hbox_new (FALSE, 2);
\r
1327 gtk_widget_show (hbox3);
\r
1328 gtk_container_add (GTK_CONTAINER (alignment2), hbox3);
\r
1330 image2 = gtk_image_new_from_stock ("gtk-no", GTK_ICON_SIZE_BUTTON);
\r
1331 gtk_widget_show (image2);
\r
1332 gtk_box_pack_start (GTK_BOX (hbox3), image2, FALSE, FALSE, 0);
\r
1334 label = gtk_label_new_with_mnemonic ("Cancel");
\r
1335 gtk_widget_show (label);
\r
1336 gtk_box_pack_start (GTK_BOX (hbox3), label, FALSE, FALSE, 0);
\r
1337 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
\r
1340 g_signal_connect ( (gpointer) SurfaceInspector,
\r
1342 G_CALLBACK (delete_event_callback),
\r
1344 g_signal_connect ((gpointer) SurfaceInspector, "destroy",
\r
1345 G_CALLBACK (gtk_widget_destroy),
\r
1348 g_signal_connect ((gpointer) texture_combo_entry, "key_press_event",
\r
1349 G_CALLBACK (on_texture_combo_entry_key_press_event),
\r
1351 g_signal_connect ((gpointer) texture_combo_entry, "activate",
\r
1352 G_CALLBACK (on_texture_combo_entry_activate),
\r
1356 g_signal_connect ((gpointer) hshift_offset_spinbutton, "value_changed",
\r
1357 G_CALLBACK (on_hshift_offset_spinbutton_value_changed),
\r
1359 g_signal_connect ((gpointer) vshift_offset_spinbutton, "value_changed",
\r
1360 G_CALLBACK (on_vshift_offset_spinbutton_value_changed),
\r
1362 g_signal_connect ((gpointer) hscale_offset_spinbutton, "value_changed",
\r
1363 G_CALLBACK (on_hscale_offset_spinbutton_value_changed),
\r
1365 g_signal_connect ((gpointer) vscale_offset_spinbutton, "value_changed",
\r
1366 G_CALLBACK (on_vscale_offset_spinbutton_value_changed),
\r
1368 g_signal_connect ((gpointer) rotate_offset_spinbutton, "value_changed",
\r
1369 G_CALLBACK (on_rotate_offset_spinbutton_value_changed),
\r
1372 g_signal_connect ((gpointer) hshift_value_spinbutton, "value_changed",
\r
1373 G_CALLBACK (on_hshift_value_spinbutton_value_changed),
\r
1375 g_signal_connect ((gpointer) vshift_value_spinbutton, "value_changed",
\r
1376 G_CALLBACK (on_vshift_value_spinbutton_value_changed),
\r
1378 g_signal_connect ((gpointer) hscale_value_spinbutton, "value_changed",
\r
1379 G_CALLBACK (on_hscale_value_spinbutton_value_changed),
\r
1381 g_signal_connect ((gpointer) vscale_value_spinbutton, "value_changed",
\r
1382 G_CALLBACK (on_vscale_value_spinbutton_value_changed),
\r
1384 g_signal_connect ((gpointer) rotate_value_spinbutton, "value_changed",
\r
1385 G_CALLBACK (on_rotate_value_spinbutton_value_changed),
\r
1388 g_signal_connect ((gpointer) hshift_step_spinbutton, "value_changed",
\r
1389 G_CALLBACK (on_hshift_step_spinbutton_value_changed),
\r
1391 g_signal_connect ((gpointer) vshift_step_spinbutton, "value_changed",
\r
1392 G_CALLBACK (on_vshift_step_spinbutton_value_changed),
\r
1394 g_signal_connect ((gpointer) hscale_step_spinbutton, "value_changed",
\r
1395 G_CALLBACK (on_hscale_step_spinbutton_value_changed),
\r
1397 g_signal_connect ((gpointer) vscale_step_spinbutton, "value_changed",
\r
1398 G_CALLBACK (on_vscale_step_spinbutton_value_changed),
\r
1400 g_signal_connect ((gpointer) rotate_step_spinbutton, "value_changed",
\r
1401 G_CALLBACK (on_rotate_step_spinbutton_value_changed),
\r
1404 g_signal_connect ((gpointer) match_grid_button, "clicked",
\r
1405 G_CALLBACK (on_match_grid_button_clicked),
\r
1407 g_signal_connect ((gpointer) lock_valuechange_togglebutton, "toggled",
\r
1408 G_CALLBACK (on_lock_valuechange_togglebutton_toggled),
\r
1411 g_signal_connect ((gpointer) fit_width_spinbutton, "value_changed",
\r
1412 G_CALLBACK (on_fit_width_spinbutton_value_changed),
\r
1414 g_signal_connect ((gpointer) fit_height_spinbutton, "value_changed",
\r
1415 G_CALLBACK (on_fit_height_spinbutton_value_changed),
\r
1417 g_signal_connect ((gpointer) fit_button, "clicked",
\r
1418 G_CALLBACK (on_fit_button_clicked),
\r
1421 g_signal_connect ((gpointer) axial_button, "clicked",
\r
1422 G_CALLBACK (on_axial_button_clicked),
\r
1425 g_signal_connect ((gpointer) done_button, "clicked",
\r
1426 G_CALLBACK (on_done_button_clicked),
\r
1428 g_signal_connect ((gpointer) apply_button, "clicked",
\r
1429 G_CALLBACK (on_apply_button_clicked),
\r
1431 g_signal_connect ((gpointer) cancel_button, "clicked",
\r
1432 G_CALLBACK (on_cancel_button_clicked),
\r
1436 return SurfaceInspector;
\r
1441 gboolean on_texture_combo_entry_key_press_event (GtkWidget *widget, GdkEventKey *event,
\r
1442 gpointer user_data)
\r
1444 // Have Tab activate selection as well as Return
\r
1445 if (event->keyval == GDK_Tab)
\r
1446 g_signal_emit_by_name ( texture_combo_entry, "activate" );
\r
1451 void on_texture_combo_entry_activate (GtkEntry *entry, gpointer user_data)
\r
1453 texdef_t* tmp_texdef;
\r
1454 texdef_t* tmp_orig_texdef;
\r
1455 texdef_to_face_t* temp_texdef_face_list;
\r
1456 char text[128] = { 0 };
\r
1458 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1460 // activate only on entry change
\r
1461 strcpy( text, gtk_entry_get_text(entry));
\r
1462 if ( strcmp( old_texture_entry, text ))
\r
1464 // Check for spaces in shader name
\r
1465 if (text[0] <= ' ' || strchr(text, ' '))
\r
1466 Sys_FPrintf(SYS_WRN, "WARNING: spaces in shader names are not allowed, ignoring '%s'\n", text);
\r
1469 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1471 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1472 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1473 strcpy( old_texture_entry, text );
\r
1474 tmp_texdef->SetName( text );
\r
1483 static void on_hshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1485 texdef_t* tmp_texdef;
\r
1486 texdef_t* tmp_orig_texdef;
\r
1487 texdef_to_face_t* temp_texdef_face_list;
\r
1489 texdef_offset.shift[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_offset_spinbutton) );
\r
1491 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1493 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1495 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1496 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1497 if (is_HShift_conflicting)
\r
1498 tmp_texdef->shift[0] = tmp_orig_texdef->shift[0] + texdef_offset.shift[0];
\r
1500 tmp_texdef->shift[0] = texdef_SI_values.shift[0] + texdef_offset.shift[0];
\r
1506 static void on_vshift_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1508 texdef_t* tmp_texdef;
\r
1509 texdef_t* tmp_orig_texdef;
\r
1510 texdef_to_face_t* temp_texdef_face_list;
\r
1512 texdef_offset.shift[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_offset_spinbutton) );
\r
1514 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1516 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1518 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1519 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1520 if (is_VShift_conflicting)
\r
1521 tmp_texdef->shift[1] = tmp_orig_texdef->shift[1] + texdef_offset.shift[1];
\r
1523 tmp_texdef->shift[1] = texdef_SI_values.shift[1] + texdef_offset.shift[1];
\r
1530 static void on_hscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1532 texdef_t* tmp_texdef;
\r
1533 texdef_t* tmp_orig_texdef;
\r
1534 texdef_to_face_t* temp_texdef_face_list;
\r
1536 texdef_offset.scale[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_offset_spinbutton) );
\r
1538 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1540 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1542 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1543 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1544 if (is_HScale_conflicting)
\r
1545 tmp_texdef->scale[0] = tmp_orig_texdef->scale[0] + texdef_offset.scale[0];
\r
1547 tmp_texdef->scale[0] = texdef_SI_values.scale[0] + texdef_offset.scale[0];
\r
1555 static void on_vscale_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1557 texdef_t* tmp_texdef;
\r
1558 texdef_t* tmp_orig_texdef;
\r
1559 texdef_to_face_t* temp_texdef_face_list;
\r
1561 texdef_offset.scale[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_offset_spinbutton) );
\r
1563 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1565 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1567 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1568 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1569 if (is_VScale_conflicting)
\r
1570 tmp_texdef->scale[1] = tmp_orig_texdef->scale[1] + texdef_offset.scale[1];
\r
1572 tmp_texdef->scale[1] = texdef_SI_values.scale[1] + texdef_offset.scale[1];
\r
1579 static void on_rotate_offset_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1581 texdef_t* tmp_texdef;
\r
1582 texdef_t* tmp_orig_texdef;
\r
1583 texdef_to_face_t* temp_texdef_face_list;
\r
1585 texdef_offset.rotate = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_offset_spinbutton) );
\r
1587 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1589 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1591 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1592 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1593 if (is_Rotate_conflicting)
\r
1594 tmp_texdef->rotate = tmp_orig_texdef->rotate + texdef_offset.rotate;
\r
1596 tmp_texdef->rotate = texdef_SI_values.rotate + texdef_offset.rotate;
\r
1605 static void on_match_grid_button_clicked (GtkButton *button, gpointer user_data)
\r
1607 float hscale, vscale;
\r
1609 if( !strcmp(gtk_entry_get_text (GTK_ENTRY (hscale_value_spinbutton)), "") )
\r
1612 hscale = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_value_spinbutton) );
\r
1614 if( !strcmp( gtk_entry_get_text (GTK_ENTRY (vscale_value_spinbutton)), "") )
\r
1617 vscale = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_value_spinbutton) );
\r
1618 DoSnapTToGrid (hscale, vscale);
\r
1622 // Lock out changes to Value
\r
1623 static void on_lock_valuechange_togglebutton_toggled (GtkToggleButton *togglebutton, gpointer user_data)
\r
1627 is_Locked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lock_valuechange_togglebutton));
\r
1629 gtk_widget_set_sensitive( GTK_WIDGET( hscale_value_spinbutton ), is_Locked );
\r
1630 gtk_widget_set_sensitive( GTK_WIDGET( vscale_value_spinbutton ), is_Locked );
\r
1631 gtk_widget_set_sensitive( GTK_WIDGET( hshift_value_spinbutton ), is_Locked );
\r
1632 gtk_widget_set_sensitive( GTK_WIDGET( vshift_value_spinbutton ), is_Locked );
\r
1633 gtk_widget_set_sensitive( GTK_WIDGET( rotate_value_spinbutton ), is_Locked );
\r
1638 static void on_hshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1640 texdef_t* tmp_texdef;
\r
1641 texdef_t* tmp_orig_texdef;
\r
1642 texdef_to_face_t* temp_texdef_face_list;
\r
1644 texdef_SI_values.shift[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_value_spinbutton) );
\r
1646 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1648 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1650 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1651 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1652 tmp_texdef->shift[0] = texdef_SI_values.shift[0] + texdef_offset.shift[0];
\r
1653 is_HShift_conflicting = FALSE;
\r
1659 static void on_vshift_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1661 texdef_t* tmp_texdef;
\r
1662 texdef_t* tmp_orig_texdef;
\r
1663 texdef_to_face_t* temp_texdef_face_list;
\r
1665 texdef_SI_values.shift[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_value_spinbutton) );
\r
1667 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1669 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1671 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1672 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1673 tmp_texdef->shift[1] = texdef_SI_values.shift[1] + texdef_offset.shift[1];
\r
1674 is_VShift_conflicting = FALSE;
\r
1680 static void on_hscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1682 texdef_t* tmp_texdef;
\r
1683 texdef_t* tmp_orig_texdef;
\r
1684 texdef_to_face_t* temp_texdef_face_list;
\r
1686 texdef_SI_values.scale[0] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_value_spinbutton) );
\r
1688 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1690 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1692 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1693 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1694 tmp_texdef->scale[0] = texdef_SI_values.scale[0] + texdef_offset.scale[0];
\r
1695 is_HScale_conflicting = FALSE;
\r
1701 static void on_vscale_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1703 texdef_t* tmp_texdef;
\r
1704 texdef_t* tmp_orig_texdef;
\r
1705 texdef_to_face_t* temp_texdef_face_list;
\r
1707 texdef_SI_values.scale[1] = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_value_spinbutton) );
\r
1709 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1711 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1713 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1714 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1715 tmp_texdef->scale[1] = texdef_SI_values.scale[1] + texdef_offset.scale[1];
\r
1716 is_VScale_conflicting = FALSE;
\r
1722 static void on_rotate_value_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1724 texdef_t* tmp_texdef;
\r
1725 texdef_t* tmp_orig_texdef;
\r
1726 texdef_to_face_t* temp_texdef_face_list;
\r
1728 texdef_SI_values.rotate = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_value_spinbutton) );
\r
1730 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1732 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1734 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1735 tmp_orig_texdef = (texdef_t *) &temp_texdef_face_list->orig_texdef;
\r
1736 tmp_texdef->rotate = texdef_SI_values.rotate + texdef_offset.rotate;
\r
1737 is_Rotate_conflicting = FALSE;
\r
1745 static void on_hshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1748 GtkAdjustment * adjust;
\r
1750 if (!g_bListenChanged)
\r
1753 l_pIncrement = Get_SI_Inc();
\r
1756 Sys_Printf("OnIncrementChanged HShift\n");
\r
1759 val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hshift_step_spinbutton) ) ;
\r
1760 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hshift_offset_spinbutton ));
\r
1761 adjust->step_increment = val;
\r
1762 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hshift_value_spinbutton ));
\r
1763 adjust->step_increment = val;
\r
1764 l_pIncrement->shift[0] = val;
\r
1767 static void on_vshift_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1770 GtkAdjustment * adjust;
\r
1772 if (!g_bListenChanged)
\r
1775 l_pIncrement = Get_SI_Inc();
\r
1778 Sys_Printf("OnIncrementChanged VShift\n");
\r
1781 val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vshift_step_spinbutton) ) ;
\r
1782 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vshift_offset_spinbutton ));
\r
1783 adjust->step_increment = val;
\r
1784 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vshift_value_spinbutton ));
\r
1785 adjust->step_increment = val;
\r
1786 l_pIncrement->shift[1] = val;
\r
1789 static void on_hscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1792 GtkAdjustment * adjust;
\r
1794 if (!g_bListenChanged)
\r
1797 l_pIncrement = Get_SI_Inc();
\r
1800 Sys_Printf("OnIncrementChanged HShift\n");
\r
1803 val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(hscale_step_spinbutton) ) ;
\r
1804 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hscale_offset_spinbutton ));
\r
1805 adjust->step_increment = val;
\r
1806 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( hscale_value_spinbutton ));
\r
1807 adjust->step_increment = val;
\r
1808 l_pIncrement->scale[0] = val;
\r
1811 static void on_vscale_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1814 GtkAdjustment * adjust;
\r
1816 if (!g_bListenChanged)
\r
1819 l_pIncrement = Get_SI_Inc();
\r
1822 Sys_Printf("OnIncrementChanged HShift\n");
\r
1825 val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(vscale_step_spinbutton) ) ;
\r
1826 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vscale_offset_spinbutton ));
\r
1827 adjust->step_increment = val;
\r
1828 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( vscale_value_spinbutton ));
\r
1829 adjust->step_increment = val;
\r
1830 l_pIncrement->scale[1] = val;
\r
1833 static void on_rotate_step_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1836 GtkAdjustment * adjust;
\r
1838 if (!g_bListenChanged)
\r
1841 l_pIncrement = Get_SI_Inc();
\r
1844 Sys_Printf("OnIncrementChanged HShift\n");
\r
1847 val = gtk_spin_button_get_value ( GTK_SPIN_BUTTON(rotate_step_spinbutton) ) ;
\r
1848 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( rotate_offset_spinbutton ));
\r
1849 adjust->step_increment = val;
\r
1850 adjust = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON ( rotate_value_spinbutton ));
\r
1851 adjust->step_increment = val;
\r
1852 l_pIncrement->rotate = val;
\r
1857 static void on_fit_width_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1859 m_nWidth = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(fit_width_spinbutton) );
\r
1862 static void on_fit_height_spinbutton_value_changed (GtkSpinButton *spinbutton, gpointer user_data)
\r
1864 m_nHeight = gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(fit_height_spinbutton) );
\r
1867 static void on_fit_button_clicked (GtkButton *button, gpointer user_data)
\r
1869 FaceList_FitTexture(get_texdef_face_list(), m_nHeight, m_nWidth);
\r
1870 Sys_UpdateWindows(W_ALL);
\r
1875 static void on_axial_button_clicked (GtkButton *button, gpointer user_data)
\r
1877 texdef_t* tmp_texdef;
\r
1878 texdef_t* tmp_orig_texdef;
\r
1879 texdef_to_face_t* temp_texdef_face_list;
\r
1881 if (!texdef_face_list_empty() && g_bListenChanged)
\r
1883 for (temp_texdef_face_list = get_texdef_face_list(); temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
\r
1885 tmp_texdef = (texdef_t *) &temp_texdef_face_list->texdef;
\r
1886 tmp_texdef->shift[0] = 0.0;
\r
1887 tmp_texdef->shift[1] = 0.0;
\r
1888 tmp_texdef->scale[0] = 0.5;
\r
1889 tmp_texdef->scale[1] = 0.5;
\r
1890 tmp_texdef->rotate = 0.0;
\r
1894 SetTexdef_FaceList( get_texdef_face_list(), FALSE, TRUE );
\r
1895 Sys_UpdateWindows(W_ALL);
\r
1900 static void on_done_button_clicked (GtkButton *button, gpointer user_data)
\r
1902 if ( !texdef_face_list_empty() )
\r
1905 Sys_UpdateWindows(W_ALL);
\r
1908 static void on_apply_button_clicked (GtkButton *button, gpointer user_data)
\r
1910 if (!g_bListenChanged)
\r
1913 if ( !texdef_face_list_empty() )
\r
1915 GetTexMods (TRUE);
\r
1916 Sys_UpdateWindows(W_CAMERA);
\r
1917 GetTexdefInfo_from_Radiant();
\r
1922 static void on_cancel_button_clicked (GtkButton *button, gpointer user_data)
\r
1924 texturewin = Texturewin ();
\r
1925 texturewin->texdef = g_old_texdef;
\r
1926 // cancel the last do if we own it
\r
1927 if ( (m_nUndoId == Undo_GetUndoId()) && ( m_nUndoId != 0 ))
\r
1930 Sys_Printf("OnCancel calling Undo_Undo\n");
\r
1932 g_bListenUpdate = false;
\r
1934 g_bListenUpdate = true;
\r