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

imlib: reverse the image::put_image logic.

File:
1 edited

Legend:

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

    r643 r644  
    2323{
    2424  if (!automap_window) return ;
    25   image *screen=automap_window->screen;
     25  image *screen=automap_window->m_surf;
    2626
    2727  long sx,ex,sy,ey,x,y,window_xstart,window_ystart,
     
    6464  if (draw_xstart==old_dx && draw_ystart==old_dy)
    6565  {
    66    automap_window->screen->Lock();
    67    automap_window->screen->AddDirty(centerx,centery,centerx + 1,centery + 1);
     66   automap_window->m_surf->Lock();
     67   automap_window->m_surf->AddDirty(centerx,centery,centerx + 1,centery + 1);
    6868    if ((tick++)&4)
    69       automap_window->screen->PutPixel(vec2i(centerx,centery),255);
     69      automap_window->m_surf->PutPixel(vec2i(centerx,centery),255);
    7070    else
    71       automap_window->screen->PutPixel(vec2i(centerx,centery),27);
    72    automap_window->screen->Unlock();
     71      automap_window->m_surf->PutPixel(vec2i(centerx,centery),27);
     72   automap_window->m_surf->Unlock();
    7373    return ;
    7474  }
     
    103103
    104104
    105   // draw the tiles that will be around the border of the automap with put_image
     105  // draw the tiles that will be around the border of the automap with PutImage
    106106  // because it handles clipping, but for ths reason is slower, the rest
    107107  // we will slam on as fast as possible
    108108
    109   screen->SetClip(window_xstart,window_ystart,window_xend+1,window_yend+1);
    110 /*  for (i=draw_xstart,j=draw_ystart,x=sx,y=sy; y<=ey; j+=AUTOTILE_HEIGHT,y++)
    111     foretiles[cur_lev->get_fg(x,y)]->micro_image->put_image(screen,i,j,0);
     109  screen->SetClip(window_xstart, window_ystart, window_xend+1, window_yend+1);
     110#if 0
     111  for (i=draw_xstart,j=draw_ystart,x=sx,y=sy; y<=ey; j+=AUTOTILE_HEIGHT,y++)
     112    screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, i, j, 0);
    112113
    113114  for (i=draw_xstart+ex*AUTOTILE_WIDTH,j=draw_ystart,y=sy,x=ex; y<=ey; j+=AUTOTILE_HEIGHT,y++)
    114     foretiles[cur_lev->get_fg(x,y)]->micro_image->put_image(screen,i,j,0);
     115    screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, i, j, 0);
    115116
    116117  for (i=draw_xstart,j=draw_ystart,x=sx,y=sy; x<=ex; i+=AUTOTILE_WIDTH,x++)
    117     foretiles[cur_lev->get_fg(x,y)]->micro_image->put_image(screen,i,j,0);
     118    screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, i, j, 0);
    118119
    119120  for (i=draw_xstart,j=draw_ystart+ey*AUTOTILE_HEIGHT,x=sx,y=ex; x<=ex; i+=AUTOTILE_WIDTH,x++)
    120     foretiles[cur_lev->get_fg(x,y)]->micro_image->put_image(screen,i,j,0); */
    121 
    122 
     121    screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, i, j, 0);
     122#endif
    123123
    124124  unsigned short *fgline;
     
    132132    int id=foretiles[ (*fgline)&0x7fff];
    133133    if (id>=0)
    134           cache.foret(id)->micro_image->put_image(screen,i,j,0);
     134          screen->PutImage(cache.foret(id)->micro_image, i, j, 0);
    135135    else
    136           cache.foret(foretiles[0])->micro_image->put_image(screen,i,j,0);
     136          screen->PutImage(cache.foret(foretiles[0])->micro_image, i, j, 0);
    137137      }
    138138      else
     
    143143  // draw the person as a dot, no need to add a dirty because we marked the
    144144  // whole screen already
    145   automap_window->screen->Lock();
     145  automap_window->m_surf->Lock();
    146146  if ((tick++)&4)
    147     automap_window->screen->PutPixel(vec2i(centerx,centery),255);
     147    automap_window->m_surf->PutPixel(vec2i(centerx,centery),255);
    148148  else
    149     automap_window->screen->PutPixel(vec2i(centerx,centery),27);
    150   automap_window->screen->Unlock();
     149    automap_window->m_surf->PutPixel(vec2i(centerx,centery),27);
     150  automap_window->m_surf->Unlock();
    151151
    152152  // set the clip back to full window size because soemthing else could mess with the area
    153   automap_window->screen->SetClip(0,0,screen->Size().x,screen->Size().y);
     153  automap_window->m_surf->SetClip(0,0,screen->Size().x,screen->Size().y);
    154154}
    155155
     
    168168        automap_window = wm->new_window(0, 0, w * AUTOTILE_WIDTH,
    169169                                        h * AUTOTILE_HEIGHT, NULL, "Map");
    170         automap_window->screen->bar(17, 1, 17 + 8 * 6 + 3, 6,
     170        automap_window->m_surf->bar(17, 1, 17 + 8 * 6 + 3, 6,
    171171                                    wm->medium_color());
    172         wm->font()->put_string(automap_window->screen, 20, 2, "Automap",
     172        wm->font()->put_string(automap_window->m_surf, 20, 2, "Automap",
    173173                               wm->dark_color());
    174174        draw();
Note: See TracChangeset for help on using the changeset viewer.