Changeset 533
- Timestamp:
- Apr 22, 2011, 7:32:13 PM (12 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/cache.h
r506 r533 62 62 * - sound 63 63 * - image 64 * - trans_image64 * - TImage 65 65 */ 66 66 -
abuse/trunk/src/dev.cpp
r528 r533 3007 3007 { 3008 3008 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)); 3010 3010 scale_put(im,me->screen,me->x1()+(i%w)*tw, 3011 3011 me->y1()+(i/w)*th,tw,th); -
abuse/trunk/src/devsel.cpp
r528 r533 112 112 { 113 113 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)); 115 115 116 116 if (rev) … … 131 131 case SPEC_CHARACTER : 132 132 { 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)); 134 134 scale_put(&im,screen,xo,yo,xw,ya); 135 135 } break; -
abuse/trunk/src/endgame.cpp
r528 r533 237 237 { 238 238 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)); 240 240 scan_map(screen,ex,ey,tcopy, 241 241 cache.img(planet2), … … 320 320 last=c; 321 321 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)); 323 323 324 324 c->x-=3; -
abuse/trunk/src/game.cpp
r530 r533 564 564 } 565 565 566 void Game::put_block_fg(int x, int y, trans_image *im)566 void Game::put_block_fg(int x, int y, TImage *im) 567 567 { 568 568 for(view *f = first_view; f; f = f->next) … … 576 576 screen->GetClip(cx1, cy1, cx2, cy2); 577 577 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())); 580 580 screen->SetClip(cx1, cy1, cx2, cy2); 581 581 } … … 945 945 if(fort_num != BLACK) 946 946 { 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)); 948 948 949 949 if(!(dev & EDIT_MODE)) … … 987 987 { 988 988 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)); 990 990 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); 992 992 993 993 if(!(dev & EDIT_MODE)) -
abuse/trunk/src/game.h
r524 r533 128 128 void draw_map(view *v, int interpolate=0); 129 129 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); 131 131 void put_block_bg(int x, int y, image *im); 132 132 -
abuse/trunk/src/go.cpp
r532 r533 104 104 sy1=max(the_game->viewy1,sy1); 105 105 sy2=min(the_game->viewy2,sy2); 106 trans_image *p=picture();106 TImage *p=picture(); 107 107 108 108 for (i=sy1; i<=sy2; i++) -
abuse/trunk/src/imlib/fonts.cpp
r528 r533 55 55 { 56 56 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)); 59 59 } 60 60 } … … 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 trans_image(&tmp,"JCfont");76 let[ch]=new TImage(&tmp,"JCfont"); 77 77 } 78 78 } -
abuse/trunk/src/imlib/fonts.h
r494 r533 35 35 { 36 36 int tl,th; 37 trans_image *let[256];37 TImage *let[256]; 38 38 public: 39 39 JCFont(image *letters); -
abuse/trunk/src/imlib/supmorph.cpp
r527 r533 25 25 ((int)(y1)-(int)y2)*((int)(y1)-(int)y2)) 26 26 27 super_morph::super_morph( trans_image *hint1, trans_image *hint2,27 super_morph::super_morph(TImage *hint1, TImage *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 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"); 359 359 360 360 time_marker time1; -
abuse/trunk/src/imlib/supmorph.h
r494 r533 20 20 unsigned char *movers; 21 21 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)); 23 23 ~super_morph() { if (t) free(movers); } 24 24 } ; -
abuse/trunk/src/imlib/timage.cpp
r532 r533 11 11 #include "config.h" 12 12 13 #include <cstdio> 14 #include <cstring> 15 13 16 #include "common.h" 14 17 15 18 #include "timage.h" 16 19 17 trans_image::trans_image(image *im, char const *name)20 TImage::TImage(image *im, char const *name) 18 21 { 19 22 m_size = im->Size(); … … 50 53 if (!parser) 51 54 { 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"); 54 57 } 55 58 … … 88 91 } 89 92 90 trans_image::~trans_image()93 TImage::~TImage() 91 94 { 92 95 free(m_data); 93 96 } 94 97 95 image * trans_image::ToImage()98 image *TImage::ToImage() 96 99 { 97 100 image *im = new image(m_size); … … 102 105 im->Unlock(); 103 106 104 PutImage(im, 0, 0);107 PutImage(im, vec2i(0)); 105 108 return im; 106 109 } 107 110 108 uint8_t * trans_image::ClipToLine(image *screen, int x1, int y1, int x2, int y2,109 int x, int &y, int &ysteps)111 uint8_t *TImage::ClipToLine(image *screen, vec2i pos1, vec2i pos2, 112 vec2i &pos, int &ysteps) 110 113 { 111 114 // 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) 113 117 return NULL; 114 118 115 119 uint8_t *parser = m_data; 116 120 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; 120 125 121 126 while (skiplines--) … … 133 138 } 134 139 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); 136 142 return parser; 137 143 } 138 144 139 145 template<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; 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) 150 { 151 vec2i pos1, pos2; 147 152 int ysteps, mul = 0; 148 153 149 screen->GetClip( x1, y1, x2, y2);154 screen->GetClip(pos1.x, pos1.y, pos2.x, pos2.y); 150 155 151 156 if (N == SCANLINE) 152 157 { 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) 156 161 return; 157 162 } 158 163 159 uint8_t *datap = ClipToLine(screen, x1, y1, x2, y2, x, y, ysteps),164 uint8_t *datap = ClipToLine(screen, pos1, pos2, pos, ysteps), 160 165 *screen_line, *blend_line = NULL, *paddr = NULL; 161 166 if (!datap) 162 167 return; // if ClipToLine says nothing to draw, return 163 168 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"); 166 172 167 173 if (N == FADE || N == FADE_TINT || N == BLEND) … … 174 180 175 181 if (N == PREDATOR) 176 ysteps = Min(ysteps, y2 - 1 -y - 2);182 ysteps = Min(ysteps, pos2.y - 1 - pos.y - 2); 177 183 178 184 screen->Lock(); 179 185 180 screen_line = screen->scan_line( y) +x;186 screen_line = screen->scan_line(pos.y) + pos.x; 181 187 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++) 185 191 { 186 192 if (N == BLEND) 187 blend_line = blend->scan_line( y - by);193 blend_line = blend->scan_line(pos.y - bpos.y); 188 194 189 195 for (int ix = 0; ix < m_size.x; ) … … 203 209 204 210 // 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)); 206 212 207 213 ix += tochop; … … 211 217 212 218 // 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)); 214 220 215 221 if (N == NORMAL || N == SCANLINE) … … 229 235 uint8_t *sl = screen_line, *sl2 = datap; 230 236 while (count--) 231 *sl++ = remap[*sl2++];237 *sl++ = map[*sl2++]; 232 238 } 233 239 else if (N == REMAP2) … … 235 241 uint8_t *sl = screen_line, *sl2 = datap; 236 242 while (count--) 237 *sl++ = remap2[remap[*sl2++]];243 *sl++ = map2[map[*sl2++]]; 238 244 } 239 245 else if (N == FADE || N == FADE_TINT || N == BLEND) 240 246 { 241 247 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; 243 250 uint8_t *sl3 = datap; 244 251 … … 246 253 { 247 254 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++); 249 257 250 258 uint8_t r = ((((int)p1[0] - p2[0]) * mul) >> 16) + p2[0]; … … 265 273 } 266 274 267 void trans_image::PutImage(image *screen, int x, int y)268 { 269 PutImageGeneric<NORMAL>(screen, x, y, 0, NULL, 0, 0, NULL, NULL,275 void TImage::PutImage(image *screen, vec2i pos) 276 { 277 PutImageGeneric<NORMAL>(screen, pos, 0, NULL, 0, NULL, NULL, 270 278 0, 1, NULL, NULL, NULL); 271 279 } 272 280 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,281 void TImage::PutRemap(image *screen, vec2i pos, uint8_t *map) 282 { 283 PutImageGeneric<REMAP>(screen, pos, 0, NULL, 0, map, NULL, 276 284 0, 1, NULL, NULL, NULL); 277 285 } 278 286 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,287 void TImage::PutDoubleRemap(image *screen, vec2i pos, 288 uint8_t *map, uint8_t *map2) 289 { 290 PutImageGeneric<REMAP2>(screen, pos, 0, NULL, 0, map, map2, 283 291 0, 1, NULL, NULL, NULL); 284 292 } 285 293 286 294 // 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, 295 void 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, 292 299 amount, total_frames, NULL, f, pal); 293 300 } 294 301 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, 302 void 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, 300 306 amount, total_frames, tint, f, pal); 301 307 } 302 308 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,309 void TImage::PutColor(image *screen, vec2i pos, uint8_t color) 310 { 311 PutImageGeneric<COLOR>(screen, pos, color, NULL, 0, NULL, NULL, 306 312 0, 1, NULL, NULL, NULL); 307 313 } … … 309 315 // This method is unused but is believed to work. 310 316 // 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, 317 void 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, 316 321 amount, 1, NULL, f, pal); 317 322 } 318 323 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,324 void TImage::PutFilled(image *screen, vec2i pos, uint8_t color) 325 { 326 PutImageGeneric<FILLED>(screen, pos, color, NULL, 0, NULL, NULL, 322 327 0, 1, NULL, NULL, NULL); 323 328 } 324 329 325 void trans_image::PutPredator(image *screen, int x, int y)326 { 327 PutImageGeneric<PREDATOR>(screen, x, y, 0, NULL, 0, 0, NULL, NULL,330 void TImage::PutPredator(image *screen, vec2i pos) 331 { 332 PutImageGeneric<PREDATOR>(screen, pos, 0, NULL, 0, NULL, NULL, 328 333 0, 1, NULL, NULL, NULL); 329 334 } 330 335 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,336 void TImage::PutScanLine(image *screen, vec2i pos, int line) 337 { 338 PutImageGeneric<SCANLINE>(screen, pos, 0, NULL, 0, NULL, NULL, 334 339 line, 1, NULL, NULL, NULL); 335 340 } 336 341 337 size_t trans_image::MemUsage()342 size_t TImage::MemUsage() 338 343 { 339 344 uint8_t *d = m_data; -
abuse/trunk/src/imlib/timage.h
r532 r533 25 25 */ 26 26 27 class trans_image // transparent image27 class TImage // transparent image 28 28 { 29 29 public: 30 trans_image(image *im, char const *name);31 ~ trans_image();30 TImage(image *im, char const *name); 31 ~TImage(); 32 32 33 33 inline vec2i Size() { return m_size; } … … 36 36 image *ToImage(); 37 37 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, 43 42 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, 45 44 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, 50 49 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); 52 51 53 52 size_t MemUsage(); 54 53 55 54 private: 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); 58 57 59 58 enum PutMode { NORMAL, REMAP, REMAP2, FADE, FADE_TINT, COLOR, 60 59 FILLED, PREDATOR, BLEND, SCANLINE }; 61 60 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, 64 63 uint8_t *map1, uint8_t *map2, int amount, 65 64 int total_frames, uint8_t *tint, -
abuse/trunk/src/items.cpp
r527 r533 261 261 262 262 263 im=new trans_image(img,"foretile");263 im=new TImage(img,"foretile"); 264 264 delete img; 265 265 … … 283 283 { 284 284 image *im=load_image(fp); 285 forward=new trans_image(im,"figure data");285 forward=new TImage(im,"figure data"); 286 286 im->FlipX(); 287 backward=new trans_image(im,"figure backward data");287 backward=new TImage(im,"figure backward data"); 288 288 delete im; 289 289 -
abuse/trunk/src/items.h
r527 r533 44 44 { 45 45 public : 46 trans_image *im;46 TImage *im; 47 47 uint16_t next; 48 48 uint8_t damage; … … 61 61 { 62 62 public : 63 trans_image *forward,*backward;63 TImage *forward,*backward; 64 64 uint8_t hit_damage,xcfg; 65 65 int8_t advance; -
abuse/trunk/src/morpher.cpp
r531 r533 58 58 59 59 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"); 62 62 super_morph *sm=new super_morph(h1,h2,anneal,stat_fun); 63 63 if (sm->t) -
abuse/trunk/src/objects.cpp
r532 r533 396 396 sy1 = Max(v->cy1, sy1); 397 397 sy2 = Min(v->cy2, sy2); 398 trans_image *p=picture();398 TImage *p=picture(); 399 399 400 400 for (i=sy1; i<=sy2; i++) 401 p->PutScanLine(screen, sx,i,0);401 p->PutScanLine(screen,vec2i(sx,i),0); 402 402 } 403 403 } … … 680 680 void game_object::draw_trans(int count, int max) 681 681 { 682 trans_image *cpict=picture();682 TImage *cpict=picture(); 683 683 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), 686 686 count,max, 687 687 color_table,the_game->current_palette()); … … 691 691 void game_object::draw_tint(int tint_id) 692 692 { 693 trans_image *cpict=picture();693 TImage *cpict=picture(); 694 694 if (fade_count()) 695 695 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), 698 698 fade_count(),fade_max(), 699 699 cache.ctint(tint_id)->data, … … 703 703 else 704 704 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), 707 707 cache.ctint(tint_id)->data); 708 708 } … … 711 711 void game_object::draw_double_tint(int tint_id, int tint2) 712 712 { 713 trans_image *cpict=picture();713 TImage *cpict=picture(); 714 714 if (fade_count()) 715 715 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), 718 718 fade_count(),fade_max(), 719 719 cache.ctint(tint_id)->data, … … 723 723 else 724 724 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), 727 727 cache.ctint(tint_id)->data, 728 728 cache.ctint(tint2)->data); … … 733 733 void game_object::draw_predator() 734 734 { 735 trans_image *cpict=picture();735 TImage *cpict=picture(); 736 736 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)); 739 739 740 740 } … … 756 756 else 757 757 { 758 trans_image *cpict=picture();758 TImage *cpict=picture(); 759 759 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)); 762 762 } 763 763 } -
abuse/trunk/src/objects.h
r527 r533 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 trans_image *picture() { return current_sequence()->get_frame(current_frame,direction); }109 TImage *picture() { return current_sequence()->get_frame(current_frame,direction); } 110 110 111 111 int next_picture(); -
abuse/trunk/src/seq.h
r527 r533 30 30 int next_frame(short ¤t) { current++; if (current>=total) { current=0; return 0; } return 1; } 31 31 int last_frame(short ¤t) { 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) 33 33 { if (direction>0) return cache.fig(seq[current])->forward; 34 34 else return cache.fig(seq[current])->backward; }
Note: See TracChangeset
for help on using the changeset viewer.