base:lines
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
base:lines [2015-11-19 13:28] – [Run length slice] bitbreaker | base:lines [2016-07-19 12:51] (current) – [Bresenham] bitbreaker | ||
---|---|---|---|
Line 20: | Line 20: | ||
* steep slope with decrementing y and decrementing on x | * steep slope with decrementing y and decrementing on x | ||
- | The versions for decrementing/ | + | The versions for decrementing/ |
- | So for steep slopes we always take one y step per pixel, but when our error value overflows we take also a step in x direction. For that we use a mask to cover 8 x steps. So a stepping for e.g. one pixel to teh right is just a shift on the mask with lsr mask. The good thing is, when the pixel falls out on the right side, the carry will be set, and thus we know when we bump on the end of our column that we draw in, no matter if we draw on a hires screen or a 16x16 charset grid. In that case we have to do further steps, like adjusting the target where we write the pixels to, as well as resetting the mask to $80 in that case. | + | So for steep slopes we always take one y step per pixel, but when our error value overflows we take also a step in x direction. For that we use a mask to cover 8 x steps. So a stepping for e.g. one pixel to the right is just a shift on the mask with lsr mask. The good thing is, when the pixel falls out on the right side, the carry will be set, and thus we know when we bump on the end of our column that we draw in, no matter if we draw on a hires screen or a 16x16 charset grid. In that case we have to do further steps, like adjusting the target where we write the pixels to, as well as resetting the mask to $80 in that case. |
===== Pixel collecting on flat slopes ===== | ===== Pixel collecting on flat slopes ===== |
base/lines.1447936123.txt.gz · Last modified: 2015-11-19 13:28 by bitbreaker