Changeset 987


Ignore:
Timestamp:
11/28/10 00:41:36 (2 years ago)
Author:
reyalp
Message:

make prop compare not waste memory if not used, clean up some obsolete commented code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/gui.c

    r986 r987  
    27832783        } 
    27842784#if !CAM_SHOW_OSD_IN_SHOOT_MENU 
    2785 //    #if defined (CAMERA_sx200is) 
    2786 //      if (!(conf.show_osd) || (canon_menu_active>0) || (canon_shoot_menu_active>0))  return; 
    2787 //    #else 
    27882785      if (!(conf.show_osd && (canon_menu_active==(int)&canon_menu_active-4) && (canon_shoot_menu_active==0)))  return;     
    2789 //    #endif 
    27902786#else 
    2791 //    #if defined (CAMERA_sx200is) 
    2792 //       if (!(conf.show_osd) || (canon_menu_active>0) /*&& (canon_shoot_menu_active==0)*/ )  return; 
    2793 //    #else 
    27942787      if (!(conf.show_osd && (canon_menu_active==(int)&canon_menu_active-4) /*&& (canon_shoot_menu_active==0)*/ ))  return; 
    2795 //    #endif 
    27962788#endif   
    27972789 
     
    28062798 
    28072799    if ((m&MODE_MASK) == MODE_REC && (recreview_hold==0 || conf.show_osd_in_review) ) { 
    2808 //        m &= MODE_SHOOTING_MASK; 
    2809 //        if (m==MODE_SCN_WATER || m==MODE_SCN_NIGHT || m==MODE_SCN_CHILD || m==MODE_SCN_PARTY || m==MODE_STITCH || 
    2810 //            m==MODE_SCN_GRASS || m==MODE_SCN_SNOW  || m==MODE_SCN_BEACH || m==MODE_SCN_FIREWORK || m==MODE_VIDEO) 
    2811 //            ++n; 
    2812  
    28132800        if (conf.show_grid_lines) { 
    28142801            gui_grid_draw_osd(1); 
     
    30773064      int offset_x = (screen_width-150)>>1; 
    30783065      int offset_y = ((screen_height-84)>>1) - 42; 
    3079 //      const color color_lookup[8] = {0xFF, 0x2E, 0x22, 0x3D, 0x1F,  0x21, 0x00, 0x11}; 
    30803066      const color color_lookup[8] = {COLOR_BLACK, 
    30813067                                                                        COLOR_SPLASH_RED/*0x2E redish*/, 
     
    33933379{ 
    33943380        #define NUM_PROPS 512 
    3395         static int initialized = 0; 
    3396         static int props[NUM_PROPS] = { }; 
     3381        // never freed, but not allocated unless prop compare is used once 
     3382        static int *props = NULL; 
    33973383        char buf[64]; 
    33983384        int i; 
     
    34003386        int c; 
    34013387 
    3402  
    3403         if( initialized ) 
     3388        if( props ) 
    34043389        { // we have previous data set! do a comparison 
    34053390                c = 0; 
     
    34303415        { 
    34313416        // no previous data was set so we save the data initially 
    3432                 for( i = 0; i < NUM_PROPS; ++i ) 
    3433                 { 
    3434                         props[i] = shooting_get_prop(i); 
     3417                props = (int *)malloc(NUM_PROPS*sizeof(int)); 
     3418                if(props) { 
     3419                        for( i = 0; i < NUM_PROPS; ++i ) 
     3420                        { 
     3421                                props[i] = shooting_get_prop(i); 
     3422                        } 
    34353423                } 
    34363424        } 
    3437         initialized = 1; 
    3438 } 
    3439  
    3440 #endif 
     3425} 
     3426 
     3427#endif 
Note: See TracChangeset for help on using the changeset viewer.