xoreos
0.0.5
src
graphics
aurora
abcfont.h
Go to the documentation of this file.
1
/* xoreos - A reimplementation of BioWare's Aurora engine
2
*
3
* xoreos is the legal property of its developers, whose names
4
* can be found in the AUTHORS file distributed with this source
5
* distribution.
6
*
7
* xoreos is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 3
10
* of the License, or (at your option) any later version.
11
*
12
* xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
25
#ifndef GRAPHICS_AURORA_ABCFONT_H
26
#define GRAPHICS_AURORA_ABCFONT_H
27
28
#include <map>
29
30
#include "
src/common/types.h
"
31
32
#include "
src/graphics/font.h
"
33
34
#include "
src/graphics/aurora/texturehandle.h
"
35
36
#include "
src/graphics/mesh/meshfont.h
"
37
38
#include "
src/graphics/shader/shaderrenderable.h
"
39
40
namespace
Common
{
41
class
UString;
42
class
SeekableReadStream;
43
}
44
45
namespace
Graphics
{
46
47
namespace
Aurora
{
48
50
class
ABCFont
:
public
Graphics::Font
{
51
public
:
52
ABCFont
(
const
Common::UString
&name);
53
~ABCFont
();
54
55
float
getWidth
(
uint32
c)
const
;
56
float
getHeight
()
const
;
57
58
void
draw
(
uint32
c)
const
;
59
64
virtual
void
renderBind
(
const
glm::mat4 &transform)
const
;
65
66
virtual
void
render
(
uint32
c,
float
&x,
float
&y,
float
*rgba)
const
;
67
virtual
void
renderUnbind
()
const
;
68
69
private
:
71
struct
Char
{
72
uint32
dataX
;
73
uint32
dataY
;
74
uint8
width
;
75
int8
spaceL
;
76
int8
spaceR
;
77
78
float
tX
[4],
tY
[4];
79
float
vX
[4],
vY
[4];
80
};
81
82
TextureHandle
_texture
;
83
Mesh::MeshFont
*
_mesh
;
84
Shader::ShaderMaterial
*
_material
;
85
Shader::ShaderRenderable
*
_renderable
;
86
87
uint8
_base
;
88
89
Char
_invalid
;
90
Char
_ascii
[128];
91
std::map<uint32, Char>
_extended
;
92
93
void
load
(
const
Common::UString
&name);
94
95
void
readCharDesc
(
Char
&c,
Common::SeekableReadStream
&abc);
96
void
calcCharVertices
(
Char
&c);
97
98
const
Char
&
findChar
(
uint32
c)
const
;
99
};
100
101
}
// End of namespace Aurora
102
103
}
// End of namespace Graphics
104
105
#endif // GRAPHICS_AURORA_ABCFONT_H
Graphics::Aurora::ABCFont::render
virtual void render(uint32 c, float &x, float &y, float *rgba) const
Definition:
abcfont.cpp:97
Graphics::Aurora::ABCFont::Char::tY
float tY[4]
Definition:
abcfont.h:78
shaderrenderable.h
Shader renderable, a class for easier managing of a collection of items (surface, material...
Common
Definition:
2dafile.h:39
Common::UString
A class holding an UTF-8 string.
Definition:
ustring.h:48
meshfont.h
Dedicated mesh used for dynamic font rendering.
uint8
uint8_t uint8
Definition:
types.h:200
Graphics::Aurora::ABCFont::Char::width
uint8 width
Definition:
abcfont.h:74
Graphics::Aurora::ABCFont::_extended
std::map< uint32, Char > _extended
Definition:
abcfont.h:91
Graphics::Aurora::ABCFont::Char::spaceR
int8 spaceR
Definition:
abcfont.h:76
texturehandle.h
A handle to an Aurora texture.
Graphics::Aurora::ABCFont::calcCharVertices
void calcCharVertices(Char &c)
Definition:
abcfont.cpp:210
Graphics::Aurora::ABCFont::Char::tX
float tX[4]
Definition:
abcfont.h:78
Graphics::Aurora::ABCFont::Char::dataY
uint32 dataY
Definition:
abcfont.h:73
Graphics::Aurora::ABCFont::_ascii
Char _ascii[128]
Definition:
abcfont.h:90
Graphics::Shader::ShaderMaterial
Definition:
shadermaterial.h:34
Graphics::Aurora::ABCFont::ABCFont
ABCFont(const Common::UString &name)
Definition:
abcfont.cpp:43
Graphics::Aurora::ABCFont::_renderable
Shader::ShaderRenderable * _renderable
Definition:
abcfont.h:85
Graphics::Aurora::ABCFont::Char::spaceL
int8 spaceL
Definition:
abcfont.h:75
Aurora
Definition:
2dafile.cpp:51
Graphics::Aurora::ABCFont::_invalid
Char _invalid
Definition:
abcfont.h:89
Graphics::Aurora::ABCFont::readCharDesc
void readCharDesc(Char &c, Common::SeekableReadStream &abc)
Definition:
abcfont.cpp:195
Graphics::Aurora::ABCFont::load
void load(const Common::UString &name)
Definition:
abcfont.cpp:129
Graphics::Aurora::ABCFont::_mesh
Mesh::MeshFont * _mesh
Definition:
abcfont.h:83
types.h
Low-level type definitions to handle fixed width types portably.
Graphics::Font
An abstract font.
Definition:
font.h:39
Graphics::Aurora::ABCFont::findChar
const Char & findChar(uint32 c) const
Definition:
abcfont.cpp:233
Graphics::Aurora::ABCFont::_material
Shader::ShaderMaterial * _material
Definition:
abcfont.h:84
Graphics::Aurora::ABCFont::Char::vY
float vY[4]
Definition:
abcfont.h:79
Graphics::Shader::ShaderRenderable
Definition:
shaderrenderable.h:40
Graphics::Aurora::ABCFont::_base
uint8 _base
Definition:
abcfont.h:87
Graphics::Aurora::ABCFont::renderUnbind
virtual void renderUnbind() const
Definition:
abcfont.cpp:121
Graphics::Aurora::ABCFont::Char::vX
float vX[4]
Definition:
abcfont.h:79
int8
int8_t int8
Definition:
types.h:199
Graphics::Aurora::ABCFont::Char
A font character.
Definition:
abcfont.h:71
Graphics::Aurora::ABCFont::Char::dataX
uint32 dataX
Definition:
abcfont.h:72
uint32
uint32_t uint32
Definition:
types.h:204
Graphics::Aurora::ABCFont::getHeight
float getHeight() const
Return the height of a character.
Definition:
abcfont.cpp:61
Graphics::Aurora::ABCFont::renderBind
virtual void renderBind(const glm::mat4 &transform) const
Bind the font for rendering.
Definition:
abcfont.cpp:88
Graphics::Aurora::ABCFont::draw
void draw(uint32 c) const
Draw this character.
Definition:
abcfont.cpp:71
Graphics::Aurora::ABCFont::~ABCFont
~ABCFont()
Definition:
abcfont.cpp:56
Graphics
Definition:
loadprogress.h:33
Graphics::Aurora::TextureHandle
A handle to a texture.
Definition:
texturehandle.h:51
Common::SeekableReadStream
Interface for a seekable & readable data stream.
Definition:
readstream.h:265
font.h
A font.
Graphics::Aurora::ABCFont
An ABC/SBM font, as used by Jade Empire.
Definition:
abcfont.h:50
Graphics::Aurora::ABCFont::getWidth
float getWidth(uint32 c) const
Return the width of a character.
Definition:
abcfont.cpp:65
Graphics::Aurora::ABCFont::_texture
TextureHandle _texture
Definition:
abcfont.h:82
Graphics::Mesh::MeshFont
Definition:
meshfont.h:34
Generated on Sun Nov 18 2018 15:13:41 for xoreos by
1.8.14