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: Partial FEV File loader #362

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
2 participants
@Nostritius
Copy link
Contributor

commented Sep 6, 2018

This is my first try in actuallly reverse engineering a file format. This loader loads the first three parts of an fmod event file (FEV). In the first one, the associated wave banks are loaded, in the second one, the possilbe categories are loadded, in the third one, the eventgroups, including the events are loaded. There are much more parts in the fev file, but this loader can now laod simple versions of fev files.

@DrMcCoy
Copy link
Member

left a comment

Neat! :)

A few style issues, though. :P

As for the future interface, I'd like some kind of play() method, that you give an event number or otherwise ID, and it plays the sounds of the event.

Plain would be enough for the first iteration, without effects (and possibly only the first actual sound). For the effects, that needs changes to the SoundManager too.

It should probably give out some kind of handle, like the SoundManager does, with which you can stop the event playing again, or otherwise modify it.

If the sound does something in a timed fashion, i.e. play x seconds of sound y, then set effects a, b, c, then play sound z after a minute, or stuff like that, that might need a new kind of manager "in front" of the soundmanager, doing these changes in a new thread. Maybe. :P


#include "src/aurora/fevfile.h"
#include "src/aurora/resman.h"
#include "fevfile.h"

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy Sep 6, 2018

Member
  1. Full paths, please
  2. You're already including that file 2 lines above!

FEVFile::FEVFile(const Common::UString &resRef) {
Common::ScopedPtr<Common::SeekableReadStream> fev(ResMan.getResource(resRef, Aurora::kFileTypeFEV));
load(*fev);

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy Sep 6, 2018

Member

ResourceManager::getResource() can return 0, if the resource doesn't exist.

load(fev);
}

Common::UString FEVFile::getBankName() {

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy Sep 6, 2018

Member

You should return a const Common::UString & here

return _bankName;
}

std::vector<FEVWaveBank> FEVFile::getWaveBanks() {

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy Sep 6, 2018

Member

const std::vector<FEVWaveBank> &

return _waveBanks;
}

std::vector<FEVCategory> FEVFile::getCategories() {

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy Sep 6, 2018

Member

const std::vector<FEVCategory> &

fev.skip(4); // Unknown value.

uint32 numSubEventCategories = fev.readUint32LE();
uint32 numEvents = fev.readUint32LE();

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy Sep 6, 2018

Member

These are all const :P

}

Common::UString FEVFile::readLengthPrefixedString(Common::SeekableReadStream &fev) {
uint32 length = fev.readUint32LE();

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy Sep 6, 2018

Member

const :P

* range from 0.0f to 1.0f, which is mapped to different
* dezibel values.
*/
struct FEVEvent {

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy Sep 6, 2018

Member

Please, put these structs and enums into class FEVFile, as FEVFile::Category, etc


namespace Aurora {

/** Possible types of streaming for fmod. */

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy Sep 6, 2018

Member

Please capitalize FMOD everywhere in the comments

void readEventCategory(Common::SeekableReadStream &fev);
void readEvent(Common::SeekableReadStream &fev);

// Utility Length prefixed string method.

This comment has been minimized.

Copy link
@DrMcCoy

DrMcCoy Sep 6, 2018

Member

Can you replace that comment with a Doxygen comment that says "Read length-prefixed string" or something like that?

@Nostritius Nostritius force-pushed the Nostritius:aurora_fevfile branch from da9788e to b24204e Sep 6, 2018

@Nostritius

This comment has been minimized.

Copy link
Contributor Author

commented Sep 6, 2018

The style issues should now be fixed

@Nostritius

This comment has been minimized.

Copy link
Contributor Author

commented Sep 6, 2018

About the future versions doesn't require wwise and xact something similar? Maybe we can combine this in a more general system.

@Nostritius Nostritius force-pushed the Nostritius:aurora_fevfile branch from b24204e to 729f9fc Sep 6, 2018

@DrMcCoy

This comment has been minimized.

Copy link
Member

commented Sep 8, 2018

Yeah, that would be neat

@DrMcCoy

This comment has been minimized.

Copy link
Member

commented Sep 9, 2018

Merged as ba9aff5, thanks! :)

@DrMcCoy DrMcCoy closed this Sep 9, 2018

@Nostritius Nostritius deleted the Nostritius:aurora_fevfile branch Sep 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.