Add subjectCreatureIt arguments to member functions in GameSurface.
GAME_COMMAND commandID;
PLAY_EXIT_CODE code = PLAY_EXIT_NONE;
ACTION_IT actionIt;
- gameSurface->Redraw();
+ gameSurface->Redraw(gameWorld->GetPlayerCreature());
while(code == PLAY_EXIT_NONE)
{
this->gameSurface->UpdateTimeStatus(this->gameWorld->GetGameTime());
actionIt = this->toNextProcess();
- commandID = gameSurface->GetCommand();
+ commandID = gameSurface->GetCommand(gameWorld->GetPlayerCreature());
code = DoGameCommand(commandID);
ProcessDeadCreatures();
if(!gameWorld->GetPlayerCreature()->second->IsAlive())
switch(command)
{
case GAME_COMMAND_VIEW_PLAYER_STATUS:
- gameSurface->ViewCreatureStatus(gameWorld->GetCreature(0));
+ gameSurface->ViewCreatureStatus(gameWorld->GetPlayerCreature()->second.get());
break;
case GAME_COMMAND_REDRAW:
- gameSurface->Redraw();
+ gameSurface->Redraw(playerIt);
break;
case GAME_COMMAND_DEBUG_XML_SAVE:
gameWorld->XMLSave();
gameSurface->SystemMessage("XML\82É\95Û\91¶\82µ\82Ü\82µ\82½\81B");
break;
case GAME_COMMAND_DEBUG_XML_LOAD:
- gameSurface->Redraw();
+ gameSurface->Redraw(playerIt);
gameWorld->XMLLoad();
gameSurface->SystemMessage("XML\82©\82ç\8cÄ\82Ñ\8fo\82µ\82Ü\82µ\82½\81B");
break;
* @brief \83Q\81[\83\80\83R\83}\83\93\83h\82ð\8eó\82¯\8eæ\82é
* @return GAME_COMMAND \82Å\92è\8b`\82³\82ê\82½\83R\83}\83\93\83h\93à\97e
*/
- virtual GAME_COMMAND GetCommand(void)
+ virtual GAME_COMMAND GetCommand(const CREATURE_IT& subjectCreatureIt)
{
+ subjectCreatureIt;
return GAME_COMMAND_REDRAW;
}
* @brief \83Q\81[\83\80\89æ\96Ê\95\\8e¦\82ð\8dX\90V\82·\82é\81B
* @return \82È\82µ
*/
- virtual void GameSurface::Redraw(void) {}
+ virtual void GameSurface::Redraw(const CREATURE_IT& subjectCreatureIt) { subjectCreatureIt; }
/*!
* @brief \83Q\81[\83\80\89æ\96Ê\82É\83N\83\8a\81[\83`\83\83\81[\8fî\95ñ\82ð\95\\8e¦\82·\82é\81B
return;
}
- void GameSurfaceSDL::pushAnyKey(void)
+ void GameSurfaceSDL::pushAnyKey(const CREATURE_IT& subjectCreatureIt)
{
SDL_Event event;
do
{
- this->Redraw();
+ this->Redraw(subjectCreatureIt);
SDL_PollEvent(&event);
} while(event.type != SDL_KEYDOWN);
}
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_PRESENTVSYNC);
}
- void GameSurfaceSDL::Redraw()
+ void GameSurfaceSDL::Redraw(const CREATURE_IT& subjectCreatureIt)
{
SDL_Rect rect = {0, 0, 0, 0};
Coordinates mapDrawingSize;
void GameSurfaceSDL::ViewCreatureStatus(Creature *creaturePtr)
{
this->viewCreaturePtr = creaturePtr;
- pushAnyKey();
+ //pushAnyKey(NULL);
this->viewCreaturePtr = NULL;
}
SDL_BlitSurface(creatureSideStatusSurface, &masterRect, windowSurface, &posRect);
}
- GAME_COMMAND GameSurfaceSDL::GetCommand(void)
+ GAME_COMMAND GameSurfaceSDL::GetCommand(const CREATURE_IT& subjectCreatureIt)
{
SDL_Event event;
SDL_Keycode key;
- this->Redraw();
+ this->Redraw(subjectCreatureIt);
while (SDL_PollEvent(&event))
{
default:
break;
}
- this->Redraw();
+ this->Redraw(subjectCreatureIt);
break;
case SDL_QUIT:
{
this->currentSystemMessage = message;
systemMessageSurface = TTF_RenderUTF8_Blended(font, toUTF8(this->currentSystemMessage.c_str()).c_str(), color);
- pushAnyKey();
+ //pushAnyKey();
this->currentSystemMessage.erase();
SDL_FreeSurface(systemMessageSurface);
}
std::map<TAG, SDL_Surface*> floorSurfaces; //!< \83t\83\8d\83A\83O\83\89\83t\83B\83b\83N\82ÌSurface\8eQ\8fÆ\83\8a\83X\83g
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(void);
+ void GameSurfaceSDL::pushAnyKey(const CREATURE_IT &subjectCreatureIt);
/*!
* @brief \83C\83\93\83^\81[\83t\83F\83C\83X\83f\81[\83^\82Ì\8f\89\8aú\89»
/*!
* @brief \83Q\81[\83\80\89æ\96Ê\82ð\8dÄ\95`\89æ\82·\82é
+ * @param subjectCreatureIt \8eå\8aÏ\82Æ\82È\82é\83N\83\8a\81[\83`\83\83\81[\83C\83e\83\8c\81[\83^
* @return \82È\82µ
*/
- void GameSurfaceSDL::Redraw(void);
+ void GameSurfaceSDL::Redraw(const CREATURE_IT& subjectCreatureIt);
/*!
* @brief \83Q\81[\83\80\8e\9e\8aÔ\95\\8e¦\82ð\8dX\90V\82·\82é
* @brief \83v\83\8c\83C\83\84\81[\82©\82ç\83R\83}\83\93\83h\82ð\8eæ\93¾\82·\82é
* @return \83Q\81[\83\80\83R\83}\83\93\83hID
*/
- GAME_COMMAND GameSurfaceSDL::GetCommand(void);
+ GAME_COMMAND GameSurfaceSDL::GetCommand(const CREATURE_IT& subjectCreatureIt);
/*!
* @brief \83t\83\8d\83A\95\\8e¦\82Ì\83t\83H\81[\83J\83X\82ð\95Ï\8dX\82·\82é