Skip to content

Commit

Permalink
Publish v0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
CryZe committed May 14, 2019
1 parent 88aaaeb commit ba41c06
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 29 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "livesplit-core"
version = "0.10.0"
version = "0.11.0"
authors = ["Christopher Serr <christopher.serr@gmail.com>"]
documentation = "https://docs.rs/livesplit-core/"
repository = "https://github.com/LiveSplit/livesplit-core"
Expand All @@ -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"
Expand All @@ -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 }
Expand All @@ -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"
Expand All @@ -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]]
Expand Down
2 changes: 1 addition & 1 deletion capi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "livesplit-core-capi"
version = "0.10.0"
version = "0.11.0"
authors = ["Christopher Serr <christopher.serr@gmail.com>"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions crates/livesplit-hotkey/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "livesplit-hotkey"
version = "0.4.0"
version = "0.5.0"
authors = ["Christopher Serr <christopher.serr@gmail.com>"]
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"]
Expand Down
5 changes: 5 additions & 0 deletions crates/livesplit-title-abbreviations/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
name = "livesplit-title-abbreviations"
version = "0.1.0"
authors = ["Christopher Serr <christopher.serr@gmail.com>"]
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]
Expand Down
2 changes: 1 addition & 1 deletion src/comparison/best_segments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion src/comparison/worst_segments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
10 changes: 6 additions & 4 deletions src/component/detailed_timer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -278,7 +280,7 @@ impl Component {
timer
.current_split()
.filter(|_| display_icon)
.map(|s| s.icon()),
.map(Segment::icon),
)
.map(str::to_owned);

Expand Down
6 changes: 3 additions & 3 deletions src/component/detailed_timer/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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());
}
4 changes: 2 additions & 2 deletions src/component/title/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/rendering/software/mod.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
12 changes: 6 additions & 6 deletions src/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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<i32> {
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
Expand Down
2 changes: 1 addition & 1 deletion src/run/parser/time_split_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub fn parse<R: BufRead>(source: R, path_for_loading_other_files: Option<PathBuf
let mut splits = line.split('\t');
run.set_category_name(splits.next().ok_or(Error::ExpectedCategoryName)?);
splits.next(); // Skip one element
let mut comparisons = splits.map(|s| s.to_string()).collect::<Vec<_>>();
let mut comparisons = splits.map(ToOwned::to_owned).collect::<Vec<_>>();

for comparison in &mut comparisons {
let mut name = comparison.to_owned();
Expand Down

0 comments on commit ba41c06

Please sign in to comment.