Ignore:
Timestamp:
May 13, 2011, 9:13:58 AM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: reverse the image::put_image logic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/loadgame.cpp

    r643 r644  
    6060}
    6161
    62 Jwindow *create_num_window(int mx, int total_saved, int lines, image **thumb_nails)
     62Jwindow *create_num_window(int mx, int total_saved, int lines, image **thumbnails)
    6363{
    6464  ico_button *buts[MAX_SAVE_GAMES];
     
    7777        x += iw;
    7878    }
    79     if (thumb_nails) { while (!thumb_nails[n]) n++; }
     79    if (thumbnails) { while (!thumbnails[n]) n++; }
    8080    buts[i]=new ico_button(x, y, ID_LOAD_GAME_NUMBER + n,
    8181               save_buts[n*3+0],save_buts[n*3+0],save_buts[n*3+1],save_buts[n*3+2],NULL);
     
    167167{
    168168    int total_saved=0;
    169     image *thumb_nails[MAX_SAVE_GAMES];
     169    image *thumbnails[MAX_SAVE_GAMES];
    170170    int start_num=0;
    171171    int max_w=160,max_h=100;
    172     memset(thumb_nails,0,sizeof(thumb_nails));
     172    memset(thumbnails,0,sizeof(thumbnails));
    173173
    174174    image *first=NULL;
     
    191191            if (se && se->type==SPEC_IMAGE)
    192192            {
    193                 thumb_nails[start_num] = new image(fp, se);
    194                 if (thumb_nails[start_num]->Size().x>max_w) max_w=thumb_nails[start_num]->Size().x;
    195                 if (thumb_nails[start_num]->Size().y>max_h) max_h=thumb_nails[start_num]->Size().y;
    196                 if (!first) first=thumb_nails[start_num];
     193                thumbnails[start_num] = new image(fp, se);
     194                if (thumbnails[start_num]->Size().x>max_w) max_w=thumbnails[start_num]->Size().x;
     195                if (thumbnails[start_num]->Size().y>max_h) max_h=thumbnails[start_num]->Size().y;
     196                if (!first) first=thumbnails[start_num];
    197197                total_saved++;
    198198            }
     
    202202        if (fail && show_all)
    203203        {
    204             thumb_nails[start_num] = new image(vec2i(160, 100));
    205             thumb_nails[start_num]->clear();
    206             console_font->put_string(thumb_nails[start_num],0,0,symbol_str("no_saved"));
     204            thumbnails[start_num] = new image(vec2i(160, 100));
     205            thumbnails[start_num]->clear();
     206            console_font->put_string(thumbnails[start_num],0,0,symbol_str("no_saved"));
    207207            total_saved++;
    208             if (!first) first=thumb_nails[start_num];
     208            if (!first) first=thumbnails[start_num];
    209209        }
    210210        delete fp;
     
    233233
    234234
    235     Jwindow *l_win=create_num_window(0,total_saved,MAX_SAVE_LINES,thumb_nails);
     235    Jwindow *l_win=create_num_window(0,total_saved,MAX_SAVE_LINES,thumbnails);
    236236    Jwindow *preview=wm->new_window(l_win->x+l_win->l+5,l_win->y,max_w,max_h,NULL,title);
    237237
    238     first->put_image(preview->screen,preview->x1(),preview->y1());
     238    preview->m_surf->PutImage(first, preview->x1(), preview->y1());
    239239
    240240    Event ev;
     
    252252            int draw_num=ev.message.id-ID_LOAD_GAME_PREVIEW;
    253253            preview->clear();
    254             thumb_nails[draw_num]->put_image(preview->screen,preview->x1(),preview->y1());
     254            preview->m_surf->PutImage(thumbnails[draw_num], preview->x1(), preview->y1());
    255255        }
    256256
     
    263263
    264264    for (i=0; i<total_saved; i++)
    265         if (thumb_nails[i])
    266             delete thumb_nails[i];
     265        delete thumbnails[i];
    267266
    268267    return got_level;
Note: See TracChangeset for help on using the changeset viewer.