OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Network2Dialogs.cpp File Reference
#include "C4Include.h"
#include "network/C4Network2Dialogs.h"
#include "network/C4Network2.h"
#include "network/C4Network2Stats.h"
#include "game/C4Viewport.h"
#include "gui/C4GameOptions.h"
#include "game/C4Game.h"
#include "player/C4PlayerList.h"
#include "control/C4GameControl.h"
#include "graphics/C4GraphicsResource.h"
#include "graphics/C4Draw.h"
#include "gui/C4Startup.h"
#include "lib/StdColors.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
Include dependency graph for C4Network2Dialogs.cpp:

Go to the source code of this file.

Functions

int GetValueDecade (int iVal)
 
int GetAxisStepRange (int iRange, int iMaxSteps)
 

Function Documentation

int GetAxisStepRange ( int  iRange,
int  iMaxSteps 
)

Definition at line 775 of file C4Network2Dialogs.cpp.

References GetValueDecade().

Referenced by C4Chart::DrawElement().

776 {
777  // try in steps of 5s and 10s
778  int iDec = GetValueDecade(iRange);
779  if (iDec == 1) return 1;
780  int iNextStepDivider = 2;
781  while (iDec>=iNextStepDivider && iNextStepDivider*iRange/iDec <= iMaxSteps)
782  {
783  iDec/=iNextStepDivider;
784  iNextStepDivider = 7 - iNextStepDivider;
785  }
786  return iDec;
787 }
int GetValueDecade(int iVal)

Here is the call graph for this function:

Here is the caller graph for this function:

int GetValueDecade ( int  iVal)

Definition at line 767 of file C4Network2Dialogs.cpp.

Referenced by C4Chart::DrawElement(), and GetAxisStepRange().

768 {
769  // get enclosing decade
770  int iDec = 1;
771  while (iVal) { iVal/=10; iDec*=10; }
772  return iDec;
773 }

Here is the caller graph for this function: