added missing tools
This commit is contained in:
1 parent
9afe83e68e
commit
534c172874
2 files changed
+45
No files matched your search
@@ -244,6 +244,18 @@ void frame(Dpi::Canvas &canvas, int x0, int y0, int x1, int y1, QColor cl0, QCol
|
||||
canvas.lineTo(x0, y1);
|
||||
}
|
||||
|
||||
void dLine(Dpi::Canvas &canvas, int x0, int x1, int y, QColor cl0, QColor cl1)
|
||||
{
|
||||
canvas.pen().setColor(cl0);
|
||||
canvas.moveTo(x0, y);
|
||||
canvas.lineTo(x1, y);
|
||||
canvas.pen().setColor(cl1);
|
||||
canvas.moveTo(x0 + 1, y + 1);
|
||||
canvas.lineTo(x1 + 1, y + 1);
|
||||
canvas.setPixel(x0, y + 1, cl0);
|
||||
canvas.setPixel(x1, y, cl1);
|
||||
}
|
||||
|
||||
void rframe(Dpi::Canvas &canvas, int x0, int y0, int x1, int y1, QColor cl0, QColor cl1)
|
||||
{
|
||||
canvas.pen().setColor(cl0);
|
||||
@@ -535,4 +547,30 @@ void imageOpCCC(Dpi::Bitmap &bmp, int x, int y, int width, int height, int color
|
||||
}
|
||||
}
|
||||
|
||||
int turnToYear(int turn)
|
||||
{
|
||||
int result = -4000;
|
||||
if (turn <= 0)
|
||||
return result;
|
||||
|
||||
auto consume = [&](int span, int yearsPerTurn) {
|
||||
const int n = std::min(span, turn);
|
||||
result += n * yearsPerTurn;
|
||||
turn -= n;
|
||||
};
|
||||
|
||||
consume(60, 50); // Year -4000..-1000, Turn 0..60
|
||||
if (turn == 0) return result;
|
||||
consume(40, 25); // Year -1000..0, Turn 60..100
|
||||
if (turn == 0) return result;
|
||||
consume(75, 20); // Year 0..1500, Turn 100..175
|
||||
if (turn == 0) return result;
|
||||
consume(25, 10); // Year 1500..1750, Turn 175..200
|
||||
if (turn == 0) return result;
|
||||
consume(50, 2); // Year 1750..1850, Turn 200..250
|
||||
if (turn == 0) return result;
|
||||
result += turn; // Year 1850.., Turn 250..
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user