#2 Polygon Drawing

closed-fixed
nobody
None
5
2010-07-20
2010-07-16
MarqW
No

Filling a 256 colour (1bpp) surface with a solid polygon renders dx + 1 pixels (dx = w = x2 - x1), however, on other surfaces, and using the textured method, it doesn't cover the extra pixel.

In fairness, the 256 colour one I believe is accurate. Take x1 = 3, and x2 = 5. Where dx = 5 - 3 = 2. But if you're drawing from 3 to 5, you do need to be drawing 3 pixels ( x2 - x1 + 1 ).

Could you adjust the width calculation to be w = x2 - x1 + 1 in hlineColor, _HLineTextured, and any other similar functions? (and remove the additional pixel in the 256col surface memset call)

Discussion

  • ferzkopp

    ferzkopp - 2010-07-20
    • status: open --> closed-fixed
     
  • ferzkopp

    ferzkopp - 2010-07-20

    Additional tests added to TestGfxPrimitives show identical rendering now for the "5 Pixel Polygon" case for colored and textured polygons.

     

Log in to post a comment.