1 #ifndef _SHAPE_BLITTER_
2 #define _SHAPE_BLITTER_
3 /*
4 SHAPE_BLITTER.H
5 
6     Copyright (C) 2009 by Jeremiah Morris and the Aleph One developers
7 
8     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 3 of the License, or
11     (at your option) any later version.
12 
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17 
18     This license is contained in the file "COPYING",
19     which is included with this source code; it is available online at
20     http://www.gnu.org/licenses/gpl.html
21 
22     Draws Shapes file bitmaps for 2D UI
23 */
24 
25 #include "cseries.h"
26 #include "map.h"
27 #include "Image_Blitter.h"
28 
29 #include <vector>
30 #include <set>
31 
32 // texture types
33 enum {
34     Shape_Texture_Wall,
35     Shape_Texture_Landscape,
36     Shape_Texture_Sprite,
37     Shape_Texture_WeaponInHand,
38     Shape_Texture_Interface,
39     SHAPE_NUMBER_OF_TEXTURE_TYPES
40 };
41 
42 class Shape_Blitter
43 {
44 public:
45 	Shape_Blitter(short collection, short frame_index, short texture_type, short clut_index = 0);
46 
47 	void Rescale(float width, float height);
48 	float Width();
49 	float Height();
50 	int UnscaledWidth();
51 	int UnscaledHeight();
52 
53     void OGL_Draw(const Image_Rect& dst);
54     void SDL_Draw(SDL_Surface *dst_surface, const Image_Rect& dst);
55 
56     ~Shape_Blitter();
57 
58 	// tint the output image -- (1, 1, 1, 1) is untinted
59 	float tint_color_r, tint_color_g, tint_color_b, tint_color_a;
60 
61 	// rotate the output image about the center of destination rect
62 	// (in degrees clockwise)
63 	float rotation;
64 
65 	// set default cropping rectangle
66 	Image_Rect crop_rect;
67 
68 protected:
69 
70 	short m_coll;
71     short m_frame;
72     short m_type;
73     Image_Rect m_src;
74     Image_Rect m_scaled_src;
75 
76     SDL_Surface *m_surface;
77     SDL_Surface *m_scaled_surface;
78 };
79 
80 #endif
81