Changeset 667


Ignore:
Timestamp:
May 16, 2011, 2:37:15 AM (10 years ago)
Author:
Sam Hocevar
Message:

imlib: remove dead code.

Location:
abuse/trunk/src/imlib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/fonts.cpp

    r662 r667  
    1919#include "fonts.h"
    2020
    21 texture_font::texture_font(image *letters, image *font_pattern)
    22 { fntpat=font_pattern;
    23   let=letters;
    24   tl=(let->Size().x+1)/32;
    25   th=(let->Size().y+1)/8;
    26 }
    27 
    28 void texture_font::put_char(image *screen,  int x, int y, char ch)
    29 { if (fntpat)
    30     screen->PutPartMasked(fntpat, vec2i(x, y), let,
    31        vec2i(((int)ch%32)*tl,((int)ch/32)*th), vec2i(0,0), vec2i(tl,th));
    32   else screen->PutPart(let, vec2i(x, y), vec2i(((int)ch%32)*tl, ((int)ch/32)*th),
    33      vec2i(((int)ch%32)*tl+tl, ((int)ch/32)*th+th), 1);
    34 }
    35 
    36 void texture_font::put_string(image *screen, int x, int y, char const *st)
    37 { while (*st)
    38   { put_char(screen,x,y,*st);
    39     st++;
    40     x+=tl;
    41   }
    42 }
    43 
    44 
    4521void JCFont::put_string(image *screen, int x, int y, char const *st, int color)
    4622{ while (*st)
     
    5026  }
    5127}
    52 
    5328
    5429void JCFont::put_char(image *screen,  int x, int y, char ch, int color)
  • abuse/trunk/src/imlib/fonts.h

    r555 r667  
    1111#ifndef __FONTS_HPP_
    1212#define __FONTS_HPP_
     13
    1314#include "image.h"
    1415#include "transimage.h"
    15 
    16 
    17 
    18 class texture_font
    19 {
    20   int tl,th;
    21   image *let,*fntpat;
    22 public:
    23   texture_font(image *letters, image *font_pattern=NULL);
    24   void put_char(image *screen,  int x, int y, char ch);
    25   void put_string(image *screen, int x, int y, char const *st);
    26   int height() { return th; }
    27   int length() { return tl; }
    28   int width() { return tl; }
    29   image *font_image() { return let; }
    30   image *font_patter() { return fntpat; }
    31   ~texture_font() { if (let) delete let; if (fntpat) delete fntpat; }
    32 } ;
    3316
    3417class JCFont
  • abuse/trunk/src/imlib/image.cpp

    r665 r667  
    371371
    372372    im->Unlock();
    373     Unlock();
    374 }
    375 
    376 void image::PutPartMasked(image *im, vec2i pos, image *mask, vec2i mpos,
    377                           vec2i aa, vec2i bb)
    378 {
    379     CHECK(aa < bb);
    380 
    381     if (m_special)
    382     {
    383         vec2i caa, cbb;
    384         m_special->GetClip(caa, cbb);
    385 
    386         if (!(pos < cbb && pos > aa - bb))
    387             return;
    388 
    389         aa += Max(caa - pos, vec2i(0));
    390         pos += Max(caa - pos, vec2i(0));
    391         bb = Min(bb, cbb - pos + aa);
    392     }
    393     else if (!(pos <= m_size && pos >= -aa))
    394         return;
    395 
    396     vec2i mask_size = mask->Size();
    397 
    398     if (!(pos < m_size && aa < im->m_size && mpos < mask_size && aa < bb))
    399         return;
    400 
    401     bb = Min(bb, im->m_size);
    402 
    403     vec2i span = bb - aa;
    404     span = Min(span, m_size - pos);
    405     AddDirty(pos.x, pos.y, pos.x + span.x, pos.y + span.y);
    406 
    407     Lock();
    408     mask->Lock();
    409     im->Lock();
    410 
    411     for (int j = 0; j < span.y; j++)
    412     {
    413         uint8_t *dst = scan_line(pos.y + j) + pos.x;
    414         uint8_t *src = im->scan_line(aa.y + j) + aa.x;
    415         uint8_t *pg3 = mask->scan_line(mpos.y) + mpos.x;
    416 
    417         if (++mpos.y >= mask_size.y) // wrap mask y around
    418             mpos.y = 0;
    419 
    420         for (int i = 0; i < span.x; i++, dst++, src++, pg3++)
    421         {
    422             if (mpos.x + i >= mask_size.x) // wrap mask x around
    423                 pg3 -= mask_size.x;
    424 
    425             if (pg3[mpos.x + i]) // check to make sure not 0 before putting
    426                 *dst = *src;
    427         }
    428     }
    429 
    430     im->Unlock();
    431     mask->Unlock();
    432373    Unlock();
    433374}
  • abuse/trunk/src/imlib/image.h

    r665 r667  
    125125    void PutPart(image *screen, vec2i pos, vec2i aa, vec2i bb,
    126126                 int transparent = 0);
    127     void PutPartMasked(image *screen, vec2i pos, image *mask, vec2i mpos,
    128                        vec2i aa, vec2i bb);
    129127    image *copy_part_dithered(int16_t x1, int16_t y1, int16_t x2, int16_t y2);
    130128    void Bar(vec2i p1, vec2i p2, uint8_t color);
Note: See TracChangeset for help on using the changeset viewer.