Changeset 719


Ignore:
Timestamp:
07/29/11 08:50:42 (22 months ago)
Author:
msl
Message:

Aktualisierung auf Rev. 1250 offizieller Trunk

  • Betrifft alle

+ Optionale System zum Neuschreiben des CHDK-Menues, wenn es vom Canon-OSD ueberschrieben wird.
+ Im Gegensatz zum int. Trunk fuer alle Kameras als Test aktiviert.
+ Links oben im Display wird ein Kontrollpixel geschrieben (int. Version SCREEN_COLOR, CHDK-DE COLOR_TRANSPARENT).
+ Wird dieses vom Canon-OSD ueberschrieben, erfolgt ein Neuschreiben des CHDK-Menues.
+ CHDK-OSD-Elemente duerfen nicht mit dem Layout-Editor bis in die oberste linke Ecke verschoben werden.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/gui.c

    r708 r719  
    19141914    static int show_md_grid=0; 
    19151915 
     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 
    19161924    gui_handle_splash(); 
    19171925 
     
    20182026    gui_in_redraw = 0; 
    20192027    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; 
    20212030#if defined (OPT_GAME_REVERSI) || (OPT_GAME_SOKOBAN || (OPT_GAME_CONNECT4) || OPT_GAME_MASTERMIND) 
    20222031        if ( 
  • trunk/core/gui_draw.c

    r542 r719  
    6060   draw_set_aspect_xcorrection_proc(xcorrection_proc); 
    6161   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 
     71void draw_set_guard() 
     72{ 
     73    *((unsigned char*)(frame_buffer[0])) = GUARD_VAL; 
     74    *((unsigned char*)(frame_buffer[1])) = GUARD_VAL; 
     75} 
     76 
     77int 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 
     85int 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 
    6295} 
    6396 
     
    79112      draw_set_aspect_ycorrection_proc(NULL); 
    80113    #endif 
     114 
     115#ifdef CAM_DETECT_SCREEN_ERASE 
     116    draw_set_guard(); 
     117#endif 
    81118} 
    82119 
     
    387424void draw_restore() { 
    388425    vid_bitmap_refresh(); 
     426 
     427#ifdef CAM_DETECT_SCREEN_ERASE 
     428    draw_set_guard(); 
     429#endif 
    389430} 
    390431 
  • trunk/core/gui_draw.h

    r705 r719  
    377377 
    378378//------------------------------------------------------------------- 
    379 void draw_init(); 
    380 void draw_set_draw_proc(void (*pixel_proc)(unsigned int offset, color cl)); 
     379extern void draw_init(); 
     380extern void draw_set_draw_proc(void (*pixel_proc)(unsigned int offset, color cl)); 
     381 
     382#ifdef CAM_DETECT_SCREEN_ERASE 
     383extern void draw_set_guard(); 
     384extern int draw_test_guard(); 
     385extern int draw_test_pixel(coord x, coord y, color c); 
     386#endif 
    381387 
    382388extern color draw_get_pixel(coord x, coord y); 
  • trunk/core/gui_menu.c

    r590 r719  
    6868     
    6969    gui_menu_redraw=2; 
     70} 
     71 
     72//------------------------------------------------------------------- 
     73void gui_menu_force_redraw() 
     74{ 
     75    if (gui_get_mode() == GUI_MODE_MENU) 
     76    { 
     77        gui_menu_redraw=2; 
     78    } 
    7079} 
    7180 
  • trunk/core/gui_menu.h

    r11 r719  
    5050extern void gui_menu_draw(); 
    5151extern void mod_user_menu(CMenuItem curr_menu_item, int* gui_menu_add_item, int mod); 
    52  
     52extern void gui_menu_force_redraw(); 
    5353//------------------------------------------------------------------- 
    5454#endif 
  • trunk/include/camera.h

    r718 r719  
    5252    #define CAM_EMUL_KEYPRESS_DURATION      5   // Length of keypress emulation 
    5353 
    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. 
    5661 
    5762    #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.