ScummVM API documentation
gui_types.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef NUVIE_GUI_GUI_TYPES_H
23 #define NUVIE_GUI_GUI_TYPES_H
24 
25 /* Basic GUI data types and classes */
26 
27 #include "ultima/nuvie/misc/sdl_compat.h"
28 
29 namespace Ultima {
30 namespace Nuvie {
31 
32 class GUI_image {
33 
34 public:
35  /* Load an image from a BMP file */
36  GUI_image(char *file);
37 
38  /* Use a Graphics::ManagedSurface as the image
39  The surface shouldn't be freed while the miage object exists.
40  */
41  GUI_image(Graphics::ManagedSurface *picture, int shouldfree = 0);
42 
43 private:
45 };
46 
47 class GUI_Color {
48 public:
49 
50  uint8 r;
51  uint8 g;
52  uint8 b;
53 //uint8 a;
54 
55  uint32 sdl_color;
56 
57 public:
58 
59  GUI_Color(uint8 red, uint8 green, uint8 blue)
60  : r(red), g(green), b(blue), sdl_color(0) {
61  };
62  GUI_Color()
63  : r(0), g(0), b(0), sdl_color(0) {
64  };
65  void map_color(const Graphics::PixelFormat &format) {
66  sdl_color = format.RGBToColor(r, g, b);
67  };
68 
69 };
70 
71 } // End of namespace Nuvie
72 } // End of namespace Ultima
73 
74 #endif
Definition: managed_surface.h:51
Definition: pixelformat.h:138
Definition: detection.h:27
Definition: gui_types.h:32
Definition: gui_types.h:47
uint32 RGBToColor(uint8 r, uint8 g, uint8 b) const
Definition: pixelformat.h:206