-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Bug: If you do MODE0:CIRCLE FILL 500,500,800
then it misses out the middle horizontal few rows of the circle.
This bug does not seem to affect the version of brandy on debian apt (version 1.23.0, Feb 2024), but does affect the latest development version of brandy, so not sure when this bug was introduced.
The bug is here, in this first if line:
static void draw_h_line(SDL_Surface *sr, int32 x1, int32 x2, int32 y, Uint32 col, Uint32 action) {
if ((x1 < 0 || x1 >= ds.vscrwidth) && (x2 < 0 || x2 >= ds.vscrwidth )) return; // BUG HERE. This omits a line if x1<0 and x2>vscrwidth, which is not what we want.
if (x1 > x2) {
int32 tt = x1;
x1 = x2;
x2 = tt;
}
I think it should be:
static void draw_h_line(SDL_Surface *sr, int32 x1, int32 x2, int32 y, Uint32 col, Uint32 action) {
if (x1 > x2) {
int32 tt = x1;
x1 = x2;
x2 = tt;
}
if (x1 >= ds.vscrwidth || x2 < 0) return; // FIXED LINE (and moved line)
This fixes the issue. I've already patched this in my pull request for the sector/segment implementation. So you don't need to do anything other than pull.
Metadata
Metadata
Assignees
Labels
No labels