Changeset 533


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

imlib: rename trans_image to TImage. The code is now clean enough.

Location:
abuse/trunk/src
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/cache.h

    r506 r533  
    6262 *  - sound
    6363 *  - image
    64  *  - trans_image
     64 *  - TImage
    6565 */
    6666
  • abuse/trunk/src/dev.cpp

    r528 r533  
    30073007    {
    30083008      im->clear();
    3009       the_game->get_fg(pat[i])->im->PutImage(im,0,0);
     3009      the_game->get_fg(pat[i])->im->PutImage(im,vec2i(0,0));
    30103010      scale_put(im,me->screen,me->x1()+(i%w)*tw,
    30113011        me->y1()+(i/w)*th,tw,th);
  • abuse/trunk/src/devsel.cpp

    r528 r533  
    112112        {
    113113          im.clear();
    114           the_game->get_fg(i)->im->PutImage(&im,0,0);
     114          the_game->get_fg(i)->im->PutImage(&im,vec2i(0,0));
    115115
    116116          if (rev)
     
    131131      case SPEC_CHARACTER :
    132132      {
    133         figures[i]->get_sequence(stopped)->get_figure(0)->forward->PutImage(&im,0,0);
     133        figures[i]->get_sequence(stopped)->get_figure(0)->forward->PutImage(&im,vec2i(0,0));
    134134        scale_put(&im,screen,xo,yo,xw,ya);
    135135      } break;
  • abuse/trunk/src/endgame.cpp

    r528 r533  
    237237      {
    238238    cache.img(planet)->put_image(tcopy,0,0);
    239     cache.fig(explo_frames1[i-30])->forward->PutImage(tcopy,100,50);
     239    cache.fig(explo_frames1[i-30])->forward->PutImage(tcopy,vec2i(100,50));
    240240        scan_map(screen,ex,ey,tcopy,
    241241           cache.img(planet2),
     
    320320      last=c;
    321321      if (c->char_num)
    322         cache.fig(explo_frames2[c->frame])->forward->PutImage(screen,c->x,c->y);
     322        cache.fig(explo_frames2[c->frame])->forward->PutImage(screen,vec2i(c->x,c->y));
    323323
    324324      c->x-=3;
  • abuse/trunk/src/game.cpp

    r530 r533  
    564564}
    565565
    566 void Game::put_block_fg(int x, int y, trans_image *im)
     566void Game::put_block_fg(int x, int y, TImage *im)
    567567{
    568568  for(view *f = first_view; f; f = f->next)
     
    576576      screen->GetClip(cx1, cy1, cx2, cy2);
    577577      screen->SetClip(viewx1, viewy1, viewx2 + 1, viewy2 + 1);
    578       im->PutImage(screen, (x - xoff / ftile_width())*ftile_width()+viewx1 - xoff % ftile_width(),
    579             (y - yoff / ftile_height())*ftile_height()+viewy1 - yoff % ftile_height());
     578      im->PutImage(screen, vec2i((x - xoff / ftile_width())*ftile_width()+viewx1 - xoff % ftile_width(),
     579            (y - yoff / ftile_height())*ftile_height()+viewy1 - yoff % ftile_height()));
    580580      screen->SetClip(cx1, cy1, cx2, cy2);
    581581    }
     
    945945          if(fort_num != BLACK)
    946946          {
    947             get_fg(fort_num)->im->PutImage(screen, draw_x, draw_y);
     947            get_fg(fort_num)->im->PutImage(screen, vec2i(draw_x, draw_y));
    948948
    949949        if(!(dev & EDIT_MODE))
     
    987987        {
    988988          if(dev & DRAW_BG_LAYER)
    989           get_fg(fort_num)->im->PutImage(screen, draw_x, draw_y);
     989          get_fg(fort_num)->im->PutImage(screen, vec2i(draw_x, draw_y));
    990990          else
    991           get_fg(fort_num)->im->PutFilled(screen, draw_x, draw_y, 0);
     991          get_fg(fort_num)->im->PutFilled(screen, vec2i(draw_x, draw_y), 0);
    992992
    993993          if(!(dev & EDIT_MODE))
  • abuse/trunk/src/game.h

    r524 r533  
    128128  void draw_map(view *v, int interpolate=0);
    129129  void dev_scroll();
    130   void put_block_fg(int x, int y, trans_image *im);
     130  void put_block_fg(int x, int y, TImage *im);
    131131  void put_block_bg(int x, int y, image *im);
    132132
  • abuse/trunk/src/go.cpp

    r532 r533  
    104104    sy1=max(the_game->viewy1,sy1);
    105105    sy2=min(the_game->viewy2,sy2);
    106     trans_image *p=picture();
     106    TImage *p=picture();
    107107
    108108    for (i=sy1; i<=sy2; i++)
  • abuse/trunk/src/imlib/fonts.cpp

    r528 r533  
    5555  {
    5656    if (color>=0)
    57       let[(int)ch]->PutColor(screen,x,y,color);
    58     else let[(int)ch]->PutImage(screen,x,y);
     57      let[(int)ch]->PutColor(screen,vec2i(x,y),color);
     58    else let[(int)ch]->PutImage(screen,vec2i(x,y));
    5959  }
    6060}
     
    7474    letters->put_part(&tmp,0,0,((int)ch%32)*tl,((int)ch/32)*th,
    7575              ((int)ch%32)*tl+tl-1,((int)ch/32)*th+th-1,1);
    76     let[ch]=new trans_image(&tmp,"JCfont");
     76    let[ch]=new TImage(&tmp,"JCfont");
    7777  }
    7878}
  • abuse/trunk/src/imlib/fonts.h

    r494 r533  
    3535{
    3636  int tl,th;
    37   trans_image *let[256];
     37  TImage *let[256];
    3838public:
    3939  JCFont(image *letters);
  • abuse/trunk/src/imlib/supmorph.cpp

    r527 r533  
    2525                             ((int)(y1)-(int)y2)*((int)(y1)-(int)y2))
    2626
    27 super_morph::super_morph(trans_image *hint1, trans_image *hint2,
     27super_morph::super_morph(TImage *hint1, TImage *hint2,
    2828             int aneal_steps, void (*stat_fun)(int))
    2929{
     
    356356  int steps=atoi(argv[1]);
    357357  if (steps<2) steps=50;
    358   trans_image *hh1=new trans_image(h1,"hint1"),*hh2=new trans_image(h2,"hint2");
     358  TImage *hh1=new TImage(h1,"hint1"),*hh2=new TImage(h2,"hint2");
    359359
    360360  time_marker time1;
  • abuse/trunk/src/imlib/supmorph.h

    r494 r533  
    2020  unsigned char *movers;
    2121  int w,h;
    22   super_morph(trans_image *h1, trans_image *h2, int aneal_steps, void (*stat_fun)(int));
     22  super_morph(TImage *h1, TImage *h2, int aneal_steps, void (*stat_fun)(int));
    2323  ~super_morph() { if (t) free(movers); }
    2424} ;
  • abuse/trunk/src/imlib/timage.cpp

    r532 r533  
    1111#include "config.h"
    1212
     13#include <cstdio>
     14#include <cstring>
     15
    1316#include "common.h"
    1417
    1518#include "timage.h"
    1619
    17 trans_image::trans_image(image *im, char const *name)
     20TImage::TImage(image *im, char const *name)
    1821{
    1922    m_size = im->Size();
     
    5053    if (!parser)
    5154    {
    52         printf("size = %d %d (%d bytes)\n",im->Size().x,im->Size().y,bytes);
    53         CONDITION(parser, "malloc error for trans_image::m_data");
     55        printf("size = %d %d (%d bytes)\n", m_size.x, m_size.y, bytes);
     56        CONDITION(parser, "malloc error for TImage::m_data");
    5457    }
    5558
     
    8891}
    8992
    90 trans_image::~trans_image()
     93TImage::~TImage()
    9194{
    9295    free(m_data);
    9396}
    9497
    95 image *trans_image::ToImage()
     98image *TImage::ToImage()
    9699{
    97100    image *im = new image(m_size);
     
    102105    im->Unlock();
    103106
    104     PutImage(im, 0, 0);
     107    PutImage(im, vec2i(0));
    105108    return im;
    106109}
    107110
    108 uint8_t *trans_image::ClipToLine(image *screen, int x1, int y1, int x2, int y2,
    109                                  int x, int &y, int &ysteps)
     111uint8_t *TImage::ClipToLine(image *screen, vec2i pos1, vec2i pos2,
     112                            vec2i &pos, int &ysteps)
    110113{
    111114    // check to see if it is totally clipped out first
    112     if (y + m_size.y <= y1 || y >= y2 || x >= x2 || x + m_size.x <= x1)
     115    if (pos.y + m_size.y <= pos1.y || pos.y >= pos2.y
     116         || pos.x >= pos2.x || pos.x + m_size.x <= pos1.x)
    113117        return NULL;
    114118
    115119    uint8_t *parser = m_data;
    116120
    117     int skiplines = Max(y1 - y, 0); // number of lines to skip
    118     ysteps = Min(y2 - y, m_size.y - skiplines); // number of lines to draw
    119     y += skiplines; // first line to draw
     121    // Number of lines to skip, number of lines to draw, first line to draw
     122    int skiplines = Max(pos1.y - pos.y, 0);
     123    ysteps = Min(pos2.y - pos.y, m_size.y - skiplines);
     124    pos.y += skiplines;
    120125
    121126    while (skiplines--)
     
    133138    }
    134139
    135     screen->AddDirty(Max(x, x1), y, Min(x + m_size.x, x2), y + m_size.y);
     140    screen->AddDirty(Max(pos.x, pos1.x), pos.y,
     141                     Min(pos.x + m_size.x, pos2.x), pos.y + m_size.y);
    136142    return parser;
    137143}
    138144
    139145template<int N>
    140 void trans_image::PutImageGeneric(image *screen, int x, int y, uint8_t color,
    141                                   image *blend, int bx, int by,
    142                                   uint8_t *remap, uint8_t *remap2,
    143                                   int amount, int total_frames,
    144                                   uint8_t *tint, color_filter *f, palette *pal)
    145 {
    146     int x1, y1, x2, y2;
     146void TImage::PutImageGeneric(image *screen, vec2i pos, uint8_t color,
     147                             image *blend, vec2i bpos, uint8_t *map,
     148                             uint8_t *map2, int amount, int total_frames,
     149                             uint8_t *tint, color_filter *f, palette *pal)
     150{
     151    vec2i pos1, pos2;
    147152    int ysteps, mul = 0;
    148153
    149     screen->GetClip(x1, y1, x2, y2);
     154    screen->GetClip(pos1.x, pos1.y, pos2.x, pos2.y);
    150155
    151156    if (N == SCANLINE)
    152157    {
    153         y1 = Max(y1, y + amount);
    154         y2 = Min(y2, y + amount + 1);
    155         if (y1 >= y2)
     158        pos1.y = Max(pos1.y, pos.y + amount);
     159        pos2.y = Min(pos2.y, pos.y + amount + 1);
     160        if (pos1.y >= pos2.y)
    156161            return;
    157162    }
    158163
    159     uint8_t *datap = ClipToLine(screen, x1, y1, x2, y2, x, y, ysteps),
     164    uint8_t *datap = ClipToLine(screen, pos1, pos2, pos, ysteps),
    160165            *screen_line, *blend_line = NULL, *paddr = NULL;
    161166    if (!datap)
    162167        return; // if ClipToLine says nothing to draw, return
    163168
    164     CONDITION(N == BLEND && y >= by && y + ysteps < by + blend->Size().y + 1,
    165               "Blend doesn't fit on trans_image");
     169    CONDITION(N == BLEND && pos.y >= bpos.y
     170                         && pos.y + ysteps < bpos.y + blend->Size().y + 1,
     171              "Blend doesn't fit on TImage");
    166172
    167173    if (N == FADE || N == FADE_TINT || N == BLEND)
     
    174180
    175181    if (N == PREDATOR)
    176         ysteps = Min(ysteps, y2 - 1 - y - 2);
     182        ysteps = Min(ysteps, pos2.y - 1 - pos.y - 2);
    177183
    178184    screen->Lock();
    179185
    180     screen_line = screen->scan_line(y) + x;
     186    screen_line = screen->scan_line(pos.y) + pos.x;
    181187    int sw = screen->Size().x;
    182     x1 -= x; x2 -= x;
    183 
    184     for (; ysteps > 0; ysteps--, y++)
     188    pos1.x -= pos.x; pos2.x -= pos.x;
     189
     190    for (; ysteps > 0; ysteps--, pos.y++)
    185191    {
    186192        if (N == BLEND)
    187             blend_line = blend->scan_line(y - by);
     193            blend_line = blend->scan_line(pos.y - bpos.y);
    188194
    189195        for (int ix = 0; ix < m_size.x; )
     
    203209
    204210            // Chop left side if necessary, but no more than todo
    205             int tochop = Min(todo, Max(x1 - ix, 0));
     211            int tochop = Min(todo, Max(pos1.x - ix, 0));
    206212
    207213            ix += tochop;
     
    211217
    212218            // Chop right side if necessary and process the remaining pixels
    213             int count = Min(todo, Max(x2 - ix, 0));
     219            int count = Min(todo, Max(pos2.x - ix, 0));
    214220
    215221            if (N == NORMAL || N == SCANLINE)
     
    229235                uint8_t *sl = screen_line, *sl2 = datap;
    230236                while (count--)
    231                     *sl++ = remap[*sl2++];
     237                    *sl++ = map[*sl2++];
    232238            }
    233239            else if (N == REMAP2)
     
    235241                uint8_t *sl = screen_line, *sl2 = datap;
    236242                while (count--)
    237                     *sl++ = remap2[remap[*sl2++]];
     243                    *sl++ = map2[map[*sl2++]];
    238244            }
    239245            else if (N == FADE || N == FADE_TINT || N == BLEND)
    240246            {
    241247                uint8_t *sl = screen_line;
    242                 uint8_t *sl2 = (N == BLEND) ? blend_line + x + ix - bx : sl;
     248                uint8_t *sl2 = (N == BLEND) ? blend_line + pos.x + ix - bpos.x
     249                                            : sl;
    243250                uint8_t *sl3 = datap;
    244251
     
    246253                {
    247254                    uint8_t *p1 = paddr + 3 * *sl2++;
    248                     uint8_t *p2 = paddr + 3 * (N == FADE_TINT ? tint[*sl3++] : *sl3++);
     255                    uint8_t *p2 = paddr + 3 * (N == FADE_TINT ? tint[*sl3++]
     256                                                              : *sl3++);
    249257
    250258                    uint8_t r = ((((int)p1[0] - p2[0]) * mul) >> 16) + p2[0];
     
    265273}
    266274
    267 void trans_image::PutImage(image *screen, int x, int y)
    268 {
    269     PutImageGeneric<NORMAL>(screen, x, y, 0, NULL, 0, 0, NULL, NULL,
     275void TImage::PutImage(image *screen, vec2i pos)
     276{
     277    PutImageGeneric<NORMAL>(screen, pos, 0, NULL, 0, NULL, NULL,
    270278                            0, 1, NULL, NULL, NULL);
    271279}
    272280
    273 void trans_image::PutRemap(image *screen, int x, int y, uint8_t *remap)
    274 {
    275     PutImageGeneric<REMAP>(screen, x, y, 0, NULL, 0, 0, remap, NULL,
     281void TImage::PutRemap(image *screen, vec2i pos, uint8_t *map)
     282{
     283    PutImageGeneric<REMAP>(screen, pos, 0, NULL, 0, map, NULL,
    276284                           0, 1, NULL, NULL, NULL);
    277285}
    278286
    279 void trans_image::PutDoubleRemap(image *screen, int x, int y,
    280                                  uint8_t *remap, uint8_t *remap2)
    281 {
    282     PutImageGeneric<REMAP2>(screen, x, y, 0, NULL, 0, 0, remap, remap2,
     287void TImage::PutDoubleRemap(image *screen, vec2i pos,
     288                            uint8_t *map, uint8_t *map2)
     289{
     290    PutImageGeneric<REMAP2>(screen, pos, 0, NULL, 0, map, map2,
    283291                            0, 1, NULL, NULL, NULL);
    284292}
    285293
    286294// Used when eg. the player teleports, or in rocket trails
    287 void trans_image::PutFade(image *screen, int x, int y,
    288                           int amount, int total_frames,
    289                           color_filter *f, palette *pal)
    290 {
    291     PutImageGeneric<FADE>(screen, x, y, 0, NULL, 0, 0, NULL, NULL,
     295void TImage::PutFade(image *screen, vec2i pos, int amount, int total_frames,
     296                     color_filter *f, palette *pal)
     297{
     298    PutImageGeneric<FADE>(screen, pos, 0, NULL, 0, NULL, NULL,
    292299                          amount, total_frames, NULL, f, pal);
    293300}
    294301
    295 void trans_image::PutFadeTint(image *screen, int x, int y,
    296                               int amount, int total_frames,
    297                               uint8_t *tint, color_filter *f, palette *pal)
    298 {
    299     PutImageGeneric<FADE_TINT>(screen, x, y, 0, NULL, 0, 0, NULL, NULL,
     302void TImage::PutFadeTint(image *screen, vec2i pos, int amount, int total_frames,
     303                         uint8_t *tint, color_filter *f, palette *pal)
     304{
     305    PutImageGeneric<FADE_TINT>(screen, pos, 0, NULL, 0, NULL, NULL,
    300306                               amount, total_frames, tint, f, pal);
    301307}
    302308
    303 void trans_image::PutColor(image *screen, int x, int y, uint8_t color)
    304 {
    305     PutImageGeneric<COLOR>(screen, x, y, color, NULL, 0, 0, NULL, NULL,
     309void TImage::PutColor(image *screen, vec2i pos, uint8_t color)
     310{
     311    PutImageGeneric<COLOR>(screen, pos, color, NULL, 0, NULL, NULL,
    306312                           0, 1, NULL, NULL, NULL);
    307313}
     
    309315// This method is unused but is believed to work.
    310316// Assumes that the blend image completely covers the transparent image.
    311 void trans_image::PutBlend(image *screen, int x, int y,
    312                            image *blend, int bx, int by,
    313                            int amount, color_filter *f, palette *pal)
    314 {
    315     PutImageGeneric<BLEND>(screen, x, y, 0, blend, bx, by, NULL, NULL,
     317void TImage::PutBlend(image *screen, vec2i pos, image *blend, vec2i bpos,
     318                      int amount, color_filter *f, palette *pal)
     319{
     320    PutImageGeneric<BLEND>(screen, pos, 0, blend, bpos, NULL, NULL,
    316321                           amount, 1, NULL, f, pal);
    317322}
    318323
    319 void trans_image::PutFilled(image *screen, int x, int y, uint8_t color)
    320 {
    321     PutImageGeneric<FILLED>(screen, x, y, color, NULL, 0, 0, NULL, NULL,
     324void TImage::PutFilled(image *screen, vec2i pos, uint8_t color)
     325{
     326    PutImageGeneric<FILLED>(screen, pos, color, NULL, 0, NULL, NULL,
    322327                            0, 1, NULL, NULL, NULL);
    323328}
    324329
    325 void trans_image::PutPredator(image *screen, int x, int y)
    326 {
    327     PutImageGeneric<PREDATOR>(screen, x, y, 0, NULL, 0, 0, NULL, NULL,
     330void TImage::PutPredator(image *screen, vec2i pos)
     331{
     332    PutImageGeneric<PREDATOR>(screen, pos, 0, NULL, 0, NULL, NULL,
    328333                              0, 1, NULL, NULL, NULL);
    329334}
    330335
    331 void trans_image::PutScanLine(image *screen, int x, int y, int line)
    332 {
    333     PutImageGeneric<SCANLINE>(screen, x, y, 0, NULL, 0, 0, NULL, NULL,
     336void TImage::PutScanLine(image *screen, vec2i pos, int line)
     337{
     338    PutImageGeneric<SCANLINE>(screen, pos, 0, NULL, 0, NULL, NULL,
    334339                              line, 1, NULL, NULL, NULL);
    335340}
    336341
    337 size_t trans_image::MemUsage()
     342size_t TImage::MemUsage()
    338343{
    339344    uint8_t *d = m_data;
  • abuse/trunk/src/imlib/timage.h

    r532 r533  
    2525 */
    2626
    27 class trans_image // transparent image
     27class TImage // transparent image
    2828{
    2929public:
    30     trans_image(image *im, char const *name);
    31     ~trans_image();
     30    TImage(image *im, char const *name);
     31    ~TImage();
    3232
    3333    inline vec2i Size() { return m_size; }
     
    3636    image *ToImage();
    3737
    38     void PutImage(image *screen, int x, int y); // always transparent
    39     void PutRemap(image *screen, int x, int y, uint8_t *remap);
    40     void PutDoubleRemap(image *screen, int x, int y,
    41                         uint8_t *remap, uint8_t *remap2);
    42     void PutFade(image *screen, int x, int y, int amount, int total_frames,
     38    void PutImage(image *screen, vec2i pos);
     39    void PutRemap(image *screen, vec2i pos, uint8_t *map);
     40    void PutDoubleRemap(image *screen, vec2i pos, uint8_t *map, uint8_t *map2);
     41    void PutFade(image *screen, vec2i pos, int amount, int total_frames,
    4342                 color_filter *f, palette *pal);
    44     void PutFadeTint(image *screen, int x, int y, int amount, int total_frames,
     43    void PutFadeTint(image *screen, vec2i pos, int amount, int total_frames,
    4544                     uint8_t *tint, color_filter *f, palette *pal);
    46     void PutColor(image *screen, int x, int y, uint8_t color);
    47     void PutFilled(image *screen, int x, int y, uint8_t color);
    48     void PutPredator(image *screen, int x, int y);
    49     void PutBlend(image *screen, int x, int y, image *blend, int bx, int by,
     45    void PutColor(image *screen, vec2i pos, uint8_t color);
     46    void PutFilled(image *screen, vec2i pos, uint8_t color);
     47    void PutPredator(image *screen, vec2i pos);
     48    void PutBlend(image *screen, vec2i pos, image *blend, vec2i bpos,
    5049                  int blend_amount, color_filter *f, palette *pal);
    51     void PutScanLine(image *screen, int x, int y, int line);
     50    void PutScanLine(image *screen, vec2i pos, int line);
    5251
    5352    size_t MemUsage();
    5453
    5554private:
    56     uint8_t *ClipToLine(image *screen, int x1, int y1, int x2, int y2,
    57                         int x, int &y, int &ysteps);
     55    uint8_t *ClipToLine(image *screen, vec2i pos1, vec2i pos2,
     56                        vec2i &posy, int &ysteps);
    5857
    5958    enum PutMode { NORMAL, REMAP, REMAP2, FADE, FADE_TINT, COLOR,
    6059                   FILLED, PREDATOR, BLEND, SCANLINE };
    6160    template<int N>
    62     void PutImageGeneric(image *dest, int x, int y, uint8_t color,
    63                          image *blend, int bx, int by,
     61    void PutImageGeneric(image *dest, vec2i pos, uint8_t color,
     62                         image *blend, vec2i bpos,
    6463                         uint8_t *map1, uint8_t *map2, int amount,
    6564                         int total_frames, uint8_t *tint,
  • abuse/trunk/src/items.cpp

    r527 r533  
    261261
    262262
    263   im=new trans_image(img,"foretile");
     263  im=new TImage(img,"foretile");
    264264  delete img;
    265265
     
    283283{
    284284  image *im=load_image(fp);
    285   forward=new trans_image(im,"figure data");
     285  forward=new TImage(im,"figure data");
    286286  im->FlipX();
    287   backward=new trans_image(im,"figure backward data");
     287  backward=new TImage(im,"figure backward data");
    288288  delete im;
    289289
  • abuse/trunk/src/items.h

    r527 r533  
    4444{
    4545public :
    46   trans_image *im;
     46  TImage *im;
    4747  uint16_t next;
    4848  uint8_t damage;
     
    6161{
    6262public :
    63   trans_image *forward,*backward;
     63  TImage *forward,*backward;
    6464  uint8_t hit_damage,xcfg;
    6565  int8_t advance;
  • abuse/trunk/src/morpher.cpp

    r531 r533  
    5858
    5959    fleft=frames;
    60     trans_image *h1=new trans_image(cache.img(t1->morph_mask),"morph tmp"),
    61                 *h2=new trans_image(cache.img(t2->morph_mask),"morph tmp");
     60    TImage *h1=new TImage(cache.img(t1->morph_mask),"morph tmp"),
     61                *h2=new TImage(cache.img(t2->morph_mask),"morph tmp");
    6262    super_morph *sm=new super_morph(h1,h2,anneal,stat_fun);
    6363    if (sm->t)
  • abuse/trunk/src/objects.cpp

    r532 r533  
    396396    sy1 = Max(v->cy1, sy1);
    397397    sy2 = Min(v->cy2, sy2);
    398     trans_image *p=picture();
     398    TImage *p=picture();
    399399
    400400    for (i=sy1; i<=sy2; i++)
    401       p->PutScanLine(screen,sx,i,0);
     401      p->PutScanLine(screen,vec2i(sx,i),0);
    402402  }
    403403}
     
    680680void game_object::draw_trans(int count, int max)
    681681{
    682   trans_image *cpict=picture();
     682  TImage *cpict=picture();
    683683  cpict->PutFade(screen,
    684           (direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    685           y-cpict->Size().y+1-current_vyadd,
     684          vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     685                y-cpict->Size().y+1-current_vyadd),
    686686          count,max,
    687687          color_table,the_game->current_palette());
     
    691691void game_object::draw_tint(int tint_id)
    692692{
    693   trans_image *cpict=picture();
     693  TImage *cpict=picture();
    694694  if (fade_count())
    695695    cpict->PutFadeTint(screen,
    696                (direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    697                y-cpict->Size().y+1-current_vyadd,
     696               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     697                     y-cpict->Size().y+1-current_vyadd),
    698698               fade_count(),fade_max(),
    699699               cache.ctint(tint_id)->data,
     
    703703  else
    704704    cpict->PutRemap(screen,
    705                (direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    706                y-cpict->Size().y+1-current_vyadd,
     705               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     706                     y-cpict->Size().y+1-current_vyadd),
    707707               cache.ctint(tint_id)->data);
    708708}
     
    711711void game_object::draw_double_tint(int tint_id, int tint2)
    712712{
    713   trans_image *cpict=picture();
     713  TImage *cpict=picture();
    714714  if (fade_count())
    715715    cpict->PutFadeTint(screen,
    716                (direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    717                y-cpict->Size().y+1-current_vyadd,
     716               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     717                     y-cpict->Size().y+1-current_vyadd),
    718718               fade_count(),fade_max(),
    719719               cache.ctint(tint_id)->data,
     
    723723  else
    724724    cpict->PutDoubleRemap(screen,
    725                (direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    726                y-cpict->Size().y+1-current_vyadd,
     725               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     726                     y-cpict->Size().y+1-current_vyadd),
    727727               cache.ctint(tint_id)->data,
    728728               cache.ctint(tint2)->data);
     
    733733void game_object::draw_predator()
    734734{
    735   trans_image *cpict=picture();
     735  TImage *cpict=picture();
    736736  cpict->PutPredator(screen,
    737              (direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    738              y-cpict->Size().y+1-current_vyadd);
     737             vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     738                   y-cpict->Size().y+1-current_vyadd));
    739739
    740740}
     
    756756    else
    757757    {
    758       trans_image *cpict=picture();
     758      TImage *cpict=picture();
    759759      cpict->PutImage(screen,
    760                (direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    761                y-cpict->Size().y+1-current_vyadd);
     760               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     761                     y-cpict->Size().y+1-current_vyadd));
    762762    }
    763763  }
  • abuse/trunk/src/objects.h

    r527 r533  
    107107  game_object *bmove(int &whit, game_object *exclude);  // ballestic move, return hit object,
    108108                                                        // or NULL (whit is 1 if hit wall)
    109   trans_image *picture() { return current_sequence()->get_frame(current_frame,direction); }
     109  TImage *picture() { return current_sequence()->get_frame(current_frame,direction); }
    110110
    111111  int next_picture();
  • abuse/trunk/src/seq.h

    r527 r533  
    3030  int next_frame(short &current) { current++; if (current>=total) { current=0; return 0; } return 1; }
    3131  int last_frame(short &current) { current--; if (current<0) { current=total-1; return 0; } return 1; }
    32   trans_image  *get_frame(short current, int direction)
     32  TImage  *get_frame(short current, int direction)
    3333   { if (direction>0) return cache.fig(seq[current])->forward;
    3434                 else return cache.fig(seq[current])->backward; }
Note: See TracChangeset for help on using the changeset viewer.