本文整理汇总了C++中FileStream::read_uint32方法的典型用法代码示例。如果您正苦于以下问题:C++ FileStream::read_uint32方法的具体用法?C++ FileStream::read_uint32怎么用?C++ FileStream::read_uint32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileStream
的用法示例。
在下文中一共展示了FileStream::read_uint32方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tex
FTGlyph::FTGlyph(FileStream & stream, char * data,
int x_offset, int y_offset,
int tex_width, int tex_height)
: tex(0)
{
charcode = stream.read_uint32();
float x1, y1, x2, y2;
x1 = stream.read_float();
y1 = stream.read_float();
x2 = stream.read_float();
y2 = stream.read_float();
bBox = FTBBox(x1, y1, x2, y2);
float advance_x, advance_y;
advance_x = stream.read_float();
advance_y = stream.read_float();
advance = FTPoint(advance_x, advance_y);
float corner_x, corner_y;
corner_x = stream.read_float();
corner_y = stream.read_float();
corner = FTPoint(corner_x, corner_y);
width = stream.read_int32();
height = stream.read_int32();
char * glyph = new char[width*height];
stream.read(glyph, width * height);
if (width && height) {
if (y_offset + height > tex_height) {
// copy subimage
height = tex_height - y_offset;
}
if (height >= 0) {
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
char c = glyph[y * width + x];
data[(y + y_offset) * tex_width + x + x_offset] = c;
}
}
}
}
#ifdef USE_OUTLINE
uv[0].X(float(x_offset - 1) / float(tex_width));
uv[0].Y(float(y_offset - 1) / float(tex_height));
uv[1].X(float(x_offset + width + 1) / float(tex_width));
uv[1].Y(float(y_offset + height + 1) / float(tex_height));
#else
uv[0].X(float(x_offset) / float(tex_width));
uv[0].Y(float(y_offset) / float(tex_height));
uv[1].X(float(x_offset + width) / float(tex_width));
uv[1].Y(float(y_offset + height) / float(tex_height));
#endif
delete[] glyph;
}
示例2:
Workspace::Workspace(FileStream & stream)
{
stream.read_c_string(name);
stream.read(data, stream.read_uint32());
}