OSDN Git Service

Add GameSurface::SetSideStatusCreature().
authorDeskull <deskull@users.sourceforge.jp>
Tue, 22 Apr 2014 14:10:15 +0000 (23:10 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Tue, 22 Apr 2014 14:10:15 +0000 (23:10 +0900)
Deeangband/GameSurface.h
Deeangband/GameSurfaceSDL.cpp
Deeangband/GameSurfaceSDL.h

index 6881b55..b0fa6b0 100644 (file)
@@ -54,6 +54,13 @@ namespace Deeangband
                virtual void GameSurface::ViewCreatureStatus(Creature *creaturePtr) { creaturePtr; }
 
                /*!
+               * @brief \83Q\81[\83\80\89æ\96Ê\8d\82É\83v\83\8c\83C\83\84\81[\8aÈ\97ª\8fî\95ñ\82ð\95\\8e¦\82·\82é\81B
+               * @param creaturePtr \95\\8e¦\82µ\82½\82¢\83N\83\8a\81[\83`\83\83\81[\82Ì\83C\83\93\83X\83^\83\93\83X\8eQ\8fÆ\83|\83C\83\93\83^\81BNULL\82È\82ç\82Î\94ñ\95\\8e¦\81B
+               * @return \82È\82µ
+               */
+               virtual void GameSurface::SetSideStatusCreature(Creature *creaturePtr) { creaturePtr; }
+
+               /*!
                * @brief \83Q\81[\83\80\89æ\96Ê\95\\8e¦\82·\82é\83t\83\8d\83A\82ð\90Ø\82è\91Ö\82¦\82é\81B
                * @param floorPtr \95\\8e¦\82µ\82½\82¢\83t\83\8d\83A\82Ì\83C\83\93\83X\83^\83\93\83X\8eQ\8fÆ\83|\83C\83\93\83^\81BNULL\82È\82ç\82Î\94ñ\95\\8e¦\81B
                * @return \82È\82µ
index 5191a31..ca96695 100644 (file)
@@ -69,6 +69,7 @@ namespace Deeangband
                SDL_Event event;
                do 
                {
+                       this->Redraw();
                        SDL_PollEvent(&event);
                } while(event.type != SDL_KEYDOWN);
        }
@@ -118,15 +119,19 @@ namespace Deeangband
 
        void GameSurfaceSDL::ViewCreatureStatus(Creature *creaturePtr)
        {
-               viewCreaturePtr = creaturePtr;
-               Redraw();
+               this->viewCreaturePtr = creaturePtr;
                pushAnyKey();
-               viewCreaturePtr = NULL;
+               this->viewCreaturePtr = NULL;
+       }
+
+       void GameSurfaceSDL::SetSideStatusCreature(Creature *creaturePtr)
+       {
+               this->sideStatusCreatutePtr = creaturePtr;
        }
 
        void GameSurfaceSDL::SetFloor(Floor *floorPtr)
        {
-               viewFloorPtr = floorPtr;
+               this->viewFloorPtr = floorPtr;
        }
 
        void GameSurfaceSDL::drawCreatureStatus(Creature *creaturePtr)
@@ -249,6 +254,7 @@ namespace Deeangband
 
                while (SDL_PollEvent(&event))
                {
+                       this->Redraw();
                        switch(event.type)
                        {
 
@@ -338,10 +344,8 @@ namespace Deeangband
        {
                this->currentMessage = message;
                messageSurface = TTF_RenderUTF8_Blended(font, toUTF8(this->currentMessage.c_str()).c_str(), color);
-               Redraw();
                pushAnyKey();
                this->currentMessage.erase();
-               Redraw();
                SDL_FreeSurface(messageSurface);
        }
 
index 3bd8edf..a6b2515 100644 (file)
@@ -33,7 +33,8 @@ namespace Deeangband
                SDL_Renderer *renderer;     //!< SDL\97p\83\8c\83\93\83_\83\89\8eQ\8fÆ\83|\83C\83\93\83^
                SDL_Window *window;         //!< SDL\83E\83B\83\93\83h\83E\8eQ\8fÆ\83|\83C\83\93\83^
 
-               Creature *viewCreaturePtr; //!< \8c»\8dÝ\82Ì\83X\83e\81[\83^\83X\95\\8e¦\91Î\8fÛ\82Æ\82È\82éCreature\8eQ\8fÆ
+               Creature *viewCreaturePtr;       //!< \8c»\8dÝ\82Ì\83X\83e\81[\83^\83X\95\\8e¦\91Î\8fÛ\82Æ\82È\82éCreature\8eQ\8fÆ\83|\83C\83\93\83^
+               Creature *sideStatusCreatutePtr; //!< \8c»\8dÝ\82Ì\83X\83e\81[\83^\83X\8aÈ\88Õ\95\\8e¦\91Î\8fÛ\82Æ\82È\82éCreature\8eQ\8fÆ\83|\83C\83\93\83^
                Floor *viewFloorPtr;       //!< \95`\89æ\91Î\8fÛ\82Æ\82È\82éFloor\8eQ\8fÆ
                Coordinates focusPoint;    //!< \83t\83\8d\83A\82Ì\95`\89æ\8d\8fã\92n\93_
 
@@ -89,6 +90,13 @@ namespace Deeangband
                void GameSurfaceSDL::ViewCreatureStatus(Creature *creaturePtr);
 
                /*!
+               * @brief \83Q\81[\83\80\89æ\96Ê\8d\82É\83v\83\8c\83C\83\84\81[\8aÈ\97ª\8fî\95ñ\82ð\95\\8e¦\82·\82é\81B
+               * @param creaturePtr \95\\8e¦\82µ\82½\82¢\83N\83\8a\81[\83`\83\83\81[\82Ì\83C\83\93\83X\83^\83\93\83X\8eQ\8fÆ\83|\83C\83\93\83^\81BNULL\82È\82ç\82Î\94ñ\95\\8e¦\81B
+               * @return \82È\82µ
+               */
+               void GameSurfaceSDL::SetSideStatusCreature(Creature *creaturePtr);
+
+               /*!
                * @brief \95\\8e¦\82·\82é\83t\83\8d\83A\82ð\90Ø\82è\91Ö\82¦\82é
                * @param floorPtr \95\\8e¦\82µ\82½\82¢\83t\83\8d\83A\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
                * @return \82È\82µ