Changeset 541


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

imlib: rename TImage to TransImage? for readability.

Location:
abuse/trunk/src
Files:
16 edited
2 moved

Legend:

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

    r533 r541  
    6262 *  - sound
    6363 *  - image
    64  *  - TImage
     64 *  - TransImage
    6565 */
    6666
  • abuse/trunk/src/game.cpp

    r533 r541  
    564564}
    565565
    566 void Game::put_block_fg(int x, int y, TImage *im)
     566void Game::put_block_fg(int x, int y, TransImage *im)
    567567{
    568568  for(view *f = first_view; f; f = f->next)
  • abuse/trunk/src/game.h

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

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

    r524 r541  
    55    filter.cpp filter.h \
    66    image.cpp image.h \
     7    transimage.cpp transimage.h \
    78    linked.cpp linked.h \
    89    input.cpp input.h \
     
    1314    supmorph.cpp supmorph.h \
    1415    pcxread.cpp pcxread.h \
    15     timage.cpp timage.h \
    1616    jrand.cpp jrand.h \
    1717    keys.cpp keys.h \
  • abuse/trunk/src/imlib/fonts.cpp

    r533 r541  
    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 TImage(&tmp,"JCfont");
     76    let[ch]=new TransImage(&tmp,"JCfont");
    7777  }
    7878}
  • abuse/trunk/src/imlib/fonts.h

    r533 r541  
    1212#define __FONTS_HPP_
    1313#include "image.h"
    14 #include "timage.h"
     14#include "transimage.h"
    1515
    1616
     
    3535{
    3636  int tl,th;
    37   TImage *let[256];
     37  TransImage *let[256];
    3838public:
    3939  JCFont(image *letters);
  • abuse/trunk/src/imlib/supmorph.cpp

    r533 r541  
    1515#include "supmorph.h"
    1616#include "specs.h"
    17 #include "timage.h"
     17#include "transimage.h"
    1818#include "timing.h"
    1919#include "filter.h"
     
    2525                             ((int)(y1)-(int)y2)*((int)(y1)-(int)y2))
    2626
    27 super_morph::super_morph(TImage *hint1, TImage *hint2,
     27super_morph::super_morph(TransImage *hint1, TransImage *hint2,
    2828             int aneal_steps, void (*stat_fun)(int))
    2929{
     
    356356  int steps=atoi(argv[1]);
    357357  if (steps<2) steps=50;
    358   TImage *hh1=new TImage(h1,"hint1"),*hh2=new TImage(h2,"hint2");
     358  TransImage *hh1=new TransImage(h1,"hint1"),*hh2=new TransImage(h2,"hint2");
    359359
    360360  time_marker time1;
  • abuse/trunk/src/imlib/supmorph.h

    r533 r541  
    1212#define __SUPER_MORPH_HPP__
    1313
    14 #include "timage.h"
     14#include "transimage.h"
    1515
    1616class super_morph
     
    2020  unsigned char *movers;
    2121  int w,h;
    22   super_morph(TImage *h1, TImage *h2, int aneal_steps, void (*stat_fun)(int));
     22  super_morph(TransImage *h1, TransImage *h2, int aneal_steps, void (*stat_fun)(int));
    2323  ~super_morph() { if (t) free(movers); }
    2424} ;
  • 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;
  • abuse/trunk/src/imlib/transimage.h

    r540 r541  
    2525 */
    2626
    27 class TImage // transparent image
     27class TransImage
    2828{
    2929public:
    30     TImage(image *im, char const *name);
    31     ~TImage();
     30    TransImage(image *im, char const *name);
     31    ~TransImage();
    3232
    3333    inline vec2i Size() { return m_size; }
     
    3939    void PutRemap(image *screen, vec2i pos, uint8_t *map);
    4040    void PutDoubleRemap(image *screen, vec2i pos, uint8_t *map, uint8_t *map2);
    41     void PutFade(image *screen, vec2i pos, int amount, int total_frames,
     41    void PutFade(image *screen, vec2i pos, int amount, int nframes,
    4242                 color_filter *f, palette *pal);
    43     void PutFadeTint(image *screen, vec2i pos, int amount, int total_frames,
     43    void PutFadeTint(image *screen, vec2i pos, int amount, int nframes,
    4444                     uint8_t *tint, color_filter *f, palette *pal);
    4545    void PutColor(image *screen, vec2i pos, uint8_t color);
     
    5050    void PutScanLine(image *screen, vec2i pos, int line);
    5151
    52     size_t MemUsage();
     52    size_t DiskUsage();
    5353
    5454private:
     
    6262                         image *blend, vec2i bpos,
    6363                         uint8_t *map1, uint8_t *map2, int amount,
    64                          int total_frames, uint8_t *tint,
     64                         int nframes, uint8_t *tint,
    6565                         color_filter *f, palette *pal);
    6666
  • abuse/trunk/src/items.cpp

    r533 r541  
    261261
    262262
    263   im=new TImage(img,"foretile");
     263  im=new TransImage(img,"foretile");
    264264  delete img;
    265265
     
    275275size_t figure::MemUsage()
    276276{
    277     return forward->MemUsage() + backward->MemUsage() + hit->size()
     277    return forward->DiskUsage() + backward->DiskUsage() + hit->size()
    278278            + f_damage->size() + b_damage->size() + sizeof(figure);
    279279}
     
    283283{
    284284  image *im=load_image(fp);
    285   forward=new TImage(im,"figure data");
     285  forward=new TransImage(im,"figure data");
    286286  im->FlipX();
    287   backward=new TImage(im,"figure backward data");
     287  backward=new TransImage(im,"figure backward data");
    288288  delete im;
    289289
  • abuse/trunk/src/items.h

    r533 r541  
    1212#define __ITEMS_HPP__
    1313#include "image.h"
     14#include "transimage.h"
    1415#include "specs.h"
    1516#include "points.h"
    16 #include "timage.h"
    1717#include <stdio.h>
    1818#include <stdlib.h>
     
    4444{
    4545public :
    46   TImage *im;
     46  TransImage *im;
    4747  uint16_t next;
    4848  uint8_t damage;
     
    6161{
    6262public :
    63   TImage *forward,*backward;
     63  TransImage *forward,*backward;
    6464  uint8_t hit_damage,xcfg;
    6565  int8_t advance;
  • abuse/trunk/src/morpher.cpp

    r533 r541  
    5858
    5959    fleft=frames;
    60     TImage *h1=new TImage(cache.img(t1->morph_mask),"morph tmp"),
    61                 *h2=new TImage(cache.img(t2->morph_mask),"morph tmp");
     60    TransImage *h1=new TransImage(cache.img(t1->morph_mask),"morph tmp"),
     61                *h2=new TransImage(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

    r534 r541  
    1313#include "common.h"
    1414
    15 #include "timage.h"
     15#include "transimage.h"
    1616#include "objects.h"
    1717#include "chars.h"
     
    388388    sy1 = Max(v->cy1, sy1);
    389389    sy2 = Min(v->cy2, sy2);
    390     TImage *p=picture();
     390    TransImage *p=picture();
    391391
    392392    for (i=sy1; i<=sy2; i++)
     
    669669void game_object::draw_trans(int count, int max)
    670670{
    671   TImage *cpict=picture();
     671  TransImage *cpict=picture();
    672672  cpict->PutFade(screen,
    673673          vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     
    680680void game_object::draw_tint(int tint_id)
    681681{
    682   TImage *cpict=picture();
     682  TransImage *cpict=picture();
    683683  if (fade_count())
    684684    cpict->PutFadeTint(screen,
     
    700700void game_object::draw_double_tint(int tint_id, int tint2)
    701701{
    702   TImage *cpict=picture();
     702  TransImage *cpict=picture();
    703703  if (fade_count())
    704704    cpict->PutFadeTint(screen,
     
    722722void game_object::draw_predator()
    723723{
    724   TImage *cpict=picture();
     724  TransImage *cpict=picture();
    725725  cpict->PutPredator(screen,
    726726             vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     
    745745    else
    746746    {
    747       TImage *cpict=picture();
     747      TransImage *cpict=picture();
    748748      cpict->PutImage(screen,
    749749               vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
  • abuse/trunk/src/objects.h

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

    r518 r541  
    1818
    1919#include "specs.h"
    20 #include "timage.h"
    2120#include "jwindow.h"
    2221#include "fonts.h"
  • abuse/trunk/src/seq.h

    r533 r541  
    1313
    1414#include "image.h"
     15#include "transimage.h"
    1516#include "items.h"
    16 #include "timage.h"
    1717#include "cache.h"
     18
    1819#include <stdarg.h>
    1920
     
    3031  int next_frame(short &current) { current++; if (current>=total) { current=0; return 0; } return 1; }
    3132  int last_frame(short &current) { current--; if (current<0) { current=total-1; return 0; } return 1; }
    32   TImage  *get_frame(short current, int direction)
     33  TransImage  *get_frame(short current, int direction)
    3334   { if (direction>0) return cache.fig(seq[current])->forward;
    3435                 else return cache.fig(seq[current])->backward; }
Note: See TracChangeset for help on using the changeset viewer.