diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:21 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:21 +0100 |
commit | 83e4ac1499b548957c554f740934b9b2a02310aa (patch) | |
tree | c890dc4ca220a4ee53b88a729472050e6da0b9b9 | |
parent | 95708732572431dc057a9fd71fa8bd8571a336a2 (diff) |
refactor(all): 2018 edition
-rw-r--r-- | examples/render-bsp/Cargo.toml | 1 | ||||
-rw-r--r-- | examples/render-bsp/src/main.rs | 20 | ||||
-rw-r--r-- | stockton-levels/Cargo.toml | 1 | ||||
-rw-r--r-- | stockton-levels/src/lib.rs | 3 | ||||
-rw-r--r-- | stockton-render/Cargo.toml | 1 | ||||
-rw-r--r-- | stockton-render/src/draw/camera.rs | 2 | ||||
-rw-r--r-- | stockton-render/src/draw/draw_buffers.rs | 9 | ||||
-rw-r--r-- | stockton-render/src/draw/target.rs | 4 | ||||
-rw-r--r-- | stockton-render/src/draw/texture/image.rs | 2 | ||||
-rw-r--r-- | stockton-render/src/draw/texture/loader.rs | 4 | ||||
-rw-r--r-- | stockton-render/src/lib.rs | 12 | ||||
-rw-r--r-- | stockton-render/src/window.rs | 2 | ||||
-rw-r--r-- | stockton-types/src/lib.rs | 2 |
13 files changed, 16 insertions, 47 deletions
diff --git a/examples/render-bsp/Cargo.toml b/examples/render-bsp/Cargo.toml index b8b5a9d..eb58e4a 100644 --- a/examples/render-bsp/Cargo.toml +++ b/examples/render-bsp/Cargo.toml @@ -2,6 +2,7 @@ name = "render-bsp" version = "0.1.0" authors = ["Oscar <oscar.shrimpton.personal@gmail.com>"] +edition = "2018" [dependencies] stockton-render = { path = "../../stockton-render", features = ["vulkan"] } diff --git a/examples/render-bsp/src/main.rs b/examples/render-bsp/src/main.rs index 8278f1e..1f85ed8 100644 --- a/examples/render-bsp/src/main.rs +++ b/examples/render-bsp/src/main.rs @@ -15,28 +15,8 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -// This program is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation, either version 3 of the License, or (at your option) -// any later version. - -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -// more details. - -// You should have received a copy of the GNU General Public License along -// with this program. If not, see <http://www.gnu.org/licenses/>. - //! Renders ./example.bsp -extern crate log; -extern crate simple_logger; -extern crate stockton_levels; -extern crate stockton_render; -extern crate stockton_types; -extern crate winit; - use winit::{event::Event, event_loop::EventLoop, window::WindowBuilder}; use stockton_levels::{prelude::*, q3::Q3BSPFile}; diff --git a/stockton-levels/Cargo.toml b/stockton-levels/Cargo.toml index facae7d..d39b8d4 100644 --- a/stockton-levels/Cargo.toml +++ b/stockton-levels/Cargo.toml @@ -5,6 +5,7 @@ authors = ["Oscar <oscar.shrimpton.personal@gmail.com>"] description = "Library for parsing different types of .bsp files." repository = "https://github.com/tcmal/stockton" homepage = "https://github.com/tcmal/stockton" +edition = "2018" [dependencies] nalgebra = "^0.20" diff --git a/stockton-levels/src/lib.rs b/stockton-levels/src/lib.rs index dfe6e52..fa07fbf 100644 --- a/stockton-levels/src/lib.rs +++ b/stockton-levels/src/lib.rs @@ -31,10 +31,9 @@ #![allow(incomplete_features)] #![feature(generic_associated_types)] +extern crate nalgebra as na; #[macro_use] extern crate bitflags; -extern crate bitvec; -extern crate nalgebra as na; pub mod coords; pub mod features; diff --git a/stockton-render/Cargo.toml b/stockton-render/Cargo.toml index 5d46e66..eef6bc0 100644 --- a/stockton-render/Cargo.toml +++ b/stockton-render/Cargo.toml @@ -2,6 +2,7 @@ name = "stockton-render" version = "0.1.0" authors = ["Oscar <oscar.shrimpton.personal@gmail.com>"] +edition = "2018" [dependencies] stockton-levels = { path = "../stockton-levels" } diff --git a/stockton-render/src/draw/camera.rs b/stockton-render/src/draw/camera.rs index 7333152..11bf617 100644 --- a/stockton-render/src/draw/camera.rs +++ b/stockton-render/src/draw/camera.rs @@ -200,7 +200,7 @@ impl WorkingCamera { #[cfg(test)] mod tests { - use draw::camera::WorkingCamera; + use crate::draw::camera::WorkingCamera; use stockton_types::Matrix4; use stockton_types::Vector3; diff --git a/stockton-render/src/draw/draw_buffers.rs b/stockton-render/src/draw/draw_buffers.rs index 2fdfa10..faf9c4e 100644 --- a/stockton-render/src/draw/draw_buffers.rs +++ b/stockton-render/src/draw/draw_buffers.rs @@ -15,10 +15,11 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -use crate::types::*; -use draw::buffer::StagedBuffer; -use draw::UVPoint; -use error::CreationError; +use crate::{ + draw::{buffer::StagedBuffer, UVPoint}, + error::CreationError, + types::*, +}; use hal::buffer::Usage; use std::mem::ManuallyDrop; diff --git a/stockton-render/src/draw/target.rs b/stockton-render/src/draw/target.rs index f8b9bd7..65e03a2 100644 --- a/stockton-render/src/draw/target.rs +++ b/stockton-render/src/draw/target.rs @@ -21,9 +21,9 @@ use crate::types::*; use core::{iter::once, mem::ManuallyDrop}; +use crate::draw::buffer::ModifiableBuffer; +use crate::draw::draw_buffers::DrawBuffers; use arrayvec::ArrayVec; -use draw::buffer::ModifiableBuffer; -use draw::draw_buffers::DrawBuffers; use hal::{ format::{ChannelType, Format, Swizzle}, image::{Extent, Usage as ImgUsage, ViewKind}, diff --git a/stockton-render/src/draw/texture/image.rs b/stockton-render/src/draw/texture/image.rs index 9a196a7..4a0fa08 100644 --- a/stockton-render/src/draw/texture/image.rs +++ b/stockton-render/src/draw/texture/image.rs @@ -31,8 +31,8 @@ use hal::{ use image::RgbaImage; use std::{convert::TryInto, iter::once}; +use crate::draw::buffer::create_buffer; use crate::types::*; -use draw::buffer::create_buffer; /// The size of each pixel in an image const PIXEL_SIZE: usize = size_of::<image::Rgba<u8>>(); diff --git a/stockton-render/src/draw/texture/loader.rs b/stockton-render/src/draw/texture/loader.rs index d71aa26..dbd9d70 100644 --- a/stockton-render/src/draw/texture/loader.rs +++ b/stockton-render/src/draw/texture/loader.rs @@ -18,9 +18,9 @@ //! Deals with loading textures into GPU memory use super::chunk::TextureChunk; +use crate::draw::texture::chunk::CHUNK_SIZE; +use crate::draw::texture::resolver::BasicFSResolver; use core::mem::ManuallyDrop; -use draw::texture::chunk::CHUNK_SIZE; -use draw::texture::resolver::BasicFSResolver; use std::path::Path; use log::debug; diff --git a/stockton-render/src/lib.rs b/stockton-render/src/lib.rs index ae902df..7cea5e7 100644 --- a/stockton-render/src/lib.rs +++ b/stockton-render/src/lib.rs @@ -15,23 +15,11 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -extern crate core; - #[cfg(feature = "vulkan")] extern crate gfx_backend_vulkan as back; extern crate gfx_hal as hal; -extern crate shaderc; -extern crate winit; - -extern crate image; -extern crate log; extern crate nalgebra_glm as na; -extern crate stockton_levels; -extern crate stockton_types; - -extern crate arrayvec; - #[macro_use] extern crate legion; diff --git a/stockton-render/src/window.rs b/stockton-render/src/window.rs index 4520ae8..ab19a6a 100644 --- a/stockton-render/src/window.rs +++ b/stockton-render/src/window.rs @@ -15,7 +15,7 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -use Renderer; +use crate::Renderer; use winit::event::Event as WinitEvent; diff --git a/stockton-types/src/lib.rs b/stockton-types/src/lib.rs index 1fda444..dee9b26 100644 --- a/stockton-types/src/lib.rs +++ b/stockton-types/src/lib.rs @@ -17,9 +17,7 @@ //! Common types for all stockton crates. -extern crate legion; extern crate nalgebra_glm as na; -extern crate stockton_levels; pub mod components; pub mod session; |