forked from raduprv/Eternal-Lands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ddsimage.h
78 lines (69 loc) · 2.39 KB
/
ddsimage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/****************************************************************************
* ddsimage.h
*
* Author: 2011 Daniel Jungmann <[email protected]>
* Copyright: See COPYING file that comes with this distribution
****************************************************************************/
#ifndef UUID_69a52b29_73df_40f9_b176_7bb53e97d035
#define UUID_69a52b29_73df_40f9_b176_7bb53e97d035
#include "platform.h"
#include "io/elfilewrapper.h"
#ifdef NEW_TEXTURES
#include "image_loading.h"
#endif /* NEW_TEXTURES */
#ifdef __cplusplus
extern "C" {
#endif
/**
* @ingroup textures
* @brief Checks if the ID is from a DDS image.
*
* Checks if the ID is from a DDS image. Must be at least four
* bytes.
* @param ID The id to check.
* @return Returns one if the id is from a dds file, zero else.
* @callgraph
*/
Uint32 check_dds(const Uint8 *ID);
#ifdef NEW_TEXTURES
/**
* @ingroup textures
* @brief Loads a dds image.
*
* Loads a dds image from file into the struct image. Can
* decompress and unpack (converts the data to RGBA8) the pixels.
* Only if needed are the mipmaps loaded also the loading can
* start at a different base level (e.g. the first mipmap).
* @param file The file to load from.
* @param compression Set of texture compressions that can be used.
* @param unpack Should the image get converted to RGBA8?
* @param strip_mipmaps Should we strip the mipmaps?
* @param base_level What base level should we use?
* @param image The image struct where we store the loaded data.
* @return Returns one if everything is ok, zero else.
* @see texture_compression_type
* @callgraph
*/
Uint32 load_dds(el_file_ptr file, const Uint32 compression, const Uint32 unpack,
const Uint32 strip_mipmaps, const Uint32 base_level,
image_t* image);
/**
* @ingroup textures
* @brief Gets dds information.
*
* Place dds information in the image struct. Only width, height,
* mipmaps, format and alpha are valid, the rest is filled
* with zeros.
* @param file The file to use.
* @param image The image struct where we store the informations data.
* @return Returns one if everything is ok, zero else.
* @callgraph
*/
Uint32 get_dds_information(el_file_ptr file, image_t* image);
#else /* NEW_TEXTURES */
void* load_dds(el_file_ptr file, int *width, int *height);
#endif /* NEW_TEXTURES */
#ifdef __cplusplus
} // extern "C"
#endif
#endif /* UUID_69a52b29_73df_40f9_b176_7bb53e97d035 */