ScummVM API documentation
texture.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 ULTIMA8_GFX_TEXTURE_H
23#define ULTIMA8_GFX_TEXTURE_H
24
25namespace Ultima {
26namespace Ultima8 {
27
28//
29// Texturing Helper Macros
30//
31
32// 32 Bit Texture bit operations
33#define TEX32_A_SHIFT 24
34#define TEX32_A_MASK 0xFF000000
35#define TEX32_A(col32) (((col32)&TEX32_A_MASK)>>TEX32_A_SHIFT)
36
37#define TEX32_G_SHIFT 8
38#define TEX32_G_MASK 0x0000FF00
39#define TEX32_G(col32) (((col32)&TEX32_G_MASK)>>TEX32_G_SHIFT)
40
41#define TEX32_B_SHIFT 16
42#define TEX32_B_MASK 0x00FF0000
43#define TEX32_B(col32) (((col32)&TEX32_B_MASK)>>TEX32_B_SHIFT)
44
45#define TEX32_R_SHIFT 0
46#define TEX32_R_MASK 0x000000FF
47#define TEX32_R(col32) (((col32)&TEX32_R_MASK)>>TEX32_R_SHIFT)
48
49#define TEX32_PACK_RGB(r, g, b) (uint32)(((0xFF) << TEX32_A_SHIFT) | ((r) << TEX32_R_SHIFT) | \
50 ((g) << TEX32_G_SHIFT) | ((b) << TEX32_B_SHIFT))
51
52#define TEX32_PACK_RGBA(r, g, b, a) (uint32)(((a) << TEX32_A_SHIFT) | ((r) << TEX32_R_SHIFT) | \
53 ((g) << TEX32_G_SHIFT) | ((b) << TEX32_B_SHIFT))
54
55} // End of namespace Ultima8
56} // End of namespace Ultima
57
58#endif