本文整理汇总了C++中idSWFBitStream::ReadColorRGB方法的典型用法代码示例。如果您正苦于以下问题:C++ idSWFBitStream::ReadColorRGB方法的具体用法?C++ idSWFBitStream::ReadColorRGB怎么用?C++ idSWFBitStream::ReadColorRGB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idSWFBitStream
的用法示例。
在下文中一共展示了idSWFBitStream::ReadColorRGB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DefineTextX
/*
========================
idSWF::DefineTextX
========================
*/
void idSWF::DefineTextX( idSWFBitStream & bitstream, bool rgba ) {
uint16 characterID = bitstream.ReadU16();
idSWFDictionaryEntry * entry = AddDictionaryEntry( characterID, SWF_DICT_TEXT );
if ( entry == NULL ) {
return;
}
idSWFText * text = entry->text;
bitstream.ReadRect( text->bounds );
bitstream.ReadMatrix( text->matrix );
uint8 glyphBits = bitstream.ReadU8();
uint8 advanceBits = bitstream.ReadU8();
while ( true ) {
uint8 flags = bitstream.ReadU8();
if ( flags == 0 ) {
break;
}
idSWFTextRecord & textRecord = text->textRecords.Alloc();
if ( flags & BIT( 3 ) ) {
textRecord.fontID = bitstream.ReadU16();
}
if ( flags & BIT( 2 ) ) {
if ( rgba ) {
bitstream.ReadColorRGBA( textRecord.color );
} else {
bitstream.ReadColorRGB( textRecord.color );
}
}
if ( flags & BIT( 0 ) ) {
textRecord.xOffset = bitstream.ReadS16();
}
if ( flags & BIT( 1 ) ) {
textRecord.yOffset = bitstream.ReadS16();
}
if ( flags & BIT( 3 ) ) {
textRecord.textHeight = bitstream.ReadU16();
}
textRecord.firstGlyph = text->glyphs.Num();
textRecord.numGlyphs = bitstream.ReadU8();
for ( int i = 0; i < textRecord.numGlyphs; i++ ) {
swfGlyphEntry_t & glyph = text->glyphs.Alloc();
glyph.index = bitstream.ReadU( glyphBits );
glyph.advance = bitstream.ReadS( advanceBits );
}
};
}