MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / DrawInfo

Method DrawInfo

engine/Poseidon/UI/Map/UIMapMain.cpp:927–958  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

925}
926
927void CStaticMapMain::DrawInfo()
928{
929 if (_scaleX > 0.2)
930 {
931 return;
932 }
933
934 float coef = 100.0; // width of field in global coord.
935 float invCoef = 0.01; // 1.0 / coef;
936
937 int xFrom = toIntFloor(-_mapX * _scaleX * coef);
938 int zFrom = toIntFloor((_invScaleY - (_h - _mapY)) * _scaleY * coef);
939 int xTo = toIntFloor((_w - _mapX) * _scaleX * coef);
940 int zTo = toIntFloor((_invScaleY - (-_mapY)) * _scaleY * coef);
941
942 float xBeg = _x + _mapX + xFrom * _invScaleX * invCoef;
943 float zBeg = _y + _mapY + (_invScaleY - zFrom * _invScaleY * invCoef);
944 float xFld = _invScaleX * invCoef;
945 float zFld = _invScaleY * invCoef;
946
947 float zAct = zBeg;
948 for (int z = zFrom; z <= zTo; z++)
949 {
950 float xAct = xBeg;
951 for (int x = xFrom; x <= xTo; x++)
952 {
953 DrawInfo(xAct, zAct - zFld, xFld, zFld, x, z);
954 xAct += xFld;
955 }
956 zAct -= zFld;
957 }
958}
959
960void CStaticMapMain::DrawInfo(float x, float y, float xStep, float yStep, int i, int j)
961{

Callers

nothing calls this directly

Calls 15

saturateMaxFunction · 0.85
DrawTextFMethod · 0.80
GetTextWidthFMethod · 0.80
Point2DFloatClass · 0.50
Rect2DFloatClass · 0.50
Rect2DPixelClass · 0.50
HeightMethod · 0.45
SizeMethod · 0.45
GetCostMethod · 0.45
GetIconMethod · 0.45
UseMipmapMethod · 0.45
TextBankMethod · 0.45

Tested by

no test coverage detected