Fix more Rust style.
Add features "debug" and "debug_sprite" on cargo so we can use some
ifdefs.
Add build DEBUG and RELEASE to QtCreator project. Debug will use
feature "debug_sprite".
Start to generalise some code.