View Single Post
Old 16 December 2019, 19:04   #13
a/b
Registered User

 
Join Date: Jun 2016
Location: europe
Posts: 174
OK, i see. Not a typical poly renderer.

Option 1:
Assuming you clear the entire bitplane beforehand, and the horizon is a simple straight line: find min_y and max_y (screen coords) of the plane while drawing sky/plane lines and then only fill between them.

Option 2:
How about a simple post-processing loop to clear bytes that are equal to 1 (only the rightmost pixel is set), something like:
Code:
char  table[256] = { 0, 0, 2, 3, 4, ..., 255 };  // 1 is mapped to 0, the rest is unchanged
char* p_plane = sky_plane_bitplane+width/8-1; // last byte of the first line
for (int h = 0;  h < height;  ++h)
  { *p_plane = table[*p_plane];  p_plane += width/8; }
a/b is offline  
 
Page generated in 0.04305 seconds with 11 queries