// Token: 0x06000035 RID: 53 RVA: 0x00002E90 File Offset: 0x00001090 private static int _amTrailUpdateNormal(AppMain.AMS_TRAIL_EFFECT pEffect) { AppMain.AMS_TRAIL_PARAM work = pEffect.Work; AppMain.AMS_TRAIL_PARTSDATA ams_TRAIL_PARTSDATA = AppMain.pTr.trailData[(int)work.trailId]; AppMain.AMS_TRAIL_PARTS ams_TRAIL_PARTS = ams_TRAIL_PARTSDATA.parts[(int)work.trailPartsId]; AppMain.AMS_TRAIL_PARTS trailTail = ams_TRAIL_PARTSDATA.trailTail; AppMain.AMS_TRAIL_PARTS trailHead = ams_TRAIL_PARTSDATA.trailHead; if ((work.state & -32768) != 0) { return(1); } AppMain.AMS_TRAIL_PARTS pPrev = trailTail.pPrev; if (ams_TRAIL_PARTS.pNext != null && ams_TRAIL_PARTS == trailHead.pNext) { trailHead.pNext.pNext.pPrev = trailHead; trailHead.pNext = trailHead.pNext.pNext; } ams_TRAIL_PARTS.Clear(); ams_TRAIL_PARTS.pNext = trailTail; ams_TRAIL_PARTS.pPrev = trailTail.pPrev; trailTail.pPrev = ams_TRAIL_PARTS; ams_TRAIL_PARTS.pPrev.pNext = ams_TRAIL_PARTS; if ((pEffect.flag & 1) != 0) { ams_TRAIL_PARTS.pos.x = AppMain.AMD_FX32_TO_FLOAT(work.trail_pos.x); ams_TRAIL_PARTS.pos.y = -AppMain.AMD_FX32_TO_FLOAT(work.trail_pos.y); ams_TRAIL_PARTS.pos.z = AppMain.AMD_FX32_TO_FLOAT(work.zBias); } else { ams_TRAIL_PARTS.pos.x = MppBitConverter.Int32ToSingle(work.trail_pos.x); ams_TRAIL_PARTS.pos.y = MppBitConverter.Int32ToSingle(work.trail_pos.y); ams_TRAIL_PARTS.pos.z = MppBitConverter.Int32ToSingle(work.trail_pos.z); } AppMain.nnSubtractVector(ams_TRAIL_PARTS.dir, ams_TRAIL_PARTS.pos, ams_TRAIL_PARTS.pPrev.pos); if (AppMain.amIsZerof(ams_TRAIL_PARTS.dir.x) && AppMain.amIsZerof(ams_TRAIL_PARTS.dir.y) && AppMain.amIsZerof(ams_TRAIL_PARTS.dir.z)) { ams_TRAIL_PARTS.dir.x = 1f; } AppMain._amTrailAddParts(ams_TRAIL_PARTS, work); ams_TRAIL_PARTS.m_Flag |= 1U; work.time -= AppMain.amEffectGetUnitFrame(); if (work.time < 0f) { work.time = 0f; AppMain.AMS_TRAIL_PARAM ams_TRAIL_PARAM = work; ams_TRAIL_PARAM.state |= short.MinValue; } return(0); }
private static int _amTrailUpdateNormal(AppMain.AMS_TRAIL_EFFECT pEffect) { AppMain.AMS_TRAIL_PARAM work = pEffect.Work; AppMain.AMS_TRAIL_PARTSDATA amsTrailPartsdata = AppMain.pTr.trailData[(int)work.trailId]; AppMain.AMS_TRAIL_PARTS part = amsTrailPartsdata.parts[(int)work.trailPartsId]; AppMain.AMS_TRAIL_PARTS trailTail = amsTrailPartsdata.trailTail; AppMain.AMS_TRAIL_PARTS trailHead = amsTrailPartsdata.trailHead; if (((int)work.state & (int)short.MinValue) != 0) { return(1); } AppMain.AMS_TRAIL_PARTS pPrev = trailTail.pPrev; if (part.pNext != null && part == trailHead.pNext) { trailHead.pNext.pNext.pPrev = trailHead; trailHead.pNext = trailHead.pNext.pNext; } part.Clear(); part.pNext = trailTail; part.pPrev = trailTail.pPrev; trailTail.pPrev = part; part.pPrev.pNext = part; if (((int)pEffect.flag & 1) != 0) { part.pos.x = AppMain.AMD_FX32_TO_FLOAT(work.trail_pos.x); part.pos.y = -AppMain.AMD_FX32_TO_FLOAT(work.trail_pos.y); part.pos.z = AppMain.AMD_FX32_TO_FLOAT(work.zBias); } else { part.pos.x = MppBitConverter.Int32ToSingle(work.trail_pos.x); part.pos.y = MppBitConverter.Int32ToSingle(work.trail_pos.y); part.pos.z = MppBitConverter.Int32ToSingle(work.trail_pos.z); } AppMain.nnSubtractVector(part.dir, part.pos, part.pPrev.pos); if (AppMain.amIsZerof(part.dir.x) && AppMain.amIsZerof(part.dir.y) && AppMain.amIsZerof(part.dir.z)) { part.dir.x = 1f; } AppMain._amTrailAddParts(part, work); part.m_Flag |= 1U; work.time -= AppMain.amEffectGetUnitFrame(); if ((double)work.time < 0.0) { work.time = 0.0f; work.state |= short.MinValue; } return(0); }