Skip to content

Commit

Permalink
normal_con_fを例外を投げるように
Browse files Browse the repository at this point in the history
  • Loading branch information
yumetodo committed Feb 13, 2016
1 parent 8210037 commit fd06490
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Don't_push/Don't_push/source/continue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ Status continu(const img_arr_t&, const sound_arr_t& sound, const config_info::la

//メインループ
keystate state;
auto normal_con_f = []() -> bool { return -1 != ProcessMessage() && 0 == ScreenFlip() && 0 == ClearDrawScreen(); };
auto normal_con_f = []() -> bool {
bool re = -1 != ProcessMessage() && 0 == ScreenFlip() && 0 == ClearDrawScreen();
if (!re) throw std::runtime_error("ProcessMessage() return -1.");
return re;
};
bool is_normal_state = normal_con_f();
screens[flag_no_continue].DrawGraph({}, false);
is_normal_state = normal_con_f();
Expand Down
6 changes: 5 additions & 1 deletion Don't_push/Don't_push/source/end.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ Status end(const img_arr_t&, const sound_arr_t& sound, const config_info::lang_t
const int font_title = CreateFontToHandle(nullptr, 100, 5, DX_FONTTYPE_EDGE);//タイトルロゴ
const int font_1 = CreateFontToHandle(nullptr, 30, 1, DX_FONTTYPE_ANTIALIASING);//「Xキーを押してね」の奴
keystate state;
auto normal_con_f = []() -> bool { return -1 != ProcessMessage() && 0 == ScreenFlip() && 0 == ClearDrawScreen(); };
auto normal_con_f = []() -> bool {
bool re = -1 != ProcessMessage() && 0 == ScreenFlip() && 0 == ClearDrawScreen();
if (!re) throw std::runtime_error("ProcessMessage() return -1.");
return re;
};
bool is_normal_state = normal_con_f();
DrawBox(0, 0, WINDOW.width, WINDOW.height, GetColor(200, 200, 100), TRUE); //背景
DrawStringToHandle(WINDOW.width * 37 / 320, WINDOW.height / 4, (L"- " + lang_table.at(L"I did it!") + L" -").c_str(), GetColor(250, 0, 0), font_title);
Expand Down

0 comments on commit fd06490

Please sign in to comment.