- Timestamp:
- Apr 24, 2011, 10:33:40 AM (12 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 16 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/cache.h
r533 r541 62 62 * - sound 63 63 * - image 64 * - T Image64 * - TransImage 65 65 */ 66 66 -
abuse/trunk/src/game.cpp
r533 r541 564 564 } 565 565 566 void Game::put_block_fg(int x, int y, T Image *im)566 void Game::put_block_fg(int x, int y, TransImage *im) 567 567 { 568 568 for(view *f = first_view; f; f = f->next) -
abuse/trunk/src/game.h
r533 r541 128 128 void draw_map(view *v, int interpolate=0); 129 129 void dev_scroll(); 130 void put_block_fg(int x, int y, T Image *im);130 void put_block_fg(int x, int y, TransImage *im); 131 131 void put_block_bg(int x, int y, image *im); 132 132 -
abuse/trunk/src/go.cpp
r533 r541 104 104 sy1=max(the_game->viewy1,sy1); 105 105 sy2=min(the_game->viewy2,sy2); 106 T Image *p=picture();106 TransImage *p=picture(); 107 107 108 108 for (i=sy1; i<=sy2; i++) -
abuse/trunk/src/imlib/Makefile.am
r524 r541 5 5 filter.cpp filter.h \ 6 6 image.cpp image.h \ 7 transimage.cpp transimage.h \ 7 8 linked.cpp linked.h \ 8 9 input.cpp input.h \ … … 13 14 supmorph.cpp supmorph.h \ 14 15 pcxread.cpp pcxread.h \ 15 timage.cpp timage.h \16 16 jrand.cpp jrand.h \ 17 17 keys.cpp keys.h \ -
abuse/trunk/src/imlib/fonts.cpp
r533 r541 74 74 letters->put_part(&tmp,0,0,((int)ch%32)*tl,((int)ch/32)*th, 75 75 ((int)ch%32)*tl+tl-1,((int)ch/32)*th+th-1,1); 76 let[ch]=new T Image(&tmp,"JCfont");76 let[ch]=new TransImage(&tmp,"JCfont"); 77 77 } 78 78 } -
abuse/trunk/src/imlib/fonts.h
r533 r541 12 12 #define __FONTS_HPP_ 13 13 #include "image.h" 14 #include "t image.h"14 #include "transimage.h" 15 15 16 16 … … 35 35 { 36 36 int tl,th; 37 T Image *let[256];37 TransImage *let[256]; 38 38 public: 39 39 JCFont(image *letters); -
abuse/trunk/src/imlib/supmorph.cpp
r533 r541 15 15 #include "supmorph.h" 16 16 #include "specs.h" 17 #include "t image.h"17 #include "transimage.h" 18 18 #include "timing.h" 19 19 #include "filter.h" … … 25 25 ((int)(y1)-(int)y2)*((int)(y1)-(int)y2)) 26 26 27 super_morph::super_morph(T Image *hint1, TImage *hint2,27 super_morph::super_morph(TransImage *hint1, TransImage *hint2, 28 28 int aneal_steps, void (*stat_fun)(int)) 29 29 { … … 356 356 int steps=atoi(argv[1]); 357 357 if (steps<2) steps=50; 358 T Image *hh1=new TImage(h1,"hint1"),*hh2=new TImage(h2,"hint2");358 TransImage *hh1=new TransImage(h1,"hint1"),*hh2=new TransImage(h2,"hint2"); 359 359 360 360 time_marker time1; -
abuse/trunk/src/imlib/supmorph.h
r533 r541 12 12 #define __SUPER_MORPH_HPP__ 13 13 14 #include "t image.h"14 #include "transimage.h" 15 15 16 16 class super_morph … … 20 20 unsigned char *movers; 21 21 int w,h; 22 super_morph(T Image *h1, TImage *h2, int aneal_steps, void (*stat_fun)(int));22 super_morph(TransImage *h1, TransImage *h2, int aneal_steps, void (*stat_fun)(int)); 23 23 ~super_morph() { if (t) free(movers); } 24 24 } ; -
abuse/trunk/src/imlib/transimage.cpp
-
Property
svn:keywords
set to
Id
r540 r541 16 16 #include "common.h" 17 17 18 #include "t image.h"19 20 T Image::TImage(image *im, char const *name)18 #include "transimage.h" 19 20 TransImage::TransImage(image *im, char const *name) 21 21 { 22 22 m_size = im->Size(); … … 53 53 if (!parser) 54 54 { 55 printf("size = %d %d (% d bytes)\n", m_size.x, m_size.y,bytes);56 CONDITION(parser, "malloc error for T Image::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"); 57 57 } 58 58 … … 91 91 } 92 92 93 T Image::~TImage()93 TransImage::~TransImage() 94 94 { 95 95 free(m_data); 96 96 } 97 97 98 image *T Image::ToImage()98 image *TransImage::ToImage() 99 99 { 100 100 image *im = new image(m_size); … … 109 109 } 110 110 111 uint8_t *T Image::ClipToLine(image *screen, vec2i pos1, vec2i pos2,112 vec2i &pos, int &ysteps)111 uint8_t *TransImage::ClipToLine(image *screen, vec2i pos1, vec2i pos2, 112 vec2i &pos, int &ysteps) 113 113 { 114 114 // check to see if it is totally clipped out first … … 144 144 145 145 template<int N> 146 void T Image::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)146 void 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) 150 150 { 151 151 vec2i pos1, pos2; … … 169 169 CONDITION(N == BLEND && pos.y >= bpos.y 170 170 && pos.y + ysteps < bpos.y + blend->Size().y + 1, 171 "Blend doesn't fit on T Image");171 "Blend doesn't fit on TransImage"); 172 172 173 173 if (N == FADE || N == FADE_TINT || N == BLEND) … … 175 175 176 176 if (N == FADE || N == FADE_TINT) 177 mul = (amount << 16) / total_frames;177 mul = (amount << 16) / nframes; 178 178 else if (N == BLEND) 179 179 mul = ((16 - amount) << 16 / 16); … … 273 273 } 274 274 275 void T Image::PutImage(image *screen, vec2i pos)275 void TransImage::PutImage(image *screen, vec2i pos) 276 276 { 277 277 PutImageGeneric<NORMAL>(screen, pos, 0, NULL, 0, NULL, NULL, … … 279 279 } 280 280 281 void T Image::PutRemap(image *screen, vec2i pos, uint8_t *map)281 void TransImage::PutRemap(image *screen, vec2i pos, uint8_t *map) 282 282 { 283 283 PutImageGeneric<REMAP>(screen, pos, 0, NULL, 0, map, NULL, … … 285 285 } 286 286 287 void T Image::PutDoubleRemap(image *screen, vec2i pos,287 void TransImage::PutDoubleRemap(image *screen, vec2i pos, 288 288 uint8_t *map, uint8_t *map2) 289 289 { … … 293 293 294 294 // Used when eg. the player teleports, or in rocket trails 295 void T Image::PutFade(image *screen, vec2i pos, int amount, int total_frames,296 color_filter *f, palette *pal)295 void TransImage::PutFade(image *screen, vec2i pos, int amount, int nframes, 296 color_filter *f, palette *pal) 297 297 { 298 298 PutImageGeneric<FADE>(screen, pos, 0, NULL, 0, NULL, NULL, 299 amount, total_frames, NULL, f, pal);300 } 301 302 void T Image::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 302 void TransImage::PutFadeTint(image *screen, vec2i pos, int amount, int nframes, 303 uint8_t *tint, color_filter *f, palette *pal) 304 304 { 305 305 PutImageGeneric<FADE_TINT>(screen, pos, 0, NULL, 0, NULL, NULL, 306 amount, total_frames, tint, f, pal);307 } 308 309 void T Image::PutColor(image *screen, vec2i pos, uint8_t color)306 amount, nframes, tint, f, pal); 307 } 308 309 void TransImage::PutColor(image *screen, vec2i pos, uint8_t color) 310 310 { 311 311 PutImageGeneric<COLOR>(screen, pos, color, NULL, 0, NULL, NULL, … … 315 315 // This method is unused but is believed to work. 316 316 // Assumes that the blend image completely covers the transparent image. 317 void T Image::PutBlend(image *screen, vec2i pos, image *blend, vec2i bpos,318 int amount, color_filter *f, palette *pal)317 void TransImage::PutBlend(image *screen, vec2i pos, image *blend, vec2i bpos, 318 int amount, color_filter *f, palette *pal) 319 319 { 320 320 PutImageGeneric<BLEND>(screen, pos, 0, blend, bpos, NULL, NULL, … … 322 322 } 323 323 324 void T Image::PutFilled(image *screen, vec2i pos, uint8_t color)324 void TransImage::PutFilled(image *screen, vec2i pos, uint8_t color) 325 325 { 326 326 PutImageGeneric<FILLED>(screen, pos, color, NULL, 0, NULL, NULL, … … 328 328 } 329 329 330 void T Image::PutPredator(image *screen, vec2i pos)330 void TransImage::PutPredator(image *screen, vec2i pos) 331 331 { 332 332 PutImageGeneric<PREDATOR>(screen, pos, 0, NULL, 0, NULL, NULL, … … 334 334 } 335 335 336 void T Image::PutScanLine(image *screen, vec2i pos, int line)336 void TransImage::PutScanLine(image *screen, vec2i pos, int line) 337 337 { 338 338 PutImageGeneric<SCANLINE>(screen, pos, 0, NULL, 0, NULL, NULL, … … 340 340 } 341 341 342 size_t T Image::MemUsage()342 size_t TransImage::DiskUsage() 343 343 { 344 344 uint8_t *d = m_data; -
Property
svn:keywords
set to
-
abuse/trunk/src/imlib/transimage.h
r540 r541 25 25 */ 26 26 27 class T Image // transparent image27 class TransImage 28 28 { 29 29 public: 30 T Image(image *im, char const *name);31 ~T Image();30 TransImage(image *im, char const *name); 31 ~TransImage(); 32 32 33 33 inline vec2i Size() { return m_size; } … … 39 39 void PutRemap(image *screen, vec2i pos, uint8_t *map); 40 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,41 void PutFade(image *screen, vec2i pos, int amount, int nframes, 42 42 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, 44 44 uint8_t *tint, color_filter *f, palette *pal); 45 45 void PutColor(image *screen, vec2i pos, uint8_t color); … … 50 50 void PutScanLine(image *screen, vec2i pos, int line); 51 51 52 size_t MemUsage();52 size_t DiskUsage(); 53 53 54 54 private: … … 62 62 image *blend, vec2i bpos, 63 63 uint8_t *map1, uint8_t *map2, int amount, 64 int total_frames, uint8_t *tint,64 int nframes, uint8_t *tint, 65 65 color_filter *f, palette *pal); 66 66 -
abuse/trunk/src/items.cpp
r533 r541 261 261 262 262 263 im=new T Image(img,"foretile");263 im=new TransImage(img,"foretile"); 264 264 delete img; 265 265 … … 275 275 size_t figure::MemUsage() 276 276 { 277 return forward-> MemUsage() + backward->MemUsage() + hit->size()277 return forward->DiskUsage() + backward->DiskUsage() + hit->size() 278 278 + f_damage->size() + b_damage->size() + sizeof(figure); 279 279 } … … 283 283 { 284 284 image *im=load_image(fp); 285 forward=new T Image(im,"figure data");285 forward=new TransImage(im,"figure data"); 286 286 im->FlipX(); 287 backward=new T Image(im,"figure backward data");287 backward=new TransImage(im,"figure backward data"); 288 288 delete im; 289 289 -
abuse/trunk/src/items.h
r533 r541 12 12 #define __ITEMS_HPP__ 13 13 #include "image.h" 14 #include "transimage.h" 14 15 #include "specs.h" 15 16 #include "points.h" 16 #include "timage.h"17 17 #include <stdio.h> 18 18 #include <stdlib.h> … … 44 44 { 45 45 public : 46 T Image *im;46 TransImage *im; 47 47 uint16_t next; 48 48 uint8_t damage; … … 61 61 { 62 62 public : 63 T Image *forward,*backward;63 TransImage *forward,*backward; 64 64 uint8_t hit_damage,xcfg; 65 65 int8_t advance; -
abuse/trunk/src/morpher.cpp
r533 r541 58 58 59 59 fleft=frames; 60 T Image *h1=new TImage(cache.img(t1->morph_mask),"morph tmp"),61 *h2=new T Image(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"); 62 62 super_morph *sm=new super_morph(h1,h2,anneal,stat_fun); 63 63 if (sm->t) -
abuse/trunk/src/objects.cpp
r534 r541 13 13 #include "common.h" 14 14 15 #include "t image.h"15 #include "transimage.h" 16 16 #include "objects.h" 17 17 #include "chars.h" … … 388 388 sy1 = Max(v->cy1, sy1); 389 389 sy2 = Min(v->cy2, sy2); 390 T Image *p=picture();390 TransImage *p=picture(); 391 391 392 392 for (i=sy1; i<=sy2; i++) … … 669 669 void game_object::draw_trans(int count, int max) 670 670 { 671 T Image *cpict=picture();671 TransImage *cpict=picture(); 672 672 cpict->PutFade(screen, 673 673 vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd, … … 680 680 void game_object::draw_tint(int tint_id) 681 681 { 682 T Image *cpict=picture();682 TransImage *cpict=picture(); 683 683 if (fade_count()) 684 684 cpict->PutFadeTint(screen, … … 700 700 void game_object::draw_double_tint(int tint_id, int tint2) 701 701 { 702 T Image *cpict=picture();702 TransImage *cpict=picture(); 703 703 if (fade_count()) 704 704 cpict->PutFadeTint(screen, … … 722 722 void game_object::draw_predator() 723 723 { 724 T Image *cpict=picture();724 TransImage *cpict=picture(); 725 725 cpict->PutPredator(screen, 726 726 vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd, … … 745 745 else 746 746 { 747 T Image *cpict=picture();747 TransImage *cpict=picture(); 748 748 cpict->PutImage(screen, 749 749 vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd, -
abuse/trunk/src/objects.h
r533 r541 107 107 game_object *bmove(int &whit, game_object *exclude); // ballestic move, return hit object, 108 108 // or NULL (whit is 1 if hit wall) 109 T Image *picture() { return current_sequence()->get_frame(current_frame,direction); }109 TransImage *picture() { return current_sequence()->get_frame(current_frame,direction); } 110 110 111 111 int next_picture(); -
abuse/trunk/src/scene.cpp
r518 r541 18 18 19 19 #include "specs.h" 20 #include "timage.h"21 20 #include "jwindow.h" 22 21 #include "fonts.h" -
abuse/trunk/src/seq.h
r533 r541 13 13 14 14 #include "image.h" 15 #include "transimage.h" 15 16 #include "items.h" 16 #include "timage.h"17 17 #include "cache.h" 18 18 19 #include <stdarg.h> 19 20 … … 30 31 int next_frame(short ¤t) { current++; if (current>=total) { current=0; return 0; } return 1; } 31 32 int last_frame(short ¤t) { current--; if (current<0) { current=total-1; return 0; } return 1; } 32 T Image *get_frame(short current, int direction)33 TransImage *get_frame(short current, int direction) 33 34 { if (direction>0) return cache.fig(seq[current])->forward; 34 35 else return cache.fig(seq[current])->backward; }
Note: See TracChangeset
for help on using the changeset viewer.