Changeset View
Changeset View
Standalone View
Standalone View
imagelib/kpPainter.cpp
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 77 | #endif | |||
---|---|---|---|---|---|
78 | 78 | | |||
79 | QList <QPoint> ret; | 79 | QList <QPoint> ret; | ||
80 | 80 | | |||
81 | Q_ASSERT (probability >= 0.0 && probability <= 1.0); | 81 | Q_ASSERT (probability >= 0.0 && probability <= 1.0); | ||
82 | const int probabilityTimes1000 = qRound (probability * 1000); | 82 | const int probabilityTimes1000 = qRound (probability * 1000); | ||
83 | #define SHOULD_DRAW() (probabilityTimes1000 == 1000/*avoid ::RandomNumberFrom0to999() call*/ || \ | 83 | #define SHOULD_DRAW() (probabilityTimes1000 == 1000/*avoid ::RandomNumberFrom0to999() call*/ || \ | ||
84 | ::RandomNumberFrom0to999 () < probabilityTimes1000) | 84 | ::RandomNumberFrom0to999 () < probabilityTimes1000) | ||
85 | 85 | | |||
86 | #if 0 | | |||
87 | qCDebug(kpLogImagelib) << "prob=" << probability | | |||
88 | << " *1000=" << probabilityTimes1000; | | |||
89 | #endif | | |||
90 | | ||||
91 | 86 | | |||
92 | // Derived from the zSprite2 Graphics Engine. | 87 | // Derived from the zSprite2 Graphics Engine. | ||
93 | // "MODIFIED" comment shows deviation from zSprite2 and Bresenham's line | 88 | // "MODIFIED" comment shows deviation from zSprite2 and Bresenham's line | ||
94 | // algorithm. | 89 | // algorithm. | ||
95 | 90 | | |||
96 | const int x1 = startPoint.x (), | 91 | const int x1 = startPoint.x (), | ||
97 | y1 = startPoint.y (), | 92 | y1 = startPoint.y (), | ||
98 | x2 = endPoint.x (), | 93 | x2 = endPoint.x (), | ||
▲ Show 20 Lines • Show All 421 Lines • Show Last 20 Lines |