In general, you'll need to modify your keyboard handling from: match keypress. The previous keyboard handling didn't allow handling of certain special characters and we had to change the layout of the tcod::input::Key struct to fix it. you will have to either do it yourself or convert it to time::Duration if you want that dependency. ![]() If you want to operate with the values returned by get_elapsed_time etc. DurationĬurrently, std::time::Duration has fewer utility methods. If the field is true, the event is a repetition, otherwise, it is the first time the event has been emitted. We aren't going to require the newest versions frivolously, but when there is a language feature or a stdlib utility we want to adopt, we will do so once it becomes stable. SDL2 allows you to detect repeated key events with the repeat field on Event::KeyDown and Event::KeyUp. In general, tcod-rs tracks the stable track of Rust rather than any specific version. Migrating from tcod 0.7.x to 0.8.0 Rust 1.3įirst and foremost, you will need to update to Rust 1.3 or newer because we use the newly-stabilised std::time::Duration. Added non-consuming iterators for pathfinding.implemented operator overloading traits for std::colors::Color.Implemented the Default and Debug traits to various structs. ![]() Ported the C++ libtcod samples code to Rust (see the samples example).Added the pseudorandom number generator bindings.Dijkstra pathfinding now passes Valgrind.See the bottom of the notes for guides on how to port your code over. Replaced time::Duration from the third-party time to std::time::Duration available in Rust 1.3 and newer.Changed the tcod::input::Key struct to allow handling special keys such as $ and #. ![]() Changed mut * to const * in signatures of various BSP methods in tcod_sys.Made the tree field of TCOD_bsp_t in tcod_sys private and added an unsafe method to access it.Unfortunately, we've introduced some breaking changes. Huge thanks to Gustorm and tomob! We're almost on parity with libtcod.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |