Make uniformly ES5
parent
a468a7b189
commit
52fba675e8
|
@ -38,7 +38,7 @@ window.spa = function(input) {
|
||||||
offset += 24;
|
offset += 24;
|
||||||
if (version == "12_1") {
|
if (version == "12_1") {
|
||||||
t.particles = [];
|
t.particles = [];
|
||||||
for (let i=0; i<particleCount; i++) {
|
for (var i=0; i<particleCount; i++) {
|
||||||
t.particles[i] = readParticle(view, offset);
|
t.particles[i] = readParticle(view, offset);
|
||||||
t.particles[i].parent = t;
|
t.particles[i].parent = t;
|
||||||
offset = t.particles[i].nextOff;
|
offset = t.particles[i].nextOff;
|
||||||
|
@ -47,14 +47,14 @@ window.spa = function(input) {
|
||||||
|
|
||||||
offset = firstTexOffset;
|
offset = firstTexOffset;
|
||||||
t.particleTextures = [];
|
t.particleTextures = [];
|
||||||
for (let i=0; i<particleTexCount; i++) {
|
for (var i=0; i<particleTexCount; i++) {
|
||||||
t.particleTextures[i] = readParticleTexture(view, offset);
|
t.particleTextures[i] = readParticleTexture(view, offset);
|
||||||
offset = t.particleTextures[i].nextOff;
|
offset = t.particleTextures[i].nextOff;
|
||||||
}
|
}
|
||||||
|
|
||||||
//window.debugParticle = true;
|
//window.debugParticle = true;
|
||||||
if (window.debugParticle) {
|
if (window.debugParticle) {
|
||||||
for (let i=0; i<particleCount; i++) {
|
for (var i=0; i<particleCount; i++) {
|
||||||
var text = document.createElement("textarea");
|
var text = document.createElement("textarea");
|
||||||
var p = t.particles[i];
|
var p = t.particles[i];
|
||||||
p.parent = null;
|
p.parent = null;
|
||||||
|
@ -272,7 +272,7 @@ window.spa = function(input) {
|
||||||
if ((obj.flag & ParticleFlags.TextureAnimation) != 0)
|
if ((obj.flag & ParticleFlags.TextureAnimation) != 0)
|
||||||
{
|
{
|
||||||
var textures = [];
|
var textures = [];
|
||||||
for (let i=0; i<8; i++) textures[i] = view.getUint8(off+i);
|
for (var i=0; i<8; i++) textures[i] = view.getUint8(off+i);
|
||||||
obj.texAnim = {
|
obj.texAnim = {
|
||||||
textures: textures,
|
textures: textures,
|
||||||
frames: view.getUint8(off+8),
|
frames: view.getUint8(off+8),
|
||||||
|
@ -284,7 +284,7 @@ window.spa = function(input) {
|
||||||
if ((obj.flag & ParticleFlags.Bit16) != 0)
|
if ((obj.flag & ParticleFlags.Bit16) != 0)
|
||||||
{
|
{
|
||||||
obj.Bit16 = [];
|
obj.Bit16 = [];
|
||||||
for (let i=0; i<20; i++) obj.Bit16[i] = view.getUint8(off+i);
|
for (var i=0; i<20; i++) obj.Bit16[i] = view.getUint8(off+i);
|
||||||
off += 20;
|
off += 20;
|
||||||
}
|
}
|
||||||
if ((obj.flag & ParticleFlags.Gravity) != 0)
|
if ((obj.flag & ParticleFlags.Gravity) != 0)
|
||||||
|
@ -308,31 +308,31 @@ window.spa = function(input) {
|
||||||
{
|
{
|
||||||
//seems to be 4 int 16s typically in some kind of pattern.
|
//seems to be 4 int 16s typically in some kind of pattern.
|
||||||
obj.Bit25 = [];
|
obj.Bit25 = [];
|
||||||
for (let i=0; i<8; i++) obj.Bit25[i] = view.getUint8(off+i);
|
for (var i=0; i<8; i++) obj.Bit25[i] = view.getUint8(off+i);
|
||||||
off += 8;
|
off += 8;
|
||||||
}
|
}
|
||||||
if ((obj.flag & ParticleFlags.Bit26) != 0)
|
if ((obj.flag & ParticleFlags.Bit26) != 0)
|
||||||
{
|
{
|
||||||
obj.Bit26 = [];
|
obj.Bit26 = [];
|
||||||
for (let i=0; i<16; i++) obj.Bit26[i] = view.getUint8(off+i);
|
for (var i=0; i<16; i++) obj.Bit26[i] = view.getUint8(off+i);
|
||||||
off += 16;
|
off += 16;
|
||||||
}
|
}
|
||||||
if ((obj.flag & ParticleFlags.Bit27) != 0)
|
if ((obj.flag & ParticleFlags.Bit27) != 0)
|
||||||
{
|
{
|
||||||
obj.Bit27 = [];
|
obj.Bit27 = [];
|
||||||
for (let i=0; i<4; i++) obj.Bit27[i] = view.getUint8(off+i);
|
for (var i=0; i<4; i++) obj.Bit27[i] = view.getUint8(off+i);
|
||||||
off += 4;
|
off += 4;
|
||||||
}
|
}
|
||||||
if ((obj.flag & ParticleFlags.Bit28) != 0)
|
if ((obj.flag & ParticleFlags.Bit28) != 0)
|
||||||
{
|
{
|
||||||
obj.Bit28 = [];
|
obj.Bit28 = [];
|
||||||
for (let i=0; i<8; i++) obj.Bit28[i] = view.getUint8(off+i);
|
for (var i=0; i<8; i++) obj.Bit28[i] = view.getUint8(off+i);
|
||||||
off += 8;
|
off += 8;
|
||||||
}
|
}
|
||||||
if ((obj.flag & ParticleFlags.Bit29) != 0)
|
if ((obj.flag & ParticleFlags.Bit29) != 0)
|
||||||
{
|
{
|
||||||
obj.Bit29 = [];
|
obj.Bit29 = [];
|
||||||
for (let i=0; i<16; i++) obj.Bit29[i] = view.getUint8(off+i);
|
for (var i=0; i<16; i++) obj.Bit29[i] = view.getUint8(off+i);
|
||||||
off += 16;
|
off += 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,8 +88,8 @@ window.NitroParticle = function(scene, emitter, pos, vel, dir, dirVel, duration,
|
||||||
function draw(view, pMatrix, gl) {
|
function draw(view, pMatrix, gl) {
|
||||||
var particlePct = t.time / t.duration;
|
var particlePct = t.time / t.duration;
|
||||||
|
|
||||||
let pos = t.pos;
|
var pos = t.pos;
|
||||||
let vel = t.vel;
|
var vel = t.vel;
|
||||||
|
|
||||||
if (t.attached != null) {
|
if (t.attached != null) {
|
||||||
pos = vec3.transformMat4([], pos, t.attached.mat);
|
pos = vec3.transformMat4([], pos, t.attached.mat);
|
||||||
|
|
Loading…
Reference in New Issue