Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Updates to compile with latest Rust #30

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ cgmath = "0.17.0"
lazy_static = "1.1"
simple_logger = "1.0.1"
threadpool = "1.0"
rhai = "0.9.0"
rhai = "0.19.8"
smallvec = "0.6.5"

[dependencies.conrod]
git = "https://github.com/Litecrafty/conrod"
features = ["glium", "winit"]

[dependencies.glium]
git = "https://github.com/Litecrafty/glium"
features = ["icon_loading"]
conrod = { git = "https://github.com/Litecrafty/conrod", features = ["glium", "winit"] }
glium = { git = "https://github.com/Litecrafty/glium", features = ["icon_loading"] }
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
- Clone the repository.
- Download and install [Rust](https://rustup.rs/) nightly.
- Open Minecraft 1.13 jar file using any zip extractor, and copy `assets/minecraft` to Litecraft `resources` folder, or use our Launcher in developer's mode.
- Build and run with `cargo run`
- Build and run with `cargo +nightly run`
- Profit!

# 🎉 F.A.Q
Expand Down
3 changes: 0 additions & 3 deletions src/core/camera/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use cgmath::prelude::*;
use cgmath::{ortho, perspective, Deg, Euler, Matrix4, Point3, Quaternion, Vector3};
use std::f32;

const YAW: f32 = -90.0;
const PITCH: f32 = 0.0;
Expand Down Expand Up @@ -106,8 +105,6 @@ impl Camera {

/// Get perspective matrix
pub fn perspective(&self) -> Matrix4<f32> {
use std::f32;

let zfar = 1024.0;
let znear = 1.0;

Expand Down
2 changes: 1 addition & 1 deletion src/core/resource_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl ResourceManager {
}

/// Get and load a font file
pub fn font(resource: &Resource) -> Result<Font, Box<Error>> {
pub fn font(resource: &Resource) -> Result<Font, Box<dyn Error>> {
use conrod::text::FontCollection;

info!("Loading font file '{}'", resource);
Expand Down
4 changes: 2 additions & 2 deletions src/core/resource_manager/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use std::io::{Error, ErrorKind};
use std::path::{Path, PathBuf};
use zip::read::ZipArchive;

type Result<T> = std::result::Result<T, Box<error::Error>>;
type Result<T> = std::result::Result<T, Box<dyn error::Error>>;

#[derive(PartialEq, Eq, Hash)]
/// Represents a resource URI and allows loading resource data
Expand Down Expand Up @@ -157,7 +157,7 @@ impl Resource {
let mut zipfile = ZipArchive::new(zipfile)?;

// Read resource from ZIP
let mut file = zipfile.by_name(&self.folder("assets"));
let file = zipfile.by_name(&self.folder("assets"));

// If file exist in zip
if let Ok(mut file) = file {
Expand Down
2 changes: 1 addition & 1 deletion src/core/resource_manager/shader_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use glium::Program;
use std::collections::HashMap;
use std::error::Error;

type Result<T> = std::result::Result<T, Box<Error>>;
type Result<T> = std::result::Result<T, Box<dyn Error>>;

pub struct ShaderManager {
shaders: HashMap<&'static str, Program>,
Expand Down
2 changes: 1 addition & 1 deletion src/gfx/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Canvas {
let resource_manager = ResourceManager::new(&display, &settings);

// Create default scene
let mut scene: Box<Scene> = Box::new(LoadingScene::new());
let mut scene: Box<dyn Scene> = Box::new(LoadingScene::new());

info!("Starting script engine!");

Expand Down
2 changes: 1 addition & 1 deletion src/gfx/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use glium::Frame;

pub enum SceneAction {
None,
ChangeScene(Box<Scene>),
ChangeScene(Box<dyn Scene>),
Quit,
}

Expand Down
2 changes: 1 addition & 1 deletion src/gfx/shapes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub struct Shapes {
}

impl Shapes {
pub fn new(display: &Display) -> Result<Shapes, Box<Error>> {
pub fn new(display: &Display) -> Result<Shapes, Box<dyn Error>> {
Ok(Shapes {
quad: {
(
Expand Down