From 8210037751afbbf2c2a98bc1ec9473d305eb00f6 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Sat, 13 Feb 2016 18:51:14 +0900 Subject: [PATCH] =?UTF-8?q?end=E3=81=AE=E8=BB=BD=E9=87=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Don't_push/Don't_push/source/end.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Don't_push/Don't_push/source/end.cpp b/Don't_push/Don't_push/source/end.cpp index dc3a787..2414edd 100644 --- a/Don't_push/Don't_push/source/end.cpp +++ b/Don't_push/Don't_push/source/end.cpp @@ -1,6 +1,8 @@ #include "end.h" #include "DxLib.h" #include "Dxkeystate.h" +#include +#include #ifdef _MSC_VER #pragma warning (push) @@ -9,16 +11,17 @@ Status end(const img_arr_t&, const sound_arr_t& sound, const config_info::lang_table_t& lang_table) { for (auto& s : sound) s.second.stop();//BGM全部停止 //フォントの定義 - const int Font_title = CreateFontToHandle(nullptr, 100, 5, DX_FONTTYPE_EDGE);//タイトルロゴ - const int Font_1 = CreateFontToHandle(nullptr, 30, 1, DX_FONTTYPE_ANTIALIASING);//「Xキーを押してね」の奴 + 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(); }; - volatile bool is_normal_state; - while ((is_normal_state = normal_con_f()) && state.update() && !state[KEY_INPUT_X] && !state.esc()) { - DrawBox(0, 0, WINDOW.width, WINDOW.height, GetColor(200, 200, 100), TRUE); //背景 - - DrawStringToHandle(180, WINDOW.height / 4, (L"- " + lang_table.at(L"I did it!") + L" -").c_str(), GetColor(250, 0, 0), Font_title); //タイトル - DrawStringToHandle(260, WINDOW.height - (WINDOW.height / 3), (L"- " + lang_table.at(L"Press X") + L" -").c_str(), GetColor(0, 0, 0), Font_1);//Xキー押してね + 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); + DrawStringToHandle(WINDOW.width * 13 / 40, WINDOW.height / 4 + 250, (L"- " + lang_table.at(L"Press X") + L" -").c_str(), GetColor(0, 0, 0), font_1); + is_normal_state = normal_con_f(); + while ((is_normal_state = -1 != ProcessMessage()) && state.update() && !state[KEY_INPUT_X] && !state.esc()) { + std::this_thread::sleep_for(std::chrono::milliseconds(50)); } if (!is_normal_state) throw std::runtime_error("ProcessMessage() return -1."); if (state.esc()) throw normal_exit();