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

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

imlib: remove trans_image::put_image_offseted, it's simply a version
of PutImage? that skips the bounds checks. Yaddah yaddah modern hardware
blah.

  • Property svn:keywords set to Id
File size: 2.3 KB
RevLine 
[56]1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
[494]4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
[56]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
[2]11#ifndef __TIMAGE_HPP_
12#define __TIMAGE_HPP_
13
[481]14#include "image.h"
15#include "palette.h"
16#include "filter.h"
[2]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{
[527]27public:
28  trans_image(image *im, char const *name);  // name has no meaning if MEM_CHECK is off
[124]29
[527]30  inline vec2i Size() { return m_size; }
31  uint8_t *Data() { return m_data; }
32
[528]33  void PutImage(image *screen, int x, int y); // always transparent
34  void PutRemap(image *screen, int x, int y, uint8_t *remap);
35  void PutDoubleRemap(image *screen, int x, int y,
36                      uint8_t *remap, uint8_t *remap2);
37  void PutFade(image *screen, int x, int y, int amount, int total_frames,
38               color_filter *f, palette *pal);
39  void PutFadeTint(image *screen, int x, int y, int amount, int total_frames,
40                   uint8_t *tint, color_filter *f, palette *pal);
41  void PutColor(image *screen, int x, int y, uint8_t color);
42  void PutFilled(image *screen, int x, int y, uint8_t color);
43  void PutPredator(image *screen, int x, int y);
44  void PutBlend(image *screen, int x, int y, image *blend, int bx, int by,
45                int blend_amount, color_filter *f, palette *pal);
[2]46
[124]47  void put_scan_line(image *screen, int x, int y, int line);   // always transparent
[527]48  size_t MemUsage();
[2]49  image *make_image();
[527]50  ~trans_image();
[520]51
52private:
53  uint8_t *ClipToLine(image *screen, int x1, int y1, int x2, int y2,
54                      int x, int &y, int &ysteps);
[2]55
[528]56  enum PutMode { NORMAL, REMAP, DOUBLE_REMAP, FADE, FADE_TINT, COLOR,
57                 FILLED, PREDATOR, BLEND };
58  template<int N>
59  void PutImageGeneric(image *dest, int x, int y, uint8_t color,
60                       image *blend, int bx, int by,
61                       uint8_t *map1, uint8_t *map2, int amount,
62                       int total_frames, uint8_t *tint,
63                       color_filter *f, palette *pal);
64
[527]65  vec2i m_size;
66  uint8_t *m_data;
67};
[2]68
69#endif
70
Note: See TracBrowser for help on using the repository browser.