Skip to content

Commit

Permalink
clear out 3ds parser when starting a new parse
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-bateman committed Jan 22, 2014
1 parent 07767e5 commit 5548357
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
25 changes: 16 additions & 9 deletions src/away3d/loaders/parsers/Max3DSParser.as
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,27 @@ package away3d.loaders.parsers
// TODO: Implement
}

/**
* @inheritDoc
*/
protected override function startParsing(frameLimit:Number):void
{
super.startParsing(frameLimit);

_byteData = ParserUtil.toByteArray(_data);
_byteData.position = 0;
_byteData.endian = Endian.LITTLE_ENDIAN;

_textures = {};
_materials = {};
_unfinalized_objects = {};
}

/**
* @inheritDoc
*/
protected override function proceedParsing():Boolean
{
if (!_byteData) {
_byteData = ParserUtil.toByteArray(_data);
_byteData.position = 0;
_byteData.endian = Endian.LITTLE_ENDIAN;

_textures = {};
_materials = {};
_unfinalized_objects = {};
}

// TODO: With this construct, the loop will run no-op for as long
// as there is time once file has finished reading. Consider a nice
Expand Down
2 changes: 1 addition & 1 deletion src/away3d/loaders/parsers/ParserBase.as
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ package away3d.loaders.parsers
* Initializes the parsing of data.
* @param frameLimit The maximum duration of a parsing session.
*/
private function startParsing(frameLimit:Number):void
protected function startParsing(frameLimit:Number):void
{
_frameLimit = frameLimit;
_timer = new Timer(_frameLimit, 0);
Expand Down

0 comments on commit 5548357

Please sign in to comment.