// Token: 0x060018E8 RID: 6376 RVA: 0x000E2E04 File Offset: 0x000E1004 private static void aoWinSysMakeCommandA(uint state, AppMain.NNS_TEXLIST texlist, uint tex_id, float x, float y, float w, float h, float z) { AppMain.AMS_PARAM_DRAW_PRIMITIVE ams_PARAM_DRAW_PRIMITIVE = GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc(); ams_PARAM_DRAW_PRIMITIVE.mtx = null; ams_PARAM_DRAW_PRIMITIVE.vtxPCT3D = null; ams_PARAM_DRAW_PRIMITIVE.format3D = 4; ams_PARAM_DRAW_PRIMITIVE.type = 1; ams_PARAM_DRAW_PRIMITIVE.count = 8; ams_PARAM_DRAW_PRIMITIVE.texlist = texlist; ams_PARAM_DRAW_PRIMITIVE.texId = ( int )tex_id; ams_PARAM_DRAW_PRIMITIVE.ablend = 1; ams_PARAM_DRAW_PRIMITIVE.sortZ = z; ams_PARAM_DRAW_PRIMITIVE.aTest = 0; ams_PARAM_DRAW_PRIMITIVE.zMask = 1; ams_PARAM_DRAW_PRIMITIVE.zTest = 0; ams_PARAM_DRAW_PRIMITIVE.noSort = 1; ams_PARAM_DRAW_PRIMITIVE.uwrap = 1; ams_PARAM_DRAW_PRIMITIVE.vwrap = 1; AppMain.NNS_PRIM3D_PCT_ARRAY nns_PRIM3D_PCT_ARRAY = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(8); AppMain.aoWinSysMakeVertex00A(nns_PRIM3D_PCT_ARRAY, x, y, w, h); ams_PARAM_DRAW_PRIMITIVE.vtxPCT3D = nns_PRIM3D_PCT_ARRAY; AppMain.amDrawPrimitive3D(state, ams_PARAM_DRAW_PRIMITIVE); nns_PRIM3D_PCT_ARRAY = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(8); AppMain.aoWinSysMakeVertex01A(nns_PRIM3D_PCT_ARRAY, x, y, w, h); ams_PARAM_DRAW_PRIMITIVE.vtxPCT3D = nns_PRIM3D_PCT_ARRAY; AppMain.amDrawPrimitive3D(state, ams_PARAM_DRAW_PRIMITIVE); nns_PRIM3D_PCT_ARRAY = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(8); AppMain.aoWinSysMakeVertex02A(nns_PRIM3D_PCT_ARRAY, x, y, w, h); ams_PARAM_DRAW_PRIMITIVE.vtxPCT3D = nns_PRIM3D_PCT_ARRAY; AppMain.amDrawPrimitive3D(state, ams_PARAM_DRAW_PRIMITIVE); GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Release(ams_PARAM_DRAW_PRIMITIVE); }
private static void aoWinSysMakeVertex02A( AppMain.NNS_PRIM3D_PCT_ARRAY array, float x, float y, float w, float h) { AppMain.NNS_PRIM3D_PCT[] buffer = array.buffer; int offset = array.offset; buffer[offset].Tex.u = buffer[offset + 1].Tex.u = buffer[offset + 6].Tex.u = buffer[offset + 7].Tex.u = 0.0f; buffer[offset + 2].Tex.u = buffer[offset + 3].Tex.u = buffer[offset + 4].Tex.u = buffer[offset + 5].Tex.u = 1f; buffer[offset].Tex.v = buffer[offset + 2].Tex.v = buffer[offset + 4].Tex.v = buffer[offset + 6].Tex.v = 1f; buffer[offset + 1].Tex.v = buffer[offset + 3].Tex.v = buffer[offset + 5].Tex.v = buffer[offset + 7].Tex.v = 0.0f; buffer[offset].Col = buffer[offset + 1].Col = buffer[offset + 2].Col = buffer[offset + 3].Col = buffer[offset + 4].Col = buffer[offset + 5].Col = buffer[offset + 6].Col = buffer[offset + 7].Col = uint.MaxValue; float num1 = x - w * 0.5f; float num2 = y - h * 0.5f; float num3 = num1 + w; float num4 = num2 + h; buffer[offset].Pos.x = buffer[offset + 1].Pos.x = num1 - 32f; buffer[offset + 2].Pos.x = buffer[offset + 3].Pos.x = num1; buffer[offset + 4].Pos.x = buffer[offset + 5].Pos.x = num3; buffer[offset + 6].Pos.x = buffer[offset + 7].Pos.x = num3 + 32f; buffer[offset].Pos.y = buffer[offset + 2].Pos.y = buffer[offset + 4].Pos.y = buffer[offset + 6].Pos.y = num4; buffer[offset + 1].Pos.y = buffer[offset + 3].Pos.y = buffer[offset + 5].Pos.y = buffer[offset + 7].Pos.y = num4 + 32f; buffer[offset].Pos.z = buffer[offset + 1].Pos.z = buffer[offset + 2].Pos.z = buffer[offset + 3].Pos.z = buffer[offset + 4].Pos.z = buffer[offset + 5].Pos.z = buffer[offset + 6].Pos.z = buffer[offset + 7].Pos.z = -2f; AppMain.AoActDrawCorWide(array, 0, 8U, AppMain.AOE_ACT_CORW.AOD_ACT_CORW_CENTER); }
// Token: 0x060018E7 RID: 6375 RVA: 0x000E2D4C File Offset: 0x000E0F4C private static void aoWinSysDrawPrimitveA(AppMain.NNS_TEXLIST texlist, uint tex_id, float x, float y, float w, float h) { AppMain.NNS_PRIM3D_PCT_ARRAY nns_PRIM3D_PCT_ARRAY = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(8); AppMain.NNS_PRIM3D_PCT[] buffer = nns_PRIM3D_PCT_ARRAY.buffer; int offset = nns_PRIM3D_PCT_ARRAY.offset; AppMain.amDrawPushState(); AppMain.amDrawInitState(); AppMain.nnSetPrimitive3DAlphaFuncGL(519U, 0.5f); AppMain.nnSetPrimitive3DDepthMaskGL(false); AppMain.nnSetPrimitive3DDepthFuncGL(519U); AppMain.nnSetPrimitiveBlend(1); AppMain.amDrawSetFog(0); AppMain.nnSetPrimitiveTexNum(texlist, ( int )tex_id); AppMain.nnSetPrimitiveTexState(0, 0, 1, 1); AppMain.nnBeginDrawPrimitive3D(4, 1, 0, 0); AppMain.aoWinSysMakeVertex00A(nns_PRIM3D_PCT_ARRAY, x, y, w, h); AppMain.nnDrawPrimitive3D(1, nns_PRIM3D_PCT_ARRAY, 8); AppMain.aoWinSysMakeVertex01A(nns_PRIM3D_PCT_ARRAY, x, y, w, h); AppMain.nnDrawPrimitive3D(1, nns_PRIM3D_PCT_ARRAY, 8); AppMain.aoWinSysMakeVertex02A(nns_PRIM3D_PCT_ARRAY, x, y, w, h); AppMain.nnDrawPrimitive3D(1, nns_PRIM3D_PCT_ARRAY, 8); AppMain.nnEndDrawPrimitive3D(); AppMain.amDrawPopState(); }
private static void aoWinSysMakeCommandA( uint state, AppMain.NNS_TEXLIST texlist, uint tex_id, float x, float y, float w, float h, float z) { AppMain.AMS_PARAM_DRAW_PRIMITIVE setParam = AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc(); setParam.mtx = (AppMain.NNS_MATRIX)null; setParam.vtxPCT3D = (AppMain.NNS_PRIM3D_PCT_ARRAY)null; setParam.format3D = 4; setParam.type = 1; setParam.count = 8; setParam.texlist = texlist; setParam.texId = (int)tex_id; setParam.ablend = 1; setParam.sortZ = z; setParam.aTest = (short)0; setParam.zMask = (short)1; setParam.zTest = (short)0; setParam.noSort = (short)1; setParam.uwrap = 1; setParam.vwrap = 1; AppMain.NNS_PRIM3D_PCT_ARRAY array1 = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(8); AppMain.aoWinSysMakeVertex00A(array1, x, y, w, h); setParam.vtxPCT3D = array1; AppMain.amDrawPrimitive3D(state, setParam); AppMain.NNS_PRIM3D_PCT_ARRAY array2 = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(8); AppMain.aoWinSysMakeVertex01A(array2, x, y, w, h); setParam.vtxPCT3D = array2; AppMain.amDrawPrimitive3D(state, setParam); AppMain.NNS_PRIM3D_PCT_ARRAY array3 = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(8); AppMain.aoWinSysMakeVertex02A(array3, x, y, w, h); setParam.vtxPCT3D = array3; AppMain.amDrawPrimitive3D(state, setParam); AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Release(setParam); }
// Token: 0x060018E9 RID: 6377 RVA: 0x000E2EF0 File Offset: 0x000E10F0 private static void aoWinSysMakeVertex00A(AppMain.NNS_PRIM3D_PCT_ARRAY array, float x, float y, float w, float h) { int offset = array.offset; AppMain.NNS_PRIM3D_PCT[] buffer = array.buffer; buffer[offset].Tex.u = (buffer[offset + 1].Tex.u = (buffer[offset + 6].Tex.u = (buffer[offset + 7].Tex.u = 0f))); buffer[offset + 2].Tex.u = (buffer[offset + 3].Tex.u = (buffer[offset + 4].Tex.u = (buffer[offset + 5].Tex.u = 1f))); buffer[offset].Tex.v = (buffer[offset + 2].Tex.v = (buffer[offset + 4].Tex.v = (buffer[offset + 6].Tex.v = 0f))); buffer[offset + 1].Tex.v = (buffer[offset + 3].Tex.v = (buffer[offset + 5].Tex.v = (buffer[offset + 7].Tex.v = 1f))); buffer[offset].Col = (buffer[offset + 1].Col = (buffer[offset + 2].Col = (buffer[offset + 3].Col = (buffer[offset + 4].Col = (buffer[offset + 5].Col = (buffer[offset + 6].Col = (buffer[offset + 7].Col = uint.MaxValue))))))); float num = x - w * 0.5f; float num2 = y - h * 0.5f; float num3 = num + w; buffer[offset].Pos.x = (buffer[offset + 1].Pos.x = num - 32f); buffer[offset + 2].Pos.x = (buffer[offset + 3].Pos.x = num); buffer[offset + 4].Pos.x = (buffer[offset + 5].Pos.x = num3); buffer[offset + 6].Pos.x = (buffer[offset + 7].Pos.x = num3 + 32f); buffer[offset].Pos.y = (buffer[offset + 2].Pos.y = (buffer[offset + 4].Pos.y = (buffer[offset + 6].Pos.y = num2 - 32f))); buffer[offset + 1].Pos.y = (buffer[offset + 3].Pos.y = (buffer[offset + 5].Pos.y = (buffer[offset + 7].Pos.y = num2))); buffer[offset].Pos.z = (buffer[offset + 1].Pos.z = (buffer[offset + 2].Pos.z = (buffer[offset + 3].Pos.z = (buffer[offset + 4].Pos.z = (buffer[offset + 5].Pos.z = (buffer[offset + 6].Pos.z = (buffer[offset + 7].Pos.z = -2f))))))); AppMain.AoActDrawCorWide(array, 0, 8U, AppMain.AOE_ACT_CORW.AOD_ACT_CORW_CENTER); }
public void Assign(AppMain.AMS_PARAM_DRAW_PRIMITIVE other) { this.mtx = other.mtx; this.type = other.type; this.vtxPCT3D = other.vtxPCT3D; this.vtxPC3D = other.vtxPC3D; this.vtxPCT2D = other.vtxPCT2D; this.vtxPC2D = other.vtxPC2D; this.formatXD = other.formatXD; this.count = other.count; this.texlist = other.texlist; this.texId = other.texId; this.ablend = other.ablend; this.sortZ = other.sortZ; this.bldSrc = other.bldSrc; this.bldDst = other.bldDst; this.bldMode = other.bldMode; this.aTest = other.aTest; this.zMask = other.zMask; this.zTest = other.zTest; this.noSort = other.noSort; this.uwrap = other.vwrap; this.vwrap = other.vwrap; }
public void Clear() { this.mtx = (AppMain.NNS_MATRIX)null; this.type = 0; this.vtxPCT3D = (AppMain.NNS_PRIM3D_PCT_ARRAY)null; this.vtxPC3D = (AppMain.NNS_PRIM3D_PC[])null; this.vtxPCT2D = (AppMain.NNS_PRIM2D_PCT[])null; this.vtxPC2D = (AppMain.NNS_PRIM2D_PC[])null; this.formatXD = 0; this.count = 0; this.texlist = (AppMain.NNS_TEXLIST)null; this.texId = 0; this.ablend = 0; this.sortZ = 0.0f; this.bldSrc = 0; this.bldDst = 0; this.bldMode = 0; this.aTest = (short)0; this.zMask = (short)0; this.zTest = (short)0; this.noSort = (short)0; this.uwrap = 0; this.vwrap = 0; }
public static int _amDrawPlane(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; AppMain.AMS_PARAM_DRAW_PRIMITIVE setParam = AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc(); int num1 = AppMain._amEffectSetDrawMode(runtime, setParam, node.blend); AppMain.SNNS_VECTOR4D pDst = new AppMain.SNNS_VECTOR4D(); float zBias = node.z_bias; AppMain.amVectorSet(out pDst, zBias * AppMain._am_ef_worldViewMtx.M20, zBias * AppMain._am_ef_worldViewMtx.M21, zBias * AppMain._am_ef_worldViewMtx.M22); AppMain.SNNS_VECTOR snnsVector = new AppMain.SNNS_VECTOR(); if (((int)node.flag & 4096) != 0) { AppMain.NNS_PRIM3D_PCT_ARRAY nnsPriM3DPctArray = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(6 * (int)runtime.active_num); AppMain.NNS_PRIM3D_PCT[] buffer = nnsPriM3DPctArray.buffer; int offset = nnsPriM3DPctArray.offset; float num2 = 0.0f; 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; AppMain.amMatrixPush(); AppMain.NNS_MATRIX current = AppMain.amMatrixGetCurrent(); float x = runtimeWorkPlane.size.x; float y = runtimeWorkPlane.size.y; AppMain.amVectorAdd(ref snnsVector, runtimeWorkPlane.position, ref pDst); AppMain.NNS_QUATERNION rotate = runtimeWorkPlane.rotate; AppMain.amQuatMultiMatrix(ref rotate, ref snnsVector); runtimeWorkPlane.rotate = rotate; num2 = AppMain.nnDistanceVector(ref snnsVector, AppMain._am_ef_camPos); buffer[offset].Pos.Assign(-x, y, 0.0f); buffer[offset + 1].Pos.Assign(x, y, 0.0f); buffer[offset + 2].Pos.Assign(-x, -y, 0.0f); buffer[offset + 5].Pos.Assign(x, -y, 0.0f); AppMain.nnTransformVector(ref buffer[offset].Pos, current, ref buffer[offset].Pos); AppMain.nnTransformVector(ref buffer[offset + 1].Pos, current, ref buffer[offset + 1].Pos); AppMain.nnTransformVector(ref buffer[offset + 2].Pos, current, ref buffer[offset + 2].Pos); AppMain.nnTransformVector(ref buffer[offset + 5].Pos, current, ref buffer[offset + 5].Pos); buffer[offset + 5].Col = AppMain.AMD_RGBA8888(runtimeWorkPlane.color.r, runtimeWorkPlane.color.g, runtimeWorkPlane.color.b, runtimeWorkPlane.color.a); buffer[offset].Col = buffer[offset + 1].Col = buffer[offset + 2].Col = buffer[offset + 5].Col; buffer[offset].Tex.u = runtimeWorkPlane.st.x; buffer[offset].Tex.v = runtimeWorkPlane.st.y; buffer[offset + 1].Tex.u = runtimeWorkPlane.st.z; buffer[offset + 1].Tex.v = runtimeWorkPlane.st.y; buffer[offset + 2].Tex.u = runtimeWorkPlane.st.x; buffer[offset + 2].Tex.v = runtimeWorkPlane.st.w; buffer[offset + 5].Tex.u = runtimeWorkPlane.st.z; buffer[offset + 5].Tex.v = runtimeWorkPlane.st.w; buffer[offset + 3] = buffer[offset + 1]; buffer[offset + 4] = buffer[offset + 2]; offset += 6; AppMain.amMatrixPop(); } setParam.format3D = 4; setParam.type = 0; setParam.vtxPCT3D = nnsPriM3DPctArray; setParam.texlist = runtime.texlist; setParam.texId = (int)node.texture_id; setParam.count = 6 * (int)runtime.active_num; setParam.ablend = num1; setParam.sortZ = num2; AppMain.amDrawPrimitive3D(runtime.ecb.drawState, setParam); } else { AppMain.NNS_PRIM3D_PC[] nnsPriM3DPcArray1 = AppMain.amDrawAlloc_NNS_PRIM3D_PC(6 * (int)runtime.active_num); int index = 0; AppMain.NNS_PRIM3D_PC[] nnsPriM3DPcArray2 = nnsPriM3DPcArray1; float num2 = 0.0f; 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; AppMain.amMatrixPush(); AppMain.NNS_MATRIX current = AppMain.amMatrixGetCurrent(); float x = runtimeWorkPlane.size.x; float y = runtimeWorkPlane.size.y; AppMain.amVectorAdd(ref snnsVector, runtimeWorkPlane.position, ref pDst); AppMain.NNS_QUATERNION rotate = runtimeWorkPlane.rotate; AppMain.amQuatMultiMatrix(ref rotate, ref snnsVector); runtimeWorkPlane.rotate = rotate; num2 = AppMain.nnDistanceVector(ref snnsVector, AppMain._am_ef_camPos); nnsPriM3DPcArray1[index].Pos.Assign(-x, y, 0.0f); nnsPriM3DPcArray1[index + 1].Pos.Assign(x, y, 0.0f); nnsPriM3DPcArray1[index + 2].Pos.Assign(-x, -y, 0.0f); nnsPriM3DPcArray1[index + 5].Pos.Assign(x, -y, 0.0f); AppMain.nnTransformVector(ref nnsPriM3DPcArray1[index].Pos, current, ref nnsPriM3DPcArray1[index].Pos); AppMain.nnTransformVector(ref nnsPriM3DPcArray1[index + 1].Pos, current, ref nnsPriM3DPcArray1[index + 1].Pos); AppMain.nnTransformVector(ref nnsPriM3DPcArray1[index + 2].Pos, current, ref nnsPriM3DPcArray1[index + 2].Pos); AppMain.nnTransformVector(ref nnsPriM3DPcArray1[index + 5].Pos, current, ref nnsPriM3DPcArray1[index + 5].Pos); nnsPriM3DPcArray1[index + 5].Col = AppMain.AMD_RGBA8888(runtimeWorkPlane.color.r, runtimeWorkPlane.color.g, runtimeWorkPlane.color.b, runtimeWorkPlane.color.a); nnsPriM3DPcArray1[index].Col = nnsPriM3DPcArray1[index + 1].Col = nnsPriM3DPcArray1[index + 2].Col = nnsPriM3DPcArray1[index + 5].Col; nnsPriM3DPcArray1[index + 3] = nnsPriM3DPcArray1[index + 1]; nnsPriM3DPcArray1[index + 4] = nnsPriM3DPcArray1[index + 2]; index += 6; AppMain.amMatrixPop(); } setParam.format3D = 2; setParam.type = 0; setParam.vtxPC3D = nnsPriM3DPcArray2; setParam.texlist = runtime.texlist; setParam.texId = -1; setParam.count = 6 * (int)runtime.active_num; setParam.ablend = num1; setParam.sortZ = num2; AppMain.amDrawPrimitive3D(runtime.ecb.drawState, setParam); } AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Release(setParam); return(0); }
// Token: 0x06001188 RID: 4488 RVA: 0x00099524 File Offset: 0x00097724 private static void gmWaterSurfaceProc(MTS_TASK_TCB tcb) { AppMain.GMS_WATER_SURFACE_INFO gms_WATER_SURFACE_INFO = (AppMain.GMS_WATER_SURFACE_INFO)tcb.work; float speed = 0f; if (AppMain.ObjObjectPauseCheck(0U) == 0U) { float num = (float)(gms_WATER_SURFACE_INFO.water_time - gms_WATER_SURFACE_INFO.water_counter); if (num != 0f) { float num2 = (gms_WATER_SURFACE_INFO.next_water_level - gms_WATER_SURFACE_INFO.now_water_level) / num; gms_WATER_SURFACE_INFO.now_water_level += num2; if (1 > ( ushort )AppMain.MTM_MATH_ABS(gms_WATER_SURFACE_INFO.now_water_level - gms_WATER_SURFACE_INFO.next_water_level)) { gms_WATER_SURFACE_INFO.water_time = 0; gms_WATER_SURFACE_INFO.water_counter = 0; } else { AppMain.GMS_WATER_SURFACE_INFO gms_WATER_SURFACE_INFO2 = gms_WATER_SURFACE_INFO; gms_WATER_SURFACE_INFO2.water_counter += 1; } } else { gms_WATER_SURFACE_INFO.now_water_level = gms_WATER_SURFACE_INFO.next_water_level; } if (!gms_WATER_SURFACE_INFO.flag_draw) { AppMain.gmWaterSurfaceGameSystemSetWaterLevel(ushort.MaxValue); return; } AppMain.gmWaterSurfaceGameSystemSetWaterLevel(( ushort )gms_WATER_SURFACE_INFO.now_water_level); speed = AppMain.amSystemGetFrameRateMain(); } OBS_CAMERA obs_CAMERA = ObjCamera.Get(6); float x = obs_CAMERA.disp_pos.x; float num3 = obs_CAMERA.disp_pos.y; float num4 = -gms_WATER_SURFACE_INFO.now_water_level - num3; if (num4 < ( float )(-( float )(AppMain.OBD_LCD_Y / 2 + 32))) { AppMain.GMS_WATER_SURFACE_MGR gms_WATER_SURFACE_MGR = AppMain.gmWaterSurfaceGetMgr(); if (gms_WATER_SURFACE_MGR != null) { gms_WATER_SURFACE_MGR.render_target = null; } return; } bool flag = false; if (num4 > ( float )AppMain.OBD_LCD_Y * 0.8f) { num3 = obs_CAMERA.disp_pos.y; num4 = ( float )AppMain.OBD_LCD_Y * 0.8f; flag = true; } int roll = obs_CAMERA.roll; float scale = 1f / obs_CAMERA.scale; AppMain.dwaterUpdate(speed, x, num3, num4, roll, scale); if (!AppMain.GmMainIsDrawEnable()) { return; } AppMain.dwaterSetParam(); uint drawflag = 0U; AppMain.ObjDraw3DNNSetCameraEx(6, 1, 9U); if (gms_WATER_SURFACE_INFO.flag_enable_ref && !flag) { AppMain.dwaterDrawReflection(9U, drawflag); } AppMain.ObjDraw3DNNUserFunc(AppMain._gmWaterSurfaceTcbProcPreDrawDT, null, 0, 9U); AppMain.ObjDraw3DNNSetCameraEx(AppMain.g_obj.glb_camera_id, 1, 9U); AppMain.ObjDraw3DNNSetCameraEx(6, 1, 4U); AppMain.AMS_PARAM_DRAW_PRIMITIVE ams_PARAM_DRAW_PRIMITIVE = GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc(); ams_PARAM_DRAW_PRIMITIVE.aTest = 0; ams_PARAM_DRAW_PRIMITIVE.zMask = 1; ams_PARAM_DRAW_PRIMITIVE.zTest = 1; ams_PARAM_DRAW_PRIMITIVE.ablend = 1; ams_PARAM_DRAW_PRIMITIVE.bldSrc = 770; ams_PARAM_DRAW_PRIMITIVE.bldDst = 1; ams_PARAM_DRAW_PRIMITIVE.bldMode = 32774; AppMain.NNS_PRIM3D_PCT_ARRAY nns_PRIM3D_PCT_ARRAY = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(18); AppMain.NNS_PRIM3D_PCT[] buffer = nns_PRIM3D_PCT_ARRAY.buffer; int offset = nns_PRIM3D_PCT_ARRAY.offset; OBS_CAMERA obs_CAMERA2 = ObjCamera.Get(0); x = obs_CAMERA2.disp_pos.x; num3 = -gms_WATER_SURFACE_INFO.now_water_level; float num5 = AppMain.FX_FX32_TO_F32(1310720); float num6 = obs_CAMERA2.znear + 1f; float num7 = 300f; num4 = num3 - (obs_CAMERA2.disp_pos.y - 300f); uint col = AppMain.AMD_RGBA8888(byte.MaxValue, byte.MaxValue, byte.MaxValue, 96); for (int i = 0; i < 3; i++) { float num8 = num6 * (float)(i + 1); int num9 = offset + i * 6; buffer[num9].Pos.Assign(x - num7, num3, num5 - num8); buffer[1 + num9].Pos.Assign(x + num7, num3, num5 - num8); buffer[2 + num9].Pos.Assign(x - num7, num3 - num4, num5 - num8); buffer[5 + num9].Pos.Assign(x + num7, num3 - num4, num5 - num8); buffer[num9].Col = col; buffer[1 + num9].Col = col; buffer[2 + num9].Col = col; buffer[5 + num9].Col = col; float num10; float num11; AppMain.nnSinCos(AppMain.NNM_DEGtoA32(AppMain._dmap_water.speed_surface * 360f), out num10, out num11); float num12 = num7 * 2f / 128f * 0.5f; float num13; float num14; float num15; float v; if (i == 0) { num13 = x / 270f; num13 -= ( float )(( int )num13) - AppMain._dmap_water.speed_surface; num14 = num13 + num12; num15 = 0.3f; v = num15 + num4 / 128f * 0.5f + num11 / 5f; } else if (i == 1) { num14 = x / 270f; num14 -= ( float )(( int )num14) + AppMain._dmap_water.speed_surface * 2f; num13 = num14 - num12 * 0.75f; num15 = 1f; v = num15 - num4 * 0.75f / 128f * 0.5f + num10 / 5f; } else { num13 = 0.171875f; num14 = num13 + 0.0078125f; num15 = 0.5f; v = num15 + 0.0078125f; buffer[num9].Col = AppMain.AMD_RGBA8888(32, 176, 64, 112); buffer[1 + num9].Col = buffer[num9].Col; buffer[2 + num9].Col = buffer[num9].Col; buffer[5 + num9].Col = buffer[num9].Col; } buffer[num9].Tex.u = num13; buffer[num9].Tex.v = num15; buffer[1 + num9].Tex.u = num14; buffer[1 + num9].Tex.v = num15; buffer[2 + num9].Tex.u = num13; buffer[2 + num9].Tex.v = v; buffer[5 + num9].Tex.u = num14; buffer[5 + num9].Tex.v = v; buffer[3 + num9] = buffer[1 + num9]; buffer[4 + num9] = buffer[2 + num9]; } 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.count = 18; ams_PARAM_DRAW_PRIMITIVE.sortZ = -num6; ams_PARAM_DRAW_PRIMITIVE.texId = 0; ams_PARAM_DRAW_PRIMITIVE.texlist = AppMain._dmap_water.tex_color.texlist; ams_PARAM_DRAW_PRIMITIVE.uwrap = 0; ams_PARAM_DRAW_PRIMITIVE.vwrap = 0; AppMain.gmWaterSurfaceMatrixPush(4U); AppMain.ObjDraw3DNNDrawPrimitive(ams_PARAM_DRAW_PRIMITIVE, 4U); AppMain.gmWaterSurfaceMatrixPop(4U); if (!flag) { AppMain.dwaterDrawSurface(4U, drawflag); } AppMain.ObjDraw3DNNSetCameraEx(AppMain.g_obj.glb_camera_id, 1, 4U); AppMain.ObjDraw3DNNUserFunc(AppMain.gmWaterSurfaceTcbProcPostDrawDT, null, 0, 8U); GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Release(ams_PARAM_DRAW_PRIMITIVE); }
// 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); }
public static int _amDrawLine(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; AppMain.AMS_PARAM_DRAW_PRIMITIVE setParam = AppMain.amDrawAlloc_AMS_PARAM_DRAW_PRIMITIVE(); int num1 = AppMain._amEffectSetDrawMode(runtime, setParam, node.blend); AppMain.NNS_VECTOR4D amDrawLineOffset = AppMain._amDrawLine_offset; AppMain.NNS_VECTOR4D amDrawLineEye = AppMain._amDrawLine_eye; float zBias = node.z_bias; AppMain.amVectorSet(amDrawLineOffset, zBias * AppMain._am_ef_worldViewMtx.M20, zBias * AppMain._am_ef_worldViewMtx.M21, zBias * AppMain._am_ef_worldViewMtx.M22); AppMain.amVectorSet(amDrawLineEye, AppMain._am_ef_worldViewMtx.M20, AppMain._am_ef_worldViewMtx.M21, AppMain._am_ef_worldViewMtx.M22); AppMain.NNS_VECTOR4D amDrawLinePos0 = AppMain._amDrawLine_pos0; AppMain.NNS_VECTOR4D amDrawLinePos1 = AppMain._amDrawLine_pos1; AppMain.NNS_VECTOR amDrawLineVel = (AppMain.NNS_VECTOR)AppMain._amDrawLine_vel; AppMain.NNS_VECTOR amDrawLineCross = (AppMain.NNS_VECTOR)AppMain._amDrawLine_cross; if (((int)node.flag & 4096) != 0) { AppMain.NNS_PRIM3D_PCT_ARRAY nnsPriM3DPctArray = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(6 * (int)runtime.active_num); AppMain.NNS_PRIM3D_PCT[] buffer = nnsPriM3DPctArray.buffer; int offset = nnsPriM3DPctArray.offset; float num2 = 0.0f; 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; double num3 = (double)AppMain.amVectorUnit(amDrawLineVel, ameRuntimeWorkLine.velocity); AppMain.nnScaleVector((AppMain.NNS_VECTOR)amDrawLinePos0, amDrawLineVel, ameRuntimeWorkLine.length); AppMain.amVectorAdd(amDrawLinePos1, ameRuntimeWorkLine.position, amDrawLineOffset); AppMain.nnAddVector((AppMain.NNS_VECTOR)amDrawLinePos0, (AppMain.NNS_VECTOR)amDrawLinePos0, (AppMain.NNS_VECTOR)amDrawLinePos1); num2 = AppMain.nnDistanceVector((AppMain.NNS_VECTOR)amDrawLinePos0, AppMain._am_ef_camPos); AppMain.nnCrossProductVector(amDrawLineCross, amDrawLineVel, (AppMain.NNS_VECTOR)amDrawLineEye); AppMain.nnNormalizeVector(amDrawLineCross, amDrawLineCross); AppMain.nnScaleVector(amDrawLineVel, amDrawLineCross, ameRuntimeWorkLine.outside_width); AppMain.nnSubtractVector(ref buffer[offset].Pos, (AppMain.NNS_VECTOR)amDrawLinePos0, amDrawLineVel); AppMain.nnAddVector(ref buffer[offset + 1].Pos, (AppMain.NNS_VECTOR)amDrawLinePos0, amDrawLineVel); AppMain.nnScaleVector(amDrawLineVel, amDrawLineCross, ameRuntimeWorkLine.inside_width); AppMain.nnSubtractVector(ref buffer[offset + 2].Pos, (AppMain.NNS_VECTOR)amDrawLinePos1, amDrawLineVel); AppMain.nnAddVector(ref buffer[offset + 5].Pos, (AppMain.NNS_VECTOR)amDrawLinePos1, amDrawLineVel); buffer[offset + 1].Col = AppMain.AMD_RGBA8888(ameRuntimeWorkLine.outside_color.r, ameRuntimeWorkLine.outside_color.g, ameRuntimeWorkLine.outside_color.b, ameRuntimeWorkLine.outside_color.a); buffer[offset].Col = buffer[offset + 1].Col; buffer[offset + 5].Col = AppMain.AMD_RGBA8888(ameRuntimeWorkLine.inside_color.r, ameRuntimeWorkLine.inside_color.g, ameRuntimeWorkLine.inside_color.b, ameRuntimeWorkLine.inside_color.a); buffer[offset + 2].Col = buffer[offset + 5].Col; AppMain.Vector4D_Quat st = ameRuntimeWorkLine.st; buffer[offset].Tex.u = st.x; buffer[offset].Tex.v = st.y; buffer[offset + 1].Tex.u = st.z; buffer[offset + 1].Tex.v = st.y; buffer[offset + 2].Tex.u = st.x; buffer[offset + 2].Tex.v = st.w; buffer[offset + 5].Tex.u = st.z; buffer[offset + 5].Tex.v = st.w; buffer[offset + 3] = buffer[offset + 1]; buffer[offset + 4] = buffer[offset + 2]; offset += 6; } setParam.format3D = 4; setParam.type = 0; setParam.vtxPCT3D = nnsPriM3DPctArray; setParam.texlist = runtime.texlist; setParam.texId = (int)node.texture_id; setParam.count = 6 * (int)runtime.active_num; setParam.ablend = num1; setParam.sortZ = num2; AppMain.amDrawPrimitive3D(runtime.ecb.drawState, setParam); } else { AppMain.NNS_PRIM3D_PC[] nnsPriM3DPcArray1 = new AppMain.NNS_PRIM3D_PC[6 * (int)runtime.active_num]; int index = 0; AppMain.NNS_PRIM3D_PC[] nnsPriM3DPcArray2 = nnsPriM3DPcArray1; float num2 = 0.0f; 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; double num3 = (double)AppMain.amVectorUnit(amDrawLineVel, ameRuntimeWorkLine.velocity); AppMain.nnScaleVector((AppMain.NNS_VECTOR)amDrawLinePos0, amDrawLineVel, ameRuntimeWorkLine.length); AppMain.amVectorAdd(amDrawLinePos1, ameRuntimeWorkLine.position, amDrawLineOffset); AppMain.nnAddVector((AppMain.NNS_VECTOR)amDrawLinePos0, (AppMain.NNS_VECTOR)amDrawLinePos0, (AppMain.NNS_VECTOR)amDrawLinePos1); num2 = AppMain.nnDistanceVector((AppMain.NNS_VECTOR)amDrawLinePos0, AppMain._am_ef_camPos); AppMain.nnCrossProductVector(amDrawLineCross, amDrawLineVel, (AppMain.NNS_VECTOR)amDrawLineEye); AppMain.nnNormalizeVector(amDrawLineCross, amDrawLineCross); AppMain.nnScaleVector(amDrawLineVel, amDrawLineCross, ameRuntimeWorkLine.outside_width); AppMain.nnSubtractVector(ref nnsPriM3DPcArray1[index].Pos, (AppMain.NNS_VECTOR)amDrawLinePos0, amDrawLineVel); AppMain.nnAddVector(ref nnsPriM3DPcArray1[index + 1].Pos, (AppMain.NNS_VECTOR)amDrawLinePos0, amDrawLineVel); AppMain.nnScaleVector(amDrawLineVel, amDrawLineCross, ameRuntimeWorkLine.inside_width); AppMain.nnSubtractVector(ref nnsPriM3DPcArray1[index + 2].Pos, (AppMain.NNS_VECTOR)amDrawLinePos1, amDrawLineVel); AppMain.nnAddVector(ref nnsPriM3DPcArray1[index + 5].Pos, (AppMain.NNS_VECTOR)amDrawLinePos1, amDrawLineVel); nnsPriM3DPcArray1[index + 1].Col = AppMain.AMD_RGBA8888(ameRuntimeWorkLine.outside_color.r, ameRuntimeWorkLine.outside_color.g, ameRuntimeWorkLine.outside_color.b, ameRuntimeWorkLine.outside_color.a); nnsPriM3DPcArray1[index].Col = nnsPriM3DPcArray1[index + 1].Col; nnsPriM3DPcArray1[index + 5].Col = AppMain.AMD_RGBA8888(ameRuntimeWorkLine.inside_color.r, ameRuntimeWorkLine.inside_color.g, ameRuntimeWorkLine.inside_color.b, ameRuntimeWorkLine.inside_color.a); nnsPriM3DPcArray1[index + 2].Col = nnsPriM3DPcArray1[index + 5].Col; nnsPriM3DPcArray1[index + 3] = nnsPriM3DPcArray1[index + 1]; nnsPriM3DPcArray1[index + 4] = nnsPriM3DPcArray1[index + 2]; index += 6; } setParam.format3D = 2; setParam.type = 0; setParam.vtxPC3D = nnsPriM3DPcArray2; setParam.texlist = runtime.texlist; setParam.texId = -1; setParam.count = 6 * (int)runtime.active_num; setParam.ablend = num1; setParam.sortZ = num2; AppMain.amDrawPrimitive3D(runtime.ecb.drawState, setParam); } return(0); }
// Token: 0x0600052C RID: 1324 RVA: 0x0002B92C File Offset: 0x00029B2C private static void GmTvxExecuteDraw() { AppMain.GMS_TVX_DRAW_WORK[] array = AppMain.gm_tvx_draw_work; if (array == null) { return; } if (array[0].tex == null) { return; } uint num = AppMain.GmMainGetLightColor(); AppMain._AMS_PARAM_DRAW_PRIMITIVE.bldSrc = 770; AppMain._AMS_PARAM_DRAW_PRIMITIVE.bldDst = 771; AppMain._AMS_PARAM_DRAW_PRIMITIVE.bldMode = 32774; AppMain._AMS_PARAM_DRAW_PRIMITIVE.aTest = 1; AppMain._AMS_PARAM_DRAW_PRIMITIVE.zMask = 0; AppMain._AMS_PARAM_DRAW_PRIMITIVE.zTest = 1; AppMain._AMS_PARAM_DRAW_PRIMITIVE.noSort = 1; AppMain._AMS_PARAM_DRAW_PRIMITIVE.format3D = 4; uint num2 = 0U; while ((ulong)num2 < (ulong)((long)AppMain.GMD_TVX_DRAW_WORK_NUM)) { if (array[(int)((UIntPtr)num2)].tex_id == -1) { return; } AppMain._AMS_PARAM_DRAW_PRIMITIVE.ablend = 0; AppMain._AMS_PARAM_DRAW_PRIMITIVE.texlist = array[(int)((UIntPtr)num2)].tex; AppMain._AMS_PARAM_DRAW_PRIMITIVE.uwrap = array[(int)((UIntPtr)num2)].u_wrap; AppMain._AMS_PARAM_DRAW_PRIMITIVE.vwrap = array[(int)((UIntPtr)num2)].v_wrap; AppMain._AMS_PARAM_DRAW_PRIMITIVE.type = 1; AppMain._AMS_PARAM_DRAW_PRIMITIVE.count = (int)(array[(int)((UIntPtr)num2)].all_vtx_num + array[(int)((UIntPtr)num2)].stack_num * 2U - 2U); AppMain.NNS_PRIM3D_PCT_ARRAY nns_PRIM3D_PCT_ARRAY = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(AppMain._AMS_PARAM_DRAW_PRIMITIVE.count); AppMain.NNS_PRIM3D_PCT[] buffer = nns_PRIM3D_PCT_ARRAY.buffer; int offset = nns_PRIM3D_PCT_ARRAY.offset; int num3 = 0; AppMain._AMS_PARAM_DRAW_PRIMITIVE.vtxPCT3D = nns_PRIM3D_PCT_ARRAY; AppMain._AMS_PARAM_DRAW_PRIMITIVE.texId = array[(int)((UIntPtr)num2)].tex_id; SNNS_MATRIX snns_MATRIX = default(SNNS_MATRIX); SNNS_MATRIX snns_MATRIX2 = default(SNNS_MATRIX); AppMain.nnMakeUnitMatrix(ref snns_MATRIX2); for (uint num4 = 0U; num4 < array[(int)((UIntPtr)num2)].stack_num; num4 += 1U) { AppMain.GMS_TVX_DRAW_STACK gms_TVX_DRAW_STACK = array[(int)((UIntPtr)num2)].stack[(int)((UIntPtr)num4)]; if ((gms_TVX_DRAW_STACK.disp_flag & AppMain.GMD_TVX_DISP_BLEND) != 0U) { AppMain._AMS_PARAM_DRAW_PRIMITIVE.ablend = 1; } float num5 = AppMain.FXM_FX32_TO_FLOAT(gms_TVX_DRAW_STACK.pos.x); float num6 = -AppMain.FXM_FX32_TO_FLOAT(gms_TVX_DRAW_STACK.pos.y); float num7 = AppMain.FXM_FX32_TO_FLOAT(gms_TVX_DRAW_STACK.pos.z); AppMain.nnMakeUnitMatrix(ref snns_MATRIX); if ((gms_TVX_DRAW_STACK.disp_flag & AppMain.GMD_TVX_DISP_ROTATE) != 0U) { AppMain.nnRotateZMatrix(ref snns_MATRIX, ref snns_MATRIX, (int)((ushort)gms_TVX_DRAW_STACK.rotate_z)); } if ((gms_TVX_DRAW_STACK.disp_flag & AppMain.GMD_TVX_DISP_SCALE) != 0U) { AppMain.nnScaleMatrix(ref snns_MATRIX, ref snns_MATRIX, AppMain.FXM_FX32_TO_FLOAT(gms_TVX_DRAW_STACK.scale.x), AppMain.FXM_FX32_TO_FLOAT(gms_TVX_DRAW_STACK.scale.y), AppMain.FXM_FX32_TO_FLOAT(gms_TVX_DRAW_STACK.scale.z)); } uint num8 = num; if ((gms_TVX_DRAW_STACK.disp_flag & AppMain.GMD_TVX_DISP_LIGHT_DISABLE) != 0U) { num8 = gms_TVX_DRAW_STACK.color; } SNNS_VECTOR snns_VECTOR = default(SNNS_VECTOR); int num9 = num3 + offset; AppMain.AOS_TVX_VERTEX[] vtx = gms_TVX_DRAW_STACK.vtx; int num10 = 0; while ((long)num10 < (long)((ulong)gms_TVX_DRAW_STACK.vtx_num)) { snns_VECTOR.x = vtx[num10].x; snns_VECTOR.y = vtx[num10].y; snns_VECTOR.z = vtx[num10].z; int num11 = num9 + num10; if (gms_TVX_DRAW_STACK.disp_flag != 0U) { AppMain.nnTransformVector(ref buffer[num11].Pos, ref snns_MATRIX, ref snns_VECTOR); } else { buffer[num11].Pos.Assign(snns_VECTOR.x, snns_VECTOR.y, snns_VECTOR.z); } AppMain.NNS_PRIM3D_PCT[] array2 = buffer; int num12 = num11; array2[num12].Pos.x = array2[num12].Pos.x + num5; AppMain.NNS_PRIM3D_PCT[] array3 = buffer; int num13 = num11; array3[num13].Pos.y = array3[num13].Pos.y + num6; AppMain.NNS_PRIM3D_PCT[] array4 = buffer; int num14 = num11; array4[num14].Pos.z = array4[num14].Pos.z + num7; buffer[num11].Tex.u = vtx[num10].u + gms_TVX_DRAW_STACK.coord.u; buffer[num11].Tex.v = vtx[num10].v + gms_TVX_DRAW_STACK.coord.v; buffer[num11].Col = (vtx[num10].c & num8); num10++; } num3 += (int)(gms_TVX_DRAW_STACK.vtx_num + 2U); if (num4 != 0U) { int num15 = num9 - 1; buffer[num15] = buffer[num15 + 1]; } if (num4 != array[(int)((UIntPtr)num2)].stack_num - 1U) { int num15 = num9 + (int)(gms_TVX_DRAW_STACK.vtx_num - 1U); buffer[num15 + 1] = buffer[num15]; } } AppMain.amMatrixPush(ref snns_MATRIX2); AppMain.ObjDraw3DNNDrawPrimitive(AppMain._AMS_PARAM_DRAW_PRIMITIVE); AppMain.amMatrixPop(); array[(int)((UIntPtr)num2)].tex = null; array[(int)((UIntPtr)num2)].tex_id = -1; array[(int)((UIntPtr)num2)].stack_num = 0U; array[(int)((UIntPtr)num2)].all_vtx_num = 0U; num2 += 1U; } }
// Token: 0x060004F4 RID: 1268 RVA: 0x0002A6CC File Offset: 0x000288CC public static void GmDecoGlareDraw(OBS_OBJECT_WORK obj_work) { int user_work = (int)obj_work.user_work; if (user_work < 14) { return; } int num = user_work; AppMain.GMS_DECOGLARE_PARAM gms_DECOGLARE_PARAM; switch (num) { case 14: break; case 15: gms_DECOGLARE_PARAM = AppMain._gm_decoGlare_param[1]; goto IL_65; case 16: goto IL_53; default: if (num == 54) { gms_DECOGLARE_PARAM = AppMain._gm_decoGlare_param[3]; goto IL_65; } switch (num) { case 109: break; case 110: goto IL_53; default: return; } break; } gms_DECOGLARE_PARAM = AppMain._gm_decoGlare_param[0]; goto IL_65; IL_53: gms_DECOGLARE_PARAM = AppMain._gm_decoGlare_param[2]; IL_65: if (!AppMain.amDrawIsRegistComplete(AppMain.pIF.regId)) { return; } if (AppMain.pIF.drawFlag != 1) { return; } if ((obj_work.disp_flag & 32U) != 0U) { return; } AppMain.VecFx32 vecFx = new AppMain.VecFx32(obj_work.pos); float num2 = (float)(vecFx.x >> 12); float num3 = -(float)(vecFx.y >> 12); float z = 256f; AppMain.AMS_PARAM_DRAW_PRIMITIVE ams_PARAM_DRAW_PRIMITIVE = GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc(); ams_PARAM_DRAW_PRIMITIVE.aTest = 0; ams_PARAM_DRAW_PRIMITIVE.zMask = 0; ams_PARAM_DRAW_PRIMITIVE.zTest = 1; ams_PARAM_DRAW_PRIMITIVE.ablend = 1; switch (gms_DECOGLARE_PARAM.ablend) { case 0: AppMain.amDrawGetPrimBlendParam(0, ams_PARAM_DRAW_PRIMITIVE); break; case 1: AppMain.amDrawGetPrimBlendParam(1, ams_PARAM_DRAW_PRIMITIVE); break; } 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 num4 = gms_DECOGLARE_PARAM.size * 0.5f; float num5 = gms_DECOGLARE_PARAM.size * 0.5f; num2 += 10f; num3 -= 10f; buffer[offset].Pos.Assign(num2 - num4, num3 + num5, z); buffer[offset + 1].Pos.Assign(num2 + num4, num3 + num5, z); buffer[offset + 2].Pos.Assign(num2 - num4, num3 - num5, z); buffer[offset + 5].Pos.Assign(num2 + num4, num3 - num5, z); buffer[offset].Col = gms_DECOGLARE_PARAM.color; buffer[offset + 1].Col = gms_DECOGLARE_PARAM.color; buffer[offset + 2].Col = gms_DECOGLARE_PARAM.color; buffer[offset + 5].Col = gms_DECOGLARE_PARAM.color; 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 = AppMain.pIF.texlist; ams_PARAM_DRAW_PRIMITIVE.texId = AppMain.pIF.texId; ams_PARAM_DRAW_PRIMITIVE.count = 6; ams_PARAM_DRAW_PRIMITIVE.sortZ = gms_DECOGLARE_PARAM.sort_z; AppMain.amDrawPrimitive3D(4U, ams_PARAM_DRAW_PRIMITIVE); GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Release(ams_PARAM_DRAW_PRIMITIVE); }
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); }
private static void GmTvxExecuteDraw() { AppMain.GMS_TVX_DRAW_WORK[] gmTvxDrawWork = AppMain.gm_tvx_draw_work; if (gmTvxDrawWork == null || gmTvxDrawWork[0].tex == null) { return; } uint lightColor = AppMain.GmMainGetLightColor(); AppMain._AMS_PARAM_DRAW_PRIMITIVE.bldSrc = 770; AppMain._AMS_PARAM_DRAW_PRIMITIVE.bldDst = 771; AppMain._AMS_PARAM_DRAW_PRIMITIVE.bldMode = 32774; AppMain._AMS_PARAM_DRAW_PRIMITIVE.aTest = (short)1; AppMain._AMS_PARAM_DRAW_PRIMITIVE.zMask = (short)0; AppMain._AMS_PARAM_DRAW_PRIMITIVE.zTest = (short)1; AppMain._AMS_PARAM_DRAW_PRIMITIVE.noSort = (short)1; AppMain._AMS_PARAM_DRAW_PRIMITIVE.format3D = 4; for (uint index1 = 0; (long)index1 < (long)AppMain.GMD_TVX_DRAW_WORK_NUM && gmTvxDrawWork[(int)index1].tex_id != -1; ++index1) { AppMain._AMS_PARAM_DRAW_PRIMITIVE.ablend = 0; AppMain._AMS_PARAM_DRAW_PRIMITIVE.texlist = gmTvxDrawWork[(int)index1].tex; AppMain._AMS_PARAM_DRAW_PRIMITIVE.uwrap = gmTvxDrawWork[(int)index1].u_wrap; AppMain._AMS_PARAM_DRAW_PRIMITIVE.vwrap = gmTvxDrawWork[(int)index1].v_wrap; AppMain._AMS_PARAM_DRAW_PRIMITIVE.type = 1; AppMain._AMS_PARAM_DRAW_PRIMITIVE.count = (int)gmTvxDrawWork[(int)index1].all_vtx_num + (int)gmTvxDrawWork[(int)index1].stack_num * 2 - 2; AppMain.NNS_PRIM3D_PCT_ARRAY nnsPriM3DPctArray = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(AppMain._AMS_PARAM_DRAW_PRIMITIVE.count); AppMain.NNS_PRIM3D_PCT[] buffer = nnsPriM3DPctArray.buffer; int offset = nnsPriM3DPctArray.offset; int num1 = 0; AppMain._AMS_PARAM_DRAW_PRIMITIVE.vtxPCT3D = nnsPriM3DPctArray; AppMain._AMS_PARAM_DRAW_PRIMITIVE.texId = gmTvxDrawWork[(int)index1].tex_id; AppMain.SNNS_MATRIX snnsMatrix1 = new AppMain.SNNS_MATRIX(); AppMain.SNNS_MATRIX snnsMatrix2 = new AppMain.SNNS_MATRIX(); AppMain.nnMakeUnitMatrix(ref snnsMatrix2); for (uint index2 = 0; index2 < gmTvxDrawWork[(int)index1].stack_num; ++index2) { AppMain.GMS_TVX_DRAW_STACK gmsTvxDrawStack = gmTvxDrawWork[(int)index1].stack[(int)index2]; if (((int)gmsTvxDrawStack.disp_flag & (int)AppMain.GMD_TVX_DISP_BLEND) != 0) { AppMain._AMS_PARAM_DRAW_PRIMITIVE.ablend = 1; } float num2 = AppMain.FXM_FX32_TO_FLOAT(gmsTvxDrawStack.pos.x); float num3 = -AppMain.FXM_FX32_TO_FLOAT(gmsTvxDrawStack.pos.y); float num4 = AppMain.FXM_FX32_TO_FLOAT(gmsTvxDrawStack.pos.z); AppMain.nnMakeUnitMatrix(ref snnsMatrix1); if (((int)gmsTvxDrawStack.disp_flag & (int)AppMain.GMD_TVX_DISP_ROTATE) != 0) { AppMain.nnRotateZMatrix(ref snnsMatrix1, ref snnsMatrix1, (int)(ushort)gmsTvxDrawStack.rotate_z); } if (((int)gmsTvxDrawStack.disp_flag & (int)AppMain.GMD_TVX_DISP_SCALE) != 0) { AppMain.nnScaleMatrix(ref snnsMatrix1, ref snnsMatrix1, AppMain.FXM_FX32_TO_FLOAT(gmsTvxDrawStack.scale.x), AppMain.FXM_FX32_TO_FLOAT(gmsTvxDrawStack.scale.y), AppMain.FXM_FX32_TO_FLOAT(gmsTvxDrawStack.scale.z)); } uint num5 = lightColor; if (((int)gmsTvxDrawStack.disp_flag & (int)AppMain.GMD_TVX_DISP_LIGHT_DISABLE) != 0) { num5 = gmsTvxDrawStack.color; } AppMain.SNNS_VECTOR src = new AppMain.SNNS_VECTOR(); int num6 = num1 + offset; AppMain.AOS_TVX_VERTEX[] vtx = gmsTvxDrawStack.vtx; for (int index3 = 0; (long)index3 < (long)gmsTvxDrawStack.vtx_num; ++index3) { src.x = vtx[index3].x; src.y = vtx[index3].y; src.z = vtx[index3].z; int index4 = num6 + index3; if (gmsTvxDrawStack.disp_flag != 0U) { AppMain.nnTransformVector(ref buffer[index4].Pos, ref snnsMatrix1, ref src); } else { buffer[index4].Pos.Assign(src.x, src.y, src.z); } buffer[index4].Pos.x += num2; buffer[index4].Pos.y += num3; buffer[index4].Pos.z += num4; buffer[index4].Tex.u = vtx[index3].u + gmsTvxDrawStack.coord.u; buffer[index4].Tex.v = vtx[index3].v + gmsTvxDrawStack.coord.v; buffer[index4].Col = vtx[index3].c & num5; } num1 += (int)gmsTvxDrawStack.vtx_num + 2; if (index2 != 0U) { int index3 = num6 - 1; buffer[index3] = buffer[index3 + 1]; } if ((int)index2 != (int)gmTvxDrawWork[(int)index1].stack_num - 1) { int index3 = num6 + ((int)gmsTvxDrawStack.vtx_num - 1); buffer[index3 + 1] = buffer[index3]; } } AppMain.amMatrixPush(ref snnsMatrix2); AppMain.ObjDraw3DNNDrawPrimitive(AppMain._AMS_PARAM_DRAW_PRIMITIVE); AppMain.amMatrixPop(); gmTvxDrawWork[(int)index1].tex = (AppMain.NNS_TEXLIST)null; gmTvxDrawWork[(int)index1].tex_id = -1; gmTvxDrawWork[(int)index1].stack_num = 0U; gmTvxDrawWork[(int)index1].all_vtx_num = 0U; } }
public static void GmDecoGlareDraw(AppMain.OBS_OBJECT_WORK obj_work) { int userWork = (int)obj_work.user_work; if (userWork < 14) { return; } AppMain.GMS_DECOGLARE_PARAM gmsDecoglareParam; switch (userWork) { case 14: case 109: gmsDecoglareParam = AppMain._gm_decoGlare_param[0]; break; case 15: gmsDecoglareParam = AppMain._gm_decoGlare_param[1]; break; case 16: case 110: gmsDecoglareParam = AppMain._gm_decoGlare_param[2]; break; case 54: gmsDecoglareParam = AppMain._gm_decoGlare_param[3]; break; default: return; } if (!AppMain.amDrawIsRegistComplete(AppMain.pIF.regId) || AppMain.pIF.drawFlag != 1 || ((int)obj_work.disp_flag & 32) != 0) { return; } AppMain.VecFx32 vecFx32 = new AppMain.VecFx32(obj_work.pos); float num1 = (float)(vecFx32.x >> 12); float num2 = -(float)(vecFx32.y >> 12); float Z = 256f; AppMain.AMS_PARAM_DRAW_PRIMITIVE setParam = AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc(); setParam.aTest = (short)0; setParam.zMask = (short)0; setParam.zTest = (short)1; setParam.ablend = 1; switch (gmsDecoglareParam.ablend) { case 0: AppMain.amDrawGetPrimBlendParam(0, setParam); break; case 1: AppMain.amDrawGetPrimBlendParam(1, setParam); break; } 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 = gmsDecoglareParam.size * 0.5f; float num4 = gmsDecoglareParam.size * 0.5f; float num5 = num1 + 10f; float num6 = num2 - 10f; buffer[offset].Pos.Assign(num5 - num3, num6 + num4, Z); buffer[offset + 1].Pos.Assign(num5 + num3, num6 + num4, Z); buffer[offset + 2].Pos.Assign(num5 - num3, num6 - num4, Z); buffer[offset + 5].Pos.Assign(num5 + num3, num6 - num4, Z); buffer[offset].Col = gmsDecoglareParam.color; buffer[offset + 1].Col = gmsDecoglareParam.color; buffer[offset + 2].Col = gmsDecoglareParam.color; buffer[offset + 5].Col = gmsDecoglareParam.color; 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 = AppMain.pIF.texlist; setParam.texId = AppMain.pIF.texId; setParam.count = 6; setParam.sortZ = gmsDecoglareParam.sort_z; AppMain.amDrawPrimitive3D(4U, setParam); AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Release(setParam); }
public static int _amDrawSprite(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; AppMain.AMS_PARAM_DRAW_PRIMITIVE setParam = AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc(); int num1 = AppMain._amEffectSetDrawMode(runtime, setParam, node.blend); AppMain.SNNS_VECTOR snnsVector1 = new AppMain.SNNS_VECTOR(); AppMain.SNNS_VECTOR snnsVector2 = new AppMain.SNNS_VECTOR(); AppMain.SNNS_VECTOR snnsVector3 = new AppMain.SNNS_VECTOR(); float zBias = node.z_bias; AppMain.amVectorSet(ref snnsVector1, zBias * AppMain._am_ef_worldViewMtx.M20, zBias * AppMain._am_ef_worldViewMtx.M21, zBias * AppMain._am_ef_worldViewMtx.M22); AppMain.amVectorSet(ref snnsVector2, AppMain._am_ef_worldViewMtx.M10, AppMain._am_ef_worldViewMtx.M11, AppMain._am_ef_worldViewMtx.M12); AppMain.amVectorSet(ref snnsVector3, AppMain._am_ef_worldViewMtx.M00, AppMain._am_ef_worldViewMtx.M01, AppMain._am_ef_worldViewMtx.M02); AppMain.SNNS_VECTOR snnsVector4 = new AppMain.SNNS_VECTOR(); AppMain.SNNS_VECTOR snnsVector5 = new AppMain.SNNS_VECTOR(); AppMain.SNNS_VECTOR snnsVector6 = new AppMain.SNNS_VECTOR(); if (((int)node.flag & 4096) != 0) { AppMain.NNS_PRIM3D_PCT_ARRAY nnsPriM3DPctArray = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(6 * (int)runtime.active_num); AppMain.NNS_PRIM3D_PCT[] buffer = nnsPriM3DPctArray.buffer; int offset = nnsPriM3DPctArray.offset; float num2 = 0.0f; for (; next != activeTail; next = next.next) { AppMain.AMS_AME_RUNTIME_WORK_SPRITE runtimeWorkSprite = (AppMain.AMS_AME_RUNTIME_WORK_SPRITE)(AppMain.AMS_AME_RUNTIME_WORK) next; float pSn; float pCs; AppMain.amSinCos(runtimeWorkSprite.twist, out pSn, out pCs); AppMain.amVectorGetAverage(ref snnsVector5, ref snnsVector3, ref snnsVector2, pCs, -pSn); AppMain.amVectorGetAverage(ref snnsVector6, ref snnsVector3, ref snnsVector2, pSn, pCs); AppMain.nnScaleVector(ref snnsVector5, ref snnsVector5, runtimeWorkSprite.size.x); AppMain.nnScaleVector(ref snnsVector6, ref snnsVector6, runtimeWorkSprite.size.y); AppMain.amVectorAdd(ref snnsVector4, runtimeWorkSprite.position, ref snnsVector1); num2 = AppMain.nnDistanceVector(ref snnsVector4, AppMain._am_ef_camPos); AppMain.nnSubtractVector(ref buffer[offset].Pos, ref snnsVector4, ref snnsVector5); AppMain.nnAddVector(ref buffer[offset].Pos, ref buffer[offset].Pos, ref snnsVector6); AppMain.nnAddVector(ref buffer[offset + 1].Pos, ref snnsVector4, ref snnsVector5); AppMain.nnAddVector(ref buffer[offset + 1].Pos, ref buffer[offset + 1].Pos, ref snnsVector6); AppMain.nnSubtractVector(ref buffer[offset + 2].Pos, ref snnsVector4, ref snnsVector5); AppMain.nnSubtractVector(ref buffer[offset + 2].Pos, ref buffer[offset + 2].Pos, ref snnsVector6); AppMain.nnAddVector(ref buffer[offset + 5].Pos, ref snnsVector4, ref snnsVector5); AppMain.nnSubtractVector(ref buffer[offset + 5].Pos, ref buffer[offset + 5].Pos, ref snnsVector6); buffer[offset + 5].Col = AppMain.AMD_RGBA8888(runtimeWorkSprite.color.r, runtimeWorkSprite.color.g, runtimeWorkSprite.color.b, runtimeWorkSprite.color.a); buffer[offset].Col = buffer[offset + 1].Col = buffer[offset + 2].Col = buffer[offset + 5].Col; buffer[offset].Tex.u = runtimeWorkSprite.st.x; buffer[offset].Tex.v = runtimeWorkSprite.st.y; buffer[offset + 1].Tex.u = runtimeWorkSprite.st.z; buffer[offset + 1].Tex.v = runtimeWorkSprite.st.y; buffer[offset + 2].Tex.u = runtimeWorkSprite.st.x; buffer[offset + 2].Tex.v = runtimeWorkSprite.st.w; buffer[offset + 5].Tex.u = runtimeWorkSprite.st.z; buffer[offset + 5].Tex.v = runtimeWorkSprite.st.w; buffer[offset + 3] = buffer[offset + 1]; buffer[offset + 4] = buffer[offset + 2]; offset += 6; } setParam.format3D = 4; setParam.type = 0; setParam.vtxPCT3D = nnsPriM3DPctArray; setParam.texlist = runtime.texlist; setParam.texId = (int)node.texture_id; setParam.count = 6 * (int)runtime.active_num; setParam.ablend = num1; setParam.sortZ = num2; AppMain.amDrawPrimitive3D(runtime.ecb.drawState, setParam); } else { AppMain.NNS_PRIM3D_PC[] nnsPriM3DPcArray1 = AppMain.amDrawAlloc_NNS_PRIM3D_PC(6 * (int)runtime.active_num); int index = 0; AppMain.NNS_PRIM3D_PC[] nnsPriM3DPcArray2 = nnsPriM3DPcArray1; float num2 = 0.0f; for (; next != activeTail; next = next.next) { AppMain.AMS_AME_RUNTIME_WORK_SPRITE runtimeWorkSprite = (AppMain.AMS_AME_RUNTIME_WORK_SPRITE)(AppMain.AMS_AME_RUNTIME_WORK) next; float pSn; float pCs; AppMain.amSinCos(runtimeWorkSprite.twist, out pSn, out pCs); AppMain.amVectorGetAverage(ref snnsVector5, ref snnsVector3, ref snnsVector2, pCs, -pSn); AppMain.amVectorGetAverage(ref snnsVector6, ref snnsVector3, ref snnsVector2, pSn, pCs); AppMain.nnScaleVector(ref snnsVector5, ref snnsVector5, runtimeWorkSprite.size.x); AppMain.nnScaleVector(ref snnsVector6, ref snnsVector6, runtimeWorkSprite.size.y); AppMain.amVectorAdd(ref snnsVector4, runtimeWorkSprite.position, ref snnsVector1); num2 = AppMain.nnDistanceVector(ref snnsVector4, AppMain._am_ef_camPos); AppMain.nnSubtractVector(ref nnsPriM3DPcArray1[index].Pos, ref snnsVector4, ref snnsVector5); AppMain.nnAddVector(ref nnsPriM3DPcArray1[index].Pos, ref nnsPriM3DPcArray1[index].Pos, ref snnsVector6); AppMain.nnAddVector(ref nnsPriM3DPcArray1[index + 1].Pos, ref snnsVector4, ref snnsVector5); AppMain.nnAddVector(ref nnsPriM3DPcArray1[index + 1].Pos, ref nnsPriM3DPcArray1[index + 1].Pos, ref snnsVector6); AppMain.nnSubtractVector(ref nnsPriM3DPcArray1[index + 2].Pos, ref snnsVector4, ref snnsVector5); AppMain.nnSubtractVector(ref nnsPriM3DPcArray1[index + 2].Pos, ref nnsPriM3DPcArray1[index + 2].Pos, ref snnsVector6); AppMain.nnAddVector(ref nnsPriM3DPcArray1[index + 5].Pos, ref snnsVector4, ref snnsVector5); AppMain.nnSubtractVector(ref nnsPriM3DPcArray1[index + 5].Pos, ref nnsPriM3DPcArray1[index + 5].Pos, ref snnsVector6); nnsPriM3DPcArray1[index + 5].Col = AppMain.AMD_RGBA8888(runtimeWorkSprite.color.r, runtimeWorkSprite.color.g, runtimeWorkSprite.color.b, runtimeWorkSprite.color.a); nnsPriM3DPcArray1[index].Col = nnsPriM3DPcArray1[index + 1].Col = nnsPriM3DPcArray1[index + 2].Col = nnsPriM3DPcArray1[index + 5].Col; nnsPriM3DPcArray1[index + 3] = nnsPriM3DPcArray1[index + 1]; nnsPriM3DPcArray1[index + 4] = nnsPriM3DPcArray1[index + 2]; index += 6; } setParam.format3D = 2; setParam.type = 0; setParam.vtxPC3D = nnsPriM3DPcArray2; setParam.texlist = runtime.texlist; setParam.texId = -1; setParam.count = 6 * (int)runtime.active_num; setParam.ablend = num1; setParam.sortZ = num2; AppMain.amDrawPrimitive3D(runtime.ecb.drawState, setParam); } AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Release(setParam); return(0); }
private static void gmWaterSurfaceProc(AppMain.MTS_TASK_TCB tcb) { AppMain.GMS_WATER_SURFACE_INFO work = (AppMain.GMS_WATER_SURFACE_INFO)tcb.work; float speed = 0.0f; if (AppMain.ObjObjectPauseCheck(0U) == 0U) { float num1 = (float)((int)work.water_time - (int)work.water_counter); if ((double)num1 != 0.0) { float num2 = (work.next_water_level - work.now_water_level) / num1; work.now_water_level += num2; if ((ushort)1 > (ushort)AppMain.MTM_MATH_ABS(work.now_water_level - work.next_water_level)) { work.water_time = (ushort)0; work.water_counter = (ushort)0; } else { ++work.water_counter; } } else { work.now_water_level = work.next_water_level; } if (work.flag_draw) { AppMain.gmWaterSurfaceGameSystemSetWaterLevel((ushort)work.now_water_level); speed = AppMain.amSystemGetFrameRateMain(); } else { AppMain.gmWaterSurfaceGameSystemSetWaterLevel(ushort.MaxValue); return; } } AppMain.OBS_CAMERA obsCamera1 = AppMain.ObjCameraGet(6); float x1 = obsCamera1.disp_pos.x; float y = obsCamera1.disp_pos.y; float dy = -work.now_water_level - y; if ((double)dy < (double)-((int)AppMain.OBD_LCD_Y / 2 + 32)) { AppMain.GMS_WATER_SURFACE_MGR mgr = AppMain.gmWaterSurfaceGetMgr(); if (mgr == null) { return; } mgr.render_target = (AppMain.AMS_RENDER_TARGET)null; } else { bool flag = false; if ((double)dy > (double)AppMain.OBD_LCD_Y * 0.800000011920929) { y = obsCamera1.disp_pos.y; dy = (float)AppMain.OBD_LCD_Y * 0.8f; flag = true; } int roll = obsCamera1.roll; float scale = 1f / obsCamera1.scale; AppMain.dwaterUpdate(speed, x1, y, dy, roll, scale); if (!AppMain.GmMainIsDrawEnable()) { return; } AppMain.dwaterSetParam(); uint drawflag = 0; AppMain.ObjDraw3DNNSetCameraEx(6, 1, 9U); if (work.flag_enable_ref && !flag) { AppMain.dwaterDrawReflection(9U, drawflag); } AppMain.ObjDraw3DNNUserFunc(AppMain._gmWaterSurfaceTcbProcPreDrawDT, (object)null, 0, 9U); AppMain.ObjDraw3DNNSetCameraEx(AppMain.g_obj.glb_camera_id, 1, 9U); AppMain.ObjDraw3DNNSetCameraEx(6, 1, 4U); AppMain.AMS_PARAM_DRAW_PRIMITIVE prim = AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc(); prim.aTest = (short)0; prim.zMask = (short)1; prim.zTest = (short)1; prim.ablend = 1; prim.bldSrc = 770; prim.bldDst = 1; prim.bldMode = 32774; AppMain.NNS_PRIM3D_PCT_ARRAY nnsPriM3DPctArray = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(18); AppMain.NNS_PRIM3D_PCT[] buffer = nnsPriM3DPctArray.buffer; int offset = nnsPriM3DPctArray.offset; AppMain.OBS_CAMERA obsCamera2 = AppMain.ObjCameraGet(0); float x2 = obsCamera2.disp_pos.x; float Y = -work.now_water_level; float f32 = AppMain.FX_FX32_TO_F32(1310720); float num1 = obsCamera2.znear + 1f; float num2 = 300f; float num3 = Y - (obsCamera2.disp_pos.y - 300f); uint num4 = AppMain.AMD_RGBA8888(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)96); for (int index1 = 0; index1 < 3; ++index1) { float num5 = num1 * (float)(index1 + 1); int index2 = offset + index1 * 6; buffer[index2].Pos.Assign(x2 - num2, Y, f32 - num5); buffer[1 + index2].Pos.Assign(x2 + num2, Y, f32 - num5); buffer[2 + index2].Pos.Assign(x2 - num2, Y - num3, f32 - num5); buffer[5 + index2].Pos.Assign(x2 + num2, Y - num3, f32 - num5); buffer[index2].Col = num4; buffer[1 + index2].Col = num4; buffer[2 + index2].Col = num4; buffer[5 + index2].Col = num4; float s; float c; AppMain.nnSinCos(AppMain.NNM_DEGtoA32(AppMain._dmap_water.speed_surface * 360f), out s, out c); float num6 = (float)((double)num2 * 2.0 / 128.0 * 0.5); float num7; float num8; float num9; float num10; if (index1 == 0) { float num11 = x2 / 270f; num7 = num11 - ((float)(int)num11 - AppMain._dmap_water.speed_surface); num8 = num7 + num6; num9 = 0.3f; num10 = (float)((double)num9 + (double)num3 / 128.0 * 0.5 + (double)c / 5.0); } else if (index1 == 1) { float num11 = x2 / 270f; num8 = num11 - ((float)(int)num11 + AppMain._dmap_water.speed_surface * 2f); num7 = num8 - num6 * 0.75f; num9 = 1f; num10 = (float)((double)num9 - (double)num3 * 0.75 / 128.0 * 0.5 + (double)s / 5.0); } else { num7 = 11f / 64f; num8 = num7 + 1f / 128f; num9 = 0.5f; num10 = num9 + 1f / 128f; buffer[index2].Col = AppMain.AMD_RGBA8888((byte)32, (byte)176, (byte)64, (byte)112); buffer[1 + index2].Col = buffer[index2].Col; buffer[2 + index2].Col = buffer[index2].Col; buffer[5 + index2].Col = buffer[index2].Col; } buffer[index2].Tex.u = num7; buffer[index2].Tex.v = num9; buffer[1 + index2].Tex.u = num8; buffer[1 + index2].Tex.v = num9; buffer[2 + index2].Tex.u = num7; buffer[2 + index2].Tex.v = num10; buffer[5 + index2].Tex.u = num8; buffer[5 + index2].Tex.v = num10; buffer[3 + index2] = buffer[1 + index2]; buffer[4 + index2] = buffer[2 + index2]; } prim.format3D = 4; prim.type = 0; prim.vtxPCT3D = nnsPriM3DPctArray; prim.count = 18; prim.sortZ = -num1; prim.texId = 0; prim.texlist = AppMain._dmap_water.tex_color.texlist; prim.uwrap = 0; prim.vwrap = 0; AppMain.gmWaterSurfaceMatrixPush(4U); AppMain.ObjDraw3DNNDrawPrimitive(prim, 4U); AppMain.gmWaterSurfaceMatrixPop(4U); if (!flag) { AppMain.dwaterDrawSurface(4U, drawflag); } AppMain.ObjDraw3DNNSetCameraEx(AppMain.g_obj.glb_camera_id, 1, 4U); AppMain.ObjDraw3DNNUserFunc(new AppMain.OBF_DRAW_USER_DT_FUNC(AppMain.gmWaterSurfaceTcbProcPostDrawDT), (object)null, 0, 8U); AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Release(prim); } }
private static void nnDrawPrimitive3DCore(uint mode, object vtx, int count) { switch (AppMain.nndrawprim3d.nnsFormat) { case 0: AppMain.mppOpenGLFeatureNotImplAssert(); break; case 1: AppMain.mppOpenGLFeatureNotImplAssert(); break; case 2: AppMain.NNS_PRIM3D_PC[] data = (AppMain.NNS_PRIM3D_PC[])vtx; int count1 = 0; AppMain.RGBA_U8[] cbuf = AppMain._nnDrawPrimitive3DCore.cbuf; AppMain._nnDrawPrimitive3DCore.colorData.Init(cbuf, 0); OpenGL.glColorPointer(4, 5121U, 0, (OpenGL.GLVertexData)AppMain._nnDrawPrimitive3DCore.colorData); int index1; for (index1 = 0; index1 < count; ++index1) { uint col = data[index1].Col; if (count1 >= 6) { OpenGL.glVertexPointer(3, 5126U, 0, (OpenGL.GLVertexData) new AppMain.NNS_PRIM3D_PC_VertexData(data, index1 - count1)); OpenGL.glDrawArrays(mode, 0, count1); switch (mode) { case 3: cbuf[0] = cbuf[5]; count1 = 1; break; case 5: cbuf[0] = cbuf[4]; cbuf[1] = cbuf[5]; count1 = 2; break; default: count1 = 0; break; } } cbuf[count1].r = (byte)(col >> 24); cbuf[count1].g = (byte)(col >> 16); cbuf[count1].b = (byte)(col >> 8); cbuf[count1].a = (byte)col; ++count1; } if (count1 <= 0) { break; } AppMain._nnDrawPrimitive3DCore.vertexDataPC.Init(data, index1 - count1); OpenGL.glVertexPointer(3, 5126U, 0, (OpenGL.GLVertexData)AppMain._nnDrawPrimitive3DCore.vertexDataPC); OpenGL.glDrawArrays(mode, 0, count1); break; case 3: AppMain.mppOpenGLFeatureNotImplAssert(); break; case 4: AppMain.NNS_PRIM3D_PCT_ARRAY nnsPriM3DPctArray = (AppMain.NNS_PRIM3D_PCT_ARRAY)vtx; AppMain.NNS_PRIM3D_PCT[] buffer = nnsPriM3DPctArray.buffer; int offset = nnsPriM3DPctArray.offset; int num = count; switch (mode) { case 3: AppMain.mppAssertNotImpl(); break; case 5: num = (num - 2) * 3; break; } if (AppMain._nnDrawPrimitive3DCore.prim_d == null || AppMain._nnDrawPrimitive3DCore.prim_d.Length < num) { AppMain._nnDrawPrimitive3DCore.prim_d = new AppMain.NNS_PRIM3D_PCT[num * 2]; AppMain._nnDrawPrimitive3DCore.prim_c = new AppMain.RGBA_U8[num * 2]; } AppMain.NNS_PRIM3D_PCT[] primD = AppMain._nnDrawPrimitive3DCore.prim_d; AppMain.RGBA_U8[] primC = AppMain._nnDrawPrimitive3DCore.prim_c; int count2 = 0; AppMain._nnDrawPrimitive3DCore.colorData.Init(primC, 0); OpenGL.glColorPointer(4, 5121U, 0, (OpenGL.GLVertexData)AppMain._nnDrawPrimitive3DCore.colorData); OpenGL.glClientActiveTexture(33984U); for (int index2 = 0; index2 < count; ++index2) { uint col = buffer[offset + index2].Col; if (count2 >= 6) { switch (mode) { case 3: primC[count2] = primC[count2 - 1]; primD[count2] = primD[count2 - 1]; ++count2; break; case 5: primC[count2] = primC[count2 - 2]; primC[count2 + 1] = primC[count2 - 1]; primD[count2] = primD[count2 - 2]; primD[count2 + 1] = primD[count2 - 1]; count2 += 2; break; } } primC[count2].r = (byte)(col >> 24); primC[count2].g = (byte)(col >> 16); primC[count2].b = (byte)(col >> 8); primC[count2].a = (byte)col; primD[count2] = buffer[offset + index2]; ++count2; } AppMain._nnDrawPrimitive3DCore.vertexData.Init(primD, 0); AppMain._nnDrawPrimitive3DCore.texCoordData.Init(primD, 0); OpenGL.glVertexPointer(3, 5126U, 0, (OpenGL.GLVertexData)AppMain._nnDrawPrimitive3DCore.vertexData); OpenGL.glTexCoordPointer(2, 5126U, 0, (OpenGL.GLVertexData)AppMain._nnDrawPrimitive3DCore.texCoordData); OpenGL.glDrawArrays(mode, 0, count2); break; } }