Re-implement gradient selections

Uncomments and makes available selection.gradient in Lua. (The backend C
code for this still existed, it just wasn't used.)

The only valid way to specify a gradient is with a table. I considered
adding non-table versions, but decided that there are too many
independent variables that can be optional. A non-table version, without
named parameters, would be confusing to read, especially since most of
the arguments are ints.

Also adds an impossible in the (possibly unreachable) case that
selection_do_gradient gets called with a bad gradient type.
This commit is contained in:
copperwater
2020-02-29 11:06:30 -05:00
committed by Pasi Kallinen
parent 407f65aa8a
commit 0befdbfd02
3 changed files with 70 additions and 4 deletions

View File

@@ -2514,6 +2514,8 @@ E struct selectionvar *FDECL(selection_filter_mapchar, (struct selectionvar *,
E void FDECL(set_floodfillchk_match_under, (XCHAR_P));
E void FDECL(selection_do_ellipse, (struct selectionvar *,
int, int, int, int, int));
E void FDECL(selection_do_gradient, (struct selectionvar *, long, long,
long, long, long, long, long, long));
E void NDECL(update_croom);
E const char *FDECL(get_trapname_bytype, (int));
E void FDECL(l_register_des, (lua_State *));