cargo fmt + fixed wasm compilation

This commit is contained in:
Dmitry Stepanov
2025-05-25 17:37:39 +03:00
parent 82e53ba5d7
commit 1008511f6b
11 changed files with 21 additions and 20 deletions
+1
View File
@@ -19,6 +19,7 @@ fyrox-core = { version = "0.36", path = "../fyrox-core" }
fxhash = "0.2.1"
regex = "1"
glow = "0.16"
serde = { version = "1.0.215", features = ["derive"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
glutin = "0.31"
+1 -1
View File
@@ -18,8 +18,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
use crate::ToGlConstant;
use crate::server::GlGraphicsServer;
use crate::ToGlConstant;
use fyrox_graphics::{
buffer::{BufferKind, BufferUsage, GpuBufferTrait},
error::FrameworkError,
+3 -3
View File
@@ -20,11 +20,10 @@
use crate::texture::PixelDescriptor;
pub use crate::{
ToGlConstant, buffer::GlBuffer, geometry_buffer::GlGeometryBuffer, program::GlProgram,
sampler::GlSampler, server::GlGraphicsServer, texture::GlTexture,
buffer::GlBuffer, geometry_buffer::GlGeometryBuffer, program::GlProgram, sampler::GlSampler,
server::GlGraphicsServer, texture::GlTexture, ToGlConstant,
};
use fyrox_graphics::{
ColorMask, DrawParameters, ElementRange,
buffer::GpuBufferTrait,
core::{color::Color, math::Rect},
error::FrameworkError,
@@ -37,6 +36,7 @@ use fyrox_graphics::{
gpu_program::GpuProgram,
gpu_texture::image_2d_size_bytes,
gpu_texture::{CubeMapFace, GpuTextureKind, GpuTextureTrait, PixelElementKind},
ColorMask, DrawParameters, ElementRange,
};
use glow::{HasContext, PixelPackData};
use std::rc::Weak;
+2 -2
View File
@@ -18,15 +18,15 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
use crate::{ToGlConstant, buffer::GlBuffer, server::GlGraphicsServer};
use crate::{buffer::GlBuffer, server::GlGraphicsServer, ToGlConstant};
use fyrox_graphics::{
ElementKind,
buffer::{BufferKind, GpuBufferTrait},
core::{array_as_u8_slice, math::TriangleDefinition},
error::FrameworkError,
geometry_buffer::{
AttributeKind, ElementsDescriptor, GeometryBufferDescriptor, GpuGeometryBufferTrait,
},
ElementKind,
};
use glow::HasContext;
use std::{cell::Cell, marker::PhantomData, rc::Weak};
+2 -2
View File
@@ -19,8 +19,8 @@
// SOFTWARE.
use crate::{
ToGlConstant,
server::{GlGraphicsServer, GlKind},
ToGlConstant,
};
use fyrox_graphics::{
core::log::{Log, MessageKind},
@@ -499,7 +499,7 @@ impl Drop for GlProgram {
#[cfg(test)]
mod test {
use crate::program::{Vendor, patch_error_message};
use crate::program::{patch_error_message, Vendor};
#[test]
fn test_line_correction() {
+2 -2
View File
@@ -19,13 +19,13 @@
// SOFTWARE.
use crate::texture::PixelDescriptor;
use crate::{ToGlConstant, buffer::GlBuffer, framebuffer::GlFrameBuffer, server::GlGraphicsServer};
use crate::{buffer::GlBuffer, framebuffer::GlFrameBuffer, server::GlGraphicsServer, ToGlConstant};
use fyrox_graphics::{
buffer::{BufferKind, BufferUsage, GpuBufferTrait},
core::{algebra::Vector2, math::Rect},
error::FrameworkError,
framebuffer::GpuFrameBufferTrait,
gpu_texture::{GpuTextureKind, image_2d_size_bytes},
gpu_texture::{image_2d_size_bytes, GpuTextureKind},
read_buffer::GpuAsyncReadBufferTrait,
};
use glow::{HasContext, PixelPackData};
+1 -1
View File
@@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
use crate::{ToGlConstant, server::GlGraphicsServer};
use crate::{server::GlGraphicsServer, ToGlConstant};
use fyrox_graphics::{
error::FrameworkError,
sampler::{
+3 -3
View File
@@ -408,7 +408,7 @@ impl GlGraphicsServer {
#[cfg(target_arch = "wasm32")]
let (window, mut context, gl_kind) = {
use crate::core::wasm_bindgen::JsCast;
use fyrox_core::wasm_bindgen::JsCast;
use serde::{Deserialize, Serialize};
use winit::{
dpi::{LogicalSize, PhysicalSize},
@@ -418,7 +418,7 @@ impl GlGraphicsServer {
let inner_size = window_builder.window_attributes().inner_size;
let window = window_builder.build(window_target).unwrap();
let web_window = crate::core::web_sys::window().unwrap();
let web_window = fyrox_core::web_sys::window().unwrap();
let scale_factor = web_window.device_pixel_ratio();
let canvas = window.canvas().unwrap();
@@ -475,7 +475,7 @@ impl GlGraphicsServer {
)
.unwrap()
.unwrap()
.dyn_into::<crate::core::web_sys::WebGl2RenderingContext>()
.dyn_into::<fyrox_core::web_sys::WebGl2RenderingContext>()
.unwrap();
(
window,
+4 -4
View File
@@ -18,15 +18,15 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
use crate::{ToGlConstant, server::GlGraphicsServer};
use crate::{server::GlGraphicsServer, ToGlConstant};
use fyrox_graphics::{
error::FrameworkError,
gpu_texture::{
CubeMapFace, GpuTextureDescriptor, GpuTextureKind, GpuTextureTrait, PixelKind,
image_1d_size_bytes, image_2d_size_bytes, image_3d_size_bytes,
image_1d_size_bytes, image_2d_size_bytes, image_3d_size_bytes, CubeMapFace,
GpuTextureDescriptor, GpuTextureKind, GpuTextureTrait, PixelKind,
},
};
use glow::{COMPRESSED_RED_RGTC1, COMPRESSED_RG_RGTC2, HasContext, PixelUnpackData};
use glow::{HasContext, PixelUnpackData, COMPRESSED_RED_RGTC1, COMPRESSED_RG_RGTC2};
use std::cell::Cell;
use std::{
marker::PhantomData,
+1 -1
View File
@@ -21,7 +21,7 @@
//! Material loader.
use crate::Material;
use fyrox_core::{TypeUuidProvider, uuid::Uuid};
use fyrox_core::{uuid::Uuid, TypeUuidProvider};
use fyrox_resource::state::LoadError;
use fyrox_resource::{
io::ResourceIo,
+1 -1
View File
@@ -21,7 +21,7 @@
//! Shader loader.
use crate::shader::Shader;
use fyrox_core::{TypeUuidProvider, uuid::Uuid};
use fyrox_core::{uuid::Uuid, TypeUuidProvider};
use fyrox_resource::{
io::ResourceIo,
loader::{BoxedLoaderFuture, LoaderPayload, ResourceLoader},