Esempio n. 1
0
 private static void _amTrailInitNormal(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[0];
     AppMain.AMS_TRAIL_PARTS     trailTail = amsTrailPartsdata.trailTail;
     AppMain.AMS_TRAIL_PARTS     trailHead = amsTrailPartsdata.trailHead;
     amsTrailPartsdata.Clear();
     part.pNext      = trailTail;
     trailTail.pPrev = part;
     part.pPrev      = trailHead;
     trailHead.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);
     }
     part.time         = work.life;
     part.partsId      = (short)0;
     work.trailPartsId = (short)1;
     ++work.trailPartsNum;
 }
Esempio n. 2
0
 // Token: 0x0600003B RID: 59 RVA: 0x00003FEC File Offset: 0x000021EC
 private static int _amTrailCalcSplinePos(NNS_VECTOR[] Pos, NNS_VECTOR[] Dir, AppMain.AMS_TRAIL_PARTS pNPP, AppMain.AMS_TRAIL_PARTS pNP, AppMain.AMS_TRAIL_PARTS pNow, AppMain.AMS_TRAIL_PARTS pNext, float len, int MaxComp)
 {
     AppMain.AMTRS_FC_PARAM amtrs_FC_PARAM = new AppMain.AMTRS_FC_PARAM();
     amtrs_FC_PARAM.m_flag = 0U;
     if (pNPP != null)
     {
         amtrs_FC_PARAM.m_x[0] = pNPP.pos.x;
         amtrs_FC_PARAM.m_y[0] = pNPP.pos.y;
         amtrs_FC_PARAM.m_z[0] = pNPP.pos.z;
     }
     else
     {
         amtrs_FC_PARAM.m_flag |= 1U;
     }
     amtrs_FC_PARAM.m_x[1] = pNP.pos.x;
     amtrs_FC_PARAM.m_y[1] = pNP.pos.y;
     amtrs_FC_PARAM.m_z[1] = pNP.pos.z;
     amtrs_FC_PARAM.m_x[2] = pNow.pos.x;
     amtrs_FC_PARAM.m_y[2] = pNow.pos.y;
     amtrs_FC_PARAM.m_z[2] = pNow.pos.z;
     if (pNext != null)
     {
         amtrs_FC_PARAM.m_x[3] = pNext.pos.x;
         amtrs_FC_PARAM.m_y[3] = pNext.pos.y;
         amtrs_FC_PARAM.m_z[3] = pNext.pos.z;
     }
     else
     {
         amtrs_FC_PARAM.m_flag |= 2U;
     }
     amtrs_FC_PARAM.m_flag |= 512U;
     if (pNPP != null)
     {
         amtrs_FC_PARAM.m_Dx[0] = pNPP.dir.x;
         amtrs_FC_PARAM.m_Dy[0] = pNPP.dir.y;
         amtrs_FC_PARAM.m_Dz[0] = pNPP.dir.z;
     }
     else
     {
         amtrs_FC_PARAM.m_flag |= 1U;
     }
     amtrs_FC_PARAM.m_Dx[1] = pNP.dir.x;
     amtrs_FC_PARAM.m_Dy[1] = pNP.dir.y;
     amtrs_FC_PARAM.m_Dz[1] = pNP.dir.z;
     amtrs_FC_PARAM.m_Dx[2] = pNow.dir.x;
     amtrs_FC_PARAM.m_Dy[2] = pNow.dir.y;
     amtrs_FC_PARAM.m_Dz[2] = pNow.dir.z;
     if (pNext != null)
     {
         amtrs_FC_PARAM.m_Dx[3] = pNext.dir.x;
         amtrs_FC_PARAM.m_Dy[3] = pNext.dir.y;
         amtrs_FC_PARAM.m_Dz[3] = pNext.dir.z;
     }
     else
     {
         amtrs_FC_PARAM.m_flag |= 2U;
     }
     amtrs_FC_PARAM.m_flag |= 512U;
     return(AppMain._amTrailCalcSplinePos(Pos, Dir, amtrs_FC_PARAM, len, MaxComp));
 }
Esempio n. 3
0
 // Token: 0x06000033 RID: 51 RVA: 0x00002CEC File Offset: 0x00000EEC
 private static void _amTrailInitNormal(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[0];
     AppMain.AMS_TRAIL_PARTS     trailTail           = ams_TRAIL_PARTSDATA.trailTail;
     AppMain.AMS_TRAIL_PARTS     trailHead           = ams_TRAIL_PARTSDATA.trailHead;
     ams_TRAIL_PARTSDATA.Clear();
     ams_TRAIL_PARTS.pNext = trailTail;
     trailTail.pPrev       = ams_TRAIL_PARTS;
     ams_TRAIL_PARTS.pPrev = trailHead;
     trailHead.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);
     }
     ams_TRAIL_PARTS.time    = work.life;
     ams_TRAIL_PARTS.partsId = 0;
     work.trailPartsId       = 1;
     AppMain.AMS_TRAIL_PARAM ams_TRAIL_PARAM = work;
     ams_TRAIL_PARAM.trailPartsNum += 1;
 }
Esempio n. 4
0
 public void Clear()
 {
     this.pos.Clear();
     this.sub_pos.Clear();
     this.dir.Clear();
     this.time    = 0.0f;
     this.pNext   = (AppMain.AMS_TRAIL_PARTS)null;
     this.pPrev   = (AppMain.AMS_TRAIL_PARTS)null;
     this.m_Flag  = 0U;
     this.partsId = (short)0;
     Array.Clear((Array)this.Dummy, 0, this.Dummy.Length);
 }
Esempio n. 5
0
 // 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);
 }
Esempio n. 6
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);
 }
Esempio n. 7
0
 private static void _amTrailAddPosition(
     AppMain.AMS_TRAIL_EFFECT pEffect,
     AppMain.NNS_VECTOR offset)
 {
     AppMain.AMS_TRAIL_PARAM     work = pEffect.Work;
     AppMain.AMS_TRAIL_PARTSDATA amsTrailPartsdata = AppMain.pTr.trailData[(int)work.trailId];
     AppMain.AMS_TRAIL_PARTS     trailTail         = amsTrailPartsdata.trailTail;
     AppMain.AMS_TRAIL_PARTS     trailHead         = amsTrailPartsdata.trailHead;
     AppMain.AMS_TRAIL_PARTS     pPrev             = trailTail.pPrev;
     if (trailTail.pPrev.pPrev == trailHead || (double)work.time <= 0.0)
     {
         return;
     }
     for (; pPrev != trailHead; pPrev = pPrev.pPrev)
     {
         AppMain.nnAddVector(pPrev.pos, pPrev.pos, offset);
     }
 }
Esempio n. 8
0
 // Token: 0x06000039 RID: 57 RVA: 0x00003EC4 File Offset: 0x000020C4
 private static void _amTrailAddParts(AppMain.AMS_TRAIL_PARTS pNew, AppMain.AMS_TRAIL_PARAM work)
 {
     AppMain.AMS_TRAIL_PARTSDATA ams_TRAIL_PARTSDATA = AppMain.pTr.trailData[(int)work.trailId];
     AppMain.AMS_TRAIL_PARTS     trailHead           = ams_TRAIL_PARTSDATA.trailHead;
     pNew.time           = work.life;
     pNew.partsId        = work.trailPartsId;
     work.trailPartsId  += 1;
     work.trailPartsNum += 1;
     if (work.trailPartsNum >= work.partsNum)
     {
         work.trailPartsNum = work.partsNum;
         work.trailPartsId  = trailHead.pNext.partsId;
     }
     if (work.trailPartsNum >= 64)
     {
         work.trailPartsNum = 64;
         work.trailPartsId  = trailHead.pNext.partsId;
     }
 }
Esempio n. 9
0
    // Token: 0x06000038 RID: 56 RVA: 0x00003C0C File Offset: 0x00001E0C
    private static void _amTrailDrawPartsNormalTex(AppMain.AMS_TRAIL_PARTS pNow, AppMain.AMS_TRAIL_PARAM work, AppMain.NNS_PRIM3D_PCT[] _pv, int pv)
    {
        int   num   = pv - 6;
        float scale = work.startSize;
        float num2  = (float)(work.trailPartsNum - work.list_no) / (float)work.trailPartsNum;

        num2 *= work.vanish_rate;
        scale = work.startSize * num2 + work.endSize * (1f - num2);
        NNS_RGBA nns_RGBA;

        nns_RGBA.r = work.startColor.r * num2 + work.endColor.r * (1f - num2);
        nns_RGBA.g = work.startColor.g * num2 + work.endColor.g * (1f - num2);
        nns_RGBA.b = work.startColor.b * num2 + work.endColor.b * (1f - num2);
        nns_RGBA.a = work.startColor.a * num2 + work.endColor.a * (1f - num2);
        NNS_VECTOR nns_VECTOR = GlobalPool <NNS_VECTOR> .Alloc();

        NNS_VECTOR nns_VECTOR2 = GlobalPool <NNS_VECTOR> .Alloc();

        NNS_VECTOR nns_VECTOR3 = GlobalPool <NNS_VECTOR> .Alloc();

        AppMain.nnDistanceVector(pNow.pos, AppMain._am_ef_camPos);
        AppMain.amVectorSet(nns_VECTOR3, 0f, 0f, 1f);
        AppMain.nnCrossProductVector(nns_VECTOR, nns_VECTOR3, pNow.dir);
        AppMain.nnNormalizeVector(nns_VECTOR, nns_VECTOR);
        AppMain.nnScaleVector(nns_VECTOR2, nns_VECTOR, scale);
        AppMain.nnAddVector(ref _pv[pv + 1].Pos, pNow.pPrev.pos, nns_VECTOR2);
        AppMain.nnSubtractVector(ref _pv[pv + 5].Pos, pNow.pPrev.pos, nns_VECTOR2);
        _pv[pv]           = _pv[num + 1];
        _pv[pv + 2]       = _pv[num + 5];
        _pv[pv + 4]       = _pv[pv + 2];
        _pv[pv + 5].Col   = AppMain.AMD_FCOLTORGBA8888(nns_RGBA.r, nns_RGBA.g, nns_RGBA.b, nns_RGBA.a);
        _pv[pv + 1].Col   = _pv[pv + 5].Col;
        _pv[pv + 1].Tex.u = num2;
        _pv[pv + 1].Tex.v = 0f;
        _pv[pv + 5].Tex.u = num2;
        _pv[pv + 5].Tex.v = 1f;
        _pv[pv + 3]       = _pv[pv + 1];
        GlobalPool <NNS_VECTOR> .Release(nns_VECTOR);

        GlobalPool <NNS_VECTOR> .Release(nns_VECTOR2);

        GlobalPool <NNS_VECTOR> .Release(nns_VECTOR3);
    }
Esempio n. 10
0
 private static void _amTrailAddParts(AppMain.AMS_TRAIL_PARTS pNew, AppMain.AMS_TRAIL_PARAM work)
 {
     AppMain.AMS_TRAIL_PARTS trailHead = AppMain.pTr.trailData[(int)work.trailId].trailHead;
     pNew.time    = work.life;
     pNew.partsId = work.trailPartsId;
     ++work.trailPartsId;
     ++work.trailPartsNum;
     if ((int)work.trailPartsNum >= (int)work.partsNum)
     {
         work.trailPartsNum = work.partsNum;
         work.trailPartsId  = trailHead.pNext.partsId;
     }
     if (work.trailPartsNum < (short)64)
     {
         return;
     }
     work.trailPartsNum = (short)64;
     work.trailPartsId  = trailHead.pNext.partsId;
 }
Esempio n. 11
0
    private static void _amTrailDrawPartsNormalTex(
        AppMain.AMS_TRAIL_PARTS pNow,
        AppMain.AMS_TRAIL_PARAM work,
        AppMain.NNS_PRIM3D_PCT[] _pv,
        int pv)
    {
        int   num1      = pv - 6;
        float startSize = work.startSize;
        float num2      = (float)((int)work.trailPartsNum - (int)work.list_no) / (float)work.trailPartsNum * work.vanish_rate;
        float scale     = (float)((double)work.startSize * (double)num2 + (double)work.endSize * (1.0 - (double)num2));

        AppMain.NNS_RGBA nnsRgba;
        nnsRgba.r = (float)((double)work.startColor.r * (double)num2 + (double)work.endColor.r * (1.0 - (double)num2));
        nnsRgba.g = (float)((double)work.startColor.g * (double)num2 + (double)work.endColor.g * (1.0 - (double)num2));
        nnsRgba.b = (float)((double)work.startColor.b * (double)num2 + (double)work.endColor.b * (1.0 - (double)num2));
        nnsRgba.a = (float)((double)work.startColor.a * (double)num2 + (double)work.endColor.a * (1.0 - (double)num2));
        AppMain.NNS_VECTOR nnsVector1 = new AppMain.NNS_VECTOR();
        AppMain.NNS_VECTOR nnsVector2 = new AppMain.NNS_VECTOR();
        AppMain.NNS_VECTOR nnsVector3 = new AppMain.NNS_VECTOR();
        double             num3       = (double)AppMain.nnDistanceVector(pNow.pos, AppMain._am_ef_camPos);

        AppMain.amVectorSet(nnsVector3, 0.0f, 0.0f, 1f);
        AppMain.nnCrossProductVector(nnsVector1, nnsVector3, pNow.dir);
        AppMain.nnNormalizeVector(nnsVector1, nnsVector1);
        AppMain.nnScaleVector(nnsVector2, nnsVector1, scale);
        AppMain.nnAddVector(ref _pv[pv + 1].Pos, pNow.pPrev.pos, nnsVector2);
        AppMain.nnSubtractVector(ref _pv[pv + 5].Pos, pNow.pPrev.pos, nnsVector2);
        _pv[pv]           = _pv[num1 + 1];
        _pv[pv + 2]       = _pv[num1 + 5];
        _pv[pv + 4]       = _pv[pv + 2];
        _pv[pv + 5].Col   = AppMain.AMD_FCOLTORGBA8888(nnsRgba.r, nnsRgba.g, nnsRgba.b, nnsRgba.a);
        _pv[pv + 1].Col   = _pv[pv + 5].Col;
        _pv[pv + 1].Tex.u = num2;
        _pv[pv + 1].Tex.v = 0.0f;
        _pv[pv + 5].Tex.u = num2;
        _pv[pv + 5].Tex.v = 1f;
        _pv[pv + 3]       = _pv[pv + 1];
        //AppMain.GlobalPool<AppMain.NNS_VECTOR>.Release(nnsVector1);
        //AppMain.GlobalPool<AppMain.NNS_VECTOR>.Release(nnsVector2);
        //AppMain.GlobalPool<AppMain.NNS_VECTOR>.Release(nnsVector3);
    }
Esempio n. 12
0
 // Token: 0x0600003A RID: 58 RVA: 0x00003F70 File Offset: 0x00002170
 private static void _amTrailAddPosition(AppMain.AMS_TRAIL_EFFECT pEffect, NNS_VECTOR offset)
 {
     AppMain.AMS_TRAIL_PARAM     work = pEffect.Work;
     AppMain.AMS_TRAIL_PARTSDATA ams_TRAIL_PARTSDATA = AppMain.pTr.trailData[(int)work.trailId];
     AppMain.AMS_TRAIL_PARTS     trailTail           = ams_TRAIL_PARTSDATA.trailTail;
     AppMain.AMS_TRAIL_PARTS     trailHead           = ams_TRAIL_PARTSDATA.trailHead;
     AppMain.AMS_TRAIL_PARTS     pPrev = trailTail.pPrev;
     if (trailTail.pPrev.pPrev == trailHead)
     {
         return;
     }
     if (work.time <= 0f)
     {
         return;
     }
     while (pPrev != trailHead)
     {
         AppMain.nnAddVector(pPrev.pos, pPrev.pos, offset);
         pPrev = pPrev.pPrev;
     }
 }
Esempio n. 13
0
    // Token: 0x06000036 RID: 54 RVA: 0x000030B0 File Offset: 0x000012B0
    private static void _amTrailDrawNormal(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     trailTail           = ams_TRAIL_PARTSDATA.trailTail;
        AppMain.AMS_TRAIL_PARTS     trailHead           = ams_TRAIL_PARTSDATA.trailHead;
        AppMain.AMS_TRAIL_PARTS     pPrev = trailTail.pPrev;
        if (trailTail.pPrev.pPrev == trailHead)
        {
            return;
        }
        if (work.time <= 0f)
        {
            return;
        }
        NNS_RGBA   startColor = work.startColor;
        NNS_RGBA   ptclColor  = work.ptclColor;
        NNS_VECTOR nns_VECTOR = GlobalPool <NNS_VECTOR> .Alloc();

        NNS_VECTOR nns_VECTOR2 = GlobalPool <NNS_VECTOR> .Alloc();

        NNS_VECTOR nns_VECTOR3 = GlobalPool <NNS_VECTOR> .Alloc();

        float num = 1f;

        AppMain.AMS_PARAM_DRAW_PRIMITIVE ams_PARAM_DRAW_PRIMITIVE = GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc();

        int ablend = 1;

        AppMain.amDrawGetPrimBlendParam((int)work.blendType, ams_PARAM_DRAW_PRIMITIVE);
        if (work.zTest != 0)
        {
            ams_PARAM_DRAW_PRIMITIVE.zTest = 1;
        }
        if (work.zMask != 0)
        {
            ams_PARAM_DRAW_PRIMITIVE.zMask = 1;
        }
        AppMain.amVectorSet(nns_VECTOR3, 0f, 0f, 1f);
        if (work.time < work.vanish_time)
        {
            num = work.time / work.vanish_time;
        }
        work.vanish_rate = num;
        startColor.a     = work.startColor.a * num;
        ptclColor.a      = work.ptclColor.a * num;
        float startSize = work.startSize;
        float ptclSize  = work.ptclSize;

        if (work.ptclFlag != 0 && work.ptclTexId != -1)
        {
            AppMain.NNS_PRIM3D_PCT_ARRAY nns_PRIM3D_PCT_ARRAY = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(6);
            AppMain.NNS_PRIM3D_PCT[]     buffer = nns_PRIM3D_PCT_ARRAY.buffer;
            int   offset = nns_PRIM3D_PCT_ARRAY.offset;
            float sortZ  = AppMain.nnDistanceVector(pPrev.pos, AppMain._am_ef_camPos);
            AppMain.mppAssertNotImpl();
            buffer[offset].Col                = AppMain.AMD_FCOLTORGBA8888(ptclColor.r, ptclColor.g, ptclColor.b, ptclColor.a);
            buffer[offset + 1].Col            = (buffer[offset + 2].Col = (buffer[offset + 5].Col = buffer[offset].Col));
            buffer[offset].Tex.u              = 0f;
            buffer[offset].Tex.v              = 0f;
            buffer[offset + 1].Tex.u          = 1f;
            buffer[offset + 1].Tex.v          = 0f;
            buffer[offset + 2].Tex.u          = 0f;
            buffer[offset + 2].Tex.v          = 1f;
            buffer[offset + 5].Tex.u          = 1f;
            buffer[offset + 5].Tex.v          = 1f;
            buffer[offset + 3]                = buffer[offset + 1];
            buffer[offset + 4]                = buffer[offset + 2];
            ams_PARAM_DRAW_PRIMITIVE.format3D = 4;
            ams_PARAM_DRAW_PRIMITIVE.type     = 0;
            ams_PARAM_DRAW_PRIMITIVE.vtxPCT3D = nns_PRIM3D_PCT_ARRAY;
            ams_PARAM_DRAW_PRIMITIVE.texlist  = work.texlist;
            ams_PARAM_DRAW_PRIMITIVE.texId    = (int)work.ptclTexId;
            ams_PARAM_DRAW_PRIMITIVE.count    = 6;
            ams_PARAM_DRAW_PRIMITIVE.ablend   = ablend;
            ams_PARAM_DRAW_PRIMITIVE.sortZ    = sortZ;
            AppMain.amDrawPrimitive3D(pEffect.drawState, ams_PARAM_DRAW_PRIMITIVE);
        }
        if (work.trailPartsNum < 3)
        {
            return;
        }
        if (work.texlist == null || work.texId == -1)
        {
            AppMain.NNS_PRIM3D_PC[] array   = AppMain.amDrawAlloc_NNS_PRIM3D_PC((int)(6 * (work.trailPartsNum - 1)));
            AppMain.NNS_PRIM3D_PC[] vtxPC3D = array;
            int   num2  = 0;
            float sortZ = AppMain.nnDistanceVector(pPrev.pos, AppMain._am_ef_camPos);
            AppMain.nnCrossProductVector(nns_VECTOR, nns_VECTOR3, pPrev.dir);
            AppMain.nnNormalizeVector(nns_VECTOR, nns_VECTOR);
            AppMain.nnScaleVector(nns_VECTOR2, nns_VECTOR, startSize);
            AppMain.nnAddVector(ref array[0].Pos, pPrev.pos, nns_VECTOR2);
            AppMain.nnAddVector(ref array[1].Pos, pPrev.pPrev.pos, nns_VECTOR2);
            AppMain.nnSubtractVector(ref array[2].Pos, pPrev.pos, nns_VECTOR2);
            AppMain.nnSubtractVector(ref array[5].Pos, pPrev.pPrev.pos, nns_VECTOR2);
            array[5].Col = AppMain.AMD_FCOLTORGBA8888(startColor.r, startColor.g, startColor.b, startColor.a);
            array[0].Col = (array[1].Col = (array[2].Col = array[5].Col));
            array[3]     = array[1];
            array[4]     = array[2];
            num2        += 6;
            pPrev        = pPrev.pPrev;
            work.list_no = 1;
            while (pPrev != trailHead.pNext)
            {
                AppMain.mppAssertNotImpl();
                pPrev.m_Flag &= 4294967293U;
                AppMain.AMS_TRAIL_PARAM ams_TRAIL_PARAM = work;
                ams_TRAIL_PARAM.list_no += 1;
                AppMain._amTrailDrawPartsNormal(pPrev, work, array, num2);
                pPrev = pPrev.pPrev;
                num2 += 6;
            }
            ams_PARAM_DRAW_PRIMITIVE.format3D = 2;
            ams_PARAM_DRAW_PRIMITIVE.type     = 0;
            ams_PARAM_DRAW_PRIMITIVE.vtxPC3D  = vtxPC3D;
            ams_PARAM_DRAW_PRIMITIVE.texlist  = work.texlist;
            ams_PARAM_DRAW_PRIMITIVE.texId    = work.texId;
            ams_PARAM_DRAW_PRIMITIVE.count    = (int)(6 * (work.trailPartsNum - 1));
            ams_PARAM_DRAW_PRIMITIVE.ablend   = ablend;
            ams_PARAM_DRAW_PRIMITIVE.sortZ    = sortZ;
            AppMain.amDrawPrimitive3D(pEffect.drawState, ams_PARAM_DRAW_PRIMITIVE);
        }
        else
        {
            AppMain.NNS_PRIM3D_PCT_ARRAY nns_PRIM3D_PCT_ARRAY2 = AppMain.amDrawAlloc_NNS_PRIM3D_PCT((int)(6 * (work.trailPartsNum - 1)));
            AppMain.NNS_PRIM3D_PCT[]     buffer2 = nns_PRIM3D_PCT_ARRAY2.buffer;
            int   offset2 = nns_PRIM3D_PCT_ARRAY2.offset;
            int   num3    = offset2;
            float num4    = (float)(work.trailPartsNum - 1) / (float)work.trailPartsNum;
            num4 *= work.vanish_rate;
            float sortZ = AppMain.nnDistanceVector(pPrev.pos, AppMain._am_ef_camPos);
            AppMain.nnCrossProductVector(nns_VECTOR, nns_VECTOR3, pPrev.dir);
            AppMain.nnNormalizeVector(nns_VECTOR, nns_VECTOR);
            AppMain.nnScaleVector(nns_VECTOR2, nns_VECTOR, startSize);
            AppMain.nnAddVector(ref buffer2[offset2].Pos, pPrev.pos, nns_VECTOR2);
            AppMain.nnAddVector(ref buffer2[offset2 + 1].Pos, pPrev.pPrev.pos, nns_VECTOR2);
            AppMain.nnSubtractVector(ref buffer2[offset2 + 2].Pos, pPrev.pos, nns_VECTOR2);
            AppMain.nnSubtractVector(ref buffer2[offset2 + 5].Pos, pPrev.pPrev.pos, nns_VECTOR2);
            buffer2[offset2 + 5].Col   = AppMain.AMD_FCOLTORGBA8888(startColor.r, startColor.g, startColor.b, startColor.a);
            buffer2[offset2].Col       = (buffer2[offset2 + 1].Col = (buffer2[offset2 + 2].Col = buffer2[offset2 + 5].Col));
            buffer2[offset2].Tex.u     = 1f;
            buffer2[offset2].Tex.v     = 0f;
            buffer2[offset2 + 1].Tex.u = num4;
            buffer2[offset2 + 1].Tex.v = 0f;
            buffer2[offset2 + 2].Tex.u = 1f;
            buffer2[offset2 + 2].Tex.v = 1f;
            buffer2[offset2 + 5].Tex.u = num4;
            buffer2[offset2 + 5].Tex.v = 1f;
            buffer2[offset2 + 3]       = buffer2[offset2 + 1];
            buffer2[offset2 + 4]       = buffer2[offset2 + 2];
            num3        += 6;
            pPrev        = pPrev.pPrev;
            work.list_no = 1;
            while (pPrev != trailHead.pNext)
            {
                pPrev.m_Flag &= 4294967293U;
                AppMain.AMS_TRAIL_PARAM ams_TRAIL_PARAM2 = work;
                ams_TRAIL_PARAM2.list_no += 1;
                AppMain._amTrailDrawPartsNormalTex(pPrev, work, buffer2, num3);
                pPrev = pPrev.pPrev;
                num3 += 6;
            }
            ams_PARAM_DRAW_PRIMITIVE.format3D = 4;
            ams_PARAM_DRAW_PRIMITIVE.type     = 0;
            ams_PARAM_DRAW_PRIMITIVE.vtxPCT3D = nns_PRIM3D_PCT_ARRAY2;
            ams_PARAM_DRAW_PRIMITIVE.texlist  = work.texlist;
            ams_PARAM_DRAW_PRIMITIVE.texId    = work.texId;
            ams_PARAM_DRAW_PRIMITIVE.count    = (int)(6 * (work.trailPartsNum - 1));
            ams_PARAM_DRAW_PRIMITIVE.ablend   = ablend;
            ams_PARAM_DRAW_PRIMITIVE.sortZ    = sortZ;
            AppMain.amDrawPrimitive3D(pEffect.drawState, ams_PARAM_DRAW_PRIMITIVE);
        }
        GlobalPool <NNS_VECTOR> .Release(nns_VECTOR);

        GlobalPool <NNS_VECTOR> .Release(nns_VECTOR2);

        GlobalPool <NNS_VECTOR> .Release(nns_VECTOR3);
    }
Esempio n. 14
0
    private static void _amTrailDrawNormal(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     trailTail         = amsTrailPartsdata.trailTail;
        AppMain.AMS_TRAIL_PARTS     trailHead         = amsTrailPartsdata.trailHead;
        AppMain.AMS_TRAIL_PARTS     pPrev1            = trailTail.pPrev;
        if (trailTail.pPrev.pPrev == trailHead || (double)work.time <= 0.0)
        {
            return;
        }
        AppMain.NNS_RGBA   startColor = work.startColor;
        AppMain.NNS_RGBA   ptclColor  = work.ptclColor;
        AppMain.NNS_VECTOR nnsVector1 = new AppMain.NNS_VECTOR();
        AppMain.NNS_VECTOR nnsVector2 = new AppMain.NNS_VECTOR();
        AppMain.NNS_VECTOR nnsVector3 = new AppMain.NNS_VECTOR();
        float num1 = 1f;

        AppMain.AMS_PARAM_DRAW_PRIMITIVE setParam = AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc();

        int num2 = 1;

        AppMain.amDrawGetPrimBlendParam((int)work.blendType, setParam);
        if (work.zTest != (short)0)
        {
            setParam.zTest = (short)1;
        }
        if (work.zMask != (short)0)
        {
            setParam.zMask = (short)1;
        }
        AppMain.amVectorSet(nnsVector3, 0.0f, 0.0f, 1f);
        if ((double)work.time < (double)work.vanish_time)
        {
            num1 = work.time / work.vanish_time;
        }
        work.vanish_rate = num1;
        startColor.a     = work.startColor.a * num1;
        ptclColor.a      = work.ptclColor.a * num1;
        float startSize = work.startSize;
        float ptclSize  = work.ptclSize;

        if (work.ptclFlag != (short)0 && work.ptclTexId != (short)-1)
        {
            AppMain.NNS_PRIM3D_PCT_ARRAY nnsPriM3DPctArray = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(6);
            AppMain.NNS_PRIM3D_PCT[]     buffer            = nnsPriM3DPctArray.buffer;
            int   offset = nnsPriM3DPctArray.offset;
            float num3   = AppMain.nnDistanceVector(pPrev1.pos, AppMain._am_ef_camPos);
            AppMain.mppAssertNotImpl();
            buffer[offset].Col       = AppMain.AMD_FCOLTORGBA8888(ptclColor.r, ptclColor.g, ptclColor.b, ptclColor.a);
            buffer[offset + 1].Col   = buffer[offset + 2].Col = buffer[offset + 5].Col = buffer[offset].Col;
            buffer[offset].Tex.u     = 0.0f;
            buffer[offset].Tex.v     = 0.0f;
            buffer[offset + 1].Tex.u = 1f;
            buffer[offset + 1].Tex.v = 0.0f;
            buffer[offset + 2].Tex.u = 0.0f;
            buffer[offset + 2].Tex.v = 1f;
            buffer[offset + 5].Tex.u = 1f;
            buffer[offset + 5].Tex.v = 1f;
            buffer[offset + 3]       = buffer[offset + 1];
            buffer[offset + 4]       = buffer[offset + 2];
            setParam.format3D        = 4;
            setParam.type            = 0;
            setParam.vtxPCT3D        = nnsPriM3DPctArray;
            setParam.texlist         = work.texlist;
            setParam.texId           = (int)work.ptclTexId;
            setParam.count           = 6;
            setParam.ablend          = num2;
            setParam.sortZ           = num3;
            AppMain.amDrawPrimitive3D(pEffect.drawState, setParam);
        }
        if (work.trailPartsNum < (short)3)
        {
            return;
        }
        if (work.texlist == null || work.texId == -1)
        {
            AppMain.NNS_PRIM3D_PC[] _pv = AppMain.amDrawAlloc_NNS_PRIM3D_PC(6 * ((int)work.trailPartsNum - 1));
            AppMain.NNS_PRIM3D_PC[] nnsPriM3DPcArray = _pv;
            int   num3 = 0;
            float num4 = AppMain.nnDistanceVector(pPrev1.pos, AppMain._am_ef_camPos);
            AppMain.nnCrossProductVector(nnsVector1, nnsVector3, pPrev1.dir);
            AppMain.nnNormalizeVector(nnsVector1, nnsVector1);
            AppMain.nnScaleVector(nnsVector2, nnsVector1, startSize);
            AppMain.nnAddVector(ref _pv[0].Pos, pPrev1.pos, nnsVector2);
            AppMain.nnAddVector(ref _pv[1].Pos, pPrev1.pPrev.pos, nnsVector2);
            AppMain.nnSubtractVector(ref _pv[2].Pos, pPrev1.pos, nnsVector2);
            AppMain.nnSubtractVector(ref _pv[5].Pos, pPrev1.pPrev.pos, nnsVector2);
            _pv[5].Col = AppMain.AMD_FCOLTORGBA8888(startColor.r, startColor.g, startColor.b, startColor.a);
            _pv[0].Col = _pv[1].Col = _pv[2].Col = _pv[5].Col;
            _pv[3]     = _pv[1];
            _pv[4]     = _pv[2];
            int pv = num3 + 6;
            AppMain.AMS_TRAIL_PARTS pPrev2 = pPrev1.pPrev;
            work.list_no = (short)1;
            while (pPrev2 != trailHead.pNext)
            {
                AppMain.mppAssertNotImpl();
                pPrev2.m_Flag &= 4294967293U;
                ++work.list_no;
                AppMain._amTrailDrawPartsNormal(pPrev2, work, _pv, pv);
                pPrev2 = pPrev2.pPrev;
                pv    += 6;
            }
            setParam.format3D = 2;
            setParam.type     = 0;
            setParam.vtxPC3D  = nnsPriM3DPcArray;
            setParam.texlist  = work.texlist;
            setParam.texId    = work.texId;
            setParam.count    = 6 * ((int)work.trailPartsNum - 1);
            setParam.ablend   = num2;
            setParam.sortZ    = num4;
            AppMain.amDrawPrimitive3D(pEffect.drawState, setParam);
        }
        else
        {
            AppMain.NNS_PRIM3D_PCT_ARRAY nnsPriM3DPctArray = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(6 * ((int)work.trailPartsNum - 1));
            AppMain.NNS_PRIM3D_PCT[]     buffer            = nnsPriM3DPctArray.buffer;
            int   offset = nnsPriM3DPctArray.offset;
            int   num3   = offset;
            float num4   = (float)((int)work.trailPartsNum - 1) / (float)work.trailPartsNum * work.vanish_rate;
            float num5   = AppMain.nnDistanceVector(pPrev1.pos, AppMain._am_ef_camPos);
            AppMain.nnCrossProductVector(nnsVector1, nnsVector3, pPrev1.dir);
            AppMain.nnNormalizeVector(nnsVector1, nnsVector1);
            AppMain.nnScaleVector(nnsVector2, nnsVector1, startSize);
            AppMain.nnAddVector(ref buffer[offset].Pos, pPrev1.pos, nnsVector2);
            AppMain.nnAddVector(ref buffer[offset + 1].Pos, pPrev1.pPrev.pos, nnsVector2);
            AppMain.nnSubtractVector(ref buffer[offset + 2].Pos, pPrev1.pos, nnsVector2);
            AppMain.nnSubtractVector(ref buffer[offset + 5].Pos, pPrev1.pPrev.pos, nnsVector2);
            buffer[offset + 5].Col   = AppMain.AMD_FCOLTORGBA8888(startColor.r, startColor.g, startColor.b, startColor.a);
            buffer[offset].Col       = buffer[offset + 1].Col = buffer[offset + 2].Col = buffer[offset + 5].Col;
            buffer[offset].Tex.u     = 1f;
            buffer[offset].Tex.v     = 0.0f;
            buffer[offset + 1].Tex.u = num4;
            buffer[offset + 1].Tex.v = 0.0f;
            buffer[offset + 2].Tex.u = 1f;
            buffer[offset + 2].Tex.v = 1f;
            buffer[offset + 5].Tex.u = num4;
            buffer[offset + 5].Tex.v = 1f;
            buffer[offset + 3]       = buffer[offset + 1];
            buffer[offset + 4]       = buffer[offset + 2];
            int pv = num3 + 6;
            AppMain.AMS_TRAIL_PARTS pPrev2 = pPrev1.pPrev;
            work.list_no = (short)1;
            while (pPrev2 != trailHead.pNext)
            {
                pPrev2.m_Flag &= 4294967293U;
                ++work.list_no;
                AppMain._amTrailDrawPartsNormalTex(pPrev2, work, buffer, pv);
                pPrev2 = pPrev2.pPrev;
                pv    += 6;
            }
            setParam.format3D = 4;
            setParam.type     = 0;
            setParam.vtxPCT3D = nnsPriM3DPctArray;
            setParam.texlist  = work.texlist;
            setParam.texId    = work.texId;
            setParam.count    = 6 * ((int)work.trailPartsNum - 1);
            setParam.ablend   = num2;
            setParam.sortZ    = num5;
            AppMain.amDrawPrimitive3D(pEffect.drawState, setParam);
        }
        //AppMain.GlobalPool<AppMain.NNS_VECTOR>.Release(nnsVector1);
        //AppMain.GlobalPool<AppMain.NNS_VECTOR>.Release(nnsVector2);
        //AppMain.GlobalPool<AppMain.NNS_VECTOR>.Release(nnsVector3);
    }