From ba41c06251789dbfafafdb0b0d89d4fe3384af2a Mon Sep 17 00:00:00 2001 From: Christopher Serr Date: Tue, 14 May 2019 22:22:00 +0200 Subject: [PATCH] Publish v0.11.0 --- CHANGELOG.md | 27 +++++++++++++++++++ Cargo.toml | 13 ++++----- capi/Cargo.toml | 2 +- crates/livesplit-hotkey/Cargo.toml | 4 +-- .../livesplit-title-abbreviations/Cargo.toml | 5 ++++ src/comparison/best_segments.rs | 2 +- src/comparison/worst_segments.rs | 2 +- src/component/detailed_timer/mod.rs | 10 ++++--- src/component/detailed_timer/tests.rs | 6 ++--- src/component/title/mod.rs | 4 +-- src/rendering/software/mod.rs | 4 +-- src/run/mod.rs | 12 ++++----- src/run/parser/time_split_tracker.rs | 2 +- 13 files changed, 64 insertions(+), 29 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..29d649e5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,27 @@ +# 0.11.0 (2019-05-14) + +This release focuses a lot on getting rendering working properly outside a web +scenario. + +- If the crate is compiled with the `image-shrinking` feature, which is + activated by default, all images such as game and segment icons that are too + large are automatically being shrunk to reduce the file size of splits files. + [#145](https://github.com/LiveSplit/livesplit-core/pull/145) +- [Flitter](https://github.com/alexozer/flitter) splits can now be parsed. + [#105](https://github.com/LiveSplit/livesplit-core/issues/150) +- The splits component now has support for custom columns. + [#149](https://github.com/LiveSplit/livesplit-core/pull/149) +- A generic renderer suitable for targeting various graphics frameworks has been + implemented. It is available via the `rendering` feature. + [#163](https://github.com/LiveSplit/livesplit-core/pull/163) +- A software renderer using the generic renderer has been implemented as well. + While certainly slower than the GPU based rendering, it offers portable + rendering of the layouts without a need for a GPU. It is mostly suitable for + screenshots. It is available via the `software-rendering` feature. + [#163](https://github.com/LiveSplit/livesplit-core/pull/163) +- The Layout files of the original LiveSplit can now be imported. + [#103](https://github.com/LiveSplit/livesplit-core/pull/103) +- Horizontal layouts are now supported in livesplit-core. + [#180](https://github.com/LiveSplit/livesplit-core/pull/180) +- Hotkeys can now be edited. + [#152](https://github.com/LiveSplit/livesplit-core/pull/152) diff --git a/Cargo.toml b/Cargo.toml index 7e4b0c37..0eb24ffa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livesplit-core" -version = "0.10.0" +version = "0.11.0" authors = ["Christopher Serr "] documentation = "https://docs.rs/livesplit-core/" repository = "https://github.com/LiveSplit/livesplit-core" @@ -9,12 +9,13 @@ description = "livesplit-core is a library that provides a lot of functionality readme = "README.md" keywords = ["speedrun", "timer", "livesplit"] include = [ - "/src/*", "/benches/*", + "/src/*", "/Cargo.toml", + "/CHANGELOG.md", + "/CODE_OF_CONDUCT.md", "/LICENSE-APACHE", "/LICENSE-MIT", - "/CODE_OF_CONDUCT.md", "/README.md" ] edition = "2018" @@ -37,7 +38,7 @@ chrono = { version = "0.4.0", features = ["serde", "clock"], default-features = derive_more = "0.14.0" image = { version = "0.21.0", features = ["png_codec"], default-features = false } indexmap = { version = "1.0.1", default-features = false, features = ["serde-1"] } -livesplit-hotkey = { path = "crates/livesplit-hotkey", version = "0.4.0" } +livesplit-hotkey = { path = "crates/livesplit-hotkey", version = "0.5.0" } odds = { version = "0.3.1", default-features = false } ordered-float = "1.0.0" palette = { version = "0.4.0", default-features = false } @@ -55,11 +56,11 @@ euclid = { version = "0.19.5", default-features = false, optional = true } livesplit-title-abbreviations = { path = "crates/livesplit-title-abbreviations", version = "0.1.0", optional = true } lyon = { version = "0.13.0", default-features = false, optional = true } rusttype = { version = "0.7.3", default-features = false, optional = true } +smallvec = { version = "0.6.9", default-features = false, optional = true } # Software Rendering euc = { version = "0.3.0", default-features = false, optional = true } vek = { version = "0.9.6", default-features = false, optional = true } -smallvec = { version = "0.6.9", default-features = false, optional = true } [dev-dependencies] memmem = "0.1.1" @@ -70,7 +71,7 @@ crc = "1.8.1" default = ["image-shrinking"] more-image-formats = ["image/webp", "image/pnm", "image/ico", "image/jpeg", "image/gif_codec", "image/tiff", "image/tga", "image/bmp", "image/hdr"] image-shrinking = ["more-image-formats"] -rendering = ["more-image-formats", "euclid", "livesplit-title-abbreviations", "rusttype", "lyon", "smallvec"] +rendering = ["more-image-formats", "euclid", "livesplit-title-abbreviations", "lyon", "rusttype", "smallvec"] software-rendering = ["rendering", "euc", "vek"] [[bench]] diff --git a/capi/Cargo.toml b/capi/Cargo.toml index 5ee319f3..99a31094 100644 --- a/capi/Cargo.toml +++ b/capi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "livesplit-core-capi" -version = "0.10.0" +version = "0.11.0" authors = ["Christopher Serr "] edition = "2018" diff --git a/crates/livesplit-hotkey/Cargo.toml b/crates/livesplit-hotkey/Cargo.toml index 2781f8f0..4c5b37e5 100644 --- a/crates/livesplit-hotkey/Cargo.toml +++ b/crates/livesplit-hotkey/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "livesplit-hotkey" -version = "0.4.0" +version = "0.5.0" authors = ["Christopher Serr "] documentation = "https://docs.rs/livesplit-hotkey/" -repository = "https://github.com/LiveSplit/livesplit-core/tree/master/hotkey" +repository = "https://github.com/LiveSplit/livesplit-core/tree/master/crates/livesplit-hotkey" license = "Apache-2.0/MIT" description = "livesplit-hotkey provides cross-platform global hotkey hooks." keywords = ["speedrun", "timer", "livesplit", "hotkey", "keyboard"] diff --git a/crates/livesplit-title-abbreviations/Cargo.toml b/crates/livesplit-title-abbreviations/Cargo.toml index 85737791..cefad333 100644 --- a/crates/livesplit-title-abbreviations/Cargo.toml +++ b/crates/livesplit-title-abbreviations/Cargo.toml @@ -2,6 +2,11 @@ name = "livesplit-title-abbreviations" version = "0.1.0" authors = ["Christopher Serr "] +documentation = "https://docs.rs/livesplit-title-abbreviations/" +repository = "https://github.com/LiveSplit/livesplit-core/tree/master/crates/livesplit-title-abbreviations" +license = "Apache-2.0/MIT" +description = "livesplit-title-abbreviations encapsulates the algorithm that LiveSplit uses to abbreviate game titles." +keywords = ["speedrun", "timer", "livesplit", "title", "abbreviation"] edition = "2018" [dependencies] diff --git a/src/comparison/best_segments.rs b/src/comparison/best_segments.rs index b6f1d70f..d4617d18 100644 --- a/src/comparison/best_segments.rs +++ b/src/comparison/best_segments.rs @@ -34,7 +34,7 @@ impl ComparisonGenerator for BestSegments { let mut index = predictions .iter() - .rposition(|p| p.is_some()) + .rposition(Option::is_some) .expect("There must always be a first sentinel prediction that is not None"); while let Some(segment_index) = index.checked_sub(1) { let prediction = diff --git a/src/comparison/worst_segments.rs b/src/comparison/worst_segments.rs index c0057377..22a544a9 100644 --- a/src/comparison/worst_segments.rs +++ b/src/comparison/worst_segments.rs @@ -34,7 +34,7 @@ impl ComparisonGenerator for WorstSegments { let mut index = predictions .iter() - .rposition(|p| p.is_some()) + .rposition(Option::is_some) .expect("There must always be a first sentinel prediction that is not None"); while let Some(segment_index) = index.checked_sub(1) { let prediction = diff --git a/src/component/detailed_timer/mod.rs b/src/component/detailed_timer/mod.rs index 198ef0b4..a4b5e326 100644 --- a/src/component/detailed_timer/mod.rs +++ b/src/component/detailed_timer/mod.rs @@ -7,11 +7,13 @@ use super::timer; use crate::comparison::{self, best_segments, none}; use crate::settings::{Field, Gradient, SemanticColor, SettingsDescription, Value}; -use crate::timing::formatter::none_wrapper::DashWrapper; use crate::timing::formatter::{ - timer as formatter, Accuracy, DigitsFormat, Short, TimeFormatter, DASH, + none_wrapper::DashWrapper, timer as formatter, Accuracy, DigitsFormat, Short, TimeFormatter, + DASH, +}; +use crate::{ + CachedImageId, GeneralLayoutSettings, Segment, TimeSpan, Timer, TimerPhase, TimingMethod, }; -use crate::{CachedImageId, GeneralLayoutSettings, TimeSpan, Timer, TimerPhase, TimingMethod}; use serde_json::{to_writer, Result}; use std::borrow::Cow; use std::io::Write; @@ -278,7 +280,7 @@ impl Component { timer .current_split() .filter(|_| display_icon) - .map(|s| s.icon()), + .map(Segment::icon), ) .map(str::to_owned); diff --git a/src/component/detailed_timer/tests.rs b/src/component/detailed_timer/tests.rs index d9053566..990ef906 100644 --- a/src/component/detailed_timer/tests.rs +++ b/src/component/detailed_timer/tests.rs @@ -19,7 +19,7 @@ fn icon_handling() { assert!(component .state(&timer, layout_settings) .icon_change - .filter(|s| s.is_empty()) + .filter(String::is_empty) .is_some()); assert!(component @@ -45,7 +45,7 @@ fn icon_handling() { assert!(component .state(&timer, layout_settings) .icon_change - .filter(|s| s.is_empty()) + .filter(String::is_empty) .is_some()); assert!(component @@ -58,6 +58,6 @@ fn icon_handling() { assert!(component .state(&timer, layout_settings) .icon_change - .filter(|s| s.is_empty()) + .filter(String::is_empty) .is_some()); } diff --git a/src/component/title/mod.rs b/src/component/title/mod.rs index 45632783..9a273aca 100644 --- a/src/component/title/mod.rs +++ b/src/component/title/mod.rs @@ -4,7 +4,7 @@ //! total number of finished runs can be shown. use crate::settings::{Alignment, Color, Field, Gradient, SettingsDescription, Value}; -use crate::{CachedImageId, Timer, TimerPhase}; +use crate::{CachedImageId, Image, Timer, TimerPhase}; use serde_json::{to_writer, Result}; use std::borrow::Cow; use std::io::Write; @@ -188,7 +188,7 @@ impl Component { let is_centered = match self.settings.text_alignment { Alignment::Center => true, Alignment::Left => false, - Alignment::Auto => game_icon.map_or(true, |i| i.is_empty()), + Alignment::Auto => game_icon.map_or(true, Image::is_empty), }; let game_name = if self.settings.show_game_name { diff --git a/src/rendering/software/mod.rs b/src/rendering/software/mod.rs index 5ff21248..4379cb9c 100644 --- a/src/rendering/software/mod.rs +++ b/src/rendering/software/mod.rs @@ -1,6 +1,6 @@ //! Provides a software renderer that can be used without a GPU. The rendering -//! much slower than with a normal GPU, but might be sufficient for situations -//! where you want to create a screenshot of the layout. +//! is much slower than with a normal GPU, but might be sufficient for +//! situations where you want to create a screenshot of the layout. #[cfg(all( test, diff --git a/src/run/mod.rs b/src/run/mod.rs index 785cb12a..a5723373 100644 --- a/src/run/mod.rs +++ b/src/run/mod.rs @@ -26,11 +26,11 @@ mod segment_history; #[cfg(test)] mod tests; -pub use self::attempt::Attempt; -pub use self::editor::{Editor, RenameError}; -pub use self::run_metadata::RunMetadata; -pub use self::segment::Segment; -pub use self::segment_history::SegmentHistory; +pub use attempt::Attempt; +pub use editor::{Editor, RenameError}; +pub use run_metadata::RunMetadata; +pub use segment::Segment; +pub use segment_history::SegmentHistory; use crate::comparison::{default_generators, personal_best, ComparisonGenerator}; use crate::{AtomicDateTime, Image, Time, TimeSpan, TimingMethod}; @@ -573,7 +573,7 @@ impl Run { /// Returns the maximum index currently in use by the Attempt History. This /// mostly serves as a helper function for the Timer. pub fn max_attempt_history_index(&self) -> Option { - self.attempt_history().iter().map(|x| x.index()).max() + self.attempt_history().iter().map(Attempt::index).max() } /// Applies some fixing algorithms on the Run. This includes fixing the diff --git a/src/run/parser/time_split_tracker.rs b/src/run/parser/time_split_tracker.rs index 321652fb..8cdf6be6 100644 --- a/src/run/parser/time_split_tracker.rs +++ b/src/run/parser/time_split_tracker.rs @@ -86,7 +86,7 @@ pub fn parse(source: R, path_for_loading_other_files: Option>(); + let mut comparisons = splits.map(ToOwned::to_owned).collect::>(); for comparison in &mut comparisons { let mut name = comparison.to_owned();