From 50f3dbb891730b0d1a666e75135b824d44c0c58f Mon Sep 17 00:00:00 2001 From: Deskull Date: Fri, 7 Mar 2014 22:20:15 +0900 Subject: [PATCH] Add displaying Height, Weight and BodySize to GameSurfaceSDL implementation. --- Deeangband/Creature.cpp | 2 +- Deeangband/GameSurfaceSDL.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Deeangband/Creature.cpp b/Deeangband/Creature.cpp index 0befbef..f222b35 100644 --- a/Deeangband/Creature.cpp +++ b/Deeangband/Creature.cpp @@ -192,5 +192,5 @@ WEIGHT Creature::GetWeight(void) BODY_SIZE Creature::GetSize(void) { - return (BODY_SIZE)(sqrt((double)this->height * (double)this->weight / 10.0f)); + return (BODY_SIZE)(sqrt((double)this->height * (double)this->weight) / 10.0f); } diff --git a/Deeangband/GameSurfaceSDL.cpp b/Deeangband/GameSurfaceSDL.cpp index 25149e8..a4b381f 100644 --- a/Deeangband/GameSurfaceSDL.cpp +++ b/Deeangband/GameSurfaceSDL.cpp @@ -154,6 +154,9 @@ void GameSurfaceSDL::drawCreatureStatus(Creature *creaturePtr) POS_ORDER, POS_CHAOS, POS_BALANCE, + POS_HEIGHT, + POS_WEIGHT, + POS_BODY_SIZE, POS_MAX }; @@ -177,6 +180,9 @@ void GameSurfaceSDL::drawCreatureStatus(Creature *creaturePtr) {200, 210, 0, 0}, {200, 230, 0, 0}, {200, 250, 0, 0}, + {10, 130, 0, 0}, + {10, 150, 0, 0}, + {10, 170, 0, 0}, }; SDL_Rect CreatureStatusViewRect[POS_MAX]; @@ -205,6 +211,9 @@ void GameSurfaceSDL::drawCreatureStatus(Creature *creaturePtr) sprintf_s(statusBuf[POS_CON], STATUS_BUFSIZE, "‘Ï‹v:%4d", creaturePtr->GetCurrentStatus(CS_CON)); sprintf_s(statusBuf[POS_CHA], STATUS_BUFSIZE, "–£—Í:%4d", creaturePtr->GetCurrentStatus(CS_CHA)); sprintf_s(statusBuf[POS_SOUL], STATUS_BUFSIZE, "ƒ\ƒEƒ‹:%4d", creaturePtr->GetCurrentSoul()); + sprintf_s(statusBuf[POS_HEIGHT], STATUS_BUFSIZE, "g’·:%6dcm", creaturePtr->GetHeight()); + sprintf_s(statusBuf[POS_WEIGHT], STATUS_BUFSIZE, "‘̏d:%6dkg", creaturePtr->GetWeight()); + sprintf_s(statusBuf[POS_BODY_SIZE], STATUS_BUFSIZE, "‘ÌŠi:%3d", creaturePtr->GetSize()); for(id = 0; id < POS_MAX; id++) { -- 2.11.0