25 #ifndef AURORA_GFXFILE_H 26 #define AURORA_GFXFILE_H 28 #include <boost/variant.hpp> 29 #include <boost/optional.hpp> 31 #include "glm/glm.hpp" 90 boost::variant<Fill, Gradient, Bitmap>
value;
309 boost::optional<Common::UString>
name;
336 boost::variant<PlaceObject, DoAction>
_value;
456 std::vector<GFXCharacter::ShapeRecord>
readShape(
byte version,
bool withStyle);
474 #endif // AURORA_GFXFILE_H
Class for parsing gfx files.
void readFileAttributes()
Read the file attributes tag.
Common::UString readNullTerminatedString()
Read a null terminated string.
int32 read2ComplementValue(Common::BitStream &bitStream, size_t n)
Read a 2's complement value.
std::vector< GradientRecord > records
std::vector< KerningCode > kerningCodes
static GFXCharacter createSprite(uint16 id, Sprite sprite)
Create a sprite character.
boost::optional< uint16 > fontHeight
void readFocalGradient(byte version)
Read a focal gradient record.
A class holding an UTF-8 string.
boost::optional< uint16 > characterId
GFXFile(const Common::UString &resref, Aurora::ActionScript::AVM &avm)
Open a gfx file specified by the reference and used with the specified avm.
boost::variant< Fill, Gradient, Bitmap > value
GFXCharacter::FillStyle readFillStyle(byte version)
Read an FillStyle record.
std::vector< GFXControl > controls
ControlType
The possible control types.
TextAlignment
The alignment of text.
void load(Common::SeekableReadStream *gfx, Aurora::ActionScript::AVM &avm)
boost::variant< Sprite, Shape, EditText, Font, ExternalImage > _value
boost::optional< uint8 > blendMode
std::vector< ShapeRecord > shapeRecords
boost::optional< uint16 > maxLength
float getFrameRate()
Get the framerate for this gfx file.
static GFXCharacter createExternalImage(uint16 id, ExternalImage externalImage)
Create an external image character.
void readImportAssets(ActionScript::AVM &avm)
Read an import assets tag.
Buffer for handling actionscript byte code.
boost::optional< uint16 > fontAscent
boost::optional< EditTextLayout > layout
An edit text character, mostly used as static, but sometimes also used as editable text...
GFXCharacter getCharacter(uint16 id)
Get a character by id.
GFXControl readPlaceObject(byte version=1)
Read a place object tag.
GFXCharacter::LineStyle readLineStyle(byte version)
Read a line style.
boost::variant< PlaceObject, DoAction > _value
struct Aurora::GFXCharacter::ShapeRecord::@3 straightEdge
std::vector< GFXControl > _controlTags
All root control tags.
std::vector< GFXCharacter::FillStyle > readFillStyleArray(byte version)
Read an fillstyle array.
boost::optional< int16 > fontLeading
A simple scoped smart pointer template.
Common::ScopedPtr< Common::SeekableReadStream > _gfx
The read stream of this gfx file.
struct Aurora::GFXCharacter::ShapeRecord::@2 move
std::vector< ShapeRecord > shapeRecords
void getExternalImage(ExternalImage &externalImage) const
Get the external image character.
A control tag is used for controlling stuff in the scene, like placing or removing objects...
std::vector< Glyph > glyphs
boost::optional< Common::UString > name
void readInitAction(ActionScript::AVM &avm)
Read a DoInitAction tag.
A simple rectangle helper class.
static GFXCharacter createShape(uint16 id, Shape shape)
Create a shape character.
std::vector< GFXCharacter::ShapeRecord > readShape(byte version, bool withStyle)
Read a shape.
void readDefineSprite()
Read a define sprite tag.
std::map< uint16, GFXCharacter > _characters
Every character associated with it's character id.
An external image character, which loads an image resource from the guis texture atlas files...
Aurora::ActionScript::ASBuffer * readAction()
Read a DoAction tag.
void readGFXDefineExternalImage(RecordHeader header, byte version=0)
Load an external image reference.
void getDoAction(DoAction &doAction) const
Get do action control.
void readExportAssets()
Read an export assets tag.
boost::optional< ColorTransform > colorTransform
GFXCharacter::GradientRecord readGradientRecord(byte version)
Read a gradient record.
Common::Rect _frameSize
The standard bounds of the ui in this file.
uint16 getExportedAssetId(const Common::UString &id)
Get the corresponding character id for an exported asset.
void readDefineFont()
Read a font definition version 3.
static GFXControl createShowFrame()
Create a show frame control.
glm::mat3x2 readMatrix()
Read a matrix.
RecordHeader readRecordHeader()
Read a record header for the next tag.
void readHeader()
Load all header information.
glm::u8vec4 readRGBA()
Reag an RGBA color record.
A Scaleform GFx font, usable for rendering letters in the ui.
void readDefineShape(byte version)
Read a DefineShape tag.
Element placeable in the current scene.
CharacterType getType() const
Get the type of this character.
struct Aurora::GFXCharacter::ShapeRecord::@1 style
Basic reading stream interfaces.
void readGFXExporterInfo(RecordHeader header)
Load the information about the gfx exporter.
static GFXCharacter createEditText(uint16 id, EditText editText)
Create an edit text character.
void getPlaceObject(PlaceObject &placeObject) const
Get the place object control.
void readBackgroundColor()
Read the background color tag.
GFXControl::ColorTransform readColorTransform()
Read a color transform.
Aurora::ActionScript::ASBuffer * asBuffer
A shape character, which is a static image shape with bounds.
glm::u8vec3 readRGB()
Read an RGB color record.
Common::UString readLengthPrefixedString()
Read a byte length prefixed string.
void getFont(Font &font) const
Get the font character.
Common::Rect readRectangle()
Read a basic rectangle type from the gfx file.
boost::optional< uint16 > fontDescent
void readDefineEditText()
Read an edit text character.
Optional layout for edit texts.
void getSprite(Sprite &sprite) const
Get the sprite character.
void getEditText(EditText &editText) const
Get the edit text character.
boost::optional< glm::u8vec4 > textColor
CharacterType
The possible element types, used in the scene.
std::map< Common::UString, uint16 > _exportTable
Every exported character id with the associated export name.
A place object control tag for placing objects.
std::vector< GFXControl > getControls()
Get all root controls.
std::vector< GFXCharacter::LineStyle > readLineStyleArray(byte version)
Read a line style array.
ControlType getType() const
Get the type of this control.
uint16 getId() const
Get the character id of this character.
unsigned short _frameCount
The count of frames in this gfx file.
A kerning code, which determines the adjustment of specific characters to another.
boost::optional< uint16 > fontId
Interface for a seekable & readable data stream.
struct Aurora::GFXCharacter::ShapeRecord::@4 curvedEdge
void getShape(Shape &shape) const
Get the shape character.
static GFXControl createDoAction(DoAction)
Create a do action control.
float _frameRate
The frame rate, how fast this gui should be played.
boost::optional< Common::UString > initialText
A sprite character, which is basically a container with control statements and other characters...
boost::optional< glm::mat3x2 > matrix
static GFXCharacter createFont(uint16 id, Font font)
Create a font character.
GFXCharacter(uint16 id, CharacterType type)
GFXControl(ControlType type)
static GFXControl createPlaceObject(PlaceObject)
Create a place object control.
The Action script virtual machine (AVM).
A character glyph for a font.