ScummVM API documentation
dds_header.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 WATCHMAKER_DDSHEADER_H
23
#define WATCHMAKER_DDSHEADER_H
24
25
#include "common/ptr.h"
26
#include "common/stream.h"
27
28
namespace
Watchmaker
{
29
30
enum class
DxtCompression : uint32 {
31
UNCOMPRESSED = 0,
32
DXT1 =
MKTAG
(
'1'
,
'T'
,
'X'
,
'D'
),
33
DXT2 =
MKTAG
(
'2'
,
'T'
,
'X'
,
'D'
),
34
DXT3 =
MKTAG
(
'3'
,
'T'
,
'X'
,
'D'
),
35
DXT4 =
MKTAG
(
'4'
,
'T'
,
'X'
,
'D'
),
36
DXT5 =
MKTAG
(
'5'
,
'T'
,
'X'
,
'D'
)
37
};
38
39
class
TextureData
{
40
public
:
41
DxtCompression _compression;
42
TextureData
(DxtCompression compression) : _compression(compression) {}
43
virtual
~
TextureData
() {}
44
virtual
int
getWidth()
const
= 0;
45
virtual
int
getHeight()
const
= 0;
46
virtual
int
getDataSize()
const
= 0;
47
virtual
const
void
*getData()
const
= 0;
48
};
49
50
class
Texture
{
51
public
:
52
virtual
~
Texture
() {}
53
virtual
void
assignData(
const
TextureData
&data) = 0;
54
virtual
void
bind() = 0;
55
};
56
57
58
struct
DDSHeader
{
59
DDSHeader
() {}
60
DDSHeader
(
Common::SeekableReadStream
&stream);
61
int
height = 0;
62
int
width = 0;
63
uint32 dataSize()
const
;
64
DxtCompression compression = DxtCompression::UNCOMPRESSED;
65
};
66
67
//Common::SharedPtr<Texture> loadTgaTextureData(Common::SeekableReadStream &stream);
68
Common::SharedPtr<TextureData>
loadDdsTexture(
Common::SeekableReadStream
&stream,
DDSHeader
&header);
69
Common::SharedPtr<TextureData>
loadDdsTexture(
Common::SeekableReadStream
&stream);
70
71
}
// End of namespace Watchmaker
72
73
#endif // WATCHMAKER_DDSHEADER_H
Watchmaker
Definition:
2d_stuff.h:30
Watchmaker::DDSHeader
Definition:
dds_header.h:58
Common::SeekableReadStream
Definition:
stream.h:745
Watchmaker::TextureData
Definition:
dds_header.h:39
MKTAG
#define MKTAG(a0, a1, a2, a3)
Definition:
endian.h:188
Common::SharedPtr
Definition:
ptr.h:159
Watchmaker::Texture
Definition:
dds_header.h:50
engines
watchmaker
3d
dds_header.h
Generated on Mon Dec 23 2024 09:21:49 for ScummVM API documentation by
1.8.13