Sha256: 8ecd99cc563f392723b9d4fa288a96b61331df54a3ed91e2742d09e4bc670ce1

Contents?: true

Size: 816 Bytes

Versions: 6

Compression:

Stored size: 816 Bytes

Contents

#include <SWFAction.h>
#include "SWF.h"
#include <cstring>

namespace SWF {

Action *Action::get( Reader *r, int end, Context *ctx ) {
	uint16_t h = r->getByte();
	int type = h;
	int len = 0;
	if( type >= 0x80 ) {
		len = r->getWord();
	}
	
	if( type == 0 ) return( new EndAction ); // terminator
	
	Action *ret = getByType( type );
	
//	printf("ACTION %02X len %i: %p\n", type, len, ret );

	if( !ret ) {
		ret = new UnknownAction;
	}

	ret->setType( type );
	ret->setLength( len );
	ret->parse( r, r->getPosition()+len, ctx );
	
	return ret;
}	

void Action::writeHeader( Writer *w, Context *ctx, size_t len ) {
//	printf("write action %02X, len %i, recorded %i(+header, 1 or 3), position %i\n", type, len, this->len, w->getPosition() );

	w->putByte( type );
	if( type >= 0x80 ) {
		w->putWord( len-=3 );
	}
}

}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
swfmill-0.0.6 ext/swfmill/src/SWFAction.cpp
swfmill-0.0.5 ext/swfmill/src/SWFAction.cpp
swfmill-0.0.4 ext/swfmill/src/SWFAction.cpp
swfmill-0.0.3 ext/swfmill/src/SWFAction.cpp
swfmill-0.0.2 ext/swfmill/src/SWFAction.cpp
swfmill-0.0.1 ext/swfmill/src/SWFAction.cpp