Skip to content

Commit

Permalink
Update to new texture system and creating tile map before_effect and …
Browse files Browse the repository at this point in the history
…after_effect
  • Loading branch information
b-guild committed Jan 1, 2025
2 parents c06381b + d98dc69 commit 2d927a9
Show file tree
Hide file tree
Showing 81 changed files with 2,929 additions and 2,811 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
pull_request:
workflow_dispatch:
# This allows running it on any branch manually:
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# This allows running it on any branch manually:
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow

env:
CARGO_TERM_COLOR: always
Expand All @@ -22,9 +22,9 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [stable]
rust: [ stable ]
# For reference: https://github.com/actions/virtual-environments#available-environments
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [stable]
rust: [ stable ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand Down Expand Up @@ -188,3 +188,13 @@ jobs:
fyrox-template upgrade --version=latest --local
cd executor-wasm
wasm-pack build --target=web
project_manager:
name: Project Manager
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build Project Manager
run: |
cargo build --package fyrox-project-manager
1 change: 1 addition & 0 deletions .idea/rg3d-core.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ members = [
"project-manager",
"fyrox-graphics",
"fyrox-build-tools"
]
, "fyrox-texture"]
resolver = "2"

[profile.dev]
Expand Down
6 changes: 3 additions & 3 deletions editor-standalone/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fyroxed"
version = "0.17.0"
version = "0.36.0"
license = "MIT"
authors = ["Dmitry Stepanov <[email protected]>"]
edition = "2021"
Expand All @@ -13,6 +13,6 @@ readme = "README.md"
include = ["/src/**/*", "/Cargo.toml", "/LICENSE", "/README.md"]

[dependencies]
fyrox = { version = "0.34.0", path = "../fyrox" }
fyroxed_base = { version = "0.21.0", path = "../editor" }
fyrox = { version = "0.36.0", path = "../fyrox" }
fyroxed_base = { version = "0.36.0", path = "../editor" }
clap = { version = "4", features = ["derive"] }
6 changes: 3 additions & 3 deletions editor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "fyroxed_base"
license = "MIT"
version = "0.21.1"
version = "0.36.0"
authors = ["Dmitry Stepanov <[email protected]>"]
edition = "2021"
rust-version = "1.80"
Expand All @@ -13,8 +13,8 @@ readme = "README.md"
include = ["/src/**/*", "/Cargo.toml", "/LICENSE", "/README.md", "/resources/**/*"]

[dependencies]
fyrox = { version = "0.34.1", path = "../fyrox", default-features = false }
fyrox-build-tools = { version = "0.1.0", path = "../fyrox-build-tools" }
fyrox = { version = "0.36.0", path = "../fyrox", default-features = false }
fyrox-build-tools = { version = "0.36.0", path = "../fyrox-build-tools" }
lazy_static = "1.4.0"
ron = "0.8.0"
serde = "^1.0.0"
Expand Down
Binary file added editor/resources/Roboto-Regular.ttf
Binary file not shown.
Binary file removed editor/resources/arial.ttf
Binary file not shown.
9 changes: 5 additions & 4 deletions editor/src/asset/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ use crate::{
message::MessageSender,
Message,
};
use fyrox::resource::texture::TextureResource;
use std::{
ops::{Deref, DerefMut},
path::{Path, PathBuf},
Expand All @@ -57,14 +58,14 @@ use std::{
pub enum AssetItemMessage {
Select(bool),
Icon {
texture: Option<UntypedResource>,
texture: Option<TextureResource>,
flip_y: bool,
},
}

impl AssetItemMessage {
define_constructor!(AssetItemMessage:Select => fn select(bool), layout: false);
define_constructor!(AssetItemMessage:Icon => fn icon(texture: Option<UntypedResource>, flip_y: bool), layout: false);
define_constructor!(AssetItemMessage:Icon => fn icon(texture: Option<TextureResource>, flip_y: bool), layout: false);
}

#[allow(dead_code)]
Expand Down Expand Up @@ -264,7 +265,7 @@ impl Control for AssetItem {
pub struct AssetItemBuilder {
widget_builder: WidgetBuilder,
path: Option<PathBuf>,
icon: Option<UntypedResource>,
icon: Option<TextureResource>,
}

fn make_tooltip(ctx: &mut BuildContext, text: &str) -> RcUiNodeHandle {
Expand Down Expand Up @@ -303,7 +304,7 @@ impl AssetItemBuilder {
self
}

pub fn with_icon(mut self, icon: Option<UntypedResource>) -> Self {
pub fn with_icon(mut self, icon: Option<TextureResource>) -> Self {
self.icon = icon;
self
}
Expand Down
5 changes: 2 additions & 3 deletions editor/src/asset/preview/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use crate::{
engine::Engine,
fxhash::FxHashMap,
gui::{message::MessageDirection, UiNode},
resource::texture::Texture,
},
};
use std::sync::mpsc::Receiver;
Expand Down Expand Up @@ -76,7 +75,7 @@ impl AssetPreviewCache {
generator.simple_icon(&resource, &engine.resource_manager)
{
let preview = AssetPreviewTexture {
texture: icon.try_cast::<Texture>().unwrap(),
texture: icon,
flip_y: false,
};
self.container.insert(resource_kind, preview.clone());
Expand All @@ -94,7 +93,7 @@ impl AssetPreviewCache {
ui.send_message(AssetItemMessage::icon(
asset_item,
MessageDirection::ToWidget,
Some(preview.texture.into()),
Some(preview.texture),
preview.flip_y,
));
}
Expand Down
24 changes: 12 additions & 12 deletions editor/src/asset/preview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub trait AssetPreviewGenerator: Send + Sync + 'static {
&self,
resource: &UntypedResource,
resource_manager: &ResourceManager,
) -> Option<UntypedResource>;
) -> Option<TextureResource>;
}

pub struct TexturePreview;
Expand Down Expand Up @@ -186,8 +186,8 @@ impl AssetPreviewGenerator for TexturePreview {
&self,
resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
resource.try_cast::<Texture>().map(Into::into)
) -> Option<TextureResource> {
resource.try_cast::<Texture>()
}
}

Expand Down Expand Up @@ -284,7 +284,7 @@ impl AssetPreviewGenerator for SoundPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/sound.png")
}
}
Expand Down Expand Up @@ -409,7 +409,7 @@ impl AssetPreviewGenerator for ModelPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/model.png")
}
}
Expand Down Expand Up @@ -450,7 +450,7 @@ impl AssetPreviewGenerator for SurfaceDataPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/model.png")
}
}
Expand Down Expand Up @@ -494,7 +494,7 @@ impl AssetPreviewGenerator for ShaderPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/shader.png")
}
}
Expand Down Expand Up @@ -538,7 +538,7 @@ impl AssetPreviewGenerator for MaterialPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/material.png")
}
}
Expand Down Expand Up @@ -569,7 +569,7 @@ impl AssetPreviewGenerator for HrirPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/hrir.png")
}
}
Expand Down Expand Up @@ -599,7 +599,7 @@ impl AssetPreviewGenerator for CurvePreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/curve.png")
}
}
Expand Down Expand Up @@ -677,7 +677,7 @@ impl AssetPreviewGenerator for FontPreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/font.png")
}
}
Expand Down Expand Up @@ -712,7 +712,7 @@ impl AssetPreviewGenerator for UserInterfacePreview {
&self,
_resource: &UntypedResource,
_resource_manager: &ResourceManager,
) -> Option<UntypedResource> {
) -> Option<TextureResource> {
load_image!("../../../resources/ui.png")
}
}
4 changes: 2 additions & 2 deletions editor/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ impl ExportWindow {
)
.add_row(Row::auto())
.add_row(Row::stretch())
.add_column(Column::auto())
.add_column(Column::stretch())
.build(ctx);

let buttons_section = StackPanelBuilder::new(
Expand Down Expand Up @@ -939,7 +939,7 @@ impl ExportWindow {
.add_row(Row::strict(200.0))
.add_row(Row::stretch())
.add_row(Row::strict(32.0))
.add_column(Column::auto())
.add_column(Column::stretch())
.build(ctx),
)
.with_title(WindowTitle::text("Export Project"))
Expand Down
Loading

0 comments on commit 2d927a9

Please sign in to comment.