Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into syssetup
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel91 committed Jul 22, 2019
2 parents 9d0c7e1 + 9709f4f commit 5acc411
Show file tree
Hide file tree
Showing 105 changed files with 406 additions and 246 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ crossbeam-channel = "0.3.1"
derivative = "1.0"
fern = { version = "0.5", features = ["colored"] }
log = { version = "0.4.6", features = ["serde"] }
rayon = "1.0.2"
rayon = "1.1.0"
rustc_version_runtime = "0.1"
sentry = "0.15.4"
winit = { version = "0.19", features = ["serde", "icon_loading"] }
Expand Down
41 changes: 11 additions & 30 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,19 @@ pipeline {
}
}
stage('Cargo Clippy') {
parallel {
stage("stable") {
environment {
RUSTFLAGS = "-D warnings"
}
agent {
docker {
image 'amethystrs/builder-linux:stable'
label 'docker'
}
}
steps {
echo 'Running Cargo clippy...'
sh 'cargo clippy --all --all-targets --features "vulkan sdl_controller json saveload"'
}
}
stage("nightly") {
environment {
RUSTFLAGS = "-D warnings"
}
agent {
docker {
image 'amethystrs/builder-linux:nightly'
label 'docker'
}
}
steps {
echo 'Running Cargo clippy...'
sh 'cargo clippy --all --all-targets --features "vulkan sdl_controller json saveload"'
}
environment {
RUSTFLAGS = "-D warnings"
}
agent {
docker {
image 'amethystrs/builder-linux:nightly'
label 'docker'
}
}
steps {
echo 'Running Cargo clippy...'
sh 'cargo clippy --all --all-targets --features "vulkan sdl_controller json saveload"'
}
}
// Separate stage for coverage to prevent race condition with the linux test stage (repo lock contention).
stage('Coverage') {
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,17 @@ For a full-blown "Hello World" tutorial check out the [Getting Started][gs] chap

[gs]: https://book.amethyst.rs/stable/getting-started.html

There are also many open source games and prototypes being made with Amethyst. See our showcase in the regularly updated [Games Made With Amethyst][gmwa] thread on the community forum for some good sources of inspiration.
### Showcase games

Our official showcase games demonstrate larger, continuously developed game projects made with Amethyst:

- [Evoli][evoli] - 3D, ecosystem simulator
- [Space Menace][menace] - 2D, action platformer

For more examples see [Games Made With Amethyst][gmwa] topic on the community forum for some good sources of inspiration.

[evoli]: https://github.com/amethyst/evoli
[menace]: https://github.com/amethyst/space-menace
[gmwa]: https://community.amethyst.rs/t/games-made-with-amethyst/134

## Dependencies
Expand All @@ -123,7 +132,7 @@ $ pacman -Sy grep gcc pkgconfig openssl alsa-lib cmake make python3 freetype2 aw
### Debian/Ubuntu

```
# apt install gcc pkg-config openssl libasound2-dev cmake build-essential python3 libfreetype6-dev libexpat1-dev libxcb-composite0-dev libssl-dev
# apt install gcc pkg-config openssl libasound2-dev cmake build-essential python3 libfreetype6-dev libexpat1-dev libxcb-composite0-dev libssl-dev libx11-dev
```

### Fedora
Expand Down
2 changes: 1 addition & 1 deletion amethyst_assets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ derivative = "1.0"
fnv = "1"
log = "0.4.6"
parking_lot = "0.6"
rayon = "1.0.2"
rayon = "1.1.0"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", optional = true }
ron = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion amethyst_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ amethyst_error = { path = "../amethyst_error", version = "0.1.0" }
fnv = "1"
log = "0.4.6"
num-traits = "0.2.0"
rayon = "1.0.2"
rayon = "1.1.0"
serde = { version = "1", features = ["derive"] }
specs = { version = "0.15", features = ["shred-derive"] }
specs-hierarchy = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion amethyst_core/src/frame_limiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl Default for FrameRateLimitStrategy {
/// use amethyst::prelude::*;
/// use amethyst::core::frame_limiter::FrameRateLimitConfig;
///
/// let config = FrameRateLimitConfig::load("./resources/frame_limiter.ron");
/// let config = FrameRateLimitConfig::load("./config/frame_limiter.ron");
/// ```
///
/// [`FrameLimiter`]: ./struct.FrameLimiter.html
Expand Down
6 changes: 6 additions & 0 deletions amethyst_core/src/timing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,22 @@ pub struct Time {

impl Time {
/// Gets the time difference between frames in seconds.
///
/// This function should not be used during `fixed_update`s, use `fixed_seconds` instead.
pub fn delta_seconds(&self) -> f32 {
self.delta_seconds
}

/// Gets the time difference between frames.
///
/// This function should not be used during `fixed_update`s, use `fixed_time` instead.
pub fn delta_time(&self) -> Duration {
self.delta_time
}

/// Gets the time difference between frames in seconds ignoring the time speed multiplier.
///
/// This function should not be used during `fixed_update`s.
pub fn delta_real_seconds(&self) -> f32 {
self.delta_real_seconds
}
Expand Down
4 changes: 2 additions & 2 deletions amethyst_gltf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ amethyst_rendy = { path = "../amethyst_rendy", version = "0.1.0" }
err-derive = "0.1"
base64 = "0.10"
fnv = "1"
gltf = "0.11"
gltf = "0.12"
gfx = "0.17"
hibitset = { version = "0.5.1", features = ["parallel"] }
itertools = "0.7"
Expand All @@ -33,7 +33,7 @@ mikktspace = { version = "0.1" }
serde = { version = "1.0", features = ["derive"] }

thread_profiler = { version = "0.3", optional = true }
image = "0.21.0"
image = "0.21.0"
derivative = "1.0.2"

[features]
Expand Down
3 changes: 2 additions & 1 deletion amethyst_input/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use super::{Axis, Button};
/// UsePowerup(PlayerId),
/// }
///
/// #[derive(Debug)]
/// struct DriverBindingTypes;
/// impl BindingTypes for DriverBindingTypes {
/// type Axis = AxisBinding;
Expand All @@ -47,7 +48,7 @@ use super::{Axis, Button};
///
/// type GameBindings = Bindings<DriverBindingTypes>;
/// ```
/// And the `bindings_config.ron`:
/// And the `bindings.ron`:
/// ```ron
/// (
/// axes: {
Expand Down
2 changes: 1 addition & 1 deletion amethyst_input/src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::sdl_events_system::ControllerMappings;

/// Bundle for adding the `InputHandler`.
///
/// This also adds the Winit EventHandler and the `InputEvent<T::Action>` EventHandler
/// This also adds the Winit EventHandler and the `InputEvent<T>` EventHandler
/// where `T::Action` is the type for Actions you have assigned here.
///
/// ## Type parameters
Expand Down
7 changes: 5 additions & 2 deletions amethyst_input/src/controller.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};

use crate::event::InputEvent;
use crate::{bindings::BindingTypes, event::InputEvent};

/// Controller axes matching SDL controller model
#[derive(Eq, PartialEq, Debug, Copy, Clone, Serialize, Deserialize)]
Expand Down Expand Up @@ -118,7 +118,10 @@ pub enum ControllerEvent {
},
}

impl<'a, T> Into<InputEvent<T>> for &'a ControllerEvent {
impl<'a, T> Into<InputEvent<T>> for &'a ControllerEvent
where
T: BindingTypes,
{
fn into(self) -> InputEvent<T> {
use self::ControllerEvent::*;
match *self {
Expand Down
38 changes: 28 additions & 10 deletions amethyst_input/src/event.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use derivative::Derivative;
use serde::{Deserialize, Serialize};
use winit::{MouseButton, VirtualKeyCode};

use super::{
bindings::BindingTypes,
button::Button,
controller::{ControllerAxis, ControllerButton},
scroll_direction::ScrollDirection,
Expand All @@ -11,20 +13,24 @@ use super::{
///
/// Type parameter T is the type assigned to your Actions for your
/// InputBundle or InputHandler.
#[derive(PartialEq, Serialize, Deserialize, Debug, Clone)]
pub enum InputEvent<T> {
#[derive(PartialEq, Serialize, Deserialize, Debug, Derivative)]
#[derivative(Clone(bound = ""))]
pub enum InputEvent<T>
where
T: BindingTypes,
{
/// A key was pressed down, sent exactly once per key press.
KeyPressed {
/// The `VirtualKeyCode`, used for semantic info. i.e. "W" was pressed
/// `VirtualKeyCode`, used for semantic info. i.e. "W" was pressed
key_code: VirtualKeyCode,
/// The scancode, used for positional info. i.e. The third key on the first row was pressed.
/// Scancode, used for positional info. i.e. The third key on the first row was pressed.
scancode: u32,
},
/// A key was released, sent exactly once per key release.
KeyReleased {
/// The `VirtualKeyCode`, used for semantic info. i.e. "W" was released
/// `VirtualKeyCode`, used for semantic info. i.e. "W" was released
key_code: VirtualKeyCode,
/// The scancode, used for positional info. i.e. The third key on the first row was released.
/// Scancode, used for positional info. i.e. The third key on the first row was released.
scancode: u32,
},
/// A unicode character was received by the window. Good for typing.
Expand All @@ -44,7 +50,8 @@ pub enum InputEvent<T> {
/// The amount the cursor moved vertically in pixels.
delta_y: f32,
},
/// The mouse device moved. Use this for any use of the mouse that doesn't involve a standard mouse pointer.
/// The mouse device moved. Use this for any use of the mouse that doesn't involve a standard
/// mouse pointer.
MouseMoved {
/// The amount the mouse moved horizontally.
delta_x: f32,
Expand All @@ -53,7 +60,18 @@ pub enum InputEvent<T> {
},
/// The mousewheel was moved in either direction
MouseWheelMoved(ScrollDirection),
/// An axis value changed.
///
/// Note that this variant is used for `BindingTypes::Axis`, not a `ControllerAxis`.
AxisMoved {
/// The axis that moved on the controller.
axis: T::Axis,
/// The amount that the axis moved.
value: f32,
},
/// A controller Axis was moved.
///
/// Note that this variant is used for a `ControllerAxis`, not `BindingTypes::Axis`.
ControllerAxisMoved {
/// The id for the controller whose axis moved.
which: u32,
Expand Down Expand Up @@ -90,12 +108,12 @@ pub enum InputEvent<T> {
///
/// If a combination is bound to an action, it will be pressed
/// if all buttons within are pressed.
ActionPressed(T),
ActionPressed(T::Action),
/// The associated action had any related button or combination released.
///
/// If a combination is bound to an action, it will be released
/// if any of the buttons within is released while all others are pressed.
ActionReleased(T),
ActionReleased(T::Action),
/// The associated action has its mouse wheel moved.
ActionWheelMoved(T),
ActionWheelMoved(T::Action),
}
Loading

0 comments on commit 5acc411

Please sign in to comment.