3 Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef TEXTURE_HEADER
21 #define TEXTURE_HEADER
23 // This file now contains all that was here
27 typedef u16 textureid_t;
31 #include "common_irrlicht.h"
32 //#include "utility.h"
36 All textures are given a "texture id".
37 0 = nothing (a NULL pointer texture)
39 typedef u16 textureid_t;
42 Every texture in the game can be specified by this.
44 It exists instead of specification strings because arbitary
45 texture combinations for map nodes are handled using this,
46 and strings are too slow for that purpose.
48 Plain texture pointers are not used because they don't contain
49 content information by themselves. A texture can be completely
50 reconstructed by just looking at this, while this also is a
51 fast unique key to containers.
54 #define TEXTURE_SPEC_TEXTURE_COUNT 4
63 TextureSpec(textureid_t id0)
69 TextureSpec(textureid_t id0, textureid_t id1)
78 for(u32 i=0; i<TEXTURE_SPEC_TEXTURE_COUNT; i++)
86 for(u32 i=0; i<TEXTURE_SPEC_TEXTURE_COUNT; i++)
94 void addTid(textureid_t tid)
96 for(u32 i=0; i<TEXTURE_SPEC_TEXTURE_COUNT; i++)
108 bool operator==(const TextureSpec &other) const
110 for(u32 i=0; i<TEXTURE_SPEC_TEXTURE_COUNT; i++)
112 if(tids[i] != other.tids[i])
118 bool operator<(const TextureSpec &other) const
120 for(u32 i=0; i<TEXTURE_SPEC_TEXTURE_COUNT; i++)
122 if(tids[i] >= other.tids[i])
128 // Ids of textures. They are blit on each other.
129 textureid_t tids[TEXTURE_SPEC_TEXTURE_COUNT];