#include ".h" #include <cstring> namespace { size_t ::calcSize( Context *ctx, int start_at ) { size_t r = start_at; r += ::getHeaderSize( r-start_at ); // printf(" sz %i bits (%.2f bytes, start %i)\n", r-start_at, ((float)r-start_at)/8, start_at ); return r-start_at; } size_t ::calcSize( Context *ctx, int start_at ) { size_t r = start_at; r += ::getHeaderSize( r-start_at ); = SWFBitsNeeded( ); ctx-> = ; =; // printf(" sz %i bits (%.2f bytes, start %i)\n", r-start_at, ((float)r-start_at)/8, start_at ); return r-start_at; } } ctx-> = ; if( ! & ) { } if( ) { } r += 8; { unsigned int i = ; do { r += 8; } while ((i>>=7) > 0); } if( >= 255 ) { r += 24; } else { r += 8; } r += 16; r += 32; r += 32; r += 64; r += 16; r += +; r += ; r++; { int bytes = 1; if( ) { int len = strlen( ); uint32_t limit = 0x80; for(; len > limit - 1; limit *= 0x80) { bytes++; } } r += (( ? strlen( ) : 0)+bytes)*8; } r += (( ? strlen( ) : 0)+1)*8; r += .getSize(ctx,r); { * item; ListItem<>* i; i = .first(); while( i ) { item = i->data(); if( item ) { r += item->getSize(ctx,r); } i = i->next(); } } r += * 8; if( r%8 != 0 ) r += 8-(r%8); { int bytes = 1; uint32_t limit = 0x80; for(; > limit - 1; limit *= 0x80) { bytes++; } r += bytes * 8; } r += 24; ctx-> = ;