Changeset 1338
- Timestamp:
- 09/14/11 10:02:16 (21 months ago)
- Location:
- trunk
- Files:
-
- 23 edited
-
CHDK/LANG/english.lng (modified) (1 diff)
-
core/conf.c (modified) (1 diff)
-
core/gui.c (modified) (28 diffs)
-
core/gui_4wins.c (modified) (11 diffs)
-
core/gui_calendar.c (modified) (2 diffs)
-
core/gui_draw.c (modified) (3 diffs)
-
core/gui_draw.h (modified) (4 diffs)
-
core/gui_lang.c (modified) (1 diff)
-
core/gui_lang.h (modified) (1 diff)
-
core/gui_mastermind.c (modified) (4 diffs)
-
core/gui_palette.c (modified) (2 diffs)
-
core/gui_read.c (modified) (4 diffs)
-
core/gui_reversi.c (modified) (3 diffs)
-
core/gui_sokoban.c (modified) (11 diffs)
-
core/kbd.c (modified) (3 diffs)
-
core/raw.c (modified) (1 diff)
-
include/camera.h (modified) (1 diff)
-
include/conf.h (modified) (1 diff)
-
include/gui.h (modified) (1 diff)
-
include/keyboard.h (modified) (1 diff)
-
include/lolevel.h (modified) (1 diff)
-
include/modelist.h (modified) (1 diff)
-
include/platform.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHDK/LANG/english.lng
r1317 r1338 598 598 460 "You need to be in REC-mode\nfor this operation." 599 599 461 "%s disabled in build" 600 462 "Touchscreen overrides" 601 463 "Video AE Controls" 602 464 "<Alt> Shortcut Buttons" -
trunk/core/conf.c
r1245 r1338 402 402 CONF_INFO(242, conf.edge_overlay_show, CONF_DEF_VALUE, i:0, NULL), 403 403 CONF_INFO(243, conf.edge_overlay_pano_overlap, CONF_DEF_VALUE, i:30, NULL), 404 405 // Touch screen U/I overrides 406 CONF_INFO(244, conf.touchscreen_disable_video_controls, CONF_DEF_VALUE, i:0, NULL), 407 CONF_INFO(245, conf.touchscreen_disable_shortcut_controls, CONF_DEF_VALUE, i:0, NULL), 404 408 }; 405 409 #define CONF_NUM (sizeof(conf_info)/sizeof(conf_info[0])) -
trunk/core/gui.c
r1337 r1338 204 204 static void gui_load_curve(int arg); 205 205 #endif 206 staticconst char* gui_histo_show_enum(int change, int arg);206 const char* gui_histo_show_enum(int change, int arg); 207 207 static const char* gui_histo_mode_enum(int change, int arg); 208 208 static const char* gui_temp_mode_enum(int change, int arg); … … 254 254 static const char* gui_iso_exposure_order_enum(int change, int arg); 255 255 */ 256 staticconst char* gui_nd_filter_state_enum(int change, int arg);256 const char* gui_nd_filter_state_enum(int change, int arg); 257 257 //static const char* gui_tv_enum(int change, int arg); 258 258 const char* gui_user_menu_show_enum(int change, int arg); … … 269 269 static const char* gui_video_af_key_enum(int change, int arg); 270 270 static const char* gui_show_movie_time(int change, int arg); 271 staticconst char* gui_override_disable_enum(int change, int arg);271 const char* gui_override_disable_enum(int change, int arg); 272 272 #ifdef OPT_CURVES 273 273 static const char* gui_conf_curve_enum(int change, int arg); … … 767 767 static CMenu raw_state_submenu = {0x24,LANG_MENU_OSD_RAW_STATE_PARAMS_TITLE, NULL, raw_state_submenu_items }; 768 768 769 #ifdef CAM_TOUCHSCREEN_UI 770 static const char* gui_touchscreen_disable_video_enum(int change, int arg); 771 static const char* gui_touchscreen_disable_shortcuts_enum(int change, int arg); 772 static CMenuItem touchscreen_submenu_items[] = { 773 {0x5f,LANG_MENU_TS_VIDEO_AE_DISABLE, MENUITEM_ENUM, (int*)gui_touchscreen_disable_video_enum }, 774 {0x5f,LANG_MENU_TS_ALT_SHORTCUTS_DISABLE,MENUITEM_ENUM, (int*)gui_touchscreen_disable_shortcuts_enum }, 775 {0x51,LANG_MENU_BACK, MENUITEM_UP }, 776 {0} 777 }; 778 static CMenu touchscreen_submenu = {0x28,LANG_MENU_TOUCHSCREEN_VALUES, /*cb_values_menu_change*/ NULL, touchscreen_submenu_items }; 779 #endif 769 780 770 781 static CMenuItem osd_submenu_items[] = { … … 792 803 {0x5c,LANG_MENU_MAIN_SAVE_OPTIONS, MENUITEM_PROC, (int*)gui_menuproc_save }, 793 804 #endif 805 #ifdef CAM_TOUCHSCREEN_UI 806 {0x22,LANG_MENU_TOUCHSCREEN_VALUES, MENUITEM_SUBMENU, (int*)&touchscreen_submenu }, 807 #endif 794 808 {0x51,LANG_MENU_BACK, MENUITEM_UP }, 795 809 {0} … … 1233 1247 return gui_change_simple_enum(&conf.sub_batch_ext,change,img_exts,NUM_IMG_EXTS); 1234 1248 } 1249 1250 //------------------------------------------------------------------- 1251 #ifdef CAM_TOUCHSCREEN_UI 1252 1253 const char* gui_on_off_enum(int change, int *conf_val) 1254 { 1255 static const char* modes[]={ "Off", "On"}; 1256 return gui_change_simple_enum(conf_val,change,modes,sizeof(modes)/sizeof(modes[0])); 1257 } 1258 1259 const char* gui_touchscreen_disable_video_enum(int change, int arg) { 1260 static const char* modes[]={ "Enable", "Disable" }; 1261 return gui_change_simple_enum(&conf.touchscreen_disable_video_controls,change,modes,sizeof(modes)/sizeof(modes[0])); 1262 } 1263 1264 const char* gui_touchscreen_disable_shortcuts_enum(int change, int arg) { 1265 static const char* modes[]={ "Enable", "Disable" }; 1266 return gui_change_simple_enum(&conf.touchscreen_disable_shortcut_controls,change,modes,sizeof(modes)/sizeof(modes[0])); 1267 } 1268 1269 #endif 1235 1270 1236 1271 //------------------------------------------------------------------- … … 1819 1854 void gui_init() 1820 1855 { 1821 1822 gui_mode = GUI_MODE_NONE; 1856 gui_set_mode(GUI_MODE_NONE); 1823 1857 gui_restore = 0; 1824 1858 gui_in_redraw = 0; … … 1881 1915 //------------------------------------------------------------------- 1882 1916 void gui_set_mode(enum Gui_Mode mode) { 1917 #ifdef CAM_TOUCHSCREEN_UI 1918 if (((gui_mode == 0) != (mode == 0)) || // Change from GUI_MODE_NONE to any other or vice-versa 1919 ((gui_mode > GUI_MODE_MENU) != (mode > GUI_MODE_MENU))) // Switch in & out of menu mode 1920 redraw_buttons = 1; 1921 #endif 1883 1922 gui_mode = mode; 1884 1923 } … … 1930 1969 1931 1970 //------------------------------------------------------------------- 1971 #ifdef OPTIONS_AUTOSAVE 1972 1973 static void conf_store_old_settings() { 1974 old_conf=conf; 1975 } 1976 1977 static int conf_save_new_settings_if_changed() { 1978 if (memcmp(&old_conf, &conf, sizeof(Conf)) != 0) { 1979 user_menu_save(); 1980 conf_save(); 1981 conf_store_old_settings(); 1982 return 1; 1983 } 1984 return 0; 1985 } 1986 1987 #endif 1988 1989 //------------------------------------------------------------------- 1990 void gui_chdk_draw() 1991 { 1992 static int show_md_grid=0; 1993 1994 gui_draw_osd(); 1995 1996 #ifdef CAM_DISP_ALT_TEXT 1997 draw_txt_string(20, 14, "<ALT>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 1998 #endif 1999 2000 #ifdef OPT_SCRIPTING 2001 if ((mode_get()&MODE_MASK) == MODE_REC) 2002 { 2003 draw_txt_string(0, 14, script_title, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 2004 if (state_kbd_script_run) show_md_grid=5; 2005 if (show_md_grid) 2006 { 2007 --show_md_grid; 2008 md_draw_grid(); 2009 } 2010 } 2011 #endif 2012 2013 console_draw(); 2014 } 2015 2016 //------------------------------------------------------------------- 2017 // Handler for Menu button press default - enter Menu mode 2018 void gui_default_kbd_process_menu_btn() 2019 { 2020 gui_set_mode(GUI_MODE_MENU); 2021 draw_restore(); 2022 } 2023 2024 // Change SD override factor, direction = 1 to increase, -1 to decrease 2025 // Only applies if camera has a Zoom lever 2026 #if CAM_HAS_ZOOM_LEVER 2027 static void sd_override_koef(int direction) 2028 { 2029 gui_subj_dist_override_koef_enum(direction,0); 2030 #if !CAM_HAS_MANUAL_FOCUS 2031 if (conf.subj_dist_override_koef==0) conf.subj_dist_override_koef=1; 2032 #endif 2033 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 2034 } 2035 #endif 2036 2037 // Change SD override by factor amount, direction = 1 to increase (zoom in), -1 to decrease (zoom out) 2038 static void sd_override(int direction) 2039 { 2040 gui_subj_dist_override_value_enum(direction,0); 2041 shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); 2042 } 2043 2044 // Main button processing for CHDK Alt mode (not in MENU mode) 2045 // This needs to be cleaned up, re-organised and commented !!!! 2046 void gui_chdk_kbd_process() 2047 { 2048 #if !CAM_HAS_ERASE_BUTTON && CAM_CAN_SD_OVERRIDE // ALT RAW toggle kbd processing if camera has SD override but no erase button 2049 if (kbd_is_key_clicked(SHORTCUT_TOGGLE_RAW)) 2050 { 2051 if (conf.debug_shortcut_action > 0) 2052 { 2053 #ifdef OPT_DEBUGGING 2054 gui_debug_shortcut(); 2055 #endif 2056 } 2057 // Check in manual focus mode 2058 else if (!shooting_get_common_focus_mode()) 2059 { 2060 // Not manual focus mode so just update RAW save setting 2061 conf.save_raw = !conf.save_raw; 2062 draw_restore(); 2063 } 2064 else 2065 { 2066 // In manual focus mode so update shooting distance 2067 #if CAM_HAS_ZOOM_LEVER 2068 conf.subj_dist_override_value=MAX_DIST; 2069 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 2070 #else 2071 if (conf.subj_dist_override_koef==4) 2072 gui_subj_dist_override_koef_enum(-3,0); 2073 else 2074 gui_subj_dist_override_koef_enum(1,0); 2075 #endif 2076 } 2077 } 2078 #else // ALT RAW toggle kbd processing if can't SD override or has erase button 2079 if (kbd_is_key_clicked(SHORTCUT_TOGGLE_RAW)) 2080 { 2081 if (conf.debug_shortcut_action > 0) 2082 { 2083 #ifdef OPT_DEBUGGING 2084 gui_debug_shortcut(); 2085 #endif 2086 } 2087 else 2088 { 2089 // Change RAW save state 2090 conf.save_raw = !conf.save_raw; 2091 draw_restore(); 2092 } 2093 } 2094 #endif 2095 #ifdef OPT_SCRIPTING // ALT Set button processing if scripting enabled - open script menu 2096 else if (kbd_is_key_clicked(KEY_SET)) 2097 { 2098 gui_menu_init(&script_submenu); 2099 gui_default_kbd_process_menu_btn(); 2100 } 2101 #endif 2102 #if CAM_CAN_SD_OVERRIDE // ALT button processing if camera has SD override 2103 else 2104 { 2105 #if !CAM_HAS_MANUAL_FOCUS 2106 if (kbd_is_key_clicked(SHORTCUT_MF_TOGGLE)) // Camera does not have manual focus 2107 { 2108 if (conf.subj_dist_override_koef>0) 2109 conf.subj_dist_override_koef=0; 2110 else conf.subj_dist_override_koef=1; 2111 draw_restore(); 2112 } 2113 else 2114 #endif 2115 if (shooting_get_common_focus_mode()) // Check in manual focus mode 2116 { 2117 #if CAM_HAS_ZOOM_LEVER // Camera has zoom lever, use left & right to change factor,up to set infinity 2118 if (kbd_is_key_clicked(KEY_RIGHT)) 2119 { 2120 sd_override_koef(1); 2121 } 2122 else if (kbd_is_key_clicked(KEY_LEFT)) 2123 { 2124 sd_override_koef(-1); 2125 } 2126 else if (kbd_is_key_clicked(SHORTCUT_SET_INFINITY)) 2127 { 2128 conf.subj_dist_override_value=MAX_DIST; 2129 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 2130 } 2131 else 2132 #endif 2133 if (kbd_is_key_clicked(SHORTCUT_SET_HYPERFOCAL)) // Set hyperfocal distance if down pressed 2134 { 2135 int m=mode_get()&MODE_SHOOTING_MASK; 2136 if ((m==MODE_M) || (m==MODE_AV)) 2137 conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance_f(shooting_get_aperture_from_av96(shooting_get_user_av96()),get_focal_length(lens_get_zoom_point())); 2138 else conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance(); 2139 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 2140 } 2141 else 2142 { 2143 switch (kbd_get_autoclicked_key()) 2144 { 2145 #if CAM_HAS_ZOOM_LEVER 2146 case KEY_ZOOM_IN: 2147 #else 2148 case KEY_RIGHT: 2149 #endif 2150 sd_override(1); 2151 break; 2152 #if CAM_HAS_ZOOM_LEVER 2153 case KEY_ZOOM_OUT: 2154 #else 2155 case KEY_LEFT: 2156 #endif 2157 sd_override(-1); 2158 break; 2159 } 2160 } 2161 } 2162 } 2163 #endif 2164 } 2165 2166 //------------------------------------------------------------------- 2167 // Handler for Menu button press in CHDK Alt mode (not in Menu mode) 2168 // Enter main menu or user menu based on configuration 2169 void gui_chdk_kbd_process_menu_btn() 2170 { 2171 if (conf.user_menu_as_root && (conf.user_menu_enable != 0)) { 2172 if (kbd_is_key_pressed(KEY_SHOOT_HALF)) 2173 gui_menu_init(&root_menu); 2174 else 2175 gui_menu_init(&user_submenu); 2176 } 2177 else { 2178 if ((conf.user_menu_enable != 0) && kbd_is_key_pressed(KEY_SHOOT_HALF)) 2179 gui_menu_init(&user_submenu); 2180 else 2181 gui_menu_init(&root_menu); 2182 } 2183 gui_default_kbd_process_menu_btn(); 2184 } 2185 2186 // Menu button handled for text reader 2187 #ifdef OPT_TEXTREADER 2188 void gui_read_kbd_process_menu_btn() 2189 { 2190 gui_read_kbd_process(); 2191 gui_default_kbd_process_menu_btn(); 2192 } 2193 #endif 2194 2195 // Menu button handled for Menu mode 2196 void gui_menu_kbd_process_menu_btn() 2197 { 2198 #ifdef OPTIONS_AUTOSAVE 2199 conf_save_new_settings_if_changed(); 2200 #endif 2201 if (gui_user_menu_flag) 2202 { 2203 gui_set_mode(GUI_MODE_MENU); 2204 gui_user_menu_flag = 0; 2205 gui_menu_init(&root_menu); 2206 } 2207 else 2208 gui_set_mode(GUI_MODE_ALT); 2209 draw_restore(); 2210 } 2211 2212 //------------------------------------------------------------------- 2213 // Structure to store gui redraw and kbd process handlers for each mode 2214 typedef struct 2215 { 2216 void (*redraw)(void); // Called to redraw screen 2217 void (*kbd_process)(void); // Main button handler for mode 2218 void (*kbd_process_menu_btn)(void); // Menu button handler for mode 2219 } gui_handler; 2220 2221 // GUI handler table (entries must be in the same order and have the same number of entries as Gui_Mode enum) 2222 gui_handler guiHandlers[] = 2223 { 2224 /*GUI_MODE_NONE*/ { gui_draw_osd, 0, 0 }, 2225 /*GUI_MODE_ALT*/ { gui_chdk_draw, gui_chdk_kbd_process, gui_chdk_kbd_process_menu_btn }, 2226 /*GUI_MODE_MENU*/ { gui_menu_draw, gui_menu_kbd_process, gui_menu_kbd_process_menu_btn }, 2227 /*GUI_MODE_PALETTE*/ { gui_palette_draw, gui_palette_kbd_process, gui_default_kbd_process_menu_btn }, 2228 /*GUI_MODE_MBOX*/ { gui_mbox_draw, gui_mbox_kbd_process, 0 }, 2229 #ifdef OPT_GAME_REVERSI 2230 /*GUI_MODE_REVERSI*/ { gui_reversi_draw, gui_reversi_kbd_process, gui_default_kbd_process_menu_btn }, 2231 #else 2232 { 0, 0, 0 }, 2233 #endif 2234 #ifdef OPT_GAME_SOKOBAN 2235 /*GUI_MODE_SOKOBAN*/ { gui_sokoban_draw, gui_sokoban_kbd_process, gui_default_kbd_process_menu_btn }, 2236 #else 2237 { 0, 0, 0 }, 2238 #endif 2239 #ifdef OPT_DEBUGGING 2240 /*GUI_MODE_DEBUG*/ { gui_debug_draw, gui_debug_kbd_process, gui_default_kbd_process_menu_btn }, 2241 #else 2242 { 0, 0, 0 }, 2243 #endif 2244 /*GUI_MODE_FSELECT*/ { gui_fselect_draw, gui_fselect_kbd_process, gui_fselect_kbd_process }, 2245 #ifdef OPT_TEXTREADER 2246 /*GUI_MODE_READ*/ { gui_read_draw, gui_read_kbd_process, gui_read_kbd_process_menu_btn }, 2247 #else 2248 { 0, 0, 0 }, 2249 #endif 2250 /*GUI_MODE_OSD*/ { gui_osd_draw, gui_osd_kbd_process, gui_default_kbd_process_menu_btn }, 2251 #ifdef OPT_CALENDAR 2252 /*GUI_MODE_CALENDAR*/ { gui_calendar_draw, gui_calendar_kbd_process, gui_default_kbd_process_menu_btn }, 2253 #else 2254 { 0, 0, 0 }, 2255 #endif 2256 #ifdef OPT_DEBUGGING 2257 /*GUI_MODE_BENCH*/ { gui_bench_draw, gui_bench_kbd_process, gui_default_kbd_process_menu_btn }, 2258 #else 2259 { 0, 0, 0 }, 2260 #endif 2261 /*GUI_MODE_MPOPUP*/ { gui_mpopup_draw, gui_mpopup_kbd_process, 0 }, 2262 #ifdef OPT_GAME_CONNECT4 2263 /*GUI_MODE_4WINS*/ { gui_4wins_draw, gui_4wins_kbd_process, gui_default_kbd_process_menu_btn }, 2264 #else 2265 { 0, 0, 0 }, 2266 #endif 2267 #ifdef OPT_GAME_MASTERMIND 2268 /*GUI_MODE_MASTERMIND*/ { gui_mastermind_draw, gui_mastermind_kbd_process, gui_default_kbd_process_menu_btn }, 2269 #else 2270 { 0, 0, 0 }, 2271 #endif 2272 }; 2273 2274 //------------------------------------------------------------------- 2275 // Main GUI redraw function, perform common initialisation then calls the redraw handler for the mode 1932 2276 void gui_redraw() 1933 2277 { 1934 2278 enum Gui_Mode gui_mode_old; 1935 static int show_md_grid=0;1936 2279 1937 2280 #ifdef CAM_DETECT_SCREEN_ERASE … … 1941 2284 gui_menu_force_redraw(); 1942 2285 gui_fselect_force_redraw(); 2286 #ifdef CAM_TOUCHSCREEN_UI 2287 extern int redraw_buttons; 2288 redraw_buttons = 1; 2289 #endif 1943 2290 } 1944 2291 #endif … … 1949 2296 gui_mode_old = gui_mode; 1950 2297 1951 #if CAM_USES_ASPECT_CORRECTION //nandoide sept-20092298 #if CAM_USES_ASPECT_CORRECTION //nandoide sept-2009 1952 2299 //the different modes arises because games are designed on a 360x240 basis and are difficult to downscale to 320x240 1953 2300 if (gui_mode == GUI_MODE_REVERSI || gui_mode == GUI_MODE_SOKOBAN || gui_mode == GUI_MODE_4WINS || gui_mode == GUI_MODE_MASTERMIND) { 1954 2301 draw_set_environment(aspect_xcorrection_games_360, aspect_ycorrection_games_360, GAMES_SCREEN_WIDTH, GAMES_SCREEN_HEIGHT); 1955 2302 } else { //default 1956 // draw_set_environment(NULL, NULL, SCREENX, SCREENY);1957 2303 draw_set_environment(NULL, NULL, vid_get_bitmap_screen_width(), vid_get_bitmap_screen_height()); 1958 2304 } 1959 #endif 1960 switch (gui_mode) { 1961 case GUI_MODE_MENU: 1962 gui_menu_draw(); 1963 // draw_txt_string(20, 14, "<CNF>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 1964 break; 1965 case GUI_MODE_ALT: 1966 gui_draw_osd(); 1967 draw_txt_string(20, 14, "<ALT>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 1968 #ifdef OPT_SCRIPTING 1969 if ((mode_get()&MODE_MASK) == MODE_REC) { 1970 draw_txt_string(0, 14, script_title, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 1971 if (state_kbd_script_run) show_md_grid=5; 1972 if (show_md_grid) { 1973 --show_md_grid; 1974 md_draw_grid(); 1975 } 1976 } 1977 #endif 1978 console_draw(); 1979 break; 1980 case GUI_MODE_NONE: 1981 gui_draw_osd(); 1982 break; 1983 case GUI_MODE_PALETTE: 1984 gui_palette_draw(); 1985 break; 1986 case GUI_MODE_MBOX: 1987 gui_mbox_draw(); 1988 break; 1989 #ifdef OPT_GAME_REVERSI 1990 case GUI_MODE_REVERSI: 1991 gui_reversi_draw(); 1992 break; 1993 #endif 1994 #ifdef OPT_GAME_SOKOBAN 1995 case GUI_MODE_SOKOBAN: 1996 gui_sokoban_draw(); 1997 break; 1998 #endif 1999 #ifdef OPT_GAME_CONNECT4 2000 case GUI_MODE_4WINS: 2001 gui_4wins_draw(); 2002 break; 2003 #endif 2004 #ifdef OPT_GAME_MASTERMIND 2005 case GUI_MODE_MASTERMIND: 2006 gui_mastermind_draw(); 2007 break; 2008 #endif 2009 #ifdef OPT_DEBUGGING 2010 case GUI_MODE_DEBUG: 2011 gui_debug_draw(); 2012 break; 2013 #endif 2014 case GUI_MODE_FSELECT: 2015 gui_fselect_draw(); 2016 break; 2017 #ifdef OPT_TEXTREADER 2018 case GUI_MODE_READ: 2019 gui_read_draw(); 2020 break; 2021 #endif 2022 case GUI_MODE_OSD: 2023 gui_osd_draw(); 2024 // draw_txt_string(20, 14, "<OSD>", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 2025 break; 2026 #ifdef OPT_CALENDAR 2027 case GUI_MODE_CALENDAR: 2028 gui_calendar_draw(); 2029 break; 2030 #endif 2031 #ifdef OPT_DEBUGGING 2032 case GUI_MODE_BENCH: 2033 gui_bench_draw(); 2034 break; 2035 #endif 2036 case GUI_MODE_MPOPUP: 2037 gui_mpopup_draw(); 2038 break; 2039 default: 2040 break; 2041 } 2042 2305 #endif 2306 2307 #ifdef CAM_TOUCHSCREEN_UI 2308 extern void virtual_buttons(); 2309 virtual_buttons(); 2310 #endif 2311 2312 // Call redraw handler 2313 if (guiHandlers[gui_mode].redraw) guiHandlers[gui_mode].redraw(); 2314 2315 // Forced redraw if needed 2043 2316 gui_in_redraw = 0; 2044 2317 if ((gui_mode_old != gui_mode && (gui_mode_old != GUI_MODE_NONE && gui_mode_old != GUI_MODE_ALT) && (gui_mode != GUI_MODE_MBOX && gui_mode != GUI_MODE_MPOPUP)) || gui_restore) { … … 2050 2323 } 2051 2324 2052 #ifdef OPTIONS_AUTOSAVE 2053 //------------------------------------------------------------------- 2054 static inline void conf_store_old_settings() { 2055 old_conf=conf; 2056 } 2057 2058 //------------------------------------------------------------------- 2059 static inline int conf_save_new_settings_if_changed() { 2060 if (memcmp(&old_conf, &conf, sizeof(Conf)) != 0) { 2061 user_menu_save(); 2062 conf_save(); 2063 conf_store_old_settings(); 2064 return 1; 2065 } 2066 return 0; 2067 } 2068 #endif 2069 2070 2071 //------------------------------------------------------------------- 2325 //------------------------------------------------------------------- 2326 // Main kbd processing for GUI modes 2072 2327 void gui_kbd_process() 2073 2328 { 2074 int clicked_key; 2075 2076 if (kbd_is_key_clicked(KEY_MENU)){ 2077 switch (gui_mode) { 2078 case GUI_MODE_ALT: 2079 if (conf.user_menu_as_root && (conf.user_menu_enable != 0)) { 2080 if (kbd_is_key_pressed(KEY_SHOOT_HALF)) 2081 gui_menu_init(&root_menu); 2082 else 2083 gui_menu_init(&user_submenu); 2084 } 2085 else { 2086 if ((conf.user_menu_enable != 0) && kbd_is_key_pressed(KEY_SHOOT_HALF)) 2087 gui_menu_init(&user_submenu); 2088 else 2089 gui_menu_init(&root_menu); 2090 } 2091 gui_mode = GUI_MODE_MENU; 2092 draw_restore(); 2093 break; 2094 case GUI_MODE_MENU: 2095 #ifdef OPTIONS_AUTOSAVE 2096 conf_save_new_settings_if_changed(); 2097 #endif 2098 if (gui_user_menu_flag) { 2099 gui_mode = GUI_MODE_MENU; 2100 gui_user_menu_flag = 0; 2101 gui_menu_init(&root_menu); 2102 } 2103 else 2104 gui_mode = GUI_MODE_ALT; 2105 draw_restore(); 2106 break; 2107 case GUI_MODE_PALETTE: 2108 case GUI_MODE_REVERSI: 2109 case GUI_MODE_SOKOBAN: 2110 case GUI_MODE_4WINS: 2111 case GUI_MODE_MASTERMIND: 2112 #ifdef OPT_DEBUGGING 2113 case GUI_MODE_DEBUG: 2114 #endif 2115 case GUI_MODE_OSD: 2116 #ifdef OPT_CALENDAR 2117 case GUI_MODE_CALENDAR: 2118 #endif 2119 case GUI_MODE_BENCH: 2120 draw_restore(); 2121 gui_mode = GUI_MODE_MENU; 2122 break; 2123 case GUI_MODE_FSELECT: 2124 gui_fselect_kbd_process(); 2125 break; 2126 #ifdef OPT_TEXTREADER 2127 case GUI_MODE_READ: 2128 gui_read_kbd_process(); 2129 draw_restore(); 2130 gui_mode = GUI_MODE_MENU; 2131 break; 2132 #endif 2133 default: 2134 break; 2135 } 2329 // Call menu button handler if menu button pressed 2330 if (kbd_is_key_clicked(KEY_MENU)) 2331 { 2332 if (guiHandlers[gui_mode].kbd_process_menu_btn) guiHandlers[gui_mode].kbd_process_menu_btn(); 2136 2333 return; 2137 2334 } 2138 2335 2139 switch (gui_mode) { 2140 case GUI_MODE_ALT: 2141 if (kbd_is_key_clicked(SHORTCUT_TOGGLE_RAW)) { 2142 if (conf.debug_shortcut_action > 0) { 2143 #ifdef OPT_DEBUGGING 2144 gui_debug_shortcut(); 2145 #endif 2146 } 2147 #if !CAM_HAS_ERASE_BUTTON && CAM_CAN_SD_OVERRIDE 2148 else if (!shooting_get_common_focus_mode()) 2149 #else 2150 else 2151 #endif 2152 {conf.save_raw = !conf.save_raw; 2153 draw_restore(); 2154 } 2155 #if !CAM_HAS_ERASE_BUTTON && CAM_CAN_SD_OVERRIDE 2156 else { 2157 #if CAM_HAS_ZOOM_LEVER 2158 conf.subj_dist_override_value=MAX_DIST; 2159 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 2160 #else 2161 if (conf.subj_dist_override_koef==4) 2162 gui_subj_dist_override_koef_enum(-3,0); 2163 else 2164 gui_subj_dist_override_koef_enum(1,0); 2165 #endif 2166 } 2167 #endif 2168 #ifdef OPT_SCRIPTING 2169 } else if (kbd_is_key_clicked(KEY_SET)) { 2170 gui_menu_init(&script_submenu); 2171 gui_mode = GUI_MODE_MENU; 2172 draw_restore(); 2173 #endif 2174 } else { 2175 #if !CAM_HAS_MANUAL_FOCUS && CAM_CAN_SD_OVERRIDE 2176 if (kbd_is_key_clicked(SHORTCUT_MF_TOGGLE)) { 2177 if (conf.subj_dist_override_koef>0) 2178 conf.subj_dist_override_koef=0; 2179 else conf.subj_dist_override_koef=1; 2180 draw_restore(); 2181 } 2182 else if (shooting_get_common_focus_mode()) 2183 #elif CAM_CAN_SD_OVERRIDE 2184 if (shooting_get_common_focus_mode()) 2185 #endif 2186 2187 #if CAM_CAN_SD_OVERRIDE 2188 { 2189 #if CAM_HAS_ZOOM_LEVER 2190 if (kbd_is_key_clicked(KEY_RIGHT)) { 2191 gui_subj_dist_override_koef_enum(1,0); 2192 #if !CAM_HAS_MANUAL_FOCUS 2193 if (conf.subj_dist_override_koef==0) conf.subj_dist_override_koef=1; 2194 #endif 2195 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 2196 } 2197 else if (kbd_is_key_clicked(KEY_LEFT)) 2198 { 2199 gui_subj_dist_override_koef_enum(-1,0); 2200 #if !CAM_HAS_MANUAL_FOCUS 2201 if (conf.subj_dist_override_koef==0) conf.subj_dist_override_koef=1; 2202 #endif 2203 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 2204 } 2205 else if (kbd_is_key_clicked(SHORTCUT_SET_INFINITY)) 2206 { 2207 conf.subj_dist_override_value=MAX_DIST; 2208 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 2209 } 2210 else 2211 #endif 2212 if (kbd_is_key_clicked(SHORTCUT_SET_HYPERFOCAL)) 2213 { 2214 int m=mode_get()&MODE_SHOOTING_MASK; 2215 if ((m==MODE_M) || (m==MODE_AV)) 2216 conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance_f(shooting_get_aperture_from_av96(shooting_get_user_av96()),get_focal_length(lens_get_zoom_point())); 2217 else conf.subj_dist_override_value=(int)shooting_get_hyperfocal_distance(); 2218 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 2219 } 2220 else 2221 switch (kbd_get_autoclicked_key()) { 2222 #if CAM_HAS_ZOOM_LEVER 2223 case KEY_ZOOM_IN: 2224 #else 2225 case KEY_RIGHT: 2226 #endif 2227 gui_subj_dist_override_value_enum(1,0); 2228 shooting_set_focus(shooting_get_subject_distance_override_value(),SET_NOW); 2229 break; 2230 #if CAM_HAS_ZOOM_LEVER 2231 case KEY_ZOOM_OUT: 2232 #else 2233 case KEY_LEFT: 2234 #endif 2235 gui_subj_dist_override_value_enum(-1,0); 2236 shooting_set_focus(shooting_get_subject_distance_override_value(), SET_NOW); 2237 break; 2238 } 2239 } 2240 #endif 2241 } 2242 break; 2243 case GUI_MODE_MENU: 2244 gui_menu_kbd_process(); 2245 break; 2246 case GUI_MODE_PALETTE: 2247 gui_palette_kbd_process(); 2248 break; 2249 case GUI_MODE_MBOX: 2250 gui_mbox_kbd_process(); 2251 break; 2252 #ifdef OPT_GAME_REVERSI 2253 case GUI_MODE_REVERSI: 2254 gui_reversi_kbd_process(); 2255 break; 2256 #endif 2257 #ifdef OPT_GAME_SOKOBAN 2258 case GUI_MODE_SOKOBAN: 2259 gui_sokoban_kbd_process(); 2260 break; 2261 #endif 2262 #ifdef OPT_GAME_CONNECT4 2263 case GUI_MODE_4WINS: 2264 gui_4wins_kbd_process(); 2265 break; 2266 #endif 2267 #ifdef OPT_GAME_MASTERMIND 2268 case GUI_MODE_MASTERMIND: 2269 gui_mastermind_kbd_process(); 2270 break; 2271 #endif 2272 #ifdef OPT_DEBUGGING 2273 case GUI_MODE_DEBUG: 2274 gui_debug_kbd_process(); 2275 break; 2276 #endif 2277 case GUI_MODE_FSELECT: 2278 gui_fselect_kbd_process(); 2279 break; 2280 #ifdef OPT_TEXTREADER 2281 case GUI_MODE_READ: 2282 gui_read_kbd_process(); 2283 break; 2284 #endif 2285 case GUI_MODE_OSD: 2286 gui_osd_kbd_process(); 2287 break; 2288 #ifdef OPT_CALENDAR 2289 case GUI_MODE_CALENDAR: 2290 gui_calendar_kbd_process(); 2291 break; 2292 #endif 2293 #ifdef OPT_DEBUGGING 2294 case GUI_MODE_BENCH: 2295 gui_bench_kbd_process(); 2296 break; 2297 #endif 2298 case GUI_MODE_MPOPUP: 2299 gui_mpopup_kbd_process(); 2300 break; 2301 default: 2302 break; 2303 } 2336 // Call mode handler for other buttons 2337 if (guiHandlers[gui_mode].kbd_process) guiHandlers[gui_mode].kbd_process(); 2304 2338 } 2305 2339 … … 2311 2345 conf_store_old_settings(); 2312 2346 #endif 2313 gui_ mode = GUI_MODE_ALT;2347 gui_set_mode(GUI_MODE_ALT); 2314 2348 2315 2349 conf_update_prevent_shutdown(); … … 2320 2354 if (conf.user_menu_enable == 2) { 2321 2355 gui_menu_init(&user_submenu); 2322 gui_ mode = GUI_MODE_MENU;2356 gui_set_mode(GUI_MODE_MENU); 2323 2357 draw_restore(); 2324 2358 gui_user_menu_flag = 1; … … 2342 2376 rbf_set_codepage(FONT_CP_WIN); 2343 2377 vid_turn_on_updates(); 2344 gui_ mode = GUI_MODE_NONE;2378 gui_set_mode(GUI_MODE_NONE); 2345 2379 2346 2380 conf_update_prevent_shutdown(); … … 2381 2415 2382 2416 #if CAM_EV_IN_VIDEO 2383 if ((movie_status==VIDEO_RECORD_IN_PROGRESS) && !kbd_is_key_pressed(KEY_SHOOT_HALF)){ 2384 #if CAM_HAS_ERASE_BUTTON 2385 if (kbd_is_key_clicked(KEY_ERASE)){ 2386 #else 2387 #if !defined (CAMERA_a480) 2388 if (kbd_is_key_clicked(KEY_DISPLAY)){ 2389 #else 2390 if (kbd_is_key_clicked(KEY_MENU)){ 2391 #endif 2392 #endif 2393 set_ev_video_avail(!get_ev_video_avail()); 2394 } 2395 if (get_ev_video_avail()) { 2396 if (kbd_is_key_clicked(KEY_LEFT)) { 2397 set_ev_video(get_ev_video()-1); 2398 } 2399 if (kbd_is_key_clicked(KEY_RIGHT)){ 2400 set_ev_video(get_ev_video()+1); 2401 } 2402 } 2403 } 2417 if ((movie_status==VIDEO_RECORD_IN_PROGRESS) && !kbd_is_key_pressed(KEY_SHOOT_HALF)){ 2418 #if CAM_HAS_ERASE_BUTTON 2419 if (kbd_is_key_clicked(KEY_ERASE)){ 2420 #else 2421 #if !defined (CAMERA_a480) 2422 if (kbd_is_key_clicked(KEY_DISPLAY)){ 2423 #else 2424 if (kbd_is_key_clicked(KEY_MENU)){ 2425 #endif 2426 #endif 2427 set_ev_video_avail(!get_ev_video_avail()); 2428 #ifdef CAM_TOUCHSCREEN_UI 2429 redraw_buttons = 1; 2430 #endif 2431 } 2432 if (get_ev_video_avail()) { 2433 if (kbd_is_key_clicked(KEY_LEFT)) { 2434 set_ev_video(get_ev_video()-1); 2435 } 2436 if (kbd_is_key_clicked(KEY_RIGHT)){ 2437 set_ev_video(get_ev_video()+1); 2438 } 2439 } 2440 } 2404 2441 #endif 2405 2442 } … … 2409 2446 2410 2447 #if defined(OPT_EXMEM_TESTING) 2411 // If defined the exmem memory is allocated; but not used for CHDK. 2412 // It is filled with a guard value (see wrappers.c) which is checked here 2413 // Any corruption is reported, otherwise 'OK' is displayed on screen (along with the exmem memory start address). 2414 extern void *exmem_start, *exmem_end; 2415 // check exmem allocated memory for corruption 2416 unsigned long* p = (unsigned long*)exmem_start; 2417 unsigned long *f = 0, *l = 0; 2418 long cnt = 0; 2419 while (p < (unsigned long*)exmem_end) 2420 { 2421 if (p[0] != 0xDEADBEEF) 2422 { 2423 l = p; 2424 if (f == 0) f = p; 2425 cnt++; 2426 } 2427 p++; 2428 } 2429 if (cnt != 0) 2430 { 2431 sprintf(osd_buf, "s:%8x e:%8x", exmem_start, exmem_end); 2432 draw_txt_string(2, 12, osd_buf, conf.osd_color); 2433 sprintf(osd_buf, "f:%8x l:%8x c:%d", f, l, cnt); 2434 } 2435 else 2436 { 2437 sprintf(osd_buf, "OK 0x%x", exmem_start); 2438 } 2439 draw_txt_string(2, 13, osd_buf, conf.osd_color); 2440 // end of check 2448 // Only do memory corruption testing if not recording video 2449 if (!MODE_IS_VIDEO(mode_get())) 2450 { 2451 // If defined the exmem memory is allocated; but not used for CHDK. 2452 // It is filled with a guard value (see wrappers.c) which is checked here 2453 // Any corruption is reported, otherwise 'OK' is displayed on screen (along with the exmem memory start address). 2454 extern void *exmem_start, *exmem_end; 2455 // check exmem allocated memory for corruption 2456 unsigned long* p = (unsigned long*)exmem_start; 2457 unsigned long *f = 0, *l = 0; 2458 long cnt = 0; 2459 while (p < (unsigned long*)exmem_end) 2460 { 2461 if (p[0] != 0xDEADBEEF) 2462 { 2463 l = p; 2464 if (f == 0) f = p; 2465 cnt++; 2466 } 2467 p++; 2468 } 2469 if (cnt != 0) 2470 { 2471 sprintf(osd_buf, "s:%8x e:%8x", exmem_start, exmem_end); 2472 draw_txt_string(2, 12, osd_buf, conf.osd_color); 2473 sprintf(osd_buf, "f:%8x l:%8x c:%d", f, l, cnt); 2474 } 2475 else 2476 { 2477 sprintf(osd_buf, "OK 0x%x", exmem_start); 2478 } 2479 draw_txt_string(2, 13, osd_buf, conf.osd_color); 2480 // end of check 2481 } 2441 2482 #endif 2442 2483 … … 2751 2792 draw_restore(); 2752 2793 gui_palette_init(PALETTE_MODE_DEFAULT, 0x00, NULL); 2753 gui_ mode = GUI_MODE_PALETTE;2794 gui_set_mode(GUI_MODE_PALETTE); 2754 2795 } 2755 2796 … … 2791 2832 draw_set_environment(aspect_xcorrection_games_360, aspect_ycorrection_games_360, GAMES_SCREEN_WIDTH, GAMES_SCREEN_HEIGHT); 2792 2833 #endif 2793 gui_ mode = GUI_MODE_REVERSI;2834 gui_set_mode(GUI_MODE_REVERSI); 2794 2835 gui_reversi_init(); 2795 2836 } … … 2808 2849 #endif 2809 2850 if ( gui_sokoban_init() ) 2810 gui_ mode = GUI_MODE_SOKOBAN;2851 gui_set_mode(GUI_MODE_SOKOBAN); 2811 2852 } 2812 2853 #endif … … 2823 2864 #endif 2824 2865 if ( gui_4wins_init() ) 2825 gui_ mode = GUI_MODE_4WINS;2866 gui_set_mode(GUI_MODE_4WINS); 2826 2867 } 2827 2868 #endif … … 2838 2879 #endif 2839 2880 if ( gui_mastermind_init() ) 2840 gui_ mode = GUI_MODE_MASTERMIND;2881 gui_set_mode(GUI_MODE_MASTERMIND); 2841 2882 } 2842 2883 #endif … … 2854 2895 #ifdef OPT_DEBUGGING 2855 2896 void gui_draw_bench(int arg) { 2856 gui_ mode = GUI_MODE_BENCH;2897 gui_set_mode(GUI_MODE_BENCH); 2857 2898 gui_bench_init(); 2858 2899 } … … 2943 2984 //------------------------------------------------------------------- 2944 2985 void gui_draw_osd_le(int arg) { 2945 gui_ mode = GUI_MODE_OSD;2986 gui_set_mode(GUI_MODE_OSD); 2946 2987 gui_osd_init(); 2947 2988 } … … 2954 2995 rbf_load_from_8x16(current_font); 2955 2996 rbf_set_codepage(conf.reader_codepage); 2956 gui_ mode = GUI_MODE_READ;2997 gui_set_mode(GUI_MODE_READ); 2957 2998 gui_read_init(fn); 2958 2999 } … … 2991 3032 void gui_menuproc_mkbootdisk(int arg) { 2992 3033 mark_filesystem_bootable(); 3034 gui_mbox_init(LANG_INFORMATION, LANG_CONSOLE_TEXT_FINISHED, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); 2993 3035 } 2994 3036 … … 3023 3065 #ifdef OPT_CALENDAR 3024 3066 void gui_draw_calendar(int arg) { 3025 gui_ mode = GUI_MODE_CALENDAR;3067 gui_set_mode(GUI_MODE_CALENDAR); 3026 3068 gui_calendar_init(); 3027 3069 } 3028 3070 #endif 3029 3071 //------------------------------------------------------------------- 3072 #ifdef OPT_TEXTREADER 3030 3073 static void gui_draw_rbf_selected(const char *fn) { 3031 3074 if (fn) { … … 3033 3076 } 3034 3077 } 3035 #ifdef OPT_TEXTREADER3036 3078 void gui_draw_load_rbf(int arg) { 3037 3079 DIR *d; -
trunk/core/gui_4wins.c
r1323 r1338 15 15 16 16 #define BORDER 20 17 #define XBORDER (CAM_TS_BUTTON_BORDER+BORDER) 17 18 #define RECT_SIZE 30 18 19 #define BORDER_TOP RECT_SIZE … … 52 53 for(i=1;field[column-1][i];i++); //1 ist wichtig (0=Fundament) 53 54 if (visible) { 54 draw_filled_ellipse(( BORDER+((column-1)*RECT_SIZE))+15, (BORDER+((6-i)*RECT_SIZE))+15+BORDER_TOP, 10,10, (cur_player==1)?P1_COLOR:P2_COLOR);55 draw_filled_ellipse((XBORDER+((column-1)*RECT_SIZE))+15, (BORDER+((6-i)*RECT_SIZE))+15+BORDER_TOP, 10,10, (cur_player==1)?P1_COLOR:P2_COLOR); 55 56 } 56 57 field[column-1][i]=player; … … 172 173 w=l*FONT_WIDTH+10; 173 174 174 x = (screen_width- w)>>1; y = ((screen_height)>>1);175 x = (screen_width-CAM_TS_BUTTON_BORDER-w)>>1; y = ((screen_height)>>1); 175 176 draw_filled_round_rect(x, y, x+w, y+FONT_HEIGHT+6, MAKE_COLOR(COLOR_RED, COLOR_RED)); 176 177 draw_string(x+((w-strlen(text)*FONT_WIDTH)>>1), y+4, text, cl); … … 180 181 { 181 182 if (cur_player==1) cur_player=2; else cur_player=1; 182 draw_filled_ellipse(( BORDER+((cursor_position)*RECT_SIZE))+15, BORDER+10, 10,10, (cur_player==1)?P1_COLOR:P2_COLOR);183 draw_filled_ellipse((XBORDER+((cursor_position)*RECT_SIZE))+15, BORDER+10, 10,10, (cur_player==1)?P1_COLOR:P2_COLOR); 183 184 } 184 185 //------------------------------------------------------------------- … … 237 238 void draw_mode() 238 239 { 239 draw_txt_string(30, 4, " ", TEXT_COLOR); 240 int x = (CAM_TS_BUTTON_BORDER/FONT_WIDTH) + 30; 241 draw_txt_string(x, 4, " ", TEXT_COLOR); 240 242 if (mode_rival==1) 241 draw_txt_string( 30, 4, lang_str(LANG_CONNECT4_HUMAN), TEXT_COLOR);243 draw_txt_string(x, 4, lang_str(LANG_CONNECT4_HUMAN), TEXT_COLOR); 242 244 else 243 draw_txt_string( 30, 4, PLATFORM, TEXT_COLOR);245 draw_txt_string(x, 4, PLATFORM, TEXT_COLOR); 244 246 } 245 247 //------------------------------------------------------------------- … … 273 275 static void move_cursor(int in_x_pos) 274 276 { 275 draw_filled_ellipse(( BORDER+((cursor_position)*RECT_SIZE))+15, BORDER+10, 10,10,BG_COLOR);277 draw_filled_ellipse((XBORDER+((cursor_position)*RECT_SIZE))+15, BORDER+10, 10,10,BG_COLOR); 276 278 if(in_game) 277 279 { … … 288 290 cursor_position=(cursor_position+in_x_pos)%8; 289 291 } 290 draw_filled_ellipse(( BORDER+((cursor_position)*RECT_SIZE))+15, BORDER+10, 10,10, (cur_player==1)?P1_COLOR:P2_COLOR);292 draw_filled_ellipse((XBORDER+((cursor_position)*RECT_SIZE))+15, BORDER+10, 10,10, (cur_player==1)?P1_COLOR:P2_COLOR); 291 293 } 292 294 //------------------------------------------------------------------- … … 300 302 srand(time(NULL)); 301 303 302 draw_filled_rect(0, 0, 360, 240, BG_COLOR); // draw backgraund303 draw_filled_rect( BORDER, BORDER+BORDER_TOP,BORDER+(7*RECT_SIZE), BORDER+(6*RECT_SIZE)+BORDER_TOP, FIELD_COLOR);304 draw_filled_round_rect( 240, 90,360-BORDER, 240-10, INFO_COLOR);305 draw_txt_string( 12, 0, lang_str(LANG_MENU_GAMES_CONNECT4), TEXT_COLOR);306 draw_line( 0,15,360,15,0xEF);304 draw_filled_rect(0, 0, screen_width, screen_height, BG_COLOR); // draw backgraund 305 draw_filled_rect(XBORDER, BORDER+BORDER_TOP, XBORDER+(7*RECT_SIZE), BORDER+(6*RECT_SIZE)+BORDER_TOP, FIELD_COLOR); 306 draw_filled_round_rect(CAM_TS_BUTTON_BORDER+240, 90, CAM_TS_BUTTON_BORDER+360-BORDER, 240-10, INFO_COLOR); 307 draw_txt_string((CAM_TS_BUTTON_BORDER/FONT_WIDTH)+12, 0, lang_str(LANG_MENU_GAMES_CONNECT4), TEXT_COLOR); 308 draw_line(CAM_TS_BUTTON_BORDER,15,CAM_TS_BUTTON_BORDER+360,15,COLOR_SPLASH_GREY); 307 309 308 310 for(i=0;i<7;i++) … … 311 313 { 312 314 field[i][j+1]=0; 313 draw_filled_ellipse( BORDER+(i*RECT_SIZE)+(RECT_SIZE/2), BORDER+(j*RECT_SIZE)+(RECT_SIZE/2)+BORDER_TOP, 10, 10, BG_COLOR);315 draw_filled_ellipse(XBORDER+(i*RECT_SIZE)+(RECT_SIZE/2), BORDER+(j*RECT_SIZE)+(RECT_SIZE/2)+BORDER_TOP, 10, 10, BG_COLOR); 314 316 } 315 317 } … … 320 322 321 323 move_cursor(0); 322 draw_txt_string( 30, 3, lang_str(LANG_CONNECT4_RIVAL), TEXT_COLOR);324 draw_txt_string((CAM_TS_BUTTON_BORDER/FONT_WIDTH)+30, 3, lang_str(LANG_CONNECT4_RIVAL), TEXT_COLOR); 323 325 sprintf(str, "%d",count_win[0]); 324 draw_txt_string( screen_width/FONT_WIDTH-2-10, screen_height/FONT_HEIGHT-9, str, MAKE_COLOR(INFO_COLOR, P1_COLOR));326 draw_txt_string((screen_width-CAM_TS_BUTTON_BORDER)/FONT_WIDTH-2-10, screen_height/FONT_HEIGHT-9, str, MAKE_COLOR(INFO_COLOR, P1_COLOR)); 325 327 sprintf(str, ":"); 326 draw_txt_string( screen_width/FONT_WIDTH-2-7, screen_height/FONT_HEIGHT-9, str, INFO_TEXT_COLOR);328 draw_txt_string((screen_width-CAM_TS_BUTTON_BORDER)/FONT_WIDTH-2-7, screen_height/FONT_HEIGHT-9, str, INFO_TEXT_COLOR); 327 329 sprintf(str, "%d",count_win[1]); 328 draw_txt_string( screen_width/FONT_WIDTH-2-4, screen_height/FONT_HEIGHT-9, str, MAKE_COLOR(INFO_COLOR, P2_COLOR));330 draw_txt_string((screen_width-CAM_TS_BUTTON_BORDER)/FONT_WIDTH-2-4, screen_height/FONT_HEIGHT-9, str, MAKE_COLOR(INFO_COLOR, P2_COLOR)); 329 331 draw_mode(); 330 332 if(cur_player==2&&!mode_rival) set(); … … 353 355 static char str[16]; 354 356 sprintf(str, "%3d%%", get_batt_perc()); 355 draw_txt_string( screen_width/FONT_WIDTH-2-13, screen_height/FONT_HEIGHT-2, str, INFO_TEXT_COLOR);356 gui_osd_draw_clock( 300,208,INFO_TEXT_COLOR);357 } 357 draw_txt_string((screen_width-CAM_TS_BUTTON_BORDER)/FONT_WIDTH-2-13, screen_height/FONT_HEIGHT-2, str, INFO_TEXT_COLOR); 358 gui_osd_draw_clock(CAM_TS_BUTTON_BORDER+290,208,INFO_TEXT_COLOR); 359 } -
trunk/core/gui_calendar.c
r1024 r1338 63 63 64 64 draw_filled_rect(0, 0, screen_width-1, screen_height-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR)); 65 draw_txt_string( 1, 0, lang_str(LANG_CALENDAR_TODAY), MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));65 draw_txt_string((CAM_TS_BUTTON_BORDER/FONT_WIDTH)+1, 0, lang_str(LANG_CALENDAR_TODAY), MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE)); 66 66 draw_rect(cal_x-3, cal_y-3, cal_x+cal_w+2, cal_y+cal_h+2, CALENDAR_COLOR); 67 67 draw_filled_rect(cal_x-1, cal_y-1, cal_x+cal_w, cal_y+FONT_HEIGHT+8, TITLE_COLOR); … … 132 132 ttm = localtime(&t); 133 133 sprintf(str, " %2u %s %04u %2u:%02u:%02u ", ttm->tm_mday, lang_str(months[ttm->tm_mon]), 1900+ttm->tm_year, ttm->tm_hour, ttm->tm_min, ttm->tm_sec); 134 draw_txt_string( 8, 0, str, MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));134 draw_txt_string((CAM_TS_BUTTON_BORDER/FONT_WIDTH)+8, 0, str, MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE)); 135 135 136 136 if (need_redraw) { -
trunk/core/gui_draw.c
r1299 r1338 317 317 draw_rectangle(x1,y1,x2,y2,cl&0xff,1); 318 318 } 319 320 void draw_round_rect_thick(coord x1, coord y1, coord x2, coord y2, color cl, int thickness) { 321 int i; 322 cl = cl & 0xff; 323 draw_rectangle(x1,y1,x2,y2,cl,1); 324 for (i=1; i<thickness; i++) 325 { 326 draw_rectangle(x1+i,y1+i,x2-i,y2-i,cl,0); 327 } 328 } 319 329 //------------------------------------------------------------------- 320 330 static void fill_rect(color cl) { … … 344 354 void draw_filled_round_rect(coord x1, coord y1, coord x2, coord y2, color cl) { 345 355 draw_round_rect(x1, y1, x2, y2, cl); 356 fill_rect(cl); 357 } 358 359 void draw_filled_round_rect_thick(coord x1, coord y1, coord x2, coord y2, color cl, int thickness) { 360 draw_round_rect_thick(x1, y1, x2, y2, cl, thickness); 346 361 fill_rect(cl); 347 362 } … … 418 433 #ifdef CAM_DETECT_SCREEN_ERASE 419 434 draw_set_guard(); 435 #ifdef CAM_TOUCHSCREEN_UI 436 extern int redraw_buttons; 437 redraw_buttons = 1; 438 #endif 420 439 #endif 421 440 } -
trunk/core/gui_draw.h
r1271 r1338 208 208 #define COLOR_BLUE_LT 0x10 209 209 #define COLOR_BLUE 0x14 210 #define COLOR_YELLOW 0x 16210 #define COLOR_YELLOW 0x60 211 211 #define COLOR_BLACK 0xFF 212 212 #define COLOR_BG 0x62 … … 229 229 #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 230 230 #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 231 #define COLOR_HISTO_RG_PLAY COLOR_YELLOW231 #define COLOR_HISTO_RG_PLAY 0x80 232 232 #undef SCREEN_COLOR 233 233 #define SCREEN_COLOR 0x1D … … 366 366 #define COLOR_HISTO_RG_PLAY COLOR_YELLOW 367 367 368 #elif CAM_BITMAP_PALETTE==12 //(IXUS 310) 369 #define COLOR_TRANSPARENT 0x00 370 #define COLOR_WHITE 0x01 371 #define COLOR_RED 0x1e 372 #define COLOR_GREY 0x1a 373 #define COLOR_GREEN 0x17 374 #define COLOR_BLUE_LT 0x10 375 #define COLOR_BLUE 0x14 376 #define COLOR_YELLOW 0x74 377 #define COLOR_BLACK 0xFF 378 #define COLOR_BG 0x1b 379 #define COLOR_FG COLOR_WHITE 380 #define COLOR_SELECTED_BG 0x0e 381 #define COLOR_SELECTED_FG COLOR_BLACK 382 #define COLOR_ALT_BG COLOR_BG 383 #define COLOR_SPLASH_RED COLOR_RED 384 #define COLOR_SPLASH_PINK 0x1e // Orange 385 #define COLOR_SPLASH_GREY 0x16 386 #define COLOR_HISTO_R 0x7a 387 #define COLOR_HISTO_R_PLAY 0x8f 388 #define COLOR_HISTO_B 0x7b 389 #define COLOR_HISTO_B_PLAY 0x90 390 #define COLOR_HISTO_G 0x7d 391 #define COLOR_HISTO_G_PLAY 0x91 392 #define COLOR_HISTO_BG COLOR_BLUE_LT 393 #define COLOR_HISTO_RG COLOR_YELLOW 394 #define COLOR_HISTO_RB COLOR_RED 395 #define COLOR_HISTO_RB_PLAY COLOR_HISTO_RB 396 #define COLOR_HISTO_BG_PLAY COLOR_BLUE_LT 397 #define COLOR_HISTO_RG_PLAY 0x85 398 #undef SCREEN_COLOR 399 #define SCREEN_COLOR 0x1D 400 368 401 #else 369 402 #error CAM_BITMAP_PALETTE not defined … … 398 431 extern void draw_rect_shadow(coord x1, coord y1, coord x2, coord y2, color cl, int thickness); 399 432 extern void draw_round_rect(coord x1, coord y1, coord x2, coord y2, color cl); 433 extern void draw_round_rect_thick(coord x1, coord y1, coord x2, coord y2, color cl, int thickness); 400 434 // color: hi_byte - BG; lo_byte - FG 401 435 extern void draw_filled_rect(coord x1, coord y1, coord x2, coord y2, color cl); 402 436 extern void draw_filled_rect_thick(coord x1, coord y1, coord x2, coord y2, color cl, int thickness); 403 437 extern void draw_filled_round_rect(coord x1, coord y1, coord x2, coord y2, color cl); 438 extern void draw_filled_round_rect_thick(coord x1, coord y1, coord x2, coord y2, color cl, int thickness); 404 439 405 440 extern void draw_char(coord x, coord y, const char ch, color cl); -
trunk/core/gui_lang.c
r1045 r1338 583 583 "460 \"You need to be in REC-mode\\nfor this operation.\"\n" 584 584 "461 \"%s disabled in build\"\n" 585 586 // Touch screen 587 "462 \"Touchscreen overrides\"\n" 588 "463 \"Video AE Controls\"\n" 589 "464 \"<Alt> Shortcut Buttons\"\n" 585 590 ; 586 591 -
trunk/core/gui_lang.h
r1045 r1338 571 571 #define LANG_MENU_BADPIXEL_CREATE 459 572 572 #define LANG_MSG_RECMODE_REQUIRED 460 573 #define LANG_CONSOLE_SCRIPT_DISABLED_IN_BUILD 461573 #define LANG_CONSOLE_SCRIPT_DISABLED_IN_BUILD 461 574 574 //------------------------------------------------------------------- 575 576 #define GUI_LANG_ITEMS 461 575 // Touch screen 576 #define LANG_MENU_TOUCHSCREEN_VALUES 462 577 #define LANG_MENU_TS_VIDEO_AE_DISABLE 463 578 #define LANG_MENU_TS_ALT_SHORTCUTS_DISABLE 464 579 //------------------------------------------------------------------- 580 581 #define GUI_LANG_ITEMS 464 577 582 578 583 //------------------------------------------------------------------- -
trunk/core/gui_mastermind.c
r1323 r1338 21 21 int curr_y; 22 22 int answer[4]; 23 char colors[6] ;23 char colors[6] = { COLOR_HISTO_R_PLAY, COLOR_HISTO_G_PLAY, COLOR_HISTO_B_PLAY, COLOR_YELLOW, COLOR_WHITE, COLOR_BLACK }; 24 24 int curr_color[4]; 25 25 int GameGo; 26 26 static char buf[128]; 27 27 28 static void guess_box(int pos, color col) 29 { 30 draw_filled_rect(CAM_TS_BUTTON_BORDER+100+(pos*10), BORDER+(2*curr_y*10)+2+2*curr_y, CAM_TS_BUTTON_BORDER+100+(pos*10)+6, BORDER+(2*curr_y*10)+8+2*curr_y , MAKE_COLOR(col,col)); 31 } 32 28 33 char WinQuary(){ 29 34 char pos=0; 30 int i=0; 31 32 for(i=0;i<4;i++){ 33 if(answer[i]==curr_color[i]){ 34 draw_filled_rect(100+(pos*10), BORDER+(2*curr_y*10)+2+2*curr_y, 100+(pos*10)+6, BORDER+(2*curr_y*10)+8+2*curr_y , MAKE_COLOR(COLOR_BLACK,COLOR_BLACK)); 35 int i, j; 36 37 for (i=0; i<4; i++) 38 { 39 if (answer[i] == curr_color[i]) 40 { 41 guess_box(pos,COLOR_BLACK); 35 42 pos++; 36 43 } 37 44 } 38 45 39 if(pos==4){ 40 GameGo=0; 46 if (pos == 4) 47 { 48 GameGo = 0; 41 49 return 1; 42 50 } 43 51 44 if(answer[0]==curr_color[1] || answer[0]==curr_color[2] || answer[0]==curr_color[3]){ 45 draw_filled_rect(100+(pos*10), BORDER+(2*curr_y*10)+2+2*curr_y, 100+(pos*10)+6, BORDER+(2*curr_y*10)+8+2*curr_y , MAKE_COLOR(COLOR_WHITE,COLOR_WHITE)); 46 pos++; 47 } 48 if(answer[1]==curr_color[0] || answer[1]==curr_color[2] || answer[1]==curr_color[3]){ 49 draw_filled_rect(100+(pos*10), BORDER+(2*curr_y*10)+2+2*curr_y, 100+(pos*10)+6, BORDER+(2*curr_y*10)+8+2*curr_y , MAKE_COLOR(COLOR_WHITE,COLOR_WHITE)); 50 pos++; 51 } 52 if(answer[2]==curr_color[0] || answer[2]==curr_color[1] || answer[2]==curr_color[3]){ 53 draw_filled_rect(100+(pos*10), BORDER+(2*curr_y*10)+2+2*curr_y, 100+(pos*10)+6, BORDER+(2*curr_y*10)+8+2*curr_y , MAKE_COLOR(COLOR_WHITE,COLOR_WHITE)); 54 pos++; 55 } 56 if(answer[3]==curr_color[0] || answer[3]==curr_color[1] || answer[3]==curr_color[2]){ 57 draw_filled_rect(100+(pos*10), BORDER+(2*curr_y*10)+2+2*curr_y, 100+(pos*10)+6, BORDER+(2*curr_y*10)+8+2*curr_y , MAKE_COLOR(COLOR_WHITE,COLOR_WHITE)); 58 pos++; 59 } 60 61 if(curr_y==0){ 62 GameGo=0; 52 for (i=0; i<4; i++) 53 { 54 for (j=0; j<4; j++) 55 { 56 if ((answer[i] == curr_color[j]) && (i != j)) 57 { 58 guess_box(pos,COLOR_WHITE); 59 pos++; 60 } 61 } 62 } 63 64 if(curr_y==0) 65 { 66 GameGo = 0; 63 67 return 2; 64 68 } 69 65 70 return 0; 66 71 } 67 72 68 73 char CanNext(){ 69 if (curr_color[0]==99 || curr_color[1]==99 || curr_color[2]==99 || curr_color[3]==99)74 if (curr_color[0]==99 || curr_color[1]==99 || curr_color[2]==99 || curr_color[3]==99) 70 75 return 0; 71 else if(curr_color[0]==curr_color[1] || curr_color[0]==curr_color[2] || curr_color[0]==curr_color[3] || 72 curr_color[1]==curr_color[2] || curr_color[1]==curr_color[3] || curr_color[2]==curr_color[3]){ 73 draw_string(167, 130 , lang_str(LANG_MENU_GAMES_DCOLOR), TEXT_COLOR); 76 else if (curr_color[0]==curr_color[1] || curr_color[0]==curr_color[2] || curr_color[0]==curr_color[3] || 77 curr_color[1]==curr_color[2] || curr_color[1]==curr_color[3] || curr_color[2]==curr_color[3]) 78 { 79 draw_string(CAM_TS_BUTTON_BORDER+167, 130, lang_str(LANG_MENU_GAMES_DCOLOR), TEXT_COLOR); 74 80 return 0; 75 81 } … … 81 87 int i=0; 82 88 83 for(i=0;i<4;i++)answer[i]=99; 84 i=0; 85 while(i<4){ 86 tmp=rand()%6; 87 if(answer[0]!=tmp && answer[1]!=tmp && answer[2]!=tmp && answer[3]!=tmp){ 88 answer[i]=tmp; 89 for (i=0; i<4; i++) answer[i] = 99; 90 i = 0; 91 while (i<4) 92 { 93 tmp = rand() % 6; 94 if (answer[0]!=tmp && answer[1]!=tmp && answer[2]!=tmp && answer[3]!=tmp) 95 { 96 answer[i] = tmp; 89 97 i++; 90 98 } 91 99 } 92 93 //for (i=0; i<4;i++)94 // draw_filled_rect(BORDER+(2*i*10), 213, BORDER+(2*i*10)+10,223, MAKE_COLOR(colors[answer[i]],colors[answer[i]]));95 96 100 } 97 101 98 102 int gui_mastermind_init() { 99 103 int i,j; 100 colors[0]=COLOR_HISTO_R_PLAY;101 colors[1]=COLOR_HISTO_G_PLAY;102 colors[2]=COLOR_HISTO_B_PLAY;103 colors[3]=COLOR_YELLOW;104 colors[4]=COLOR_WHITE;105 colors[5]=COLOR_BLACK;106 curr_color[0]=0;107 curr_color[1]=0;108 curr_color[2]=0;109 curr_color[3]=0;110 104 111 105 curr_x=0; 112 106 curr_y=7; 113 107 114 draw_filled_rect( 0, 0, 360, 240, BG_COLOR); 115 116 for (i=0;i<4;i++){ 117 for (j=0;j<8;j++){ 118 draw_filled_rect(BORDER+(2*i*10), BORDER+(2*j*10)+2*j, BORDER+(2*i*10)+10, BORDER+(2*j*10)+2*j+10 , COLOR_LIGHT_GRAY); 119 } 120 } 121 122 draw_filled_rect(10, BORDER+(2*j*10)+2*j, 150,BORDER+(2*j*10)+2*j+1, MAKE_COLOR(BG_COLOR,COLOR_WHITE)); 123 draw_filled_rect(148, 10, 149,230, MAKE_COLOR(BG_COLOR,COLOR_WHITE)); 124 draw_filled_rect(151, 10, 152,230, MAKE_COLOR(BG_COLOR,COLOR_WHITE)); 125 126 //for (i=0; i<4;i++) 127 // draw_filled_rect(BORDER+(2*i*10), 213, BORDER+(2*i*10)+10,223, COLOR_LIGHT_GRAY); 108 draw_filled_rect( 0, 0, screen_width-1, screen_height-1, BG_COLOR); 109 110 for (i=0;i<4;i++) 111 for (j=0;j<8;j++) 112 draw_filled_rect(CAM_TS_BUTTON_BORDER+BORDER+(2*i*10), BORDER+(2*j*10)+2*j, CAM_TS_BUTTON_BORDER+BORDER+(2*i*10)+10, BORDER+(2*j*10)+2*j+10 , COLOR_LIGHT_GRAY); 113 114 draw_filled_rect(CAM_TS_BUTTON_BORDER+10, BORDER+(2*j*10)+2*j, CAM_TS_BUTTON_BORDER+150,BORDER+(2*j*10)+2*j+1, MAKE_COLOR(BG_COLOR,COLOR_WHITE)); 115 draw_filled_rect(CAM_TS_BUTTON_BORDER+148, 10, CAM_TS_BUTTON_BORDER+149,230, MAKE_COLOR(BG_COLOR,COLOR_WHITE)); 116 draw_filled_rect(CAM_TS_BUTTON_BORDER+151, 10, CAM_TS_BUTTON_BORDER+152,230, MAKE_COLOR(BG_COLOR,COLOR_WHITE)); 128 117 129 118 for (i=0; i<6;i++) 130 draw_filled_rect( BORDER+(2*(i+7)*10)+20, 40,BORDER+(2*(i+7)*10)+35,55, MAKE_COLOR(colors[i],colors[i]));119 draw_filled_rect(CAM_TS_BUTTON_BORDER+BORDER+(2*(i+7)*10)+20, 40, CAM_TS_BUTTON_BORDER+BORDER+(2*(i+7)*10)+35,55, MAKE_COLOR(colors[i],colors[i])); 131 120 132 draw_filled_rect(BORDER+(2*7*10)+20, 65, BORDER+(2*7*10)+35,80, MAKE_COLOR(COLOR_BLACK,COLOR_BLACK)); 133 draw_string(BORDER+(2*7*10)+50, 65 , lang_str(LANG_MENU_GAMES_RIGHT_PLACE), TEXT_COLOR); 134 135 draw_filled_rect(BORDER+(2*7*10)+20, 90, BORDER+(2*7*10)+35,105, MAKE_COLOR(COLOR_WHITE,COLOR_WHITE)); 136 draw_string(BORDER+(2*7*10)+50, 90 , lang_str(LANG_MENU_GAMES_C_IN_ANSWER), TEXT_COLOR); 137 121 draw_filled_rect(CAM_TS_BUTTON_BORDER+BORDER+(2*7*10)+20, 65, CAM_TS_BUTTON_BORDER+BORDER+(2*7*10)+35,80, MAKE_COLOR(COLOR_BLACK,COLOR_BLACK)); 122 draw_string(CAM_TS_BUTTON_BORDER+BORDER+(2*7*10)+50, 65 , lang_str(LANG_MENU_GAMES_RIGHT_PLACE), TEXT_COLOR); 123 124 draw_filled_rect(CAM_TS_BUTTON_BORDER+BORDER+(2*7*10)+20, 90, CAM_TS_BUTTON_BORDER+BORDER+(2*7*10)+35,105, MAKE_COLOR(COLOR_WHITE,COLOR_WHITE)); 125 draw_string(CAM_TS_BUTTON_BORDER+BORDER+(2*7*10)+50, 90 , lang_str(LANG_MENU_GAMES_C_IN_ANSWER), TEXT_COLOR); 138 126 139 draw_string( 173, 20 , lang_str(LANG_MENU_GAMES_AC_COLORS), TEXT_COLOR);127 draw_string(CAM_TS_BUTTON_BORDER+173, 20 , lang_str(LANG_MENU_GAMES_AC_COLORS), TEXT_COLOR); 140 128 141 draw_string( 167, 200 , lang_str(LANG_MENU_GAMES_CURSOR1), TEXT_COLOR);142 draw_string( 167, 185 , lang_str(LANG_MENU_GAMES_CURSOR2), TEXT_COLOR);143 draw_string( 167, 170 , lang_str(LANG_MENU_GAMES_CURSOR3), TEXT_COLOR);129 draw_string(CAM_TS_BUTTON_BORDER+167, 200 , lang_str(LANG_MENU_GAMES_CURSOR1), TEXT_COLOR); 130 draw_string(CAM_TS_BUTTON_BORDER+167, 185 , lang_str(LANG_MENU_GAMES_CURSOR2), TEXT_COLOR); 131 draw_string(CAM_TS_BUTTON_BORDER+167, 170 , lang_str(LANG_MENU_GAMES_CURSOR3), TEXT_COLOR); 144 132 145 133 for(i=0;i<4;i++) curr_color[i]=99; … … 148 136 } 149 137 //------------------------------------------------------------------- 138 static void draw_box(color border) 139 { 140 if (curr_color[curr_x] == 99) curr_color[curr_x] = 0; 141 draw_filled_rect(CAM_TS_BUTTON_BORDER+BORDER+(2*curr_x*10), BORDER+(2*curr_y*10)+2*curr_y, CAM_TS_BUTTON_BORDER+BORDER+(2*curr_x*10)+10, BORDER+(2*curr_y*10)+2*curr_y+10 , MAKE_COLOR(colors[curr_color[curr_x]],border)); 142 } 143 144 static void end_game(int msg) 145 { 146 int i; 147 draw_string(CAM_TS_BUTTON_BORDER+198, 130 , lang_str(msg), TEXT_COLOR); 148 for (i=0; i<4;i++) 149 draw_filled_rect(CAM_TS_BUTTON_BORDER+BORDER+(2*i*10), 213, CAM_TS_BUTTON_BORDER+BORDER+(2*i*10)+10,223, MAKE_COLOR(colors[answer[i]],colors[answer[i]])); 150 } 151 152 static void chg_box(int inc_box, int inc_val) 153 { 154 draw_box(colors[curr_color[curr_x]]); 155 curr_x = (curr_x + inc_box) & 3; 156 if (curr_color[curr_x] == 99) curr_color[curr_x] = 0; 157 curr_color[curr_x] = (curr_color[curr_x] + inc_val); 158 if (curr_color[curr_x] < 0) curr_color[curr_x] = 5; 159 else if (curr_color[curr_x] > 5) curr_color[curr_x] = 0; 160 draw_box(COLOR_BLACK); 161 } 162 150 163 void gui_mastermind_kbd_process() { 151 164 int i=0; 152 165 rand(); 153 switch (kbd_get_autoclicked_key()) 154 { 155 case KEY_SET: 156 if(GameGo==1){ 157 if(CanNext()){ 158 if(WinQuary()==1){ 159 draw_string(198, 130 , lang_str(LANG_MENU_GAMES_RIGHT), TEXT_COLOR); 160 draw_string(167, 200 , lang_str(LANG_MENU_GAMES_CURSOR1), TEXT_COLOR); 161 draw_string(167, 185 , lang_str(LANG_MENU_GAMES_CURSOR2), TEXT_COLOR); 162 draw_string(167, 170 , lang_str(LANG_MENU_GAMES_CURSOR3), TEXT_COLOR); 163 for (i=0; i<4;i++) 164 draw_filled_rect(BORDER+(2*i*10), 213, BORDER+(2*i*10)+10,223, MAKE_COLOR(colors[answer[i]],colors[answer[i]])); 165 } 166 else if(WinQuary()==2){ 167 draw_string(198, 130 , lang_str(LANG_MENU_GAMES_GAME_OVER), TEXT_COLOR); 168 draw_string(167, 200 , lang_str(LANG_MENU_GAMES_CURSOR1), TEXT_COLOR); 169 draw_string(167, 185 , lang_str(LANG_MENU_GAMES_CURSOR2), TEXT_COLOR); 170 draw_string(167, 170 , lang_str(LANG_MENU_GAMES_CURSOR3), TEXT_COLOR); 171 for (i=0; i<4;i++) 172 draw_filled_rect(BORDER+(2*i*10), 213, BORDER+(2*i*10)+10,223, MAKE_COLOR(colors[answer[i]],colors[answer[i]])); 173 } 174 else{ 175 draw_filled_rect(BORDER+(2*(curr_x)*10), BORDER+(2*curr_y*10)+2*curr_y, BORDER+(2*(curr_x)*10)+10, BORDER+(2*curr_y*10)+2*curr_y+10 , MAKE_COLOR(colors[curr_color[curr_x]],colors[curr_color[curr_x]])); 176 for(i=0;i<4;i++) curr_color[i]=99; 177 curr_y--; 178 curr_x=0; 179 if(curr_color[curr_x]==99) curr_color[curr_x]=0; 180 draw_filled_rect(BORDER+(2*curr_x*10), BORDER+(2*curr_y*10)+2*curr_y, BORDER+(2*curr_x*10)+10, BORDER+(2*curr_y*10)+2*curr_y+10 , MAKE_COLOR(colors[curr_color[curr_x]],COLOR_BLACK)); 181 } 182 } 183 } 184 else{ 185 gui_mastermind_init(); 186 CreateColorCombo(); 187 for (i=0; i<4;i++)draw_filled_rect(BORDER+(2*i*10), 213, BORDER+(2*i*10)+10,223, BG_COLOR); // overwrite anwser 188 curr_x=0; 189 if(curr_color[curr_x]==99) curr_color[curr_x]=0; 190 draw_filled_rect(BORDER+(2*curr_x*10), BORDER+(2*curr_y*10)+2*curr_y, BORDER+(2*curr_x*10)+10, BORDER+(2*curr_y*10)+2*curr_y+10 , MAKE_COLOR(colors[curr_color[curr_x]],COLOR_BLACK)); 191 GameGo=1; 192 draw_string(198, 130 , " ", TEXT_COLOR); 193 } 194 break; 195 case KEY_LEFT: 196 if(GameGo==1){ 197 draw_filled_rect(BORDER+(2*curr_x*10), BORDER+(2*curr_y*10)+2*curr_y, BORDER+(2*curr_x*10)+10, BORDER+(2*curr_y*10)+2*curr_y+10 , MAKE_COLOR(colors[curr_color[curr_x]],colors[curr_color[curr_x]])); 198 (curr_x==0)?curr_x=3:curr_x--; 199 if(curr_color[curr_x]==99) curr_color[curr_x]=0; 200 draw_filled_rect(BORDER+(2*curr_x*10), BORDER+(2*curr_y*10)+2*curr_y, BORDER+(2*curr_x*10)+10, BORDER+(2*curr_y*10)+2*curr_y+10 , MAKE_COLOR(colors[curr_color[curr_x]],COLOR_BLACK)); 201 } 202 break; 203 case KEY_RIGHT: 204 if(GameGo==1){ 205 draw_filled_rect(BORDER+(2*curr_x*10), BORDER+(2*curr_y*10)+2*curr_y, BORDER+(2*curr_x*10)+10, BORDER+(2*curr_y*10)+2*curr_y+10 , MAKE_COLOR(colors[curr_color[curr_x]],colors[curr_color[curr_x]])); 206 curr_x=(curr_x+1)%4; 207 if(curr_color[curr_x]==99) curr_color[curr_x]=0; 208 draw_filled_rect(BORDER+(2*curr_x*10), BORDER+(2*curr_y*10)+2*curr_y, BORDER+(2*curr_x*10)+10, BORDER+(2*curr_y*10)+2*curr_y+10 , MAKE_COLOR(colors[curr_color[curr_x]],COLOR_BLACK)); 209 } 210 break; 211 case KEY_UP: 212 if(GameGo==1){ 213 draw_string(167, 130 , " ", TEXT_COLOR); 214 curr_color[curr_x]=(curr_color[curr_x]+1)%6; 215 draw_filled_rect(BORDER+(2*curr_x*10), BORDER+(2*curr_y*10)+2*curr_y, BORDER+(2*curr_x*10)+10, BORDER+(2*curr_y*10)+2*curr_y+10 , MAKE_COLOR(colors[curr_color[curr_x]],COLOR_BLACK)); 216 } 217 break; 218 case KEY_DOWN: 219 if(GameGo==1){ 220 draw_string(167, 130 , " ", TEXT_COLOR); 221 (curr_color[curr_x]-1<0)?curr_color[curr_x]=5:curr_color[curr_x]--; 222 draw_filled_rect(BORDER+(2*curr_x*10), BORDER+(2*curr_y*10)+2*curr_y, BORDER+(2*curr_x*10)+10, BORDER+(2*curr_y*10)+2*curr_y+10 , MAKE_COLOR(colors[curr_color[curr_x]],COLOR_BLACK)); 223 } 224 break; 225 } 166 long key = kbd_get_autoclicked_key(); 167 if (key) 168 { 169 if (GameGo == 1) 170 { 171 draw_string(CAM_TS_BUTTON_BORDER+167, 130 , " ", TEXT_COLOR); 172 switch (kbd_get_autoclicked_key()) 173 { 174 case KEY_SET: 175 if(CanNext()) 176 { 177 if(WinQuary() == 1) 178 { 179 end_game(LANG_MENU_GAMES_RIGHT); 180 } 181 else if(WinQuary() == 2) 182 { 183 end_game(LANG_MENU_GAMES_GAME_OVER); 184 } 185 else 186 { 187 draw_box(colors[curr_color[curr_x]]); 188 for(i=0;i<4;i++) curr_color[i]=99; 189 curr_y--; 190 curr_x=0; 191 draw_box(COLOR_BLACK); 192 } 193 } 194 break; 195 case KEY_LEFT: 196 chg_box(-1,0); 197 break; 198 case KEY_RIGHT: 199 chg_box(1,0); 200 break; 201 case KEY_UP: 202 chg_box(0,1); 203 break; 204 case KEY_DOWN: 205 chg_box(0,-1); 206 break; 207 } 208 } 209 else if (key == KEY_SET) 210 { 211 gui_mastermind_init(); 212 CreateColorCombo(); 213 draw_box(COLOR_BLACK); 214 GameGo=1; 215 } 216 } 226 217 } 227 218 //------------------------------------------------------------------- … … 230 221 static struct tm *ttm; 231 222 232 draw_txt_string( 15, 0, lang_str(LANG_MENU_GAMES_MASTERMIND), MAKE_COLOR(BG_COLOR, COLOR_WHITE));223 draw_txt_string(CAM_TS_BUTTON_BORDER/FONT_WIDTH+15, 0, lang_str(LANG_MENU_GAMES_MASTERMIND), MAKE_COLOR(BG_COLOR, COLOR_WHITE)); 233 224 234 225 t = time(NULL); 235 226 ttm = localtime(&t); 236 sprintf(buf, "Time: %2u:%02u", ttm->tm_hour, ttm->tm_min); 237 draw_txt_string(screen_width/FONT_WIDTH-2-1-1-9-2-5-4, screen_height/FONT_HEIGHT-1, buf, TEXT_COLOR); 238 239 sprintf(buf, "Batt:%3d%%", get_batt_perc()); 240 draw_txt_string(screen_width/FONT_WIDTH-2-9, screen_height/FONT_HEIGHT-1, buf, TEXT_COLOR); 241 } 227 sprintf(buf, "Time: %2u:%02u Batt:%3d%%", ttm->tm_hour, ttm->tm_min, get_batt_perc()); 228 draw_txt_string((screen_width-CAM_TS_BUTTON_BORDER)/FONT_WIDTH-2-1-1-9-2-5-4, screen_height/FONT_HEIGHT-1, buf, TEXT_COLOR); 229 } -
trunk/core/gui_palette.c
r1234 r1338 65 65 66 66 void gui_palette_draw() { 67 unsigned int x, y ;67 unsigned int x, y, xl, xr; 68 68 char f=0; 69 69 color c; 70 70 static char buf[64]; 71 71 72 xl = CAM_TS_BUTTON_BORDER; 73 xr = screen_width - CAM_TS_BUTTON_BORDER; 74 72 75 if (gui_palette_redraw) 73 76 { 74 77 // Draw top text line - current color + instructions 75 draw_string( screen_width-29*FONT_WIDTH, 0, " Use \x18\x19\x1b\x1a to change color ", MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));78 draw_string(xr-29*FONT_WIDTH, 0, " Use \x18\x19\x1b\x1a to change color ", MAKE_COLOR(COLOR_BLACK, COLOR_WHITE)); 76 79 sprintf(buf, " %s: 0x%02hX ", lang_str(LANG_PALETTE_TEXT_COLOR), (unsigned char)cl); 77 draw_ txt_string(0, 0, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));80 draw_string(xl, 0, buf, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE)); 78 81 79 82 // Draw Palette color boxes … … 83 86 for (x=DISP_LEFT; x<DISP_RIGHT; x+=CELL_SIZE, c+=0x0100) 84 87 { 85 draw_filled_rect(x , y,x+CELL_SIZE, y+CELL_SIZE, c);88 draw_filled_rect(xl+x, y, xl+x+CELL_SIZE, y+CELL_SIZE, c); 86 89 } 87 90 } 88 91 89 92 // Draw gray borders 90 draw_rect_thick( 0, DISP_TOP-BORDER_SIZE, screen_width-1, screen_height-1, COLOR_GREY, BORDER_SIZE); // outer border91 draw_filled_rect( DISP_RIGHT+1, DISP_TOP,DISP_RIGHT+BORDER_SIZE, DISP_BOTTOM, MAKE_COLOR(COLOR_GREY, COLOR_GREY)); //middle93 draw_rect_thick(xl, DISP_TOP-BORDER_SIZE, xr-1, screen_height-1, COLOR_GREY, BORDER_SIZE); // outer border 94 draw_filled_rect(xl+DISP_RIGHT+1, DISP_TOP, xl+DISP_RIGHT+BORDER_SIZE, DISP_BOTTOM, MAKE_COLOR(COLOR_GREY, COLOR_GREY)); //middle 92 95 93 // Co-ordin tate of selected color96 // Co-ordinate of selected color 94 97 y = DISP_TOP + ((cl>>4)&0x0F) * CELL_SIZE; 95 98 x = DISP_LEFT + (cl&0x0F) * CELL_SIZE; 96 99 97 100 // Highlight selected color 98 draw_filled_rect_thick(x -CELL_ZOOM, y-CELL_ZOOM,x+CELL_SIZE+CELL_ZOOM, y+CELL_SIZE+CELL_ZOOM, MAKE_COLOR(cl, COLOR_RED), 2);101 draw_filled_rect_thick(xl+x-CELL_ZOOM, y-CELL_ZOOM, xl+x+CELL_SIZE+CELL_ZOOM, y+CELL_SIZE+CELL_ZOOM, MAKE_COLOR(cl, COLOR_RED), 2); 99 102 100 103 // Fill 'sample' area with selected color 101 draw_filled_rect( DISP_RIGHT+BORDER_SIZE+1, DISP_TOP, screen_width-BORDER_SIZE-1, DISP_BOTTOM, MAKE_COLOR(cl, COLOR_WHITE));104 draw_filled_rect(xl+DISP_RIGHT+BORDER_SIZE+1, DISP_TOP, xr-BORDER_SIZE-1, DISP_BOTTOM, MAKE_COLOR(cl, COLOR_WHITE)); 102 105 103 106 gui_palette_redraw = 0; -
trunk/core/gui_read.c
r547 r1338 26 26 static void gui_read_draw_batt() { 27 27 sprintf(buffer, "Batt:%3d%%", get_batt_perc()); 28 draw_txt_string( screen_width/FONT_WIDTH-2-1-1-9, 0, buffer, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));28 draw_txt_string((screen_width-CAM_TS_BUTTON_BORDER)/FONT_WIDTH-2-1-1-9, 0, buffer, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE)); 29 29 } 30 30 … … 37 37 ttm = localtime(&t); 38 38 sprintf(buffer, "%2u:%02u", ttm->tm_hour, ttm->tm_min); 39 draw_txt_string( screen_width/FONT_WIDTH-2-1-1-9-2-5, 0, buffer, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE));39 draw_txt_string((screen_width-CAM_TS_BUTTON_BORDER)/FONT_WIDTH-2-1-1-9-2-5, 0, buffer, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE)); 40 40 } 41 41 42 42 //------------------------------------------------------------------- 43 43 static void gui_read_draw_scroll_indicator() { 44 draw_txt_char( screen_width/FONT_WIDTH-2, 0, (conf.reader_autoscroll)?((pause)?'\x05':'\x04'):'\x03', MAKE_COLOR(COLOR_BLACK, COLOR_WHITE)); //title infoline44 draw_txt_char((screen_width-CAM_TS_BUTTON_BORDER)/FONT_WIDTH-2, 0, (conf.reader_autoscroll)?((pause)?'\x05':'\x04'):'\x03', MAKE_COLOR(COLOR_BLACK, COLOR_WHITE)); //title infoline 45 45 } 46 46 … … 60 60 pause = 0; 61 61 read_to_draw = 1; 62 x= 6;62 x=CAM_TS_BUTTON_BORDER+6; 63 63 y=FONT_HEIGHT; 64 w=screen_width- 6-6-8;64 w=screen_width-CAM_TS_BUTTON_BORDER*2-6-6-8; 65 65 h=screen_height-y; 66 66 last_time = get_tick_count(); … … 167 167 sprintf(buffer, "(%3d%%) %d/%d ", (read_file_size)?(conf.reader_pos*100/read_file_size):0, conf.reader_pos, read_file_size); 168 168 buffer[screen_width/FONT_WIDTH]=0; 169 draw_txt_string( 0, 0, buffer, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE)); //title infoline169 draw_txt_string((CAM_TS_BUTTON_BORDER/FONT_WIDTH), 0, buffer, MAKE_COLOR(COLOR_BLACK, COLOR_WHITE)); //title infoline 170 170 171 171 // scrollbar -
trunk/core/gui_reversi.c
r1323 r1338 220 220 221 221 field_size = (screen_height-2*FONT_HEIGHT-4)&0xFFF8; 222 field_x = FONT_WIDTH+8;222 field_x = CAM_TS_BUTTON_BORDER+FONT_WIDTH+8; 223 223 field_y = (screen_height-field_size)>>1; 224 224 cell_size = field_size >> 3; … … 322 322 //------------------------------------------------------------------- 323 323 static void redrawstatus() { 324 uchar x=field_size+FONT_WIDTH*2+23, y = 25;324 int x=CAM_TS_BUTTON_BORDER+field_size+FONT_WIDTH*2+23, y = 25; 325 325 if (InGame) { 326 326 if (CurrPlayer==FIELD_PLAYER1) { … … 410 410 411 411 sprintf(buf, "Batt:%3d%%", get_batt_perc()); 412 draw_txt_string( screen_width/FONT_WIDTH-2-9, screen_height/FONT_HEIGHT-1, buf, MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));412 draw_txt_string((screen_width-CAM_TS_BUTTON_BORDER)/FONT_WIDTH-2-9, screen_height/FONT_HEIGHT-1, buf, MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE)); 413 413 414 414 Timer(); -
trunk/core/gui_sokoban.c
r1323 r1338 48 48 49 49 static int need_redraw; 50 static int need_redraw_all; 50 51 static int moves; 51 52 static char field[FIELD_HEIGHT][FIELD_WIDTH]; … … 216 217 if (++conf.sokoban_level >= num_levels) conf.sokoban_level = 0; 217 218 sokoban_set_level(conf.sokoban_level); 218 need_redraw = 1;219 need_redraw_all = 1; 219 220 } 220 221 … … 249 250 //------------------------------------------------------------------- 250 251 static void sokoban_draw_box(int x, int y, color cl) { 251 draw_filled_rect( x*cell_size, y*cell_size,x*cell_size+cell_size-1, y*cell_size+cell_size-1, cl);252 draw_line( x*cell_size+2, y*cell_size,x*cell_size+2, y*cell_size+cell_size-1, cl);253 draw_line( x*cell_size+cell_size-1-2, y*cell_size,x*cell_size+cell_size-1-2, y*cell_size+cell_size-1, cl);254 draw_line( x*cell_size+2, y*cell_size+2,x*cell_size+cell_size-1-2, y*cell_size+2, cl);255 draw_line( x*cell_size+2, y*cell_size+cell_size-1-2,x*cell_size+cell_size-1-2, y*cell_size+cell_size-1-2, cl);252 draw_filled_rect(CAM_TS_BUTTON_BORDER+x*cell_size, y*cell_size, CAM_TS_BUTTON_BORDER+x*cell_size+cell_size-1, y*cell_size+cell_size-1, cl); 253 draw_line(CAM_TS_BUTTON_BORDER+x*cell_size+2, y*cell_size, CAM_TS_BUTTON_BORDER+x*cell_size+2, y*cell_size+cell_size-1, cl); 254 draw_line(CAM_TS_BUTTON_BORDER+x*cell_size+cell_size-1-2, y*cell_size, CAM_TS_BUTTON_BORDER+x*cell_size+cell_size-1-2, y*cell_size+cell_size-1, cl); 255 draw_line(CAM_TS_BUTTON_BORDER+x*cell_size+2, y*cell_size+2, CAM_TS_BUTTON_BORDER+x*cell_size+cell_size-1-2, y*cell_size+2, cl); 256 draw_line(CAM_TS_BUTTON_BORDER+x*cell_size+2, y*cell_size+cell_size-1-2, CAM_TS_BUTTON_BORDER+x*cell_size+cell_size-1-2, y*cell_size+cell_size-1-2, cl); 256 257 } 257 258 … … 321 322 return 0; 322 323 } 323 need_redraw = 1;324 need_redraw_all = 1; 324 325 return 1; 325 326 } … … 363 364 #endif 364 365 sokoban_set_level(conf.sokoban_level); 365 need_redraw = 1;366 need_redraw_all = 1; 366 367 break; 367 368 #if CAM_HAS_ERASE_BUTTON … … 378 379 int y, x; 379 380 static char str[16]; 381 382 if (need_redraw_all) { 383 draw_filled_rect(0, 0, screen_width-1, screen_height-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR)); 384 need_redraw_all = 0; 385 need_redraw = 1; 386 } 380 387 381 388 if (need_redraw) { … … 385 392 switch (field[y][x]) { 386 393 case MARKER_WALL: 387 draw_filled_rect( x*cell_size, y*cell_size,x*cell_size+cell_size-1, y*cell_size+cell_size-1, MAKE_COLOR(WALL_COLOR_1, WALL_COLOR_2));394 draw_filled_rect(CAM_TS_BUTTON_BORDER+x*cell_size, y*cell_size, CAM_TS_BUTTON_BORDER+x*cell_size+cell_size-1, y*cell_size+cell_size-1, MAKE_COLOR(WALL_COLOR_1, WALL_COLOR_2)); 388 395 break; 389 396 case MARKER_BOX: … … 391 398 break; 392 399 case MARKER_PLACE: 393 draw_filled_rect( x*cell_size, y*cell_size,x*cell_size+cell_size-1, y*cell_size+cell_size-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR));394 draw_filled_rect( x*cell_size+4, y*cell_size+4,x*cell_size+cell_size-1-4, y*cell_size+cell_size-1-4, MAKE_COLOR(PLACE_COLOR_1, PLACE_COLOR_2));400 draw_filled_rect(CAM_TS_BUTTON_BORDER+x*cell_size, y*cell_size, CAM_TS_BUTTON_BORDER+x*cell_size+cell_size-1, y*cell_size+cell_size-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR)); 401 draw_filled_rect(CAM_TS_BUTTON_BORDER+x*cell_size+4, y*cell_size+4, CAM_TS_BUTTON_BORDER+x*cell_size+cell_size-1-4, y*cell_size+cell_size-1-4, MAKE_COLOR(PLACE_COLOR_1, PLACE_COLOR_2)); 395 402 break; 396 403 case MARKER_BOX_PLACE: … … 399 406 case MARKER_PLAYER: 400 407 case MARKER_PLAYER_PLACE: 401 draw_filled_rect( x*cell_size, y*cell_size,x*cell_size+cell_size-1, y*cell_size+cell_size-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR));402 draw_filled_ellipse( x*cell_size+(cell_size>>1)-1, y*cell_size+(cell_size>>1)-1, (cell_size>>1)-3, (cell_size>>1)-3, MAKE_COLOR(PLAYER_COLOR_1, PLAYER_COLOR_2));408 draw_filled_rect(CAM_TS_BUTTON_BORDER+x*cell_size, y*cell_size, CAM_TS_BUTTON_BORDER+x*cell_size+cell_size-1, y*cell_size+cell_size-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR)); 409 draw_filled_ellipse(CAM_TS_BUTTON_BORDER+x*cell_size+(cell_size>>1)-1, y*cell_size+(cell_size>>1)-1, (cell_size>>1)-3, (cell_size>>1)-3, MAKE_COLOR(PLAYER_COLOR_1, PLAYER_COLOR_2)); 403 410 break; 404 411 case MARKER_EMPTY: 405 412 default: 406 draw_filled_rect( x*cell_size, y*cell_size,x*cell_size+cell_size-1, y*cell_size+cell_size-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR));413 draw_filled_rect(CAM_TS_BUTTON_BORDER+x*cell_size, y*cell_size, CAM_TS_BUTTON_BORDER+x*cell_size+cell_size-1, y*cell_size+cell_size-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR)); 407 414 break; 408 415 } … … 410 417 } 411 418 412 draw_line(cell_size*FIELD_WIDTH, 0, cell_size*FIELD_WIDTH, screen_height-1, COLOR_WHITE); 413 draw_line(cell_size*FIELD_WIDTH+1, 0, cell_size*FIELD_WIDTH+1, screen_height-1, COLOR_BLACK); 414 415 //draw_filled_rect(cell_size*FIELD_WIDTH+2, 0, screen_width-1, 7, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR)); 416 draw_filled_rect(cell_size*FIELD_WIDTH+2, 0, screen_width-1, screen_height-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR)); 419 draw_line(CAM_TS_BUTTON_BORDER+cell_size*FIELD_WIDTH, 0, CAM_TS_BUTTON_BORDER+cell_size*FIELD_WIDTH, screen_height-1, COLOR_WHITE); 420 draw_line(CAM_TS_BUTTON_BORDER+cell_size*FIELD_WIDTH+1, 0, CAM_TS_BUTTON_BORDER+cell_size*FIELD_WIDTH+1, screen_height-1, COLOR_BLACK); 417 421 418 422 sprintf(str, "%s: %-6d", lang_str(LANG_SOKOBAN_TEXT_LEVEL), conf.sokoban_level+1); 419 draw_string( cell_size*FIELD_WIDTH+2, 8, str, MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));423 draw_string(CAM_TS_BUTTON_BORDER+cell_size*FIELD_WIDTH+2, 8, str, MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE)); 420 424 sprintf(str, "%s: %-6d", lang_str(LANG_SOKOBAN_TEXT_MOVES), moves); 421 draw_string( cell_size*FIELD_WIDTH+2, 8+FONT_HEIGHT, str, MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));425 draw_string(CAM_TS_BUTTON_BORDER+cell_size*FIELD_WIDTH+2, 8+FONT_HEIGHT, str, MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE)); 422 426 423 427 //draw_filled_rect(cell_size*FIELD_WIDTH+2, 8+FONT_HEIGHT*2, screen_width-1, screen_height-1, MAKE_COLOR(SCREEN_COLOR, SCREEN_COLOR)); … … 430 434 431 435 sprintf(str, "Batt:%3d%%", get_batt_perc()); 432 draw_txt_string( screen_width/FONT_WIDTH-2-9, screen_height/FONT_HEIGHT-1, str, MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE));433 } 434 436 draw_txt_string((screen_width-CAM_TS_BUTTON_BORDER)/FONT_WIDTH-2-9, screen_height/FONT_HEIGHT-1, str, MAKE_COLOR(SCREEN_COLOR, COLOR_WHITE)); 437 } 438 -
trunk/core/kbd.c
r1327 r1338 92 92 static int nTxtbl[]={0,2,4,6,8,10,12,13}; 93 93 #endif 94 // ------ add by Masuji SUTO (end) -------------- 94 95 95 #if defined(CAMERA_sx100is) || defined(CAMERA_sx110is) 96 96 #define ZSTEP_TABLE_SIZE 8 … … 112 112 static int nTxtbl[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13}; 113 113 #endif 114 115 #if defined(CAMERA_ixus310_elph500hs) 116 #define ZSTEP_TABLE_SIZE 9 117 static int nTxtbl[]={0,8,16,24,32,40,48,56,64}; 118 #endif 119 114 120 #if defined(CAMERA_s90) || defined(CAMERA_s95) 115 121 #define ZSTEP_TABLE_SIZE 10 116 122 static int nTxtbl[]={0,1,2,3,4,5,6,7,8,9}; 117 123 #endif 124 // ------ add by Masuji SUTO (end) -------------- 118 125 119 126 #ifdef OPT_SCRIPTING … … 209 216 return 1; 210 217 } 218 219 #ifdef CAM_TOUCHSCREEN_UI 220 extern int ts_process_touch(); 221 if (ts_process_touch()) 222 { 223 extern void draw_restore(); 224 draw_restore(); 225 } 226 #endif 211 227 212 228 // deals with the rest -
trunk/core/raw.c
r1249 r1338 117 117 int i; 118 118 if (gamma[255]) return; 119 #if defined(CAMERA_sx30) || defined(CAMERA_g12) 119 #if defined(CAMERA_sx30) || defined(CAMERA_g12) || defined(CAMERA_ixus310_elph500hs) 120 120 for (i=0; i<12; i++) gamma[i]=255*pow(i/255.0, 0.5); 121 121 for (i=12; i<64; i++) gamma[i]=255*pow(i/255.0, 0.4); -
trunk/include/camera.h
r1307 r1338 63 63 // The guard pixel is the first pixel of the top row in the screen bitmap. 64 64 65 #undef CAM_TOUCHSCREEN_UI // Define to enable touch screen U/I (e.g. IXUS 310 HS) 66 #define CAM_TS_BUTTON_BORDER 0 // Define this to leave a border on each side of the OSD display for touch screen buttons. 67 // Used on the IXUS 310 to stop the OSD from overlapping the on screen buttons on each side 68 #define CAM_DISP_ALT_TEXT 1 // Display the '<ALT>' message at the bottom of the screen in ALT mode (IXUS 310 changes button color instead) 69 65 70 #undef CAM_AF_SCAN_DURING_VIDEO_RECORD // CHDK can make single AF scan during video record 66 71 #undef CAM_HAS_VIDEO_BUTTON // Camera can take stills in video mode, and vice versa -
trunk/include/conf.h
r1245 r1338 278 278 int flash_manual_override; 279 279 int flash_video_override_power; 280 281 // Overrides to disable touchscreen U/I components (IXUS 310) 282 int touchscreen_disable_video_controls; 283 int touchscreen_disable_shortcut_controls; 280 284 } Conf; 281 285 -
trunk/include/gui.h
r1034 r1338 7 7 #define MAKE_COLOR(bg, fg) ((color)((((char)(bg))<<8)|((char)(fg)))) 8 8 9 // Don't delete or re-order entries unless guiHandlers (gui.c) table is updated to match 9 10 enum Gui_Mode { 10 11 GUI_MODE_NONE = 0, -
trunk/include/keyboard.h
r1292 r1338 56 56 extern void other_kbd_process(); 57 57 58 #ifdef CAM_TOUCHSCREEN_UI 59 extern int redraw_buttons; 58 60 #endif 61 62 #endif -
trunk/include/lolevel.h
r1335 r1338 260 260 extern int some_flag_for_af_scan; 261 261 extern int parameter_for_af_scan; 262 extern void_SetAE_ShutterSpeed(short* tv);262 extern short _SetAE_ShutterSpeed(short* tv); 263 263 264 264 extern void _EnterToCompensationEVF(void); -
trunk/include/modelist.h
r1232 r1338 114 114 MODE_SCN_WINK_SELF_TIMER, // sx30/g12 (Smart Shutter, Wink Self Timer mode) 115 115 MODE_SCN_FACE_SELF_TIMER, // sx30/g12 (Smart Shutter, Face Self Timer mode) 116 MODE_VIDEO_SUPER_SLOW , // IXUS 310 HS Super Slow Motion Movie 116 117 }; 117 118 -
trunk/include/platform.h
r1316 r1338 589 589 #endif 590 590 591 #endif 591 #ifdef CAM_TOUCHSCREEN_UI 592 extern unsigned short touch_screen_x, touch_screen_y; 593 extern int touch_screen_active; 594 #endif 595 596 #endif
Note: See TracChangeset
for help on using the changeset viewer.