source: abuse/trunk/src/imlib/timage.h @ 520

Last change on this file since 520 was 520, checked in by Sam Hocevar, 7 years ago

imlib: refactor and simplify trans_image::ClipToLine?().

  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5 *
6 *  This software was released into the Public Domain. As with most public
7 *  domain software, no warranty is made or implied by Crack dot Com or
8 *  Jonathan Clark.
9 */
10
11#ifndef __TIMAGE_HPP_
12#define __TIMAGE_HPP_
13
14#include "image.h"
15#include "macs.h"
16#include "palette.h"
17#include "filter.h"
18
19/* data is stored in the following format
20
21  skip amount, data size, data  // no scan line wraps allowed
22
23*/
24
25
26class trans_image       // transpernet image
27{
28  unsigned char *data;
29  short w,h;
30
31public :
32  short height() { return h; }
33  short width() { return w; }
34  trans_image(image *im, char const *name);  // name has no meaning if MEM_CHECK is off
35  void put_image(image *screen, int x, int y);   // always transparent
36
37  // if screen x & y offset already calculated save a mul
38  // and no clipping, but fast use this
39  void put_image_offseted(image *screen, uint8_t *s_off);
40  void put_image_filled(image *screen, int x, int y,
41            uint8_t fill_color);
42  void put_fade(image *screen, int x, int y,
43               int frame_on, int total_frames,
44               color_filter *f, palette *pal);
45  void put_fade_tint(image *screen, int x, int y,
46             int frame_on, int total_frames,
47             uint8_t *tint,
48             color_filter *f, palette *pal);
49  void put_color(image *screen, int x, int y, int color);
50
51  void put_blend16(image *screen, image *blend, int x, int y,
52               int blendx, int blendy, int blend_amount, color_filter *f, palette *pal);
53  void put_double_remaped(image *screen, int x, int y, unsigned char *remap, unsigned char *remap2);
54  void put_remaped(image *screen, int x, int y, unsigned char *remap);
55  void put_predator(image *screen, int x, int y);
56  void put_scan_line(image *screen, int x, int y, int line);   // always transparent
57  unsigned char *t_data() { return data; }
58  void make_color(int c);
59  int size();
60  image *make_image();
61  ~trans_image() { free(data); }
62
63private:
64  uint8_t *ClipToLine(image *screen, int x1, int y1, int x2, int y2,
65                      int x, int &y, int &ysteps);
66} ;
67
68
69#endif
70
71
72
73
74
Note: See TracBrowser for help on using the repository browser.