I have a (somewhat exorbitant) number of these:
extern TCODLIB_API const TCOD_color_t TCOD_red;
extern TCODLIB_API const TCOD_color_t TCOD_flame;
extern TCODLIB_API const TCOD_color_t TCOD_orange;
extern TCODLIB_API const TCOD_color_t TCOD_amber;
extern TCODLIB_API const TCOD_color_t TCOD_yellow;
extern TCODLIB_API const TCOD_color_t TCOD_lime;
How can I get at the values on the Ruby side nicely? It feels like there should be an attach_const equivalent to attach_function, as used below:
module TCOD
extend FFI::Library
ffi_lib File.join(APP_ROOT, "libtcod-1.5.1/libtcod.so")
attach_function :color_RGB, 'TCOD_color_RGB', [:uchar, :uchar, :uchar], Color.val
end
I'd prefer not to have to redefine everything from lightest_sepia to desaturated_chartreuse if at all possible...