Skip to content

Commit

Permalink
feat(model): load loop information when loading models
Browse files Browse the repository at this point in the history
  • Loading branch information
fallenoak committed Jan 5, 2024
1 parent 10c430c commit 47f95ee
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/lib/model/M2Model.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { IoMode, IoSource, openStream } from '@wowserhq/io';
import * as io from '@wowserhq/io';
import * as m2Io from './io/m2.js';
import { M2_MODEL_FLAG } from './const.js';
import M2Texture, { M2_TEXTURE_COMBINER, M2_TEXTURE_COORD } from './M2Texture.js';
import M2Material from './M2Material.js';
import M2TextureWeight from './M2TextureWeight.js';
import M2TextureTransform from './M2TextureTransform.js';
import { m2typedArray } from './io/common.js';
import * as io from '@wowserhq/io';
import M2Sequence from './M2Sequence.js';

class M2Model {
Expand All @@ -27,11 +27,16 @@ class M2Model {
#skinProfileCount: number;

#sequences: M2Sequence[] = [];
#loops: Uint32Array;

get flags() {
return this.#flags;
}

get loops() {
return this.#loops;
}

get materials() {
return this.#materials;
}
Expand All @@ -44,6 +49,10 @@ class M2Model {
return this.#sequences;
}

get skinProfileCount() {
return this.#skinProfileCount;
}

get textures() {
return this.#textures;
}
Expand Down Expand Up @@ -76,10 +85,6 @@ class M2Model {
return this.#textureWeightCombos;
}

get skinProfileCount() {
return this.#skinProfileCount;
}

get vertices() {
return this.#vertices;
}
Expand All @@ -101,6 +106,7 @@ class M2Model {
this.#flags = data.flags;
this.#skinProfileCount = data.skinProfileCount;
this.#vertices = data.vertices.buffer;
this.#loops = data.loops;

this.#textureCombos = data.textureCombos;
this.#textureCoordCombos = data.textureCoordCombos;
Expand Down

0 comments on commit 47f95ee

Please sign in to comment.