mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added client localhost connection
Former-commit-id: d4dec70ef3ecad8f40196b87b0f5c8b55c51c44a
This commit is contained in:
parent
dbbcc1e80e
commit
2fffe21bc7
@ -46,7 +46,7 @@ impl PlayState for TitleState {
|
|||||||
Event::Close => return PlayStateResult::Shutdown,
|
Event::Close => return PlayStateResult::Shutdown,
|
||||||
// When space is pressed, start a session
|
// When space is pressed, start a session
|
||||||
Event::Char(' ') => return PlayStateResult::Push(
|
Event::Char(' ') => return PlayStateResult::Push(
|
||||||
Box::new(SessionState::new(global_state.window.renderer_mut())),
|
Box::new(SessionState::new(global_state.window.renderer_mut()).unwrap()), // TODO: Handle this error
|
||||||
),
|
),
|
||||||
// Ignore all other events
|
// Ignore all other events
|
||||||
_ => {},
|
_ => {},
|
||||||
|
@ -11,15 +11,12 @@ use gfx::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Local
|
// Local
|
||||||
use super::{
|
use super::super::{
|
||||||
Globals,
|
|
||||||
super::{
|
|
||||||
Pipeline,
|
Pipeline,
|
||||||
TgtColorFmt,
|
TgtColorFmt,
|
||||||
TgtDepthFmt,
|
TgtDepthFmt,
|
||||||
Mesh,
|
Mesh,
|
||||||
Quad,
|
Quad,
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
gfx_defines! {
|
gfx_defines! {
|
||||||
|
@ -4,7 +4,7 @@ use std::marker::PhantomData;
|
|||||||
// Library
|
// Library
|
||||||
use gfx::{
|
use gfx::{
|
||||||
self,
|
self,
|
||||||
traits::{Factory, FactoryExt},
|
traits::Factory,
|
||||||
};
|
};
|
||||||
use image::{
|
use image::{
|
||||||
DynamicImage,
|
DynamicImage,
|
||||||
@ -14,7 +14,6 @@ use image::{
|
|||||||
// Local
|
// Local
|
||||||
use super::{
|
use super::{
|
||||||
RenderError,
|
RenderError,
|
||||||
mesh::Mesh,
|
|
||||||
Pipeline,
|
Pipeline,
|
||||||
gfx_backend,
|
gfx_backend,
|
||||||
};
|
};
|
||||||
|
@ -34,14 +34,14 @@ pub struct SessionState {
|
|||||||
/// Represents an active game session (i.e: one that is being played)
|
/// Represents an active game session (i.e: one that is being played)
|
||||||
impl SessionState {
|
impl SessionState {
|
||||||
/// Create a new `SessionState`
|
/// Create a new `SessionState`
|
||||||
pub fn new(renderer: &mut Renderer) -> Self {
|
pub fn new(renderer: &mut Renderer) -> Result<Self, Error> {
|
||||||
let client = Client::new().with_test_state(); // <--- TODO: Remove this
|
let client = Client::new(([127, 0, 0, 1], 59003))?.with_test_state(); // <--- TODO: Remove this
|
||||||
Self {
|
Ok(Self {
|
||||||
// Create a scene for this session. The scene handles visible elements of the game world
|
// Create a scene for this session. The scene handles visible elements of the game world
|
||||||
scene: Scene::new(renderer, &client),
|
scene: Scene::new(renderer, &client),
|
||||||
client,
|
client,
|
||||||
key_state: KeyState::new(),
|
key_state: KeyState::new(),
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
// Standard
|
// Standard
|
||||||
use std::{
|
use std::rc::Rc;
|
||||||
rc::Rc,
|
|
||||||
cell::RefCell,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Library
|
// Library
|
||||||
use image::DynamicImage;
|
use image::DynamicImage;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user