Skip to content
Snippets Groups Projects
Commit e81002b8 authored by StarArawn's avatar StarArawn
Browse files

Fixed most of the warnings.

parent be183faa
No related branches found
No related tags found
No related merge requests found
use bevy::{ use bevy::{
prelude::{ prelude::{Plugin, Res, ResMut},
AddAsset, AssetEvent, AssetServer, Assets, Commands, EventReader, Handle, Local, Plugin,
Res, ResMut,
},
render2::{ render2::{
render_asset::RenderAssets, render_asset::RenderAssets,
render_resource::{FilterMode, TextureFormat, TextureUsages},
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
texture::Image, texture::Image,
RenderApp, RenderStage, RenderApp, RenderStage,
}, },
utils::HashSet,
}; };
use kayak_font::{FontTextureCache, KayakFont, KayakFontPlugin}; use kayak_font::{FontTextureCache, KayakFontPlugin};
mod extract; mod extract;
mod font_mapping; mod font_mapping;
......
...@@ -7,7 +7,6 @@ use bevy::{ ...@@ -7,7 +7,6 @@ use bevy::{
use bevy_kayak_ui::{BevyContext, BevyKayakUIPlugin, FontMapping, UICameraBundle}; use bevy_kayak_ui::{BevyContext, BevyKayakUIPlugin, FontMapping, UICameraBundle};
use kayak_components::{Button, Text, Window}; use kayak_components::{Button, Text, Window};
use kayak_core::{ use kayak_core::{
context::KayakContext,
styles::{Style, StyleProp, Units}, styles::{Style, StyleProp, Units},
EventType, Index, OnEvent, EventType, Index, OnEvent,
}; };
......
...@@ -7,7 +7,6 @@ use bevy::{ ...@@ -7,7 +7,6 @@ use bevy::{
use bevy_kayak_ui::{BevyContext, BevyKayakUIPlugin, FontMapping, ImageManager, UICameraBundle}; use bevy_kayak_ui::{BevyContext, BevyKayakUIPlugin, FontMapping, ImageManager, UICameraBundle};
use kayak_components::{NinePatch, Text}; use kayak_components::{NinePatch, Text};
use kayak_core::{ use kayak_core::{
context::KayakContext,
layout_cache::Space, layout_cache::Space,
styles::{LayoutType, Style, StyleProp, Units}, styles::{LayoutType, Style, StyleProp, Units},
widget, Children, EventType, Index, OnEvent, widget, Children, EventType, Index, OnEvent,
......
...@@ -7,7 +7,6 @@ use kayak_font::{KayakFont, KayakFontPlugin}; ...@@ -7,7 +7,6 @@ use kayak_font::{KayakFont, KayakFontPlugin};
fn startup(mut commands: Commands, asset_server: Res<AssetServer>) { fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
let font_handle: Handle<KayakFont> = asset_server.load("roboto.kayak_font"); let font_handle: Handle<KayakFont> = asset_server.load("roboto.kayak_font");
dbg!(font_handle); dbg!(font_handle);
} }
......
use std::{collections::HashMap, path::PathBuf}; use std::collections::HashMap;
use bevy::{ use bevy::{
asset::{AssetLoader, AssetPath, BoxedFuture, LoadContext, LoadedAsset}, asset::{AssetLoader, AssetPath, BoxedFuture, LoadContext, LoadedAsset},
......
...@@ -12,7 +12,6 @@ use bevy::{ ...@@ -12,7 +12,6 @@ use bevy::{
}, },
render2::{ render2::{
render_resource::{FilterMode, TextureFormat, TextureUsages}, render_resource::{FilterMode, TextureFormat, TextureUsages},
renderer::{RenderDevice, RenderQueue},
texture::Image, texture::Image,
RenderApp, RenderStage, RenderApp, RenderStage,
}, },
......
...@@ -7,12 +7,11 @@ use bevy::{ ...@@ -7,12 +7,11 @@ use bevy::{
render_resource::{ render_resource::{
AddressMode, BindGroup, BindGroupDescriptor, BindGroupEntry, BindGroupLayout, AddressMode, BindGroup, BindGroupDescriptor, BindGroupEntry, BindGroupLayout,
BindingResource, CommandEncoderDescriptor, Extent3d, FilterMode, ImageCopyTexture, BindingResource, CommandEncoderDescriptor, Extent3d, FilterMode, ImageCopyTexture,
ImageDataLayout, Origin3d, SamplerDescriptor, TextureAspect, TextureDescriptor, Origin3d, SamplerDescriptor, TextureAspect, TextureDescriptor, TextureDimension,
TextureDimension, TextureFormat, TextureUsages, TextureViewDescriptor, TextureFormat, TextureUsages, TextureViewDescriptor, TextureViewDimension,
TextureViewDimension,
}, },
renderer::{RenderDevice, RenderQueue}, renderer::{RenderDevice, RenderQueue},
texture::{GpuImage, Image, TextureFormatPixelInfo}, texture::{GpuImage, Image},
}, },
utils::HashMap, utils::HashMap,
}; };
......
use crate::{atlas::Atlas, glyph::Glyph, metrics::Metrics, SDFType}; use crate::{atlas::Atlas, glyph::Glyph, metrics::Metrics};
use bevy::math::Vec2; use bevy::math::Vec2;
use serde::Deserialize; use serde::Deserialize;
...@@ -68,6 +68,7 @@ impl Sdf { ...@@ -68,6 +68,7 @@ impl Sdf {
#[test] #[test]
fn test_sdf_loader() { fn test_sdf_loader() {
use crate::SDFType;
let sdf = Sdf::from_string(include_str!("../assets/roboto.kayak_font").to_string()); let sdf = Sdf::from_string(include_str!("../assets/roboto.kayak_font").to_string());
assert!(sdf.max_glyph_size() == Vec2::new(30.0, 36.0)); assert!(sdf.max_glyph_size() == Vec2::new(30.0, 36.0));
assert!(sdf.atlas.width == 212); assert!(sdf.atlas.width == 212);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment