MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / DrawObject

Function DrawObject

xgeneral.cpp:1562–1732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1560// Draw the glyph of an object at particular coordinates on the screen.
1561
1562void DrawObject(int obj, int x, int y)
1563{
1564 char szGlyph[4];
1565 flag fNoText = fFalse, fDoThin, fCustomGlyph;
1566 int col, nFont, ch, nScale;
1567
1568 if (!gs.fLabel) // If inhibiting labels, then do nothing.
1569 return;
1570 if (obj < 0) {
1571 // Negative object index means skip drawing glyph as letter abbreviation.
1572 obj = -obj-1;
1573 fNoText = fTrue;
1574 }
1575
1576 col = kObjB[obj];
1577#ifdef EXPRESS
1578 // Adjust color if AstroExpression says to do so.
1579 if (!us.fExpOff && FSzSet(us.szExpColObj)) {
1580 ExpSetN(iLetterY, obj);
1581 ExpSetN(iLetterZ, col);
1582 ParseExpression(us.szExpColObj);
1583 col = NExpGet(iLetterZ);
1584 if (!FValidColorA(col))
1585 col = kBlack;
1586 }
1587#endif
1588 DrawColor(col);
1589
1590 fCustomGlyph = (szDrawObject[obj] != szDrawObjectDef[obj] ||
1591 szDrawObject2[obj] != szDrawObjectDef2[obj]);
1592 nFont = fCustomGlyph ? 0 : gs.nFontObj;
1593 ch = -1;
1594 nScale = 100;
1595 if (nFont == fiAstro && obj <= cuspHi && szObjectFontAstro[obj] > ' ')
1596 ch = szObjectFontAstro[obj];
1597 else if (nFont == fiEnigma && obj <= dwarfHi &&
1598 szObjectFontEnigma[obj] > ' ') {
1599 ch = szObjectFontEnigma[obj];
1600 if (obj == oEri && gs.nGlyphEri == 2)
1601 ch = 236;
1602 y -= gi.nScale;
1603 } else if (nFont == fiHamburg && obj <= uranHi &&
1604 szObjectFontHamburg[obj] > ' ') {
1605 ch = szObjectFontHamburg[obj];
1606 if (obj == oUra && gs.nGlyphUra == 2)
1607 ch = 130;
1608 else if (obj == oPlu && gs.nGlyphPlu == 2)
1609 ch = 132;
1610 else if (obj == oLil && gs.nGlyphLil == 2)
1611 ch = '`';
1612 else if (obj == oVtx && gs.nGlyphVer == 2)
1613 ch = 149;
1614 y += gi.nScale;
1615 } else if (nFont == fiAstronom && obj <= dwarfHi) {
1616 ch = szObjectFontAstronomicon[obj];
1617 if (obj == oUra && gs.nGlyphUra == 2)
1618 ch = 'a';
1619 else if (obj == oPlu && gs.nGlyphPlu == 2)

Callers 15

FEvalFunctionFunction · 0.85
DrawSidebarFunction · 0.85
DrawWheelFunction · 0.85
DrawSymbolRingFunction · 0.85
DrawObjectsFunction · 0.85
xcharts0.cppFile · 0.85
XChartAstroGraphFunction · 0.85
XChartGridFunction · 0.85
XChartTelescopeFunction · 0.85
XChartLocalFunction · 0.85
xcharts1.cppFile · 0.85
XChartDispositorFunction · 0.85

Calls 13

ExpSetNFunction · 0.85
NExpGetFunction · 0.85
DrawColorFunction · 0.85
AdjustGlyphFunction · 0.85
DrawThickFunction · 0.85
DrawGlyphFunction · 0.85
PsFontFunction · 0.85
MetaSelectFunction · 0.85
MetaWordFunction · 0.85
SvgTextFunction · 0.85
AdjustCoordinatesFunction · 0.85
DrawTurtleFunction · 0.85

Tested by

no test coverage detected