mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
fixed warnings
This commit is contained in:
@@ -9,12 +9,12 @@
|
||||
//! just 1 second will take ~172 Kb of memory (with 44100 Hz sampling rate and float sample representation).
|
||||
|
||||
use crate::buffer::{generic::GenericBuffer, streaming::StreamingBuffer};
|
||||
use rg3d_core::io;
|
||||
use rg3d_core::io::FileLoadError;
|
||||
use rg3d_core::visitor::{Visit, VisitError, VisitResult, Visitor};
|
||||
use rg3d_core::{
|
||||
io::FileLoadError,
|
||||
visitor::{Visit, VisitError, VisitResult, Visitor},
|
||||
};
|
||||
use std::{
|
||||
fs::File,
|
||||
io::{BufReader, Cursor, Read, Seek, SeekFrom},
|
||||
io::{Cursor, Read, Seek, SeekFrom},
|
||||
ops::{Deref, DerefMut},
|
||||
path::{Path, PathBuf},
|
||||
sync::{Arc, Mutex},
|
||||
@@ -34,7 +34,7 @@ pub enum DataSource {
|
||||
|
||||
/// Buffered file opened for read.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
data: BufReader<File>,
|
||||
data: std::io::BufReader<std::fs::File>,
|
||||
|
||||
/// TODO: In case of WASM load file entirely.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
@@ -74,13 +74,13 @@ impl DataSource {
|
||||
path: path.as_ref().to_path_buf(),
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
data: BufReader::new(match File::open(path) {
|
||||
data: std::io::BufReader::new(match std::fs::File::open(path) {
|
||||
Ok(file) => file,
|
||||
Err(e) => return Err(FileLoadError::Io(e)),
|
||||
}),
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
data: Cursor::new(io::load_file(path).await?),
|
||||
data: Cursor::new(rg3d_core::io::load_file(path).await?),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,10 @@ trait Device {
|
||||
|
||||
/// Transfer ownership of device to separate mixer thread. It will
|
||||
/// call the callback with a specified rate to get data to send to a physical device.
|
||||
pub(in crate) fn run_device(buffer_len_bytes: u32, callback: Box<FeedCallback>) {
|
||||
pub(in crate) fn run_device(
|
||||
#[allow(unused_variables)] buffer_len_bytes: u32,
|
||||
#[allow(unused_variables)] callback: Box<FeedCallback>,
|
||||
) {
|
||||
// TODO: Add WASM backend.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
|
||||
@@ -1,26 +1,20 @@
|
||||
//! Resource manager controls loading and lifetime of resource in the engine.
|
||||
|
||||
use crate::resource::texture::{
|
||||
CompressionOptions, TextureError, TexturePixelKind, TextureWrapMode,
|
||||
};
|
||||
use crate::resource::ResourceLoadError;
|
||||
use crate::utils::log::MessageKind;
|
||||
use crate::{
|
||||
core::visitor::{Visit, VisitResult, Visitor},
|
||||
resource::{
|
||||
model::{Model, ModelData},
|
||||
texture::{
|
||||
Texture, TextureData, TextureMagnificationFilter, TextureMinificationFilter,
|
||||
TextureState,
|
||||
CompressionOptions, Texture, TextureData, TextureError, TextureMagnificationFilter,
|
||||
TextureMinificationFilter, TexturePixelKind, TextureState, TextureWrapMode,
|
||||
},
|
||||
Resource, ResourceData, ResourceState,
|
||||
Resource, ResourceData, ResourceLoadError, ResourceState,
|
||||
},
|
||||
sound::buffer::{DataSource, SoundBuffer},
|
||||
utils::log::Log,
|
||||
utils::log::{Log, MessageKind},
|
||||
};
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
use futures::executor::ThreadPool;
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
ops::{Deref, DerefMut},
|
||||
|
||||
+2
-3
@@ -2,7 +2,6 @@
|
||||
|
||||
use crate::lazy_static::lazy_static;
|
||||
use std::{
|
||||
fs::File,
|
||||
io::{self, Write},
|
||||
sync::Mutex,
|
||||
};
|
||||
@@ -10,7 +9,7 @@ use std::{
|
||||
lazy_static! {
|
||||
static ref LOG: Mutex<Log> = Mutex::new(Log {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
file: File::create("rg3d.log").unwrap(),
|
||||
file: std::fs::File::create("rg3d.log").unwrap(),
|
||||
verbosity: MessageKind::Information
|
||||
});
|
||||
}
|
||||
@@ -40,7 +39,7 @@ impl MessageKind {
|
||||
/// See module docs.
|
||||
pub struct Log {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
file: File,
|
||||
file: std::fs::File,
|
||||
verbosity: MessageKind,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user