Skip to content

Commit

Permalink
refactoring flump code
Browse files Browse the repository at this point in the history
  • Loading branch information
mientjan committed May 2, 2016
1 parent be039cf commit e5084d0
Show file tree
Hide file tree
Showing 30 changed files with 146 additions and 221 deletions.
18 changes: 9 additions & 9 deletions src/PixiFlump.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/PixiFlump.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions src/PixiFlump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import {Promise} from "./util/Promise";
import {ILoadable} from "./interface/ILoadable";
import {HttpRequest} from "./util/HttpRequest";
import {ILibrary} from "./core/ILibrary";
import {FlumpMovieData} from "./core/MovieData";
import {FlumpTextureGroup} from "./core/TextureGroup";
import {IFlumpMovie} from "./core/IFlumpMovie";
import {FlumpMovie} from "./core/FlumpMovie";

import {TextureGroup} from "./core/TextureGroup";
import {ILibrary} from "./interface/ILibrary";
import {MovieData} from "./data/MovieData";
import {QueueItem} from "./util/QueueItem";


export class PixiFlump implements ILoadable<PixiFlump>
Expand Down Expand Up @@ -44,8 +44,8 @@ export class PixiFlump implements ILoadable<PixiFlump>
});
}

public movieData:Array<FlumpMovieData> = [];
public textureGroups:Array<FlumpTextureGroup> = [];
public movieData:Array<MovieData> = [];
public textureGroups:Array<TextureGroup> = [];

public url:string;
public md5:string;
Expand Down Expand Up @@ -105,23 +105,23 @@ export class PixiFlump implements ILoadable<PixiFlump>
this.referenceList = json.referenceList || null;
this.isOptimised = json.optimised || false;

var textureGroupLoaders:Array<Promise<FlumpTextureGroup>> = [];
var textureGroupLoaders:Array<Promise<TextureGroup>> = [];
for(var i = 0; i < json.movies.length; i++)
{
var flumpMovieData = new FlumpMovieData(this, json.movies[i]);
var flumpMovieData = new MovieData(this, json.movies[i]);
this.movieData.push(flumpMovieData);
}

var textureGroups = json.textureGroups;
for(var i = 0; i < textureGroups.length; i++)
{
var textureGroup = textureGroups[i];
var promise = FlumpTextureGroup.load(this, textureGroup);
var promise = TextureGroup.load(this, textureGroup);
textureGroupLoaders.push(promise);
}

return HttpRequest.wait(textureGroupLoaders, onProcess)
.then((textureGroups:Array<FlumpTextureGroup>) => {
.then((textureGroups:Array<TextureGroup>) => {

for(var i = 0; i < textureGroups.length; i++)
{
Expand All @@ -135,7 +135,7 @@ export class PixiFlump implements ILoadable<PixiFlump>
});
}

public getFlumpMovieData(name:string):FlumpMovieData
public getMovieData(name:string):MovieData
{
for(var i = 0; i < this.movieData.length; i++)
{
Expand All @@ -153,7 +153,7 @@ export class PixiFlump implements ILoadable<PixiFlump>
{
for(var i = 0; i < this.textureGroups.length; i++)
{
var flumpTextures = this.textureGroups[i].flumpTextures;
var flumpTextures = this.textureGroups[i].textures;

if(name in flumpTextures)
{
Expand Down
18 changes: 8 additions & 10 deletions src/core/Texture.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e5084d0

Please sign in to comment.