Changed project name (placeholder), some renames
This commit is contained in:
Generated
+24
-24
@@ -1,5 +1,29 @@
|
|||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
|
[[package]]
|
||||||
|
name = "VoxelGame"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"bytemuck",
|
||||||
|
"byteorder",
|
||||||
|
"cgmath",
|
||||||
|
"dirs",
|
||||||
|
"flate2",
|
||||||
|
"fs_extra",
|
||||||
|
"futures",
|
||||||
|
"glob",
|
||||||
|
"image",
|
||||||
|
"linked-hash-map",
|
||||||
|
"noise",
|
||||||
|
"rand 0.8.3",
|
||||||
|
"shaderc",
|
||||||
|
"wgpu",
|
||||||
|
"wgpu_glyph",
|
||||||
|
"winit",
|
||||||
|
"yaml-rust",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ab_glyph"
|
name = "ab_glyph"
|
||||||
version = "0.2.10"
|
version = "0.2.10"
|
||||||
@@ -2273,30 +2297,6 @@ dependencies = [
|
|||||||
"wgpu",
|
"wgpu",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wgpufun"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"bytemuck",
|
|
||||||
"byteorder",
|
|
||||||
"cgmath",
|
|
||||||
"dirs",
|
|
||||||
"flate2",
|
|
||||||
"fs_extra",
|
|
||||||
"futures",
|
|
||||||
"glob",
|
|
||||||
"image",
|
|
||||||
"linked-hash-map",
|
|
||||||
"noise",
|
|
||||||
"rand 0.8.3",
|
|
||||||
"shaderc",
|
|
||||||
"wgpu",
|
|
||||||
"wgpu_glyph",
|
|
||||||
"winit",
|
|
||||||
"yaml-rust",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi"
|
name = "winapi"
|
||||||
version = "0.2.8"
|
version = "0.2.8"
|
||||||
|
|||||||
+2
-4
@@ -1,11 +1,9 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wgpufun"
|
name = "VoxelGame"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Piotrek <piotrek54pl@gmail.com>"]
|
authors = ["Piotrek <hello@pbaja.me>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
winit = "0.24"
|
winit = "0.24"
|
||||||
wgpu = "0.7"
|
wgpu = "0.7"
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ pub enum GameState {
|
|||||||
Running
|
Running
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct App {
|
pub struct Game {
|
||||||
player: Player,
|
player: Player,
|
||||||
world: World
|
world: World
|
||||||
}
|
}
|
||||||
|
|
||||||
impl App {
|
impl Game {
|
||||||
pub fn new(content: &mut dyn ContentView) -> Self {
|
pub fn new(content: &mut dyn ContentView) -> Self {
|
||||||
let mut app = Self {
|
let mut app = Self {
|
||||||
player: Player::new(),
|
player: Player::new(),
|
||||||
@@ -8,7 +8,7 @@ use cgmath::Point3;
|
|||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use crate::app::world::{WorldBlock, block};
|
use crate::game::world::{WorldBlock, block};
|
||||||
|
|
||||||
pub const SIZE: usize = 32;
|
pub const SIZE: usize = 32;
|
||||||
const SIZE_SQ: usize = SIZE*SIZE;
|
const SIZE_SQ: usize = SIZE*SIZE;
|
||||||
@@ -2,7 +2,7 @@ use cgmath::Point3;
|
|||||||
use noise::{Perlin, NoiseFn};
|
use noise::{Perlin, NoiseFn};
|
||||||
use rand::{Rng, prelude::ThreadRng};
|
use rand::{Rng, prelude::ThreadRng};
|
||||||
|
|
||||||
use crate::app::world::{block, block::WorldBlock};
|
use crate::game::world::{block, block::WorldBlock};
|
||||||
|
|
||||||
const SCALE: f64 = 150.0;
|
const SCALE: f64 = 150.0;
|
||||||
|
|
||||||
+3
-3
@@ -8,8 +8,8 @@ use winit::{
|
|||||||
mod renderer;
|
mod renderer;
|
||||||
use renderer::Renderer;
|
use renderer::Renderer;
|
||||||
|
|
||||||
mod app;
|
mod game;
|
||||||
use app::{App, GameState};
|
use game::{Game, GameState};
|
||||||
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -24,7 +24,7 @@ fn main() {
|
|||||||
.expect("Failed to create window");
|
.expect("Failed to create window");
|
||||||
|
|
||||||
let mut renderer = Renderer::new(&window);
|
let mut renderer = Renderer::new(&window);
|
||||||
let mut app = App::new(&mut renderer);
|
let mut app = Game::new(&mut renderer);
|
||||||
|
|
||||||
// Stats
|
// Stats
|
||||||
let mut fps_timer = std::time::Instant::now();
|
let mut fps_timer = std::time::Instant::now();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::time::Instant;
|
|||||||
use byteorder::{ByteOrder, LittleEndian};
|
use byteorder::{ByteOrder, LittleEndian};
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use cgmath::Point3;
|
use cgmath::Point3;
|
||||||
use crate::app::world::block::WorldBlock;
|
use crate::game::world::block::WorldBlock;
|
||||||
|
|
||||||
pub const BLOCK_SIZE : usize = 32; // 32x32x32 block size
|
pub const BLOCK_SIZE : usize = 32; // 32x32x32 block size
|
||||||
pub const BLOCK_TEX_SIZE : usize = 64; // 64x64 blocks in texture
|
pub const BLOCK_TEX_SIZE : usize = 64; // 64x64 blocks in texture
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use crate::Renderer;
|
use crate::Renderer;
|
||||||
use crate::app::world::block::WorldBlock;
|
use crate::game::world::block::WorldBlock;
|
||||||
use cgmath::Point3;
|
use cgmath::Point3;
|
||||||
|
|
||||||
pub trait ContentView {
|
pub trait ContentView {
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user