OpenClonk
C4Network2Dialogs.cpp File Reference
#include "C4Include.h"
#include "network/C4Network2Dialogs.h"
#include "control/C4GameControl.h"
#include "game/C4Viewport.h"
#include "graphics/C4Draw.h"
#include "graphics/C4GraphicsResource.h"
#include "gui/C4GameOptions.h"
#include "gui/C4Startup.h"
#include "lib/StdColors.h"
#include "network/C4Network2.h"
#include "network/C4Network2Stats.h"
#include "player/C4PlayerList.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

◆ GetAxisStepRange()

int GetAxisStepRange ( int  iRange,
int  iMaxSteps 
)

Definition at line 772 of file C4Network2Dialogs.cpp.

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

References GetValueDecade().

Referenced by C4Chart::DrawElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetValueDecade()

int GetValueDecade ( int  iVal)

Definition at line 764 of file C4Network2Dialogs.cpp.

765 {
766  // get enclosing decade
767  int iDec = 1;
768  while (iVal) { iVal/=10; iDec*=10; }
769  return iDec;
770 }

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

Here is the caller graph for this function: