Changeset 1977
- Timestamp:
- Oct 4, 2012, 6:28:42 PM (10 years ago)
- Location:
- trunk/tools/neercs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/neercs/neercs.cpp
r1866 r1977 59 59 } 60 60 61 62 61 void Neercs::TickDraw(float seconds) 63 62 { -
trunk/tools/neercs/term/term.cpp
r1962 r1977 24 24 #include "term.h" 25 25 26 extern bool g_setup; 27 26 28 Term::Term(ivec2 size) 27 29 : m_pty(0), … … 45 47 46 48 #if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H 47 bool have_ctrl = Input::GetStatus(Key::LeftCtrl) 48 || Input::GetStatus(Key::RightCtrl); 49 bool have_shift = Input::GetStatus(Key::LeftShift) 50 || Input::GetStatus(Key::RightShift); 51 52 for (int i = 0x0; i < 0x7f; ++i) 53 { 54 if (Input::WasPressed((Key::Value)i)) 49 if (!g_setup) 50 { 51 bool have_ctrl = Input::GetStatus(Key::LeftCtrl) 52 || Input::GetStatus(Key::RightCtrl); 53 bool have_shift = Input::GetStatus(Key::LeftShift) 54 || Input::GetStatus(Key::RightShift); 55 56 /* Check for standard ASCII keys */ 57 for (int i = 0x0; i < 0x7f; ++i) 55 58 { 56 if ( have_ctrl && i >= 'a' && i <= 'z')59 if (Input::WasPressed((Key::Value)i)) 57 60 { 58 char c = i + 1 - 'a'; 59 m_pty->WriteData(&c, 1); 61 if (have_ctrl && i >= 'a' && i <= 'z') 62 { 63 char c = i + 1 - 'a'; 64 m_pty->WriteData(&c, 1); 65 } 66 else if (have_shift && i >= 'a' && i <= 'z') 67 { 68 char c = i + 'A' - 'a'; 69 m_pty->WriteData(&c, 1); 70 } 71 else 72 { 73 char c = i; 74 m_pty->WriteData(&c, 1); 75 } 60 76 } 61 else if (have_shift && i >= 'a' && i <= 'z') 62 { 63 char c = i + 'A' - 'a'; 64 m_pty->WriteData(&c, 1); 65 } 66 else 67 { 68 char c = i; 69 m_pty->WriteData(&c, 1); 70 } 77 } 78 79 /* Check for special keys */ 80 static struct { Key::Value k; char const *str; int len; } const lut[] = 81 { 82 { Key::Up, "\033OA", 3 }, 83 { Key::Down, "\033OB", 3 }, 84 { Key::Right, "\033OC", 3 }, 85 { Key::Left, "\033OD", 3 }, 86 { Key::PageUp, "\033[5~", 4 }, 87 { Key::PageDown, "\033[6~", 4 }, 88 { Key::Home, "\033[1~", 4 }, 89 { Key::Insert, "\033[2~", 4 }, 90 { Key::Delete, "\033[3~", 4 }, 91 { Key::End, "\033[4~", 4 }, 92 #if 0 /* FIXME: disabled for now (used by the theme system */ 93 { Key::F1, "\033[11~", 5 }, 94 { Key::F2, "\033[12~", 5 }, 95 { Key::F3, "\033[13~", 5 }, 96 { Key::F4, "\033[14~", 5 }, 97 { Key::F5, "\033[15~", 5 }, 98 { Key::F6, "\033[17~", 5 }, 99 { Key::F7, "\033[18~", 5 }, 100 { Key::F8, "\033[19~", 5 }, 101 { Key::F9, "\033[20~", 5 }, 102 { Key::F10, "\033[21~", 5 }, 103 { Key::F11, "\033[23~", 5 }, 104 { Key::F12, "\033[24~", 5 }, 105 #endif 106 }; 107 108 for (size_t i = 0; i < sizeof(lut) / sizeof(*lut); i++) 109 { 110 if (!have_ctrl && !have_shift) 111 if (Input::WasPressed(lut[i].k)) 112 m_pty->WriteData(lut[i].str, lut[i].len); 71 113 } 72 114 } -
trunk/tools/neercs/video/render.cpp
r1974 r1977 44 44 45 45 #define PID M_PI/180.0f // pi ratio 46 47 /* 48 * Global variable -- ugly 49 */ 50 bool g_setup = true; 46 51 47 52 /* … … 580 585 m_pause(false), 581 586 m_polygon(true), 582 m_setup(true),583 587 m_shader(true), 584 588 m_shader_glow(true), … … 611 615 612 616 /* draw setup */ 613 if ( m_setup)617 if (g_setup) 614 618 { 615 619 /* background */ … … 708 712 if (Input::WasPressed(Key::F1)) 709 713 { 710 m_setup = !m_setup;711 if ( m_setup) setup_n = calc_item_length();714 g_setup = !g_setup; 715 if (g_setup) setup_n = calc_item_length(); 712 716 sync_flag = true; 713 717 sync_angle = main_angle; … … 729 733 if (Input::WasPressed(Key::Tab)) 730 734 { 731 if ( m_setup)735 if (g_setup) 732 736 { 733 737 setup_switch = !setup_switch; … … 738 742 if (Input::WasPressed(Key::Up)) 739 743 { 740 if ( m_setup)744 if (g_setup) 741 745 { 742 746 if (!setup_switch) … … 788 792 if (Input::WasPressed(Key::Down)) 789 793 { 790 if ( m_setup)794 if (g_setup) 791 795 { 792 796 if (!setup_switch) … … 838 842 if (Input::WasPressed(Key::PageUp)) 839 843 { 840 if ( m_setup)844 if (g_setup) 841 845 { 842 846 if (!setup_switch) … … 887 891 if (Input::WasPressed(Key::PageDown)) 888 892 { 889 if ( m_setup)893 if (g_setup) 890 894 { 891 895 if (!setup_switch) … … 936 940 if (Input::WasPressed(Key::Left)) 937 941 { 938 if ( m_setup && setup_switch)942 if (g_setup && setup_switch) 939 943 { 940 944 setup_var[setup_item_key].w -= setup_var[setup_item_key].z; … … 945 949 if (Input::WasPressed(Key::Right)) 946 950 { 947 if ( m_setup && setup_switch)951 if (g_setup && setup_switch) 948 952 { 949 953 setup_var[setup_item_key].w += setup_var[setup_item_key].z; … … 954 958 if (Input::WasPressed(Key::Home)) 955 959 { 956 if ( m_setup && setup_switch)960 if (g_setup && setup_switch) 957 961 { 958 962 setup_var[setup_item_key].w = setup_var[setup_item_key].x; … … 962 966 if (Input::WasPressed(Key::End)) 963 967 { 964 if ( m_setup && setup_switch)968 if (g_setup && setup_switch) 965 969 { 966 970 setup_var[setup_item_key].w = setup_var[setup_item_key].y; … … 1042 1046 m_txt_screen->Render(); 1043 1047 1044 if ( m_setup)1048 if (g_setup) 1045 1049 m_txt_setup->Render(); 1046 1050 … … 1059 1063 1060 1064 m_txt_screen->Blit(border, canvas_size); 1061 if ( m_setup)1065 if (g_setup) 1062 1066 m_txt_setup->Blit((screen_size - setup_canvas_size) / 2, setup_canvas_size); 1063 1067 -
trunk/tools/neercs/video/render.h
r1971 r1977 37 37 bool m_pause; 38 38 bool m_polygon; 39 bool m_setup;40 39 bool m_shader; 41 40 bool m_shader_glow;
Note: See TracChangeset
for help on using the changeset viewer.