OSDN Git Service

GameSurfaceSDL::PushAnyKey()の別引数追加。 / Implement another GameSurfaceSDL::PushAnyKey().
authorDeskull <desull@users.sourceforge.jp>
Mon, 5 Jan 2015 11:53:20 +0000 (20:53 +0900)
committerDeskull <desull@users.sourceforge.jp>
Mon, 5 Jan 2015 11:53:20 +0000 (20:53 +0900)
Deeangband/GameSurfaceSDL.cpp
Deeangband/GameSurfaceSDL.h

index 181b5e1..d900747 100644 (file)
@@ -77,6 +77,21 @@ namespace Deeangband
                } while(event.type != SDL_KEYDOWN);
        }
 
+       void GameSurfaceSDL::pushAnyKey(void)
+       {
+               SDL_Event event;
+               do 
+               {
+                       SDL_Rect rect = {0, 0, 0, 0};
+                       this->drawSystemMessage();
+                       SDL_UpdateWindowSurfaceRects(window, &rect, 1);
+                       SDL_UpdateWindowSurface(window);
+
+                       SDL_PollEvent(&event);
+               } while(event.type != SDL_KEYDOWN);
+       }
+
+
        void GameSurfaceSDL::initInterfaces(GameWorld *gameWorld)
        {
                std::map<TAG, boost::shared_ptr<Floor>>::iterator floorIt;
@@ -612,7 +627,7 @@ void GameSurfaceSDL::drawField(const CREATURE_IT &subjectCreatureIt, GameWorld *
        {
                this->currentSystemMessage = message;
                systemMessageSurface = TTF_RenderUTF8_Blended(font, toUTF8(this->currentSystemMessage.c_str()).c_str(), color);
-               //pushAnyKey();
+               pushAnyKey();
                this->currentSystemMessage.erase();
                SDL_FreeSurface(systemMessageSurface);
        }
index 9ce3d29..341ed5d 100644 (file)
@@ -66,6 +66,7 @@ namespace Deeangband
                std::map<ID, SDL_Surface*> creatureSurfaces; //!< \83N\83\8a\81[\83`\83\83\81[\83O\83\89\83t\83B\83b\83N\82ÌSurface\8eQ\8fÆ\83\8a\83X\83g
 
                void GameSurfaceSDL::pushAnyKey(const CREATURE_IT &subjectCreatureIt);
+               void GameSurfaceSDL::pushAnyKey(void);
 
                /*!
                 * @brief \83C\83\93\83^\81[\83t\83F\83C\83X\83f\81[\83^\82Ì\8f\89\8aú\89»