1 #pragma once
2 
3 //********************************************************************************************
4 //*
5 //*    This file is part of Egoboo.
6 //*
7 //*    Egoboo is free software: you can redistribute it and/or modify it
8 //*    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 //*    Egoboo is distributed in the hope that it will be useful, but
13 //*    WITHOUT ANY WARRANTY; without even the implied warranty of
14 //*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 //*    General Public License for more details.
16 //*
17 //*    You should have received a copy of the GNU General Public License
18 //*    along with Egoboo.  If not, see <http://www.gnu.org/licenses/>.
19 //*
20 //********************************************************************************************
21 
22 /// @file texture.h
23 
24 #include "egoboo_typedef.h"
25 #include "ogl_texture.h"
26 
27 //--------------------------------------------------------------------------------------------
28 //--------------------------------------------------------------------------------------------
29 
30 /// Special Textures
31 enum e_global_tx_type
32 {
33     TX_PARTICLE_TRANS = 0,
34     TX_PARTICLE_LIGHT,
35     TX_TILE_0,
36     TX_TILE_1,
37     TX_TILE_2,
38     TX_TILE_3,
39     TX_WATER_TOP,
40     TX_WATER_LOW,
41     TX_PHONG,
42     TX_FONT,
43     TX_BARS,
44     TX_BLIP,
45     TX_MAP,
46     TX_XP_BAR,
47     ICON_NULL,
48     ICON_KEYB,
49     ICON_MOUS,
50     ICON_JOYA,
51     ICON_JOYB,
52     TX_LAST
53 };
54 
55 //--------------------------------------------------------------------------------------------
56 //--------------------------------------------------------------------------------------------
57 #define TRANSCOLOR                      0           ///< Color index of the transparent color in an 8-bit image, or the rgb components of the transparent color in a 24-bit image
58 
59 #define TX_TEXTURE_COUNT   (2*(MAX_TEXTURE + MAX_ICON))
60 #define INVALID_TX_TEXTURE TX_TEXTURE_COUNT
61 
62 /// declare special arrays of textures
63 DECLARE_LIST_EXTERN( oglx_texture_t, TxTexture, TX_TEXTURE_COUNT );
64 
65 //--------------------------------------------------------------------------------------------
66 //--------------------------------------------------------------------------------------------
67 void           TxTexture_init_all();
68 void           TxTexture_delete_all();
69 void           TxTexture_release_all();
70 TX_REF         TxTexture_get_free( const TX_REF itex );
71 bool_t         TxTexture_free_one( const TX_REF  itex );
72 TX_REF         TxTexture_load_one_vfs( const char *filename, const TX_REF  itex_src, Uint32 key );
73 oglx_texture_t * TxTexture_get_ptr( const TX_REF itex );
74 
75 void           TxTexture_reload_all();
76