Skip to content

Commit

Permalink
MDL ParticleEmitter2 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
4eb0da committed Aug 29, 2024
1 parent 1a38cc2 commit 453c663
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions mdl/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function generateGeosetVertexGroup (arr: Uint8Array|Uint16Array): string {
if (!arr.length) {
return '';
}

let middle = '';

for (let i = 0; i < arr.length; ++i) {
Expand Down Expand Up @@ -745,6 +745,7 @@ function generateParticleEmitter2Chunk (particleEmitter2: ParticleEmitter2) {
generateIntPropIfNotEmpty('LifeSpan', particleEmitter2.LifeSpan, 0) +
generateIntPropIfNotEmpty('TailLength', particleEmitter2.TailLength, 0) +
generateIntPropIfNotEmpty('PriorityPlane', particleEmitter2.PriorityPlane, 0) +
generateIntPropIfNotEmpty('ReplaceableId', particleEmitter2.ReplaceableId, null) +
(particleEmitter2.Flags & ParticleEmitter2Flags.SortPrimsFarZ ? generateBooleanProp('SortPrimsFarZ') : '') +
(particleEmitter2.Flags & ParticleEmitter2Flags.LineEmitter ? generateBooleanProp('LineEmitter') : '') +
(particleEmitter2.Flags & ParticleEmitter2Flags.ModelSpace ? generateBooleanProp('ModelSpace') : '') +
Expand Down Expand Up @@ -868,7 +869,7 @@ function generateBindPose (model: Model): string {
}

function generateBindPoseChunk (bindPose: BindPose): string {
const middle = generateBlockStart('Matrices', bindPose.Matrices.length, 1) +
const middle = generateBlockStart('Matrices', bindPose.Matrices.length, 1) +
bindPose.Matrices.map(item => {
return generateTab(2) + generateArray(item);
}).join('\n') + '\n' +
Expand Down
2 changes: 1 addition & 1 deletion mdl/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ function parseParticleEmitter2 (state: State, model: Model): void {
break;
}
res[keyword] = parseAnimVector(state, type);
} else if (keyword === 'Variation' || keyword === 'Gravity') {
} else if (keyword === 'Variation' || keyword === 'Gravity' || keyword === 'ReplaceableId' || keyword === 'PriorityPlane') {
res[keyword] = parseNumber(state);
} else if (keyword === 'SortPrimsFarZ' || keyword === 'Unshaded' || keyword === 'LineEmitter' ||
keyword === 'Unfogged' || keyword === 'ModelSpace' || keyword === 'XYQuad') {
Expand Down

0 comments on commit 453c663

Please sign in to comment.