Skip to content

Commit

Permalink
Camera shake + music start time fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aedm committed May 13, 2023
1 parent ba74436 commit 48e7a7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/bitang/src/render/vulkan_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use winit::{
event_loop::{ControlFlow, EventLoop},
};

const START_IN_DEMO_MODE: bool = !true;
const START_IN_DEMO_MODE: bool = true;

pub struct VulkanContext {
// TODO: expand and remove
Expand Down
6 changes: 4 additions & 2 deletions crates/bitang/src/tool/music_player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rodio::{Decoder, OutputStream, OutputStreamHandle, Sink, Source};
use std::fs::File;
use std::io::BufReader;
use std::time::Duration;
use tracing::{info};
use tracing::info;

pub struct MusicPlayer {
sink: Sink,
Expand All @@ -12,6 +12,8 @@ pub struct MusicPlayer {
is_playing: bool,
}

const MUSIC_FILE: &str = "Brian-Attractors-(short-version).mp3";

impl MusicPlayer {
pub fn new() -> Self {
let (stream, stream_handle) = OutputStream::try_default().unwrap();
Expand All @@ -30,7 +32,7 @@ impl MusicPlayer {
info!("Music can't be played from negative time");
return;
}
let path = format! {"{ROOT_FOLDER}/music.mp3"};
let path = format! {"{ROOT_FOLDER}/{MUSIC_FILE}"};
let Ok(file) = File::open(&path) else {
info!("Music file '{path}' not found");
return;
Expand Down

0 comments on commit 48e7a7a

Please sign in to comment.