Changeset 530


Ignore:
Timestamp:
Apr 22, 2011, 7:32:01 PM (6 years ago)
Author:
sam
Message:

imlib: remove trans_image::put_image_offseted, it's simply a version
of PutImage? that skips the bounds checks. Yaddah yaddah modern hardware
blah.

Location:
abuse/trunk/src
Files:
3 edited

Legend:

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

    r528 r530  
    933933      cl = current_level->get_fgline(y)+x1;
    934934    else cl = NULL;
    935     uint8_t *sl1 = draw_y < ncy1 ? 0 : screen->scan_line(draw_y)+xo;
    936 
    937     for(x = x1, draw_x = xo; x <= x2; x++, draw_x += xinc, cl++, sl1 += xinc)
     935
     936    for(x = x1, draw_x = xo; x <= x2; x++, draw_x += xinc, cl++)
    938937    {
    939938      if(x < fg_w && y < fg_h)
     
    946945          if(fort_num != BLACK)
    947946          {
    948         if(draw_y < ncy1 || draw_y + yinc > ncy2 || draw_x < ncx1 || draw_x + xinc > ncx2)
    949947            get_fg(fort_num)->im->PutImage(screen, draw_x, draw_y);
    950         else
    951             get_fg(fort_num)->im->put_image_offseted(screen, sl1);
    952948
    953949        if(!(dev & EDIT_MODE))
  • abuse/trunk/src/imlib/timage.cpp

    r528 r530  
    241241}
    242242
    243 void trans_image::put_image_offseted(image *screen, uint8_t *s_off)   // if screen x & y offset already calculated save a mul
    244 {
    245   int ix,ysteps=m_size.y;
    246   int screen_skip;
    247   uint8_t skip,*datap=m_data;
    248 
    249   screen->Lock();
    250   screen_skip = screen->Size().x - m_size.x;
    251   for (; ysteps; ysteps--)
    252   {
    253     for (ix=0; ix<m_size.x; )
    254     {
    255       skip=*datap;       // skip leading blank space
    256       datap++;
    257       ix+=skip;
    258       s_off+=skip;
    259 
    260       if (s_off<screen->scan_line(0))
    261           printf("bad write in trans_image::put_image_offseted");
    262 
    263 
    264       if (ix<m_size.x)
    265       {
    266     skip=*datap;
    267     datap++;
    268     memcpy(s_off,datap,skip);
    269     datap+=skip;
    270     s_off+=skip;
    271     ix+=skip;
    272 
    273     if (s_off>=screen->scan_line(screen->Size().y+1))
    274             printf("bad write in trans_image::put_image_offseted");
    275       }
    276     }
    277     s_off+=screen_skip;
    278   }
    279   screen->Unlock();
    280 }
    281 
    282243template<int N>
    283244void trans_image::PutImageGeneric(image *screen, int x, int y, uint8_t color,
  • abuse/trunk/src/imlib/timage.h

    r528 r530  
    4545                int blend_amount, color_filter *f, palette *pal);
    4646
    47   // if screen x & y offset already calculated save a mul
    48   // and no clipping, but fast use this
    49   void put_image_offseted(image *screen, uint8_t *s_off);
    50 
    5147  void put_scan_line(image *screen, int x, int y, int line);   // always transparent
    5248  size_t MemUsage();
Note: See TracChangeset for help on using the changeset viewer.