tomassedovic/tcod-rs — pull request #24 by tomassedovic (2014-11-01 21:58:27+00:00)
Title: POC: Fix the colour constants exported by libtcod

tcod-rs was using two separate structs to represent colours. The first one was
created by rust-bindgen in `tcod::ffi::TCOD_color_t` and the second one is in
`tcod::Color`.

All the colour constants libtcod comes with were declared as statics in the
`ffi` module and used `TCOD_color_t` but all the safe interface was using the
`tcod::Color` struct.

There was no safe and easy way to convert between the two and one could not e.g.
create a separate module which re-exported the C-namespaced names to something
more pleasant and ready to use.

This fixes both by changing the `TCOD_color_t` definition to a re-export of
`tcod::Color` (they always had the same layout). We can go the other way around,
too, but this allows us to keep `impl Color` in `lib.rs` and keep the hand
modifications to `ffi.rs` to a minimum (which is good since that file is
generated by rust-bindgen).