ugly-game 0.15.37 → 0.15.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,12 @@
1
- export { CROWD_MATERIAL_COUNT, CROWD_RECORD_FLOATS, CROWD_REC_LAYER, CROWD_REC_MATERIAL, CROWD_REC_MODEL, CROWD_REC_PALETTE_SLOT, CROWD_REC_POOL_SLOT, CROWD_REC_TINT, writeCrowdRecord, } from './crowdRecord';
1
+ export declare const CROWD_MATERIAL_COUNT = 5;
2
+ export declare const CROWD_RECORD_FLOATS = 24;
3
+ export declare const CROWD_REC_LAYER = 20;
4
+ export declare const CROWD_REC_MATERIAL = 23;
5
+ export declare const CROWD_REC_MODEL = 0;
6
+ export declare const CROWD_REC_PALETTE_SLOT = 21;
7
+ export declare const CROWD_REC_POOL_SLOT = 22;
8
+ export declare const CROWD_REC_TINT = 16;
9
+ export declare function writeCrowdRecord(out: Float32Array, off: number, model: ArrayLike<number>, tint: ArrayLike<number>, layer: number, paletteSlot: number, poolSlot: number, material?: number): void;
2
10
  /**
3
11
  * One rung of the shared body mesh, as cooked into a .ugm.
4
12
  *
@@ -24,8 +24,18 @@
24
24
  // "must match" comment, and a crowd that disagreed would light its characters out of a different
25
25
  // number of cascades than the ground they stand on.
26
26
  import { MAX_CASCADES } from './gpuSkin';
27
- import { CROWD_RECORD_FLOATS, CROWD_REC_MATERIAL, CROWD_REC_TINT, } from './crowdRecord';
28
- export { CROWD_MATERIAL_COUNT, CROWD_RECORD_FLOATS, CROWD_REC_LAYER, CROWD_REC_MATERIAL, CROWD_REC_MODEL, CROWD_REC_PALETTE_SLOT, CROWD_REC_POOL_SLOT, CROWD_REC_TINT, writeCrowdRecord, } from './crowdRecord';
27
+ import { CROWD_MATERIAL_COUNT as CROWD_MATERIAL_COUNT_VALUE, CROWD_RECORD_FLOATS as CROWD_RECORD_FLOATS_VALUE, CROWD_REC_LAYER as CROWD_REC_LAYER_VALUE, CROWD_REC_MATERIAL as CROWD_REC_MATERIAL_VALUE, CROWD_REC_MODEL as CROWD_REC_MODEL_VALUE, CROWD_REC_PALETTE_SLOT as CROWD_REC_PALETTE_SLOT_VALUE, CROWD_REC_POOL_SLOT as CROWD_REC_POOL_SLOT_VALUE, CROWD_REC_TINT as CROWD_REC_TINT_VALUE, writeCrowdRecord as writeCrowdRecordValue, } from './crowdRecord';
28
+ export const CROWD_MATERIAL_COUNT = CROWD_MATERIAL_COUNT_VALUE;
29
+ export const CROWD_RECORD_FLOATS = CROWD_RECORD_FLOATS_VALUE;
30
+ export const CROWD_REC_LAYER = CROWD_REC_LAYER_VALUE;
31
+ export const CROWD_REC_MATERIAL = CROWD_REC_MATERIAL_VALUE;
32
+ export const CROWD_REC_MODEL = CROWD_REC_MODEL_VALUE;
33
+ export const CROWD_REC_PALETTE_SLOT = CROWD_REC_PALETTE_SLOT_VALUE;
34
+ export const CROWD_REC_POOL_SLOT = CROWD_REC_POOL_SLOT_VALUE;
35
+ export const CROWD_REC_TINT = CROWD_REC_TINT_VALUE;
36
+ export function writeCrowdRecord(out, off, model, tint, layer, paletteSlot, poolSlot, material = 0) {
37
+ writeCrowdRecordValue(out, off, model, tint, layer, paletteSlot, poolSlot, material);
38
+ }
29
39
  /**
30
40
  * Floats per instance record: mat4 (16) + tint (4) + layer/paletteSlot/poolSlot/material (4).
31
41
  *
package/dist/character.js CHANGED
@@ -351,7 +351,7 @@ export class GpuCrowdCharactersBackend {
351
351
  palettes.set(batch.frame.palettes.subarray(sourceIndex * paletteStride, (sourceIndex + 1) * paletteStride), recordIndex * paletteStride);
352
352
  actorSlots[recordIndex] = actorSlot;
353
353
  const bucket = buckets[buckets.length - 1];
354
- if (bucket.lod === lod)
354
+ if (buckets.length > 0 && bucket.lod === lod)
355
355
  bucket.count++;
356
356
  else
357
357
  buckets.push({ lod, first: recordIndex, count: 1 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugly-game",
3
- "version": "0.15.37",
3
+ "version": "0.15.39",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {