Ignore:
Timestamp:
Apr 24, 2011, 10:33:40 AM (12 years ago)
Author:
Sam Hocevar
Message:

imlib: rename TImage to TransImage? for readability.

File:
1 moved

Legend:

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

    • Property svn:keywords set to Id
    r540 r541  
    1616#include "common.h"
    1717
    18 #include "timage.h"
    19 
    20 TImage::TImage(image *im, char const *name)
     18#include "transimage.h"
     19
     20TransImage::TransImage(image *im, char const *name)
    2121{
    2222    m_size = im->Size();
     
    5353    if (!parser)
    5454    {
    55         printf("size = %d %d (%d bytes)\n", m_size.x, m_size.y, bytes);
    56         CONDITION(parser, "malloc error for TImage::m_data");
     55        printf("size = %d %d (%ld bytes)\n", m_size.x, m_size.y, (long)bytes);
     56        CONDITION(parser, "malloc error for TransImage::m_data");
    5757    }
    5858
     
    9191}
    9292
    93 TImage::~TImage()
     93TransImage::~TransImage()
    9494{
    9595    free(m_data);
    9696}
    9797
    98 image *TImage::ToImage()
     98image *TransImage::ToImage()
    9999{
    100100    image *im = new image(m_size);
     
    109109}
    110110
    111 uint8_t *TImage::ClipToLine(image *screen, vec2i pos1, vec2i pos2,
    112                             vec2i &pos, int &ysteps)
     111uint8_t *TransImage::ClipToLine(image *screen, vec2i pos1, vec2i pos2,
     112                                vec2i &pos, int &ysteps)
    113113{
    114114    // check to see if it is totally clipped out first
     
    144144
    145145template<int N>
    146 void 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)
     146void TransImage::PutImageGeneric(image *screen, vec2i pos, uint8_t color,
     147                                 image *blend, vec2i bpos, uint8_t *map,
     148                                 uint8_t *map2, int amount, int nframes,
     149                                 uint8_t *tint, color_filter *f, palette *pal)
    150150{
    151151    vec2i pos1, pos2;
     
    169169    CONDITION(N == BLEND && pos.y >= bpos.y
    170170                         && pos.y + ysteps < bpos.y + blend->Size().y + 1,
    171               "Blend doesn't fit on TImage");
     171              "Blend doesn't fit on TransImage");
    172172
    173173    if (N == FADE || N == FADE_TINT || N == BLEND)
     
    175175
    176176    if (N == FADE || N == FADE_TINT)
    177         mul = (amount << 16) / total_frames;
     177        mul = (amount << 16) / nframes;
    178178    else if (N == BLEND)
    179179        mul = ((16 - amount) << 16 / 16);
     
    273273}
    274274
    275 void TImage::PutImage(image *screen, vec2i pos)
     275void TransImage::PutImage(image *screen, vec2i pos)
    276276{
    277277    PutImageGeneric<NORMAL>(screen, pos, 0, NULL, 0, NULL, NULL,
     
    279279}
    280280
    281 void TImage::PutRemap(image *screen, vec2i pos, uint8_t *map)
     281void TransImage::PutRemap(image *screen, vec2i pos, uint8_t *map)
    282282{
    283283    PutImageGeneric<REMAP>(screen, pos, 0, NULL, 0, map, NULL,
     
    285285}
    286286
    287 void TImage::PutDoubleRemap(image *screen, vec2i pos,
     287void TransImage::PutDoubleRemap(image *screen, vec2i pos,
    288288                            uint8_t *map, uint8_t *map2)
    289289{
     
    293293
    294294// Used when eg. the player teleports, or in rocket trails
    295 void TImage::PutFade(image *screen, vec2i pos, int amount, int total_frames,
    296                      color_filter *f, palette *pal)
     295void TransImage::PutFade(image *screen, vec2i pos, int amount, int nframes,
     296                         color_filter *f, palette *pal)
    297297{
    298298    PutImageGeneric<FADE>(screen, pos, 0, NULL, 0, NULL, NULL,
    299                           amount, total_frames, NULL, f, pal);
    300 }
    301 
    302 void TImage::PutFadeTint(image *screen, vec2i pos, int amount, int total_frames,
    303                          uint8_t *tint, color_filter *f, palette *pal)
     299                          amount, nframes, NULL, f, pal);
     300}
     301
     302void TransImage::PutFadeTint(image *screen, vec2i pos, int amount, int nframes,
     303                             uint8_t *tint, color_filter *f, palette *pal)
    304304{
    305305    PutImageGeneric<FADE_TINT>(screen, pos, 0, NULL, 0, NULL, NULL,
    306                                amount, total_frames, tint, f, pal);
    307 }
    308 
    309 void TImage::PutColor(image *screen, vec2i pos, uint8_t color)
     306                               amount, nframes, tint, f, pal);
     307}
     308
     309void TransImage::PutColor(image *screen, vec2i pos, uint8_t color)
    310310{
    311311    PutImageGeneric<COLOR>(screen, pos, color, NULL, 0, NULL, NULL,
     
    315315// This method is unused but is believed to work.
    316316// Assumes that the blend image completely covers the transparent image.
    317 void TImage::PutBlend(image *screen, vec2i pos, image *blend, vec2i bpos,
    318                       int amount, color_filter *f, palette *pal)
     317void TransImage::PutBlend(image *screen, vec2i pos, image *blend, vec2i bpos,
     318                          int amount, color_filter *f, palette *pal)
    319319{
    320320    PutImageGeneric<BLEND>(screen, pos, 0, blend, bpos, NULL, NULL,
     
    322322}
    323323
    324 void TImage::PutFilled(image *screen, vec2i pos, uint8_t color)
     324void TransImage::PutFilled(image *screen, vec2i pos, uint8_t color)
    325325{
    326326    PutImageGeneric<FILLED>(screen, pos, color, NULL, 0, NULL, NULL,
     
    328328}
    329329
    330 void TImage::PutPredator(image *screen, vec2i pos)
     330void TransImage::PutPredator(image *screen, vec2i pos)
    331331{
    332332    PutImageGeneric<PREDATOR>(screen, pos, 0, NULL, 0, NULL, NULL,
     
    334334}
    335335
    336 void TImage::PutScanLine(image *screen, vec2i pos, int line)
     336void TransImage::PutScanLine(image *screen, vec2i pos, int line)
    337337{
    338338    PutImageGeneric<SCANLINE>(screen, pos, 0, NULL, 0, NULL, NULL,
     
    340340}
    341341
    342 size_t TImage::MemUsage()
     342size_t TransImage::DiskUsage()
    343343{
    344344    uint8_t *d = m_data;
Note: See TracChangeset for help on using the changeset viewer.