Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AURORA: Add loader for Scaleform GFx files #373

Merged
merged 1 commit into from Nov 4, 2018

Conversation

Nostritius
Copy link
Contributor

@Nostritius Nostritius commented Sep 26, 2018

As the name says, this PR introduces a loader for scaleform gfx files, used by dragonage and dragonage2. I still does not implement all of the necessary tags, but the most relevant ones.

@Nostritius Nostritius force-pushed the aurora_gfxfile branch 2 times, most recently from 7bfb5a4 to efc5fce Compare October 3, 2018 13:45
Copy link
Member

@DrMcCoy DrMcCoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat, thanks :)

A few style issues, though:

#ifndef AURORA_GFXFILE_H
#define AURORA_GFXFILE_H

#include <glm/glm.hpp>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To show that we're using our own glm copy, please include it with #include "", not #include <>

/**
* The possible element types, used in the scene.
*/
enum CharacterType {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that be a part of class GFXCharacter? Likewise, ControlType should be within GFXControl's scope

GFXFile(const Common::UString &resref, Aurora::ActionScript::AVM &avm);

/** Get the framerate for this gfx file. */
float getFrameRate(){ return _frameRate; };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a space between () and {, please

shape = boost::get<Shape>(_value);
}

void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the linebreak here, please

font = boost::get<Font>(_value);
}

void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the linebreak here, please


void GFXFile::readExportAssets() {
uint16 count = _gfx->readUint16LE();
for (int i = 0; i < count; ++i) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signed/unsigned

assert(reserved == 0);

uint16 count = _gfx->readUint16LE();
for (int i = 0; i < count; ++i) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signed/unsigned

size_t startOffsetTable = _gfx->pos();

std::vector<uint32> offsetTable;
for (int i = 0; i < numGlyphs; ++i) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signed/unsigned, here and multiple times below


if (_gfx->pos() - oldPos < header.tagLength) {
uint16 numCodeOffsets = _gfx->readUint16LE();
for (int i = 0; i < numCodeOffsets; ++i) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signed/unsigned

@Nostritius
Copy link
Contributor Author

The issues should now be fixed. I also fixed some things on my own, mostly making some variables const

@DrMcCoy DrMcCoy merged commit f9f48a8 into xoreos:master Nov 4, 2018
@DrMcCoy
Copy link
Member

DrMcCoy commented Nov 4, 2018

Merged, thanks! :)

@Nostritius Nostritius deleted the aurora_gfxfile branch December 8, 2018 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants