Clean up some warnings.

This commit is contained in:
2016-06-07 23:54:15 +02:00
parent bdd3d4db3a
commit a4f31c0397
5 changed files with 6 additions and 61 deletions

View File

@@ -1,10 +1,9 @@
#[deny(trivial_casts, trivial_numeric_casts)]
extern crate sdl2;
extern crate sdl2_image;
use std::path::Path;
use std::cell::{Cell, RefCell};
use std::collections::HashMap;
use sdl2_image::LoadTexture;
use sdl2::rect::Rect;
@@ -15,7 +14,6 @@ use sdl2::render::{Renderer, Texture};
use tile::Layer;
use camera::Camera;
// use player::Player;
use keyboard::KeyboardHandler;
use sprite::{Sprite, StaticSprite, AnimatedSprite};
use timer::Timer;
@@ -24,11 +22,9 @@ use timer::Timer;
mod timer;
mod tile;
mod camera;
mod player;
mod keyboard;
mod sprite;
const SCREEN_WIDTH : u32 = 960;
const SCREEN_HEIGHT : u32 = 640;
@@ -44,7 +40,6 @@ const PLAYER_ACCELERATION_X_START : f32 = 0.02;
const PLAYER_ACCELERATION_X_STOP : f32 = 0.15;
const PLAYER_ACCELERATION_X_CHANGE : f32 = 0.06;
struct GameObject<'a> {
pub x: f32,
pub y: f32,
@@ -95,15 +90,13 @@ trait Renderable {
fn render(&self, &GameObject, f64, &mut Renderer, &Rect);
}
struct PlayerPhysicsComponent;
impl Updatable for PlayerPhysicsComponent {
fn update(&self, object: &GameObject) {
fn update(&self, _: &GameObject) {
}
}
struct PlayerGraphicsComponent<'a> {
flip_horizontal: Cell<bool>,
sprite_standing: RefCell<StaticSprite<'a>>,
@@ -144,7 +137,6 @@ impl<'a> Renderable for PlayerGraphicsComponent<'a> {
}
}
#[derive(Clone)]
enum Tile<'a> {
Empty,
@@ -153,7 +145,6 @@ enum Tile<'a> {
Floor(Rect)
}
fn main() {
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
@@ -553,7 +544,5 @@ fn main() {
player.render(elapsed, &mut renderer, &player_rect);
renderer.present();
// sleep(std::time::Duration::from_millis(5));
}
}