Skip to content

Commit

Permalink
Display debug build net usage meter at bottom of player window, indep…
Browse files Browse the repository at this point in the history
…endently of player window size.

Text no longer covers player 8.

Only affects debug builds.
  • Loading branch information
Cyp committed Sep 5, 2012
1 parent 9575cf9 commit 5c219f8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/multimenu.cpp
Expand Up @@ -87,7 +87,6 @@ UDWORD current_numplayers = 4;
#define MULTIMENU_FORM_X 10 + D_W
#define MULTIMENU_FORM_Y 23 + D_H
#define MULTIMENU_FORM_W 620
#define MULTIMENU_FORM_H 295

#define MULTIMENU_PLAYER_H 32
#define MULTIMENU_FONT_OSET 20
Expand Down Expand Up @@ -826,19 +825,19 @@ static void displayExtraGubbins(UDWORD height)

char const *srText[2] = {_("Sent/Received per sec —"), _("Total Sent/Received —")};
sprintf(str, srText[q]);
iV_DrawText(str, MULTIMENU_FORM_X + xPos, MULTIMENU_FORM_Y + MULTIMENU_FORM_H + yPos);
iV_DrawText(str, MULTIMENU_FORM_X + xPos, MULTIMENU_FORM_Y + height + yPos);
xPos += iV_GetTextWidth(str) + 20;

sprintf(str, _("Traf: %u/%u"), NETgetStatistic(NetStatisticRawBytes, true, isTotal), NETgetStatistic(NetStatisticRawBytes, false, isTotal));
iV_DrawText(str, MULTIMENU_FORM_X + xPos, MULTIMENU_FORM_Y + MULTIMENU_FORM_H + yPos);
iV_DrawText(str, MULTIMENU_FORM_X + xPos, MULTIMENU_FORM_Y + height + yPos);
xPos += iV_GetTextWidth(str) + 20;

sprintf(str, _("Uncompressed: %u/%u"), NETgetStatistic(NetStatisticUncompressedBytes, true, isTotal), NETgetStatistic(NetStatisticUncompressedBytes, false, isTotal));
iV_DrawText(str, MULTIMENU_FORM_X + xPos, MULTIMENU_FORM_Y + MULTIMENU_FORM_H + yPos);
iV_DrawText(str, MULTIMENU_FORM_X + xPos, MULTIMENU_FORM_Y + height + yPos);
xPos += iV_GetTextWidth(str) + 20;

sprintf(str, _("Pack: %u/%u"), NETgetStatistic(NetStatisticPackets, true, isTotal), NETgetStatistic(NetStatisticPackets, false, isTotal));
iV_DrawText(str, MULTIMENU_FORM_X + xPos, MULTIMENU_FORM_Y + MULTIMENU_FORM_H + yPos);
iV_DrawText(str, MULTIMENU_FORM_X + xPos, MULTIMENU_FORM_Y + height + yPos);
}
#endif
return;
Expand Down Expand Up @@ -1261,7 +1260,7 @@ bool addDebugMenu(bool bAdd)
sFormInit.x =(SWORD)(DEBUGMENU_FORM_X);
sFormInit.y =(SWORD)(DEBUGMENU_FORM_Y);
sFormInit.width = DEBUGMENU_FORM_W;
sFormInit.height = (UWORD)formHeight; //MULTIMENU_FORM_H;
sFormInit.height = formHeight;
sFormInit.pDisplay = intOpenPlainForm;
sFormInit.disableChildren = true;

Expand Down Expand Up @@ -1340,7 +1339,7 @@ bool intAddMultiMenu(void)
sFormInit.x =(SWORD)(MULTIMENU_FORM_X);
sFormInit.y =(SWORD)(MULTIMENU_FORM_Y);
sFormInit.width = MULTIMENU_FORM_W;
sFormInit.height = (UWORD)(MULTIMENU_PLAYER_H*game.maxPlayers + MULTIMENU_PLAYER_H+7); //MULTIMENU_FORM_H;
sFormInit.height = MULTIMENU_PLAYER_H*game.maxPlayers + MULTIMENU_PLAYER_H + 7;
sFormInit.pDisplay = intOpenPlainForm;
sFormInit.disableChildren = true;

Expand Down

0 comments on commit 5c219f8

Please sign in to comment.