Changeset 719
- Timestamp:
- 07/29/11 08:50:42 (22 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
core/gui.c (modified) (2 diffs)
-
core/gui_draw.c (modified) (3 diffs)
-
core/gui_draw.h (modified) (1 diff)
-
core/gui_menu.c (modified) (1 diff)
-
core/gui_menu.h (modified) (1 diff)
-
include/camera.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/gui.c
r708 r719 1914 1914 static int show_md_grid=0; 1915 1915 1916 #ifdef CAM_DETECT_SCREEN_ERASE 1917 if (!draw_test_guard()) 1918 { 1919 draw_set_guard(); 1920 gui_menu_force_redraw(); 1921 } 1922 #endif 1923 1916 1924 gui_handle_splash(); 1917 1925 … … 2018 2026 gui_in_redraw = 0; 2019 2027 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) { 2020 gui_restore = 0; 2028 if (gui_restore) gui_menu_force_redraw(); 2029 gui_restore = 0; 2021 2030 #if defined (OPT_GAME_REVERSI) || (OPT_GAME_SOKOBAN || (OPT_GAME_CONNECT4) || OPT_GAME_MASTERMIND) 2022 2031 if ( -
trunk/core/gui_draw.c
r542 r719 60 60 draw_set_aspect_xcorrection_proc(xcorrection_proc); 61 61 draw_set_aspect_ycorrection_proc(ycorrection_proc); 62 } 63 64 #endif 65 66 //------------------------------------------------------------------- 67 #ifdef CAM_DETECT_SCREEN_ERASE 68 69 #define GUARD_VAL COLOR_TRANSPARENT 70 71 void draw_set_guard() 72 { 73 *((unsigned char*)(frame_buffer[0])) = GUARD_VAL; 74 *((unsigned char*)(frame_buffer[1])) = GUARD_VAL; 75 } 76 77 int draw_test_guard() 78 { 79 if (*((unsigned char*)(frame_buffer[0])) != GUARD_VAL) return 0; 80 if (*((unsigned char*)(frame_buffer[1])) != GUARD_VAL) return 0; 81 return 1; 82 } 83 84 // Test a pixel value in both frame buffers, returns 0 if either doesn't match or co-ords out of range 85 int draw_test_pixel(coord x, coord y, color c) 86 { 87 if (x >= screen_width || y >= screen_height) return 0; 88 #if CAM_USES_ASPECT_CORRECTION 89 return (frame_buffer[0][y * screen_buffer_width + aspect_xcorrection_proc(x)] == c) && 90 (frame_buffer[1][y * screen_buffer_width + aspect_xcorrection_proc(x)] == c); 91 #else 92 return (frame_buffer[0][y * screen_buffer_width + x] == c) && 93 (frame_buffer[1][y * screen_buffer_width + x] == c); 94 #endif 62 95 } 63 96 … … 79 112 draw_set_aspect_ycorrection_proc(NULL); 80 113 #endif 114 115 #ifdef CAM_DETECT_SCREEN_ERASE 116 draw_set_guard(); 117 #endif 81 118 } 82 119 … … 387 424 void draw_restore() { 388 425 vid_bitmap_refresh(); 426 427 #ifdef CAM_DETECT_SCREEN_ERASE 428 draw_set_guard(); 429 #endif 389 430 } 390 431 -
trunk/core/gui_draw.h
r705 r719 377 377 378 378 //------------------------------------------------------------------- 379 void draw_init(); 380 void draw_set_draw_proc(void (*pixel_proc)(unsigned int offset, color cl)); 379 extern void draw_init(); 380 extern void draw_set_draw_proc(void (*pixel_proc)(unsigned int offset, color cl)); 381 382 #ifdef CAM_DETECT_SCREEN_ERASE 383 extern void draw_set_guard(); 384 extern int draw_test_guard(); 385 extern int draw_test_pixel(coord x, coord y, color c); 386 #endif 381 387 382 388 extern color draw_get_pixel(coord x, coord y); -
trunk/core/gui_menu.c
r590 r719 68 68 69 69 gui_menu_redraw=2; 70 } 71 72 //------------------------------------------------------------------- 73 void gui_menu_force_redraw() 74 { 75 if (gui_get_mode() == GUI_MODE_MENU) 76 { 77 gui_menu_redraw=2; 78 } 70 79 } 71 80 -
trunk/core/gui_menu.h
r11 r719 50 50 extern void gui_menu_draw(); 51 51 extern void mod_user_menu(CMenuItem curr_menu_item, int* gui_menu_add_item, int mod); 52 52 extern void gui_menu_force_redraw(); 53 53 //------------------------------------------------------------------- 54 54 #endif -
trunk/include/camera.h
r718 r719 52 52 #define CAM_EMUL_KEYPRESS_DURATION 5 // Length of keypress emulation 53 53 54 #define CAM_MENU_BORDERWIDTH 30 // Related to screen layout somehow. 55 // TODO someone explain what this does, probably doesn't really belong here 54 #define CAM_MENU_BORDERWIDTH 30 // Defines the width of the border on each side of the CHDK menu. The CHDK menu will have this 55 // many pixels left blank to the on each side. Should not be less than 10 to allow room for the 56 // scroll bar on the right. 57 #define CAM_DETECT_SCREEN_ERASE 1 // Define this to add 'guard' pixel to the screen bitmap to help detect if the firmware has erase the screen 58 // If the guard pixel changes the CHDK ALT menu is forced to redraw. 59 // Take care not to place CHDK OSD elements over the guard pixel. 60 // The guard pixel is the first pixel of the top row in the screen bitmap. 56 61 57 62 #undef CAM_AF_SCAN_DURING_VIDEO_RECORD // CHDK can make single AF scan during video record
Note: See TracChangeset
for help on using the changeset viewer.