private static AppMain.AMS_AME_TEX_ANIM readTexAnim(BinaryReader br) { AppMain.AMS_AME_TEX_ANIM amsAmeTexAnim = new AppMain.AMS_AME_TEX_ANIM() { time = br.ReadSingle(), key_num = br.ReadInt32() }; amsAmeTexAnim.key_buf = new AppMain.AMS_AME_TEX_ANIM_KEY[amsAmeTexAnim.key_num]; for (int index = 0; index < amsAmeTexAnim.key_num; ++index) { amsAmeTexAnim.key_buf[index].time = br.ReadSingle(); amsAmeTexAnim.key_buf[index].l = br.ReadSingle(); amsAmeTexAnim.key_buf[index].t = br.ReadSingle(); amsAmeTexAnim.key_buf[index].r = br.ReadSingle(); amsAmeTexAnim.key_buf[index].b = br.ReadSingle(); } return(amsAmeTexAnim); }
public static int _amUpdateSimpleSprite(object r) { AppMain.AMS_AME_RUNTIME runtime = (AppMain.AMS_AME_RUNTIME)r; AppMain.AMS_AME_NODE_SPRITE node = (AppMain.AMS_AME_NODE_SPRITE)runtime.node; AppMain.AMS_AME_LIST next = runtime.active_head.next; AppMain.AMS_AME_LIST activeTail = runtime.active_tail; int transparency = runtime.ecb.transparency; float num1; float num2; if ((double)node.life >= 0.0) { num1 = node.life; num2 = 1f / num1; } else { num1 = float.MaxValue; num2 = 0.0f; } float sizeRate = runtime.ecb.size_rate; float num3 = node.scale_x_start * sizeRate; float num4 = node.scale_y_start * sizeRate; float num5 = node.scale_x_end * sizeRate; float num6 = node.scale_y_end * sizeRate; for (; next != activeTail; next = next.next) { AppMain.AMS_AME_RUNTIME_WORK_SIMPLE_SPRITE workSimpleSprite = (AppMain.AMS_AME_RUNTIME_WORK_SIMPLE_SPRITE)(AppMain.AMS_AME_RUNTIME_WORK) next; workSimpleSprite.time += AppMain._am_unit_frame; float rate = workSimpleSprite.time * num2; AppMain.NNS_VECTOR4D amEffectVel = AppMain._amEffect_vel; AppMain.amVectorScale(amEffectVel, workSimpleSprite.velocity, AppMain._am_unit_time); AppMain.amVectorAdd(workSimpleSprite.position, amEffectVel); if ((double)workSimpleSprite.time >= (double)num1) { if (runtime.spawn_runtime != null) { AppMain._amCreateSpawnParticle(runtime, (AppMain.AMS_AME_RUNTIME_WORK)workSimpleSprite); } AppMain.amEffectDisconnectLink((AppMain.AMS_AME_LIST)workSimpleSprite); --runtime.active_num; AppMain.amEffectFreeRuntimeWork((AppMain.AMS_AME_RUNTIME_WORK)workSimpleSprite); } else { float num7 = 1f - rate; float num8 = (float)((double)num3 * (double)num7 + (double)num5 * (double)rate); float num9 = (float)((double)num4 * (double)num7 + (double)num6 * (double)rate); AppMain.Vector4D_Buf size = workSimpleSprite.size; workSimpleSprite.set_size(size.z * num8, size.z * num9, size.z, size.w); AppMain.AMS_RGBA8888 pCO; AppMain.amEffectLerpColor(out pCO, ref node.color_start, ref node.color_end, rate); pCO.a = (byte)((int)pCO.a * transparency >> 8); workSimpleSprite.set_color(pCO.color); if (((int)node.flag & 32768) != 0) { AppMain.AMS_AME_TEX_ANIM texAnim = node.tex_anim; if (((int)workSimpleSprite.flag & 2) == 0) { workSimpleSprite.tex_time += AppMain._am_unit_frame; if ((double)workSimpleSprite.tex_time >= (double)texAnim.key_buf[workSimpleSprite.tex_no].time) { workSimpleSprite.tex_time = 0.0f; ++workSimpleSprite.tex_no; if (workSimpleSprite.tex_no == texAnim.key_num) { if (((int)node.flag & 65536) != 0) { workSimpleSprite.tex_no = 0; } else { workSimpleSprite.tex_no = texAnim.key_num - 1; workSimpleSprite.flag |= 2U; } } } } AppMain.AMS_AME_TEX_ANIM_KEY amsAmeTexAnimKey = texAnim.key_buf[workSimpleSprite.tex_no]; Vector4 vector4 = new Vector4(amsAmeTexAnimKey.l, amsAmeTexAnimKey.t, amsAmeTexAnimKey.r, amsAmeTexAnimKey.b); if (((int)workSimpleSprite.flag & 8) != 0) { float x = vector4.X; vector4.X = vector4.Z; vector4.Z = x; } if (((int)workSimpleSprite.flag & 16) != 0) { float y = vector4.Y; vector4.Y = vector4.W; vector4.W = y; } workSimpleSprite.set_st(vector4.X, vector4.Y, vector4.Z, vector4.W); } else if (((int)node.flag & 16384) != 0) { float num10 = node.scroll_u * AppMain._am_unit_time; float num11 = node.scroll_v * AppMain._am_unit_time; if (((int)workSimpleSprite.flag & 8) != 0) { num10 = -num10; } if (((int)workSimpleSprite.flag & 16) != 0) { num11 = -num11; } AppMain.Vector4D_Quat st = workSimpleSprite.st; Vector4 vector4 = new Vector4(st.x + num10, st.y + num11, st.z + num10, st.w + num11); workSimpleSprite.set_st(vector4.X, vector4.Y, vector4.Z, vector4.W); } } } return(0); }
public static int _amUpdatePlane(object r) { AppMain.AMS_AME_RUNTIME runtime = (AppMain.AMS_AME_RUNTIME)r; AppMain.AMS_AME_NODE_PLANE node = (AppMain.AMS_AME_NODE_PLANE)runtime.node; AppMain.AMS_AME_LIST next = runtime.active_head.next; AppMain.AMS_AME_LIST activeTail = runtime.active_tail; int transparency = runtime.ecb.transparency; float num1; float num2; if ((double)node.life >= 0.0) { num1 = node.life; num2 = 1f / num1; } else { num1 = float.MaxValue; num2 = 0.0f; } float sizeRate = runtime.ecb.size_rate; float num3 = node.scale_x_start * sizeRate; float num4 = node.scale_y_start * sizeRate; float num5 = node.scale_x_end * sizeRate; float num6 = node.scale_y_end * sizeRate; AppMain.NNS_VECTOR4D amEffectVel = AppMain._amEffect_vel; AppMain.NNS_QUATERNION nnsQuaternion = new AppMain.NNS_QUATERNION(); AppMain.NNS_VECTOR4D pVec = new AppMain.NNS_VECTOR4D(); for (; next != activeTail; next = next.next) { AppMain.AMS_AME_RUNTIME_WORK_PLANE runtimeWorkPlane = (AppMain.AMS_AME_RUNTIME_WORK_PLANE)(AppMain.AMS_AME_RUNTIME_WORK) next; runtimeWorkPlane.time += AppMain._am_unit_frame; float rate = runtimeWorkPlane.time * num2; AppMain.amVectorScale(amEffectVel, runtimeWorkPlane.velocity, AppMain._am_unit_time); AppMain.amVectorAdd(runtimeWorkPlane.position, amEffectVel); if ((double)runtimeWorkPlane.time >= (double)num1) { if (runtime.spawn_runtime != null) { AppMain._amCreateSpawnParticle(runtime, (AppMain.AMS_AME_RUNTIME_WORK)(AppMain.AMS_AME_LIST) runtimeWorkPlane); } AppMain.amEffectDisconnectLink((AppMain.AMS_AME_LIST)runtimeWorkPlane); --runtime.active_num; AppMain.amEffectFreeRuntimeWork((AppMain.AMS_AME_RUNTIME_WORK)(AppMain.AMS_AME_LIST) runtimeWorkPlane); } else { pVec.x = runtimeWorkPlane.rotate_axis.x; pVec.y = runtimeWorkPlane.rotate_axis.y; pVec.z = runtimeWorkPlane.rotate_axis.z; pVec.w = runtimeWorkPlane.rotate_axis.w; AppMain.amQuatRotAxisToQuat(ref nnsQuaternion, pVec, pVec.w * AppMain._am_unit_time); AppMain.NNS_QUATERNION rotate = runtimeWorkPlane.rotate; AppMain.amQuatMulti(ref rotate, ref nnsQuaternion, ref rotate); runtimeWorkPlane.rotate = rotate; float num7 = 1f - rate; float num8 = (float)((double)num3 * (double)num7 + (double)num5 * (double)rate); float num9 = (float)((double)num4 * (double)num7 + (double)num6 * (double)rate); runtimeWorkPlane.set_size(runtimeWorkPlane.size.z * num8, runtimeWorkPlane.size.z * num9, runtimeWorkPlane.size.z, runtimeWorkPlane.size.w); AppMain.AMS_RGBA8888 pCO; AppMain.amEffectLerpColor(out pCO, ref node.color_start, ref node.color_end, rate); pCO.a = (byte)((int)pCO.a * transparency >> 8); runtimeWorkPlane.set_color(pCO.color); if (((int)node.flag & 32768) != 0) { AppMain.AMS_AME_TEX_ANIM texAnim = node.tex_anim; if (((int)runtimeWorkPlane.flag & 2) == 0) { runtimeWorkPlane.tex_time += AppMain._am_unit_frame; if ((double)runtimeWorkPlane.tex_time >= (double)texAnim.key_buf[runtimeWorkPlane.tex_no].time) { runtimeWorkPlane.tex_time = 0.0f; ++runtimeWorkPlane.tex_no; if (runtimeWorkPlane.tex_no == texAnim.key_num) { if (((int)node.flag & 65536) != 0) { runtimeWorkPlane.tex_no = 0; } else { runtimeWorkPlane.tex_no = texAnim.key_num - 1; runtimeWorkPlane.flag |= 2U; } } } } AppMain.AMS_AME_TEX_ANIM_KEY amsAmeTexAnimKey = texAnim.key_buf[runtimeWorkPlane.tex_no]; runtimeWorkPlane.set_st(amsAmeTexAnimKey.l, amsAmeTexAnimKey.t, amsAmeTexAnimKey.r, amsAmeTexAnimKey.b); if (((int)runtimeWorkPlane.flag & 8) != 0) { runtimeWorkPlane.set_st(runtimeWorkPlane.st.z, runtimeWorkPlane.st.y, runtimeWorkPlane.st.x, runtimeWorkPlane.st.w); } if (((int)runtimeWorkPlane.flag & 16) != 0) { runtimeWorkPlane.set_st(runtimeWorkPlane.st.x, runtimeWorkPlane.st.w, runtimeWorkPlane.st.z, runtimeWorkPlane.st.y); } } else if (((int)node.flag & 16384) != 0) { float num10 = node.scroll_u * AppMain._am_unit_time; float num11 = node.scroll_v * AppMain._am_unit_time; if (((int)runtimeWorkPlane.flag & 8) != 0) { num10 = -num10; } if (((int)runtimeWorkPlane.flag & 16) != 0) { num11 = -num11; } runtimeWorkPlane.set_st(runtimeWorkPlane.st.x + num10, runtimeWorkPlane.st.y + num11, runtimeWorkPlane.st.z + num10, runtimeWorkPlane.st.w + num11); } } } //AppMain.GlobalPool<AppMain.NNS_VECTOR4D>.Release(pVec); return(0); }
public static int _amUpdateLine(object r) { AppMain.AMS_AME_RUNTIME runtime = (AppMain.AMS_AME_RUNTIME)r; AppMain.AMS_AME_NODE_LINE node = (AppMain.AMS_AME_NODE_LINE)runtime.node; AppMain.AMS_AME_LIST next = runtime.active_head.next; AppMain.AMS_AME_LIST activeTail = runtime.active_tail; int transparency = runtime.ecb.transparency; float num1; float num2; if ((double)node.life >= 0.0) { num1 = node.life; num2 = 1f / num1; } else { num1 = 1E+38f; num2 = 0.0f; } float sizeRate = runtime.ecb.size_rate; float num3 = node.length_start * sizeRate; float num4 = node.length_end * sizeRate; float num5 = node.inside_width_start * sizeRate; float num6 = node.outside_width_start * sizeRate; float num7 = node.inside_width_end * sizeRate; float num8 = node.outside_width_end * sizeRate; AppMain.NNS_VECTOR4D nnsVectoR4D = new AppMain.NNS_VECTOR4D(); for (; next != activeTail; next = next.next) { AppMain.AMS_AME_RUNTIME_WORK_LINE ameRuntimeWorkLine = (AppMain.AMS_AME_RUNTIME_WORK_LINE)(AppMain.AMS_AME_RUNTIME_WORK) next; ameRuntimeWorkLine.time += AppMain._am_unit_frame; float rate = ameRuntimeWorkLine.time * num2; AppMain.amVectorScale(nnsVectoR4D, ameRuntimeWorkLine.velocity, AppMain._am_unit_time); AppMain.amVectorAdd(ameRuntimeWorkLine.position, nnsVectoR4D); if ((double)ameRuntimeWorkLine.time >= (double)num1) { if (runtime.spawn_runtime != null) { AppMain._amCreateSpawnParticle(runtime, (AppMain.AMS_AME_RUNTIME_WORK)ameRuntimeWorkLine); } AppMain.amEffectDisconnectLink((AppMain.AMS_AME_LIST)ameRuntimeWorkLine); --runtime.active_num; AppMain.amEffectFreeRuntimeWork((AppMain.AMS_AME_RUNTIME_WORK)ameRuntimeWorkLine); } else { float num9 = 1f - rate; ameRuntimeWorkLine.length = (float)((double)num3 * (double)num9 + (double)num4 * (double)rate); ameRuntimeWorkLine.inside_width = (float)((double)num5 * (double)num9 + (double)num7 * (double)rate); ameRuntimeWorkLine.outside_width = (float)((double)num6 * (double)num9 + (double)num8 * (double)rate); AppMain.AMS_RGBA8888 pCO; AppMain.amEffectLerpColor(out pCO, ref node.inside_color_start, ref node.inside_color_end, rate); pCO.a = (byte)((int)pCO.a * transparency >> 8); ameRuntimeWorkLine.set_inside_color(pCO.color); AppMain.amEffectLerpColor(out pCO, ref node.outside_color_start, ref node.outside_color_end, rate); pCO.a = (byte)((int)pCO.a * transparency >> 8); ameRuntimeWorkLine.set_outside_color(pCO.color); if (((int)node.flag & 32768) != 0) { AppMain.AMS_AME_TEX_ANIM texAnim = node.tex_anim; if (((int)ameRuntimeWorkLine.flag & 2) == 0) { ameRuntimeWorkLine.tex_time += AppMain._am_unit_frame; if ((double)ameRuntimeWorkLine.tex_time >= (double)texAnim.key_buf[ameRuntimeWorkLine.tex_no].time) { ameRuntimeWorkLine.tex_time = 0.0f; ++ameRuntimeWorkLine.tex_no; if (ameRuntimeWorkLine.tex_no == texAnim.key_num) { if (((int)node.flag & 65536) != 0) { ameRuntimeWorkLine.tex_no = 0; } else { ameRuntimeWorkLine.tex_no = texAnim.key_num - 1; ameRuntimeWorkLine.flag |= 2U; } } } } AppMain.AMS_AME_TEX_ANIM_KEY amsAmeTexAnimKey = texAnim.key_buf[ameRuntimeWorkLine.tex_no]; ameRuntimeWorkLine.set_st(amsAmeTexAnimKey.l, amsAmeTexAnimKey.t, amsAmeTexAnimKey.r, amsAmeTexAnimKey.b); if (((int)ameRuntimeWorkLine.flag & 8) != 0) { ameRuntimeWorkLine.set_st(ameRuntimeWorkLine.st.z, ameRuntimeWorkLine.st.y, ameRuntimeWorkLine.st.x, ameRuntimeWorkLine.st.w); } if (((int)ameRuntimeWorkLine.flag & 16) != 0) { ameRuntimeWorkLine.set_st(ameRuntimeWorkLine.st.x, ameRuntimeWorkLine.st.w, ameRuntimeWorkLine.st.z, ameRuntimeWorkLine.st.y); } } else if (((int)node.flag & 16384) != 0) { float num10 = node.scroll_u * AppMain._am_unit_time; float num11 = node.scroll_v * AppMain._am_unit_time; if (((int)ameRuntimeWorkLine.flag & 8) != 0) { num10 = -num10; } if (((int)ameRuntimeWorkLine.flag & 16) != 0) { num11 = -num11; } ameRuntimeWorkLine.set_st(ameRuntimeWorkLine.st.x + num10, ameRuntimeWorkLine.st.w + num10, ameRuntimeWorkLine.st.z + num11, ameRuntimeWorkLine.st.y + num11); } } } //AppMain.GlobalPool<AppMain.NNS_VECTOR4D>.Release(nnsVectoR4D); return(0); }