Commit 1398d9e7 authored by Benjamin Lee's avatar Benjamin Lee 💬
Browse files

updated to latest rust nightly

parent 9c4126b7
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "alga"
version = "0.7.2"
......
......@@ -12,12 +12,9 @@ build_target () {
export CXXFLAGS="\
-DIMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS \
-DIMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS \
-static -static-libstdc++ -static-libgcc"
export RUSTFLAGS="$RUSTFLAGS \
-Clink-arg=-static \
-Clink-arg=-static-libgcc \
-Clink-arg=-static-libstdc++"
-static"
export RUSTFLAGS="$RUSTFLAGS -C link-arg=-static"
fi
if [[ $1 == "i686-pc-windows-gnu" ]]; then
......@@ -26,7 +23,7 @@ build_target () {
fi
echo "Building target $1..."
cargo build --release --target $1 --verbose
cargo build --release --target $1
)
}
......@@ -37,8 +34,8 @@ dist_target () {
case $1 in
*"-pc-windows-gnu")
bin_src="ball-gfx-hal.exe"
bin="ball-gfx-hal-$arch.exe"
dist="dist/ball-gfx-hal-windows"
bin="ball-gfx-hal.exe"
dist="dist/ball-gfx-hal-windows/$arch"
toolchain="$arch-w64-mingw32"
;;
*"-linux-gnu")
......@@ -59,6 +56,23 @@ dist_target () {
mkdir -p $dist
cp target/$1/release/$bin_src $dist/$bin
$toolchain-strip $dist/$bin
# copy required dlls over for the windows one
if [[ $1 = *"-pc-windows-gnu" ]]; then
prefix="/usr/$arch-w64-mingw32"
cp $prefix/lib/libstdc++-6.dll $dist
cp $prefix/bin/libwinpthread-1.dll $dist
case $arch in
"x86_64")
cp $prefix/lib/libgcc_s_seh-1.dll $dist
;;
"i686")
cp $prefix/lib/libgcc_s_sjlj-1.dll $dist
;;
esac
# strip all of the dlls
$toolchain-strip $dist/*.dll
fi
}
# builds and packages all targets for a given platform
......@@ -76,7 +90,7 @@ package () {
echo "unsupported platform $1"
exit 1
esac
echo "Building all $1 targets..."
mkdir -p dist/$dist
......@@ -85,7 +99,7 @@ package () {
dist_target "x86_64-$target"
build_target "i686-$target"
dist_target "i686-$target"
echo "Packaging $1 targets..."
cd dist/
......
......@@ -92,9 +92,9 @@ impl DebugState {
let start = NETWORK_HISTORY_LENGTH - size;
for (i, stats) in self.network_rx.try_iter().enumerate() {
let bandwidth_in = stats.bytes_in as f32 /
NETWORK_STATS_RATE.as_float_secs() as f32;
NETWORK_STATS_RATE.as_secs_f32();
let bandwidth_out = stats.bytes_out as f32 /
NETWORK_STATS_RATE.as_float_secs() as f32;
NETWORK_STATS_RATE.as_secs_f32();
let packet_loss = f32::from(stats.packets_lost) /
f32::from(stats.packets_sent);
// Convert to KB
......
......@@ -293,7 +293,7 @@ impl Game {
Some(&(ref new, new_time)) => {
let alpha = if delayed_time > old_time {
let span = new_time.duration_since(old_time);
delayed_time.duration_since(old_time).div_duration(span)
delayed_time.duration_since(old_time).div_duration_f32(span)
} else {
0.0
};
......
#![feature(duration_float, range_contains, copy_within)]
#![feature(duration_float, copy_within)]
extern crate gfx_backend_vulkan as backend;
use ctrlc;
......@@ -147,16 +147,16 @@ fn run_gui() {
let now = Instant::now();
let update_time =
now.duration_since(last_update).as_float_secs() as f32;
now.duration_since(last_update).as_secs_f32();
last_update = now;
game_state.update(update_time);
if graphics.wait_for_frame(Some(Duration::from_float_secs(1.0 / 400.0)))
if graphics.wait_for_frame(Some(Duration::from_secs_f32(1.0 / 400.0)))
{
let now = Instant::now();
let frame_time =
now.duration_since(last_frame).as_float_secs() as f32;
now.duration_since(last_frame).as_secs_f32();
last_frame = now;
let ui = imgui_winit.frame(&mut imgui, &window);
......
......@@ -50,7 +50,7 @@ impl RttEstimator {
pub fn pong(&mut self, sequence: u32) {
if let Some((expected, time)) = self.last_ping {
if sequence == expected {
let sample = time.elapsed().as_float_secs() as f32;
let sample = time.elapsed().as_secs_f32();
self.rtt = Some(match self.rtt {
Some(rtt) => 0.875 * rtt + 0.125 * sample,
None => sample,
......
......@@ -400,7 +400,7 @@ impl Server {
fn game_tick(&mut self) -> Result<(), Error> {
let now = Instant::now();
let (dt, interval) = self.game_tick.next(now);
let dt = dt.as_float_secs() as f32;
let dt = dt.as_secs_f32();
self.timer.set_timeout(interval, TimeoutState::Tick);
let events = self.game.tick(dt);
......
......@@ -53,7 +53,7 @@ impl Interval {
}
};
let tick_length = tick - (self.next - self.interval);
trace!("scheduling next tick in {} secs", interval.as_float_secs());
trace!("scheduling next tick in {} secs", interval.as_secs_f32());
self.next = tick + interval;
(tick_length, interval)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment