本文整理汇总了C++中idSWFBitStream::ReadBool方法的典型用法代码示例。如果您正苦于以下问题:C++ idSWFBitStream::ReadBool方法的具体用法?C++ idSWFBitStream::ReadBool怎么用?C++ idSWFBitStream::ReadBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idSWFBitStream
的用法示例。
在下文中一共展示了idSWFBitStream::ReadBool方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DefineEditText
/*
========================
idSWF::DefineEditText
========================
*/
void idSWF::DefineEditText( idSWFBitStream & bitstream ) {
uint16 characterID = bitstream.ReadU16();
idSWFDictionaryEntry * entry = AddDictionaryEntry( characterID, SWF_DICT_EDITTEXT );
if ( entry == NULL ) {
return;
}
idSWFEditText * edittext = entry->edittext;
bitstream.ReadRect( edittext->bounds );
bitstream.ResetBits();
bool hasText = bitstream.ReadBool();
bool wordWrap = bitstream.ReadBool();
bool multiline = bitstream.ReadBool();
bool password = bitstream.ReadBool();
bool readonly = bitstream.ReadBool();
bool hasTextColor = bitstream.ReadBool();
bool hasMaxLength = bitstream.ReadBool();
bool hasFont = bitstream.ReadBool();
bool hasFontClass = bitstream.ReadBool();
bool autoSize = bitstream.ReadBool();
bool hasLayout = bitstream.ReadBool();
bool noSelect = bitstream.ReadBool();
bool border = bitstream.ReadBool();
bool wasStatic = bitstream.ReadBool();
bool html = bitstream.ReadBool();
bool useOutlines = bitstream.ReadBool();
if ( hasFont ) {
edittext->fontID = bitstream.ReadU16();
edittext->fontHeight = bitstream.ReadU16();
}
if ( hasFontClass ) {
idStr fontClass = bitstream.ReadString();
}
if ( hasTextColor ) {
bitstream.ReadColorRGBA( edittext->color );
}
if ( hasMaxLength ) {
edittext->maxLength = bitstream.ReadU16();
}
if ( hasLayout ) {
edittext->align = (swfEditTextAlign_t)bitstream.ReadU8();
edittext->leftMargin = bitstream.ReadU16();
edittext->rightMargin = bitstream.ReadU16();
edittext->indent = bitstream.ReadU16();
edittext->leading = bitstream.ReadS16();
}
edittext->variable = bitstream.ReadString();
if ( hasText ) {
const char * text = bitstream.ReadString();
idStr initialText;
// convert html tags if necessary
for ( int i = 0; text[i] != 0; i++ ) {
if ( text[i] == '<' ) {
if ( i != 0 && text[i+1] == 'p' ) {
initialText.Append( '\n' );
}
for ( ; text[i] != 0 && text[i] != '>'; i++ ) {
}
continue;
}
byte tc = (byte)text[i];
if ( tc == '&' ) {
idStr special;
for ( i++; text[i] != 0 && text[i] != ';'; i++ ) {
special.Append( text[i] );
}
if ( special.Icmp( "amp" ) == 0 ) {
tc = '&';
} else if ( special.Icmp( "apos" ) == 0 ) {
tc = '\'';
} else if ( special.Icmp( "lt" ) == 0 ) {
tc = '<';
} else if ( special.Icmp( "gt" ) == 0 ) {
tc = '>';
} else if ( special.Icmp( "quot" ) == 0 ) {
tc = '\"';
}
}
initialText.Append( tc );
}
edittext->initialText = initialText;
}
edittext->flags |= wordWrap ? SWF_ET_WORDWRAP : 0;
edittext->flags |= multiline ? SWF_ET_MULTILINE : 0;
edittext->flags |= password ? SWF_ET_PASSWORD : 0;
edittext->flags |= readonly ? SWF_ET_READONLY : 0;
edittext->flags |= autoSize ? SWF_ET_AUTOSIZE : 0;
edittext->flags |= border ? SWF_ET_BORDER : 0;
}
示例2: ParseShapes
/*
========================
idSWFShapeParser::ParseShapes
========================
*/
void idSWFShapeParser::ParseShapes( idSWFBitStream& bitstream1, idSWFBitStream* bitstream2, bool swap )
{
int32 pen1X = 0;
int32 pen1Y = 0;
int32 pen2X = 0;
int32 pen2Y = 0;
uint8 fillStyle0 = 0;
uint8 fillStyle1 = 0;
uint8 lineStyle = 0;
uint16 baseFillStyle = 0;
uint16 baseLineStyle = 0;
uint8 numBits = bitstream1.ReadU8();
uint8 numFillBits1 = numBits >> 4;
uint8 numLineBits1 = numBits & 0xF;
uint8 numFillBits2 = 0;
uint8 numLineBits2 = 0;
if( bitstream2 )
{
numBits = bitstream2->ReadU8();
numFillBits2 = numBits >> 4;
numLineBits2 = numBits & 0xF;
}
while( true )
{
if( !bitstream1.ReadBool() )
{
bool stateNewStyles = bitstream1.ReadBool();
bool stateLineStyle = bitstream1.ReadBool();
bool stateFillStyle1 = bitstream1.ReadBool();
bool stateFillStyle0 = bitstream1.ReadBool();
bool stateMoveTo = bitstream1.ReadBool();
if( ( stateNewStyles || stateLineStyle || stateFillStyle1 || stateFillStyle0 || stateMoveTo ) == false )
{
// end record
if( bitstream2 )
{
uint8 flags = bitstream2->ReadU( 6 );
if( flags != 0 )
{
idLib::Warning( "idSWFShapeParser: morph stream 1 ends before 2" );
break;
}
}
break;
}
if( stateMoveTo )
{
uint8 moveBits = bitstream1.ReadU( 5 );
pen1X = bitstream1.ReadS( moveBits );
pen1Y = bitstream1.ReadS( moveBits );
}
if( stateFillStyle0 )
{
fillStyle0 = bitstream1.ReadU( numFillBits1 );
}
if( stateFillStyle1 )
{
fillStyle1 = bitstream1.ReadU( numFillBits1 );
}
if( stateLineStyle )
{
lineStyle = bitstream1.ReadU( numLineBits1 );
}
if( stateNewStyles )
{
baseFillStyle = fillDraws.Num();
baseLineStyle = lineDraws.Num();
ReadFillStyle( bitstream1 );
numBits = bitstream1.ReadU8();
numFillBits1 = numBits >> 4;
numLineBits1 = numBits & 0xF;
}
if( bitstream2 )
{
bool isEdge = bitstream2->ReadBool();
if( isEdge )
{
idLib::Warning( "idSWFShapeParser: morph stream 1 defines style change, but stream 2 does not" );
break;
}
bool stateNewStyles = bitstream2->ReadBool();
bool stateLineStyle = bitstream2->ReadBool();
bool stateFillStyle1 = bitstream2->ReadBool();
bool stateFillStyle0 = bitstream2->ReadBool();
bool stateMoveTo = bitstream2->ReadBool();
if( stateMoveTo )
{
uint8 moveBits = bitstream2->ReadU( 5 );
pen2X = bitstream2->ReadS( moveBits );
//.........这里部分代码省略.........