View Single Post
Old December 10, 2016, 02:07   #3
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
That looks good! If you have any additional questions, feel free to ask.

Originally Posted by droof View Post
I used int instead of byte for the color, because grid_data_as_text() also uses "int a" for the color value.
Well, it doesn't really matter, because of what C calls 'default argument promotions'... or is it 'usual arithmetic conversions'? Something like that Anyway, this stuff only makes any sense if you know assembler, so don't care about it. Int is fine.

I'm sure the added code could be improved, but at least it is working, stable and no compiler complaints.
The new colors won' persist through saving/loading (I'd expect all new colors to become black *), so if you want it, take a look at wr_dungeon_aux()/rd_dungeon_aux() (save.c and load.c, respectively). There are some general explanations in savefile.c.
Also, tiles are ruined now If you want them to work, you can move color assignement into grid_get_attr(), since that one is called only when tiles are not used.

*edit: come to think of it, they should turn into white again? I haven't actually tested it yet

Last edited by t4nk; December 10, 2016 at 04:03.
t4nk is offline   Reply With Quote