1 /*
2 This file is part of Warzone 2100.
3 Copyright (C) 1999-2004 Eidos Interactive
4 Copyright (C) 2005-2020 Warzone 2100 Project
5
6 Warzone 2100 is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 Warzone 2100 is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Warzone 2100; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 #ifndef __INCLUDED_BITIMAGE__
21 #define __INCLUDED_BITIMAGE__
22
23 #include "ivisdef.h"
24 #include "pietypes.h"
25 #include "lib/framework/wzstring.h"
26
iV_GetImageWidth(const IMAGEFILE * ImageFile,const unsigned short ID)27 static inline WZ_DECL_PURE unsigned short iV_GetImageWidth(const IMAGEFILE *ImageFile, const unsigned short ID)
28 {
29 assert(ID < ImageFile->imageDefs.size());
30 return Image(ImageFile, ID).width();
31 }
32
33
iV_GetImageHeight(const IMAGEFILE * ImageFile,const unsigned short ID)34 static inline WZ_DECL_PURE unsigned short iV_GetImageHeight(const IMAGEFILE *ImageFile, const unsigned short ID)
35 {
36 assert(ID < ImageFile->imageDefs.size());
37 return Image(ImageFile, ID).height();
38 }
39
40
iV_GetImageXOffset(const IMAGEFILE * ImageFile,const unsigned short ID)41 static inline WZ_DECL_PURE short iV_GetImageXOffset(const IMAGEFILE *ImageFile, const unsigned short ID)
42 {
43 assert(ID < ImageFile->imageDefs.size());
44 return Image(ImageFile, ID).xOffset();
45 }
46
47
iV_GetImageYOffset(const IMAGEFILE * ImageFile,const unsigned short ID)48 static inline WZ_DECL_PURE short iV_GetImageYOffset(const IMAGEFILE *ImageFile, const unsigned short ID)
49 {
50 assert(ID < ImageFile->imageDefs.size());
51 return Image(ImageFile, ID).yOffset();
52 }
53
54 ImageDef *iV_GetImage(const WzString &filename);
55 IMAGEFILE *iV_LoadImageFile(const char *FileData);
56 void iV_FreeImageFile(IMAGEFILE *ImageFile);
57
58 #endif
59