NCURSES ACS_* constants don't play nicely with mvchgat()...?

Hi all... first post. Whee.

I'm trying to brush up on my C++ by writing a roguelike. I'm using the NCURSES ACS_* constants for linedraw characters to draw walls, floors, and passageways. These characters display correctly only as long as I'm not messing with the display attributes in the space where I'm drawing.

For example, I have the following in my drawSpace() function:

1
2
mvaddch( row, col, ACS_BULLET ) ; // I'm using the bullet character for the floor.
mvchgat( row, col, 1, A_DIM, 2, NULL ) ; // Sets to a dull grassy green. 


If I remove/comment the call to mvchgat() then the bullet is drawn normally. If I add it in, then I get a tilde character instead. (I'm guessing this is some kind of buffer wrap of the large ACS_BULLET constant inside a char buffer.) This happens in terminal windows using any font, and also happens in Windows/puTTY. I haven't tried it on a console but I suspect it might behave similarly...?

Might anyone have any tips as to how I might be able to set color attributes for these special characters? I know I could just use normal printable characters -- I have in fact successfully tested it -- but I'd rather use the fancy boxdraw and shading characters if possible.
The problem is that the second call is removing the bit for A_ALTCHARSET.
If you change that second line to
mvchgat( row, col, 1, A_DIM | ALT_CHARSET, 2, NULL ) ;
then you should get the expected result.

(this might be a bug in ncurses, then again it might be simply a misfeature)
(@TEDickey) That did the trick; thanks! I guess the connection between constants named ACS and the property ALT_CHARSET was too subtle for me... ^_^'
Topic archived. No new replies allowed.