Skip to content

Commit

Permalink
Merge pull request #126 from tomassedovic/rust-master
Browse files Browse the repository at this point in the history
Update to Rust master & various fixes
  • Loading branch information
tomassedovic committed Mar 22, 2015
2 parents 3d808e7 + b7e9c33 commit 90e4aea
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 37 deletions.
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "tcod"
description = "The Rust bindings for the Doryen library (a.k.a. libtcod)."
version = "0.5.0"
version = "0.5.1"
homepage = "https://github.com/tomassedovic/tcod-rs"
repository = "https://github.com/tomassedovic/tcod-rs"
documentation = "http://tomassedovic.github.io/tcod-rs/tcod/index.html"
readme = "README.md"
keywords = ["gamedev", "roguelike", "libtcod"]
license = "WTFPL"
Expand All @@ -22,10 +23,11 @@ path = "src/lib.rs"

[dependencies]
bitflags = "0.1"
libc = "0.1.2"

[dependencies.tcod-sys]
path = "tcod-sys"
version = "2.0.5"
version = "2.0.6"

[dev-dependencies]
rand = "0.1.2"
rand = "0.2.1"
65 changes: 34 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,12 @@ useful functionality such as:
* Keyboard and mouse input
* Path finding
* Field of view
* Portable (works on linux and windows; mac too but requires some effort)
* Portable (works on linux, windows and mac)
* [Lots of other stuff](http://roguecentral.org/doryen/libtcod/features/)


This project provides [Rust](http://www.rust-lang.org/) bindings for libtcod
v1.5.1 (current stable).

**The only version tested and known to work is `libtcod 1.5.1`.** Link to other
versions (e.g. the `1.5.2` or `1.6.0` nightlies) at your own peril!

Rust is a new-ish systems programming language that aims to be fast (on the C++
level), memory and data-race safe, modern (first-class modules instead of a
preprocessor text-include hack, type inference, pattern matching, closures).

We track the nightly releases of Rust, usually lagging a few days behind. The
latest version of rustc tested:

```sh
$ rustc --version
rustc 0.11.0-pre-nightly (7ec7805 2014-06-16 08:16:49 +0000)
```
v1.5.2.

This project follows [Semantic Versioning](http://semver.org/). Since we're
under `1.0.0` anything goes. The API can change at any time.
Expand All @@ -39,24 +24,39 @@ Indeed, it probably should change! If you have better ideas on how it make it
safer or more familiar to Rust developers, please let us know.


Documentation
---------------

We run `rustdoc` on every new commit:

http://tomassedovic.github.io/tcod-rs/tcod/index.html

But that's mostly useful for types, function signatures, etc. We don't have much
in term of actual docs, but you can always check the official ones:

http://roguecentral.org/doryen/data/libtcod/doc/1.5.1/index2.html?c=true


Current status
--------------

All raw tcod bindings are available via the `ffi` module. In addition we want to
provide safe (and more in line with the Rust style) wrappers. These are far from
complete however.
All raw tcod bindings are available via the `tcod-sys` crate. In addition we
want to provide safe (and more in line with the Rust style) wrappers -- if you
can segfault outside of `unsafe` blocks, that's a bug. The safe bindings are not
yet complete, however.

### Implemented
### Already Implemented

* Most of the _Console_ features (new, init_root, blit, putting text on the
screen, reading key presses, etc.)
* Most of _Map_ (new, size, set, is_walkable)
* A\* and Dijkstra _Path_ finding
* Some of the _System_ layer (get/set FPS, last frame length)
* _Colors_
* _Console_
* Most of the _System_ layer (FPS, time, fullscreen, screenshots)
* _Field of view_
* _Map_
* _Path finding_ (both A\* and Dijkstra)

### Probably Won't Ever Be Implemented Because Rust Provides This Already
* Filesystem utilities
* All purposes container
* Containers
* Pseudorandom generator (Rust has good RNGs, but maybe we want to provide this
anyway for people porting existing code depending on tcod's RNG to Rust?)
* Compression toolkit (there will probably be a better Rust library for this)
Expand All @@ -65,6 +65,7 @@ complete however.
* Everything else!



How to use this
---------------

Expand All @@ -78,8 +79,8 @@ building process. [See below](#using-existing-binary-distribution).
To use `tcod-rs`, add this to your game's `Cargo.toml`:

```toml
[dependencies.tcod]
git = "https://github.com/tomassedovic/tcod-rs.git"
[dependencies]
tcod = "*"
```

### Building on Linux
Expand Down Expand Up @@ -152,6 +153,10 @@ If you don't want to build libtcod yourself, you can
[instruct Cargo to override the build script](http://doc.crates.io/build-script.html#overriding-build-scripts). See `.cargo/config`
from the repository for an example.

NOTE: The official MinGW pre-built libraries (for Windows)
[don't seem to work with tcod-rs](https://github.com/tomassedovic/tcod-rs/issues/54).
We're not sure exactly why this is so we'd appreciate anyone's help!


Contributing
------------
Expand All @@ -168,8 +173,6 @@ typos) gets accepted, you'll get a commit access if you want it.
We accept GitHub as well as regular pull requests (i.e. emailing or tweeting the
URL of your feature branch works).

Please make sure it builds against the latest `rustc`.

You can regenerate the raw bindings by running:

```sh
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(libc, std_misc, core, path_ext)]
#![feature(std_misc, core, path_ext)]

extern crate libc;
extern crate "tcod-sys" as ffi;
Expand Down
5 changes: 4 additions & 1 deletion tcod-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tcod-sys"
description = "Raw FFI bindings & build script to link against libtcod."
version = "2.0.5"
version = "2.0.6"
license = "WTFPL"
homepage = "https://github.com/tomassedovic/tcod-rs"
repository = "https://github.com/tomassedovic/tcod-rs/tree/master/tcod-sys"
Expand All @@ -12,3 +12,6 @@ build = "build.rs"
[lib]
name = "tcod-sys"
path = "lib.rs"

[dependencies]
libc = "0.1.2"
1 change: 0 additions & 1 deletion tcod-sys/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals,
missing_copy_implementations, raw_pointer_derive)]
#![feature(libc)]
// This is not added by rust-bindgen even though it's used heavily in the
// generated code:
extern crate libc;
Expand Down

0 comments on commit 90e4aea

Please sign in to comment.