Skip to content

Commit

Permalink
SOUND: Load XACT binary SoundBank event timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Dec 31, 2018
1 parent 9bac062 commit 2137ff2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/sound/xactsoundbank.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ class XACTSoundBank {
/** An event within a sound track. */
struct Event {
EventType type;
uint32 timestamp; ///< Timestamp of the event, in milliseconds.

union {
struct {
Expand All @@ -189,7 +190,7 @@ class XACTSoundBank {

} params;

Event(EventType t) : type(t) { }
Event(EventType t) : type(t), timestamp(0) { }
};

/** A wave within a sound track. */
Expand Down
4 changes: 3 additions & 1 deletion src/sound/xactsoundbank_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ void XACTSoundBank_Binary::readComplexTrack(Common::SeekableReadStream &xsb, Tra
track.events.push_back(Event((EventType) xsb.readByte()));
Event &event = track.events.back();

xsb.skip(3); // Unknown
event.timestamp = xsb.readByte();
event.timestamp += xsb.readByte() << 8;
event.timestamp += xsb.readByte() << 16;

uint8 parameterSize = xsb.readByte();

Expand Down

0 comments on commit 2137ff2

Please sign in to comment.