• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

line rasterizer test


Commit MetaInfo

Révisionb2e37df1885c05eec08d623da211a0a03e12bbca (tree)
l'heure2011-02-14 01:55:16
Auteurberu <berupon@gmai...>
Commiterberu

Message de Log

slop correction revised
changed minimum width

Change Summary

Modification

--- a/gl/lineDrawer8_Shift.h
+++ b/gl/lineDrawer8_Shift.h
@@ -82,13 +82,16 @@ public:
8282 const NumericT gradient = dy / width;
8383 float rotation = abs(width / dy);
8484
85- alpha *= slopeCorrectionTable_[ ToInt(mul<slopeCorrectionTableSize - 1>(abs(gradient))) ];
86-
85+ {
86+ float r2 = width < height ? (width/height) : (height/width);
87+ alpha *= slopeCorrectionTable_[ ToInt(mul<slopeCorrectionTableSize - 1>(r2)) ];
88+ }
8789 uint8_t pat1[512] = {0};
8890 uint8_t pat2[512+1];
8991
90- float patLen = rotation * 1.28;
92+ float patLen = rotation * 1.4;
9193 patLen = std::min(256.0f, patLen);
94+ patLen = std::max(1.50001f, patLen);
9295 int iPatLen = ceil(patLen);
9396 for (size_t i=0; i<iPatLen; ++i) {
9497 float x = (i * 2) / patLen;
@@ -112,7 +115,7 @@ public:
112115 const size_t w = iPatLen * 2;
113116 shift(pat1, pat2, w, fracOffset);
114117 for (size_t x=0; x<w; ++x) {
115- ptr[io+x] = pat2[x];
118+ ptr[io+x] = pat2[x] * (alpha / 255.0);
116119 }
117120 OffsetPtr(ptr, lineOffset);
118121 curOffset += offset;