Skip to content

Commit

Permalink
Merge pull request #19 from ForesightMiningSoftwareCorporation/hook-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
IceSentry committed Oct 4, 2023
2 parents 8e86c91 + 82e5bf2 commit 1bf51d1
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 4 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Pipeline

on:
pull_request:
push:
branches:
- main
workflow_dispatch:
inputs:
publish:
type: boolean
required: false
description: Trigger with publish

jobs:
publish:
uses: ForesightMiningSoftwareCorporation/github/.github/workflows/rust-build.yml@v1.1.0
with:
skip-test: ${{ github.event_name == 'push' && 'true' || (github.event_name == 'workflow_dispatch' && inputs.publish) }}
publish: ${{ (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish)) && 'true' || 'false' }}
publish_public_registry: true
secrets: inherit
2 changes: 1 addition & 1 deletion examples/bloom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy::{
},
prelude::*,
};
use bevy_aabb_instancing::{CuboidMaterialId, Cuboid, Cuboids, VertexPullingRenderPlugin};
use bevy_aabb_instancing::{Cuboid, CuboidMaterialId, Cuboids, VertexPullingRenderPlugin};
use smooth_bevy_cameras::{controllers::fps::*, LookTransformPlugin};

fn main() {
Expand Down
85 changes: 85 additions & 0 deletions flake.lock

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

35 changes: 35 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain = if builtins.pathExists "${self}/rust-toolchain.toml" then
pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile "${self}/rust-toolchain.toml"
else
pkgs.pkgsBuildHost.rust-bin.stable.latest.default;
nativeBuildInputs = with pkgs; [rustToolchain pkg-config ];
buildInputs = with pkgs; [ alsa-lib udev ];
in
with pkgs;
{
devShells.default = mkShell {
inherit buildInputs nativeBuildInputs;
};
}
);
}
18 changes: 16 additions & 2 deletions src/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,24 @@ impl Default for CuboidMaterial {
///
/// HSL hue is determined as:
/// ```
/// use bevy_aabb_instancing::ScalarHueOptions;
///
/// fn clamp<T: PartialOrd>(value: T, min: T, max: T) -> T {
/// if value < min {
/// min
/// } else if value > max {
/// max
/// } else {
/// value
/// }
/// }
///
/// let hue_options = ScalarHueOptions::default();
/// // Normalize scalar value.
/// let s = (clamp(scalar, clamp_min, clamp_max) - clamp_min) / (clamp_max - clamp_min);
/// let scalar = 12.2;
/// let s = (clamp(scalar, hue_options.clamp_min, hue_options.clamp_max) - hue_options.clamp_min) / (hue_options.clamp_max - hue_options.clamp_min);
/// // Choose hue linearly.
/// let hue = (360.0 + hue_zero + s * hue_slope) % 360.0;
/// let hue = (360.0 + hue_options.hue_zero + s * hue_options.hue_slope) % 360.0;
/// ```
///
/// These options are only available in [`COLOR_MODE_SCALAR_HUE`].
Expand Down
4 changes: 3 additions & 1 deletion src/vertex_pulling/buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use bevy::prelude::{Deref, DerefMut, Resource};
use bevy::render::render_resource::{DynamicUniformBuffer, UniformBuffer};

#[derive(Resource, Default, Deref, DerefMut)]
pub(crate) struct DynamicUniformBufferOfCuboidMaterial(pub(crate) DynamicUniformBuffer<CuboidMaterial>);
pub(crate) struct DynamicUniformBufferOfCuboidMaterial(
pub(crate) DynamicUniformBuffer<CuboidMaterial>,
);

#[derive(Resource, Default, Deref, DerefMut)]
pub(crate) struct DynamicUniformBufferOfCuboidTransforms(
Expand Down

0 comments on commit 1bf51d1

Please sign in to comment.