[AD] [ alleg-Bugs-1692717 ] some bugs

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Bugs item #1692717, was opened at 2007-04-02 08:25
Message generated for change (Comment added) made by scherno2000
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1692717&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: erno (scherno2000)
Assigned to: Nobody/Anonymous (nobody)
Summary: some bugs

Initial Comment:
1. rest(0) does not yield.
2. in fbcon.c console_users is incremented twice, but decremented only once.
3. If allegro application is run in console mode, and get_tty() returns 0 (running application from midnight commander), problems with threads created before fork().
4. If allegro application is run in console mode, from midnight commander, then the shell thinks the application is ended too early because of main process is killed in allegro initialization.

Please read the readme file in attached zip file.


----------------------------------------------------------------------

>Comment By: erno (scherno2000)
Date: 2007-04-10 15:29

Message:
Logged In: YES 
user_id=1542934
Originator: YES

I try to describe the main idea in my loop:

The old _show_polygon() works fine excepting the bottom lines or vertices,
where are missing points, or horizontal lines.
You can imagine the same polygon mirrored by a horizontal axis. Then every
bottom will be top, and every top will be bottom. The same algorithm will
give correct results for every line, that is not bottom on the mirrored
polygon, or equivalently, not on the top of the original polygon.
Making an union of drawn segments of corresponding lines of original and
mirrored polygons, will give correct results for any case.
The algorithm makes exactly this:
The first
  if(edge->bottom != c)
  {
    up=1-up;
  }
simulates drawing like in original algorithm ignoring bottoms(they were
discarded before in original algorithm), if up==1 then is must be drawn,
else no.

The second
  if(edge->top != c)
  {
    dn=1-dn;
  }
simulates drawing of the same line, but viewed as the mirrored polygon.
The bottom of mirrored polygon is top on the original.
If dn==1 should draw, else no.

The next if checks if the union of up and dn is a beginning of a
horizontal line(if last up+dn==0 and current up+dn!=0) then must begin a
new line and x is saved.
If last up+dn!=0 and current up+dn==0, then line ends, and it will really
draw in the bitmap from saved x to the endpoint.

I hope you understand my not too good English.

----------------------------------------------------------------------

Comment By: Elias Pschernig (elias)
Date: 2007-04-10 13:41

Message:
Logged In: YES 
user_id=32894
Originator: NO

The result of the polygon test looks nice, I'm not sure I follow the
change though.. could you describe what was wrong in the edge loop and how
you fixed it?

----------------------------------------------------------------------

Comment By: Milan Mimica (mmimica)
Date: 2007-04-10 13:11

Message:
Logged In: YES 
user_id=1171214
Originator: NO

Commited the fix for the display_switch_lock() problem. Thanks!

----------------------------------------------------------------------

Comment By: erno (scherno2000)
Date: 2007-04-10 12:16

Message:
Logged In: YES 
user_id=1542934
Originator: YES

I agree with you.
I corrected the polygon.c, now should be correct.
I sent the new polygon.c and the diff file too, with the test program.

About console: I discovered another dependency: when set_gfx_mode is
called, then console mus't be already initialized, because
display_switch_lock uses __al_linux_console_fd.
I corrected this by defining the sys_linux_save_console_state() and
sys_linux_restore_console_state() in lsystem.c.

For files see the attachment.

File Added: temp.zip

----------------------------------------------------------------------

Comment By: Elias Pschernig (elias)
Date: 2007-04-06 09:51

Message:
Logged In: YES 
user_id=32894
Originator: NO



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/