Skip to content
This repository has been archived by the owner on Jun 16, 2019. It is now read-only.

Commit

Permalink
Ctrl+Shift+PgUp/PGDn Rotates Textures by 1deg (+1 Warn fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
AEonZR committed Jan 8, 2010
1 parent 9f9cee3 commit eb90f83
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
19 changes: 18 additions & 1 deletion radiant/mainframe.cpp
Expand Up @@ -229,6 +229,8 @@ SCommandInfo g_Commands[] =
{"ZZoomIn", GDK_Delete, 0x04, ID_VIEW_ZZOOMIN, "menu_view_zzoomin"},
{"TexRotateClock", GDK_Next, 0x01, ID_SELECTION_TEXTURE_ROTATECLOCK, "menu_selection_texture_rotateclock"},
{"TexRotateCounter", GDK_Prior, 0x01, ID_SELECTION_TEXTURE_ROTATECOUNTER, "menu_selection_texture_rotatecounter"},
{"TexRotateClock1deg", GDK_Next, 0x05, ID_SELECTION_TEXTURE_ROTATECLOCK_1DEG, "menu_selection_texture_rotateclock_1deg"},
{"TexRotateCounter1deg", GDK_Prior, 0x05, ID_SELECTION_TEXTURE_ROTATECOUNTER_1DEG, "menu_selection_texture_rotatecounter_1deg"},
{"TexScaleUp", GDK_Up, 0x04, ID_SELECTION_TEXTURE_SCALEUP, "menu_selection_texture_scaleup"},
{"TexScaleDown", GDK_Down, 0x04, ID_SELECTION_TEXTURE_SCALEDOWN, "menu_selection_texture_scaledown"},
{"TexShiftLeft", GDK_Left, 0x01, ID_SELECTION_TEXTURE_SHIFTLEFT, "menu_selection_texture_shiftleft"},
Expand Down Expand Up @@ -675,6 +677,8 @@ gint HandleCommand (GtkWidget *widget, gpointer data)
case ID_SELECTION_TEXTURE_FIT: g_pParentWnd->OnSelectionTextureFit (); break;
case ID_SELECTION_TEXTURE_ROTATECLOCK: g_pParentWnd->OnSelectionTextureRotateclock (); break;
case ID_SELECTION_TEXTURE_ROTATECOUNTER: g_pParentWnd->OnSelectionTextureRotatecounter (); break;
case ID_SELECTION_TEXTURE_ROTATECLOCK_1DEG: g_pParentWnd->OnSelectionTextureRotateclock1deg (); break;
case ID_SELECTION_TEXTURE_ROTATECOUNTER_1DEG: g_pParentWnd->OnSelectionTextureRotatecounter1deg (); break;
case ID_SELECTION_TEXTURE_SCALEUP: g_pParentWnd->OnSelectionTextureScaleup (); break;
case ID_SELECTION_TEXTURE_SCALEDOWN: g_pParentWnd->OnSelectionTextureScaledown (); break;
case ID_SELECTION_TEXTURE_SHIFTLEFT: g_pParentWnd->OnSelectionTextureShiftleft (); break;
Expand Down Expand Up @@ -1640,6 +1644,8 @@ void MainFrame::create_main_menu (GtkWidget *window, GtkWidget *vbox)
create_menu_item_with_mnemonic (menu, "MouseRotate", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECT_MOUSEROTATE);
create_menu_item_with_mnemonic (menu, "TexRotateClock", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_ROTATECLOCK);
create_menu_item_with_mnemonic (menu, "TexRotateCounter", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_ROTATECOUNTER);
create_menu_item_with_mnemonic (menu, "TexRotateClock1deg", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_ROTATECLOCK_1DEG);
create_menu_item_with_mnemonic (menu, "TexRotateCounter1deg", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_ROTATECOUNTER_1DEG);
create_menu_item_with_mnemonic (menu, "TexScaleUp", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SCALEUP);
create_menu_item_with_mnemonic (menu, "TexScaleDown", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SCALEDOWN);
create_menu_item_with_mnemonic (menu, "TexShiftLeft", GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_TEXTURE_SHIFTLEFT);
Expand Down Expand Up @@ -7156,7 +7162,7 @@ void MainFrame::OnSelectFuncGroup()
// check to see if the selected brush is part of a func group
// if it is, deselect everything and reselect the next brush
// in the group
brush_t *b2, *b = selected_brushes.next;
brush_t *b = selected_brushes.next;
entity_t * e;
if (b != &selected_brushes)
{
Expand Down Expand Up @@ -7360,6 +7366,17 @@ void MainFrame::OnSelectionTextureRotatecounter()
Select_RotateTexture(-abs(g_PrefsDlg.m_nRotation));
}

// AEon: Fixed texture rotation by 1°
void MainFrame::OnSelectionTextureRotateclock1deg()
{
Select_RotateTexture(1);
}

void MainFrame::OnSelectionTextureRotatecounter1deg()
{
Select_RotateTexture(-1);
}

void MainFrame::OnSelectionTextureScaleup()
{
Select_ScaleTexture(0, g_qeglobals.d_savedinfo.m_SIIncrement.scale[1]);
Expand Down
4 changes: 4 additions & 0 deletions radiant/mainframe.h
Expand Up @@ -409,6 +409,8 @@ struct SKeyInfo

#define ID_SELECT_FUNC_GROUP 40233

#define ID_SELECTION_TEXTURE_ROTATECLOCK_1DEG 40238
#define ID_SELECTION_TEXTURE_ROTATECOUNTER_1DEG 40239
#define ID_SELECTION_TEXTURE_SHIFTLEFT_1U 40240
#define ID_SELECTION_TEXTURE_SHIFTRIGHT_1U 40241
#define ID_SELECTION_TEXTURE_SHIFTUP_1U 40242
Expand Down Expand Up @@ -757,6 +759,8 @@ class MainFrame
// void OnSelectionTextureInc();
void OnSelectionTextureRotateclock();
void OnSelectionTextureRotatecounter();
void OnSelectionTextureRotateclock1deg();
void OnSelectionTextureRotatecounter1deg();
void OnSelectionTextureScaledown();
void OnSelectionTextureScaleup();
void OnSelectionTextureShiftdown();
Expand Down

0 comments on commit eb90f83

Please sign in to comment.