int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){ ChangeWindowMode(TRUE);//ウィンドウモード if(DxLib_Init() == -1 || SetDrawScreen( DX_SCREEN_BACK )!=0) return -1;//初期化と裏画面化 while(ProcessLoop()==0){//メインループ switch(func_state){ case 0://初回のみ入る処理 load(); //データロード first_ini();//初回の初期化 func_state=99; break; case 99://STGを始める前に行う初期化 ini(); func_state=100; break; case 100://通常処理 calc_ch(); //キャラクタ計算 ch_move(); //キャラクタの移動制御 enemy_main();//敵処理メイン graph_main();//描画メイン stage_count++; break; default: printfDx("不明なfunc_state\n"); break; } if(CheckStateKey(KEY_INPUT_ESCAPE)==1)break;//エスケープが入力されたらブレイク ScreenFlip();//裏画面反映 } DxLib_End();//DXライブラリ終了処理 return 0; }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { system_init(); if (DxLib_Init() == -1 || SetDrawScreen(DX_SCREEN_BACK) != 0)return -1; // 初期化と裏画面化 game_init(); LogSP log1 = LogSP(new Log("あいうえお")); LogSP log2 = LogSP(new Log("かきくけこ")); LogSP log3 = LogSP(new Log("さしすせそ")); manager.push(log1); manager.push(log2); manager.push(log3); while (ProcessLoop()) { mso::KeyBoard::SetNowState(); manager.process(); mso::FpsController::Wait(); mso::FpsController::Draw(); ScreenFlip(); // 裏画面反映 mso::KeyBoard::KeepPrevState(); } DxLib_End(); return 0; }
LCPPolyDist<Dimension,FVector,DVector>::LCPPolyDist (int numFaces1, FVector* A1, float* B1, int numFaces2, FVector* A2, float* B2, int& statusCode, float& distance, FVector closest[2], double verifyMinDifference, double randomWidth) : mDimension(sizeof(DVector)/sizeof(double)), mNumEquations(numFaces1 + numFaces2 + 2*mDimension), mNumPoints1(0), // unused mNumPoints2(0), // unused mNumFaces1(numFaces1), mNumFaces2(numFaces2), mPoints1(0), // unused mPoints2(0), // unused mVerifyMinDifference(verifyMinDifference), mRandomWidth(randomWidth) { int i, j; mA1 = new1<DVector>(mNumFaces1); mB1 = new1<double>(mNumFaces1); for (i = 0; i < mNumFaces1; ++i) { mB1[i] = (double)B1[i]; for (j = 0; j < mDimension; ++j) { mA1[i][j] = (double)A1[i][j]; } } mA2 = new1<DVector>(mNumFaces2); mB2 = new1<double>(mNumFaces2); for (i = 0; i < mNumFaces2; ++i) { mB2[i] = (double)B2[i]; for (j = 0; j < mDimension; ++j) { mA2[i][j] = (double)A2[i][j]; } } WM5_LCPPOLYDIST_FUNCTION(OpenLog()); WM5_LCPPOLYDIST_FUNCTION(LogHalfspaces(mNumFaces1, mA1, mB1)); WM5_LCPPOLYDIST_FUNCTION(LogHalfspaces(mNumFaces2, mA2, mB2)); WM5_LCPPOLYDIST_FUNCTION(RandomizeHalfspaces()); distance = (float)ProcessLoop(true, statusCode, closest); WM5_LCPPOLYDIST_FUNCTION(CloseLog()); delete1(mA1); delete1(mB1); delete1(mA2); delete1(mB2); }
void SoundManager::Update() { if(nextupdate <= millis()) { switch(curr_sequence) { case TONE_START: // Start Music switch(count) { case 0: PlayTone(NOTE_2,1); count++; break; case 1: PlayTone(NOTE_4,2); count++; break; case 2: PlayTone(NOTE_5,2); count++; break; case 3: PlayTone(NOTE_7,1); count++; break; case 4: PlayTone(NOTE_5,2); count++; break; case 5: PlayTone(NOTE_4,2); count++; break; case 6: PlayTone(NOTE_2,2); count++; break; case 7: PlayTone(NOTE_4,1); count++; break; case 8: ClearTone(); ProcessLoop(); count = 0; break; } break; case TONE_BATT_LOW: switch(count) { case 0: PlayTone(800,5); count++; break; case 1: ClearTone(); nextupdate = millis()+5*TIME_UNIT; count ++; break; case 2: ClearTone(); ProcessLoop(); count = 0; break; } break; case TONE_BATT_CRIT: switch(count) { case 0: PlayTone(800,2); count++; break; case 1: ClearTone(); nextupdate = millis()+1*TIME_UNIT; count ++; break; case 2: ClearTone(); ProcessLoop(); count = 0; break; } break; case TONE_UNSTABLE: switch(count) { case 0: PlayTone(NOTE_4,5); count++; break; case 1: PlayTone(NOTE_9,5); count++; break; case 2: PlayTone(NOTE_4,5); count++; break; case 3: PlayTone(NOTE_9,5); count++; break; case 4: ClearTone(); ProcessLoop(); count = 0; break; } } } }
bool LoopBarriers::runOnLoop(Loop *L, LPPassManager &LPM) { //if (!Workgroup::isKernelToProcess(*L->getHeader()->getParent())) // return false; DT = &getAnalysis<DominatorTree>(); bool changed = ProcessLoop(L, LPM); DT->verifyAnalysis(); return changed; }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { if (init() == -1)return -1; country_init(); while (!ProcessLoop()) { First_process();//ループの初めにする処理 country_judge(Mx, My);//国を判断して表示(国を追加も可能) } DxLib_End(); // DXライブラリ使用の終了処理 return 0; // ソフトの終了 }
LCPPolyDist<Dimension,FVector,DVector>::LCPPolyDist (int numPoints1, FVector* points1, int numFaces1, ITuple* faces1, int numPoints2, FVector* points2, int numFaces2, ITuple* faces2, int& statusCode, float& distance, FVector closest[2], double verifyMinDifference, double randomWidth) : mDimension(sizeof(DVector)/sizeof(double)), mNumEquations(numFaces1 + numFaces2 + 2*mDimension), mNumPoints1(numPoints1), mNumPoints2(numPoints2), mNumFaces1(numFaces1), mNumFaces2(numFaces2), mFaces1(faces1), mFaces2(faces2), mVerifyMinDifference(verifyMinDifference), mRandomWidth(randomWidth) { WM5_LCPPOLYDIST_FUNCTION(OpenLog()); WM5_LCPPOLYDIST_FUNCTION(LogVerticesAndFaces(numPoints1, points1, numFaces1, faces1)); WM5_LCPPOLYDIST_FUNCTION(LogVerticesAndFaces(numPoints2, points2, numFaces2, faces2)); int i, j; mPoints1 = new1<DVector>(mNumPoints1); for (i = 0; i < mNumPoints1; ++i) { for (j = 0; j < mDimension; ++j) { mPoints1[i][j] = (double)points1[i][j]; } } mPoints2 = new1<DVector>(mNumPoints2); for (i = 0; i < mNumPoints2; ++i) { for (j = 0; j < mDimension; ++j) { mPoints2[i][j] = (double)points2[i][j]; } } mA1 = new1<DVector>(mNumFaces1); mB1 = new1<double>(mNumEquations); GenerateHalfSpaceDescription(mNumPoints1, mPoints1, mNumFaces1, mFaces1, mA1, mB1); mA2 = new1<DVector>(mNumFaces2); mB2 = new1<double>(mNumEquations); GenerateHalfSpaceDescription(mNumPoints2, mPoints2, mNumFaces2, mFaces2, mA2, mB2); distance = (float)ProcessLoop(false, statusCode, closest); delete1(mA1); delete1(mB1); delete1(mA2); delete1(mB2); delete1(mPoints1); delete1(mPoints2); WM5_LCPPOLYDIST_FUNCTION(CloseLog()); }
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){ //FullscreenMessage(); ChangeWindowMode( FALSE ); SetMainWindowText("高橋テトリスver0.04"); if (DxLib_Init() == -1) return -1; //初期化 load(); if (SetDrawScreen( DX_SCREEN_BACK )!=0) return -1;//裏画面化 exe_cnt=0; func_state=0; while(ProcessLoop()==0){//メインループ music_ini(); switch(func_state){ case 0: //初期ロード launch_ini(); mode=0; menu_ini(); func_state=1; break; case 1: //ロゴ画面 graph_logo(); break; case 2: //メニュー画面 control_menu(); graph_menu(); break; case 50: //モード選択画面 control_menu(); graph_menu(); break; case 51: //モード選択後移行画面 graph_menu(); menu_selected_cnt++; if (menu_selected_cnt>30) { first_ini(); func_state=100; } break; case 100: //ゲームメイン画面 control_main(); block_main(); cal_score(); graph_main(); stage_cnt++; if (gameover_flag==1 && CheckStatePad(-1,PAD_NUM_HOLD)==1) { result_ini(); func_state=101; } if (CheckStatePad(-1,PAD_NUM_PAUSE)==1) { pause_push_Pl=PadPushPlayer; StopSoundMem( bgm_handle[bgm_num] ) ; pause_select=0; func_state=999; } break; case 999: //ポーズ画面 control_game_pause(); graph_main(); if (CheckStatePad((all_cpu_flag==0)?pause_push_Pl:-1,PAD_NUM_HOLD)==1) { switch (pause_select) { case 0: PlaySoundMem( bgm_handle[bgm_num] , DX_PLAYTYPE_LOOP , FALSE ) ; func_state=100; break; case 1: first_ini(); func_state=100; break; case 2: menu_ini(); func_state=50; break; } } if (CheckStatePad((all_cpu_flag==0)?pause_push_Pl:-1,PAD_NUM_PAUSE)==1) { PlaySoundMem( bgm_handle[bgm_num] , DX_PLAYTYPE_LOOP , FALSE ) ; func_state=100; } break; case 101: //リザルト画面 control_result(); graph_main(); stage_cnt++; if (CheckStatePad(-1,PAD_NUM_HOLD)==1) func_state=102; break; case 102: //ゲームオーバー後選択画面 control_over_select(); graph_main(); stage_cnt++; if (CheckStatePad(-1,PAD_NUM_HOLD)==1) { switch (over_select) { case 0: first_ini(); func_state=100; break; case 1: menu_ini(); menu_select=mode; func_state=50; break; case 3: func_state=101; break; } } break; default: printfDx("error:不明なfunc_state\n"); break; } control_func_state(); exe_cnt++; music_play(); if(CheckStateKey(KEY_INPUT_ESCAPE)==1) break;//エスケープが入力されたらブレイク ScreenFlip();//裏画面反映 } DxLib_End();//DXライブラリ終了処理 return 0; }