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

Last change on this file since 527 was 527, checked in by Sam Hocevar, 11 years ago

imlib: some cleaning up in trans_image before I templatise half of it.

  • Property svn:keywords set to Id
File size: 2.1 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 "palette.h"
16#include "filter.h"
17
18/* data is stored in the following format
19
20  skip amount, data size, data  // no scan line wraps allowed
21
22*/
23
24
25class trans_image       // transpernet image
26{
27public:
28  trans_image(image *im, char const *name);  // name has no meaning if MEM_CHECK is off
29
30  inline vec2i Size() { return m_size; }
31  uint8_t *Data() { return m_data; }
32
33  void put_image(image *screen, int x, int y);   // always transparent
34
35  // if screen x & y offset already calculated save a mul
36  // and no clipping, but fast use this
37  void put_image_offseted(image *screen, uint8_t *s_off);
38  void put_image_filled(image *screen, int x, int y,
39            uint8_t fill_color);
40  void put_fade(image *screen, int x, int y,
41               int frame_on, int total_frames,
42               color_filter *f, palette *pal);
43  void put_fade_tint(image *screen, int x, int y,
44             int frame_on, int total_frames,
45             uint8_t *tint,
46             color_filter *f, palette *pal);
47  void put_color(image *screen, int x, int y, int color);
48
49  void put_blend16(image *screen, image *blend, int x, int y,
50               int blendx, int blendy, int blend_amount, color_filter *f, palette *pal);
51  void put_double_remaped(image *screen, int x, int y, unsigned char *remap, unsigned char *remap2);
52  void put_remaped(image *screen, int x, int y, unsigned char *remap);
53  void put_predator(image *screen, int x, int y);
54  void put_scan_line(image *screen, int x, int y, int line);   // always transparent
55  size_t MemUsage();
56  image *make_image();
57  ~trans_image();
58
59private:
60  uint8_t *ClipToLine(image *screen, int x1, int y1, int x2, int y2,
61                      int x, int &y, int &ysteps);
62
63  vec2i m_size;
64  uint8_t *m_data;
65};
66
67#endif
68
Note: See TracBrowser for help on using the repository browser.