private static void gmMainPre(AppMain.MTS_TASK_TCB tcb) { AppMain.gmMainUpdateSuspendedPause(); AppMain.GMS_MAIN_SYSTEM gGmMainSystem = AppMain.g_gm_main_system; if (((int)gGmMainSystem.game_flag & 134217728) != 0) { AppMain.g_gm_main_system.game_flag &= 4160749567U; if (AppMain.g_gs_main_sys_info.stage_id != (ushort)28 && ((int)AppMain.g_gm_main_system.game_flag & 524288) == 0) { AppMain.GmSoundPlayStageBGM(0); } } CPadVirtualPad.CreateInstance().Update(); AppMain.CPadPolarHandle instance = AppMain.CPadPolarHandle.CreateInstance(); instance.Update(); int polarNow = gGmMainSystem.polar_now; gGmMainSystem.polar_now = instance.GetAngle32Value(); gGmMainSystem.polar_diff = gGmMainSystem.polar_now - polarNow; if (!AppMain.gmMainIsUseWaitUpCamera()) { return; } if (AppMain.GmPlayerIsStateWait(gGmMainSystem.ply_work[0])) { if (gGmMainSystem.camscale_state == AppMain.GME_MAIN_CAMSCALE_STATE.GMD_MAIN_CAMSCALE_STATE_NON) { gGmMainSystem.camscale_state = AppMain.GME_MAIN_CAMSCALE_STATE.GMD_MAIN_CAMSCALE_STATE_ZOOM; } } else { gGmMainSystem.camscale_state = AppMain.GME_MAIN_CAMSCALE_STATE.GMD_MAIN_CAMSCALE_STATE_NON; gGmMainSystem.camera_scale = 0.6743833f; } if (gGmMainSystem.camscale_state == AppMain.GME_MAIN_CAMSCALE_STATE.GMD_MAIN_CAMSCALE_STATE_ZOOM) { gGmMainSystem.camera_scale -= 0.01f; if ((double)gGmMainSystem.camera_scale < 0.337191671133041) { gGmMainSystem.camera_scale = 0.3371917f; gGmMainSystem.camscale_state = AppMain.GME_MAIN_CAMSCALE_STATE.GMD_MAIN_CAMSCALE_STATE_UP; } } for (int cam_id = 0; cam_id < 7; ++cam_id) { AppMain.OBS_CAMERA obsCamera = AppMain.ObjCameraGet(cam_id); if (obsCamera != null) { obsCamera.scale = gGmMainSystem.camera_scale; } } }
private static float gmFixVirtualPadPartGetMovePadFrame(AppMain.GMS_FIX_PART_VIRTUAL_PAD pArg) { ushort num1 = CPadVirtualPad.CreateInstance().GetValue(); float num2 = 0.0f; for (int index = 0; index < AppMain.c_key_to_frame_table.Length; ++index) { AppMain.SKeyToFrame skeyToFrame = AppMain.c_key_to_frame_table[index]; if ((skeyToFrame.key & (int)num1) != 0) { num2 = skeyToFrame.frame; break; } } return(num2); }
private static void GmMainEnd() { AppMain.GmPadVibExit(); if (AppMain.g_gm_main_system.pre_tcb != null) { AppMain.mtTaskClearTcb(AppMain.g_gm_main_system.pre_tcb); AppMain.g_gm_main_system.pre_tcb = (AppMain.MTS_TASK_TCB)null; } if (AppMain.g_gm_main_system.post_tcb != null) { AppMain.mtTaskClearTcb(AppMain.g_gm_main_system.post_tcb); AppMain.g_gm_main_system.post_tcb = (AppMain.MTS_TASK_TCB)null; } AppMain.amTrailEFDeleteGroup((ushort)1); AppMain.GmPlyEfctTrailSysExit(); AppMain.g_obj.ppPre = (AppMain.OBJECT_Delegate)null; AppMain.ObjObjectClearAllObject(); AppMain.ObjPreExit(); AppMain.GmMapExit(); AppMain.GmFixExit(); AppMain.GmPauseExit(); AppMain.GmRingExit(); AppMain.GmCameraExit(); AppMain.GmSoundExit(); AppMain.GmMapFarExit(); AppMain.GmDecoExit(); AppMain.GmWaterSurfaceExit(); AppMain.GmEventMgrExit(); AppMain.ObjDrawESEffectSystemExit(); AppMain.GmClearDemoExit(); AppMain.GmOverExit(); AppMain.GmSplStageExit(); AppMain.GmEndingExit(); AppMain.GmStartDemoExit(); AppMain.GmStartMsgExit(); CPadVirtualPad.CreateInstance().Release(); AppMain.CPadPolarHandle.CreateInstance().Release(); AppMain.GsMainSysSetSleepFlag(true); AppMain.GsMainSysSetAccelFlag(false); }
private static void gmFixVirtualPadPartInit(AppMain.GMS_FIX_MGR_WORK mgr_work) { CPadVirtualPad cpadVirtualPad = CPadVirtualPad.CreateInstance(); if (!cpadVirtualPad.IsValid()) { return; } AppMain.MPP_VOID_OBS_OBJECT_WORK[] voidObsObjectWorkArray = new AppMain.MPP_VOID_OBS_OBJECT_WORK[4] { new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmFixVirtualPadOutClassGMD_FIX_MGR_FLAG_HIDE_VIRTUAL_PAD_PART_SUPER_SONIC.OutFunc), new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmFixVirtualPadOutClassGMD_FIX_MGR_FLAG_HIDE_VIRTUAL_PAD_PART_PAUSE.OutFunc), new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmFixVirtualPadOutClassGMD_FIX_MGR_FLAG_HIDE_VIRTUAL_PAD_PART_ACTION.OutFunc), new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmFixVirtualPadOutClassGMD_FIX_MGR_FLAG_HIDE_VIRTUAL_PAD_PART_MOVE_PAD.OutFunc) }; AppMain.GMS_FIX_PART_WORK partVirtualPad = (AppMain.GMS_FIX_PART_WORK)mgr_work.part_virtual_pad; AppMain.gmFixRegisterPart(mgr_work, partVirtualPad, 4); partVirtualPad.proc_update = new AppMain.MPP_VOID_GMS_FIX_PART_WORK(AppMain.gmFixVirtualPadPartProcUpdateMain); partVirtualPad.proc_disp = new AppMain.MPP_VOID_GMS_FIX_PART_WORK(AppMain.gmFixVirtualPadPartProcDispMain); int index1 = 0; for (int index2 = 4; index1 < index2; ++index1) { if (AppMain.gm_fix_virtual_pad_act_id_tbl[AppMain.gmFixGetPlan()][index1] < 0) { ((AppMain.GMS_FIX_PART_VIRTUAL_PAD)partVirtualPad).sub_parts[index1] = (AppMain.GMS_COCKPIT_2D_WORK)null; } else { AppMain.OBS_OBJECT_WORK work = AppMain.GMM_COCKPIT_CREATE_WORK((AppMain.TaskWorkFactoryDelegate)(() => (object)new AppMain.GMS_COCKPIT_2D_WORK()), (AppMain.OBS_OBJECT_WORK)null, (ushort)0, "FIX_VIRTUAL_PAD"); AppMain.GMS_COCKPIT_2D_WORK gmsCockpit2DWork = (AppMain.GMS_COCKPIT_2D_WORK)work; work.ppOut = voidObsObjectWorkArray[index1]; AppMain.ObjObjectAction2dAMALoadSetTexlist(work, gmsCockpit2DWork.obj_2d, (AppMain.OBS_DATA_WORK)null, (string)null, AppMain.gm_fix_ama_amb_idx_tbl[AppMain.GsEnvGetLanguage()][0], AppMain.GmGameDatGetCockpitData(), AppMain.AoTexGetTexList(AppMain.gm_fix_textures[0]), (uint)AppMain.gm_fix_virtual_pad_act_id_tbl[AppMain.gmFixGetPlan()][index1], 0); AppMain.amFlagOff(ref work.disp_flag, 32U); AppMain.gmFixSetFrameStatic(work, 0.0f); if (1 == index1) { if (AppMain.gmFixIsSpecialStage()) { work.pos.x += AppMain.FX_F32_TO_FX32(400f); } else if (AppMain.gmFixIsTimeAttack()) { work.pos.x += AppMain.FX_F32_TO_FX32(200f); } } ((AppMain.GMS_FIX_PART_VIRTUAL_PAD)partVirtualPad).sub_parts[index1] = (AppMain.GMS_COCKPIT_2D_WORK)work; } } switch (AppMain.GsEnvGetLanguage()) { case 3: case 5: ((AppMain.GMS_FIX_PART_VIRTUAL_PAD)partVirtualPad).pause_icon_frame[0] = 2f; ((AppMain.GMS_FIX_PART_VIRTUAL_PAD)partVirtualPad).pause_icon_frame[1] = 3f; break; default: ((AppMain.GMS_FIX_PART_VIRTUAL_PAD)partVirtualPad).pause_icon_frame[0] = 0.0f; ((AppMain.GMS_FIX_PART_VIRTUAL_PAD)partVirtualPad).pause_icon_frame[1] = 1f; break; } AppMain.amFlagOff(ref partVirtualPad.flag, 2U); }
private static void gmMainGameStart() { bool flag = false; if (SaveState.shouldResume()) { SaveState.resumePlayerState(); SaveState.resumeMapData(); } AppMain.amIPhoneTouchCanceled(); CPadVirtualPad.CreateInstance().Create(new float[4] { -120f, 166f, 232f, 318f }); AppMain.CPadPolarHandle instance = AppMain.CPadPolarHandle.CreateInstance(); if (AppMain.g_gs_main_sys_info.stage_id == (ushort)9) { instance.Create(0.0f, 0.0f, (float)((double)AppMain.AMD_SCREEN_2D_WIDTH * 4.0 / 5.0), AppMain.AMD_SCREEN_2D_HEIGHT); } else { instance.Create(); } instance.SetValue(0.0f); AppMain.g_gm_main_system.polar_now = 0; AppMain.g_gm_main_system.polar_diff = 0; if (((int)AppMain.GsGetMainSysInfo().game_flag & 1) == 0) { AppMain.GsMainSysSetSleepFlag(false); AppMain.GsMainSysSetAccelFlag(true); } else if (((int)AppMain.GsGetMainSysInfo().game_flag & 512) == 0 && (AppMain.GsGetMainSysInfo().stage_id == (ushort)9 || AppMain.GSM_MAIN_STAGE_IS_SPSTAGE())) { AppMain.GsMainSysSetSleepFlag(false); AppMain.GsMainSysSetAccelFlag(true); } else { AppMain.GsMainSysSetSleepFlag(true); AppMain.GsMainSysSetAccelFlag(false); } AppMain.GmPadVibInit(); if (((int)AppMain.g_gm_main_system.game_flag & 512) != 0) { AppMain.g_gm_main_system.game_time = 0U; flag = true; } AppMain.g_gm_main_system.game_flag &= 4187479041U; AppMain.g_gm_main_system.die_event_wait_time = 0; AppMain.g_gm_main_system.pseudofall_dir = (ushort)0; AppMain.g_gm_main_system.boss_load_no = -1; AppMain.g_gm_main_system.pre_tcb = AppMain.MTM_TASK_MAKE_TCB(new AppMain.GSF_TASK_PROCEDURE(AppMain.gmMainPre), (AppMain.GSF_TASK_PROCEDURE)null, 0U, (ushort)0, 4096U, 5, (AppMain.TaskWorkFactoryDelegate)null, "GM_MAIN_PRE"); AppMain.g_gm_main_system.post_tcb = AppMain.MTM_TASK_MAKE_TCB(new AppMain.GSF_TASK_PROCEDURE(AppMain.gmMainPost), (AppMain.GSF_TASK_PROCEDURE)null, 0U, (ushort)0, 32768U, 5, (AppMain.TaskWorkFactoryDelegate)null, "GM_MAIN_POST"); AppMain.g_obj.flag = 4194408U; AppMain.g_obj.ppPre = new AppMain.OBJECT_Delegate(AppMain.GmObjPreFunc); AppMain.g_obj.ppPost = (AppMain.OBJECT_Delegate)null; AppMain.g_obj.ppCollision = new AppMain.OBJECT_WORK_Delegate(AppMain.GmObjCollision); AppMain.g_obj.ppObjPre = new AppMain.OBJECT_WORK_Delegate(AppMain.GmObjObjPreFunc); AppMain.g_obj.ppObjPost = new AppMain.OBJECT_WORK_Delegate(AppMain.GmObjObjPostFunc); AppMain.g_obj.ppRegRecAuto = new AppMain.OBJECT_WORK_Delegate(AppMain.GmObjRegistRectAuto); AppMain.g_obj.draw_scale.x = AppMain.g_obj.draw_scale.y = AppMain.g_obj.draw_scale.z = 13107; AppMain.g_obj.inv_draw_scale.x = AppMain.g_obj.inv_draw_scale.y = AppMain.g_obj.inv_draw_scale.z = AppMain.FX_Div(4096, AppMain.g_obj.draw_scale.x); AppMain.g_obj.depth = 128; AppMain.ObjDebugRectActionInit(); AppMain.gmMainInitLight(); if (((int)AppMain.g_gs_main_sys_info.game_flag & 4) != 0) { AppMain.g_gm_main_system.game_time = AppMain.g_gm_main_system.time_save; if (AppMain.g_gm_main_system.marker_pri == 0U) { AppMain.g_gm_main_system.ply_dmg_count = 0U; AppMain.g_gm_main_system.game_flag &= 4227858431U; } else { AppMain.g_gm_main_system.game_flag |= 67108864U; if (flag) { AppMain.g_gs_main_sys_info.game_flag |= 256U; } } } AppMain.GmMapInit(); AppMain.GmTvxInit(); AppMain.GmMapFarInit(); AppMain.GmDecoInit(); AppMain.GmWaterSurfaceInit(); AppMain.GmPlyEfctTrailSysInit(); AppMain.GmFixInit(); AppMain.GmCameraInit(); AppMain.GmSoundInit(); AppMain.GmRingInit(); AppMain.GmEventMgrInit(); AppMain.GmEventMgrStart(); for (int index = 0; index < 1; ++index) { if (AppMain.g_gs_main_sys_info.char_id[index] != (int)short.MaxValue) { AppMain.g_gm_main_system.ply_work[index] = AppMain.GmPlayerInit(AppMain.g_gs_main_sys_info.char_id[index], (ushort)0, (ushort)index, (ushort)0); } } AppMain.GmEveMgrCreateStateEvent(); if (((int)AppMain.g_gs_main_sys_info.game_flag & 4) != 0 && AppMain.g_gm_main_system.marker_pri > 0U) { SaveState.saveCurrentState(0); } if (AppMain.g_gs_main_sys_info.stage_id != (ushort)28) { AppMain.g_gm_main_system.game_flag |= 268435456U; AppMain.g_gm_main_system.game_flag &= 4160749567U; } AppMain.g_gm_main_system.game_flag &= 4294964223U; AppMain.g_gm_main_system.game_flag |= 2048U; if (AppMain.GSM_MAIN_STAGE_IS_SPSTAGE()) { AppMain.GmSplStageStart(); } else if (AppMain.g_gs_main_sys_info.game_mode == 2) { AppMain.GmEndingStart(); } else { AppMain.GmStartDemoStart(); } }