Skip to content

Commit

Permalink
Fix unused warnings on non-macOS targets
Browse files Browse the repository at this point in the history
  • Loading branch information
kelpsyberry committed Jan 4, 2024
1 parent e5dcbbe commit 6efc083
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
3 changes: 2 additions & 1 deletion frontend/desktop/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ pub enum TitleBarMode {
}

impl TitleBarMode {
pub fn system_title_bar_hidden(&self) -> bool {
#[cfg(target_os = "macos")]
pub fn system_title_bar_is_hidden(&self) -> bool {
*self != TitleBarMode::System
}
}
Expand Down
14 changes: 8 additions & 6 deletions frontend/desktop/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ mod log;
#[allow(dead_code)]
pub mod window;

#[cfg(target_os = "macos")]
use crate::config::TitleBarMode;
#[cfg(feature = "debug-views")]
use crate::debug_views;
use crate::{
audio,
config::{self, Launch, Renderer2dKind, Renderer3dKind, TitleBarMode},
config::{self, Launch, Renderer2dKind, Renderer3dKind},
emu, game_db, input,
utils::{base_dirs, Lazy},
DsSlotRom, FrameData,
Expand Down Expand Up @@ -720,15 +722,15 @@ impl UiState {
self.emu.as_ref().map_or(false, |emu| emu.playing)
}

fn update_menu_bar(&mut self, config: &config::Config, window: &mut window::Window) {
fn update_menu_bar(&mut self, config: &config::Config, _window: &mut window::Window) {
if config_changed!(config, full_window_screen) {
self.show_menu_bar |= !config!(config, full_window_screen);
}

#[cfg(target_os = "macos")]
{
if let Some(mode) = config_changed_value!(config, title_bar_mode) {
window.set_macos_title_bar_hidden(mode.system_title_bar_hidden());
_window.set_macos_title_bar_hidden(mode.system_title_bar_is_hidden());
}
}
}
Expand Down Expand Up @@ -766,9 +768,9 @@ impl UiState {
buffer
}

fn update_title(&self, config: &config::Config, window: &window::Window) {
fn update_title(&self, _config: &config::Config, window: &window::Window) {
#[cfg(target_os = "macos")]
if match config!(config, title_bar_mode) {
if match config!(_config, title_bar_mode) {
TitleBarMode::System => false,
TitleBarMode::Mixed => !self.show_menu_bar,
TitleBarMode::Imgui => true,
Expand Down Expand Up @@ -912,7 +914,7 @@ pub fn main() {
window::AdapterSelection::Auto(wgpu::PowerPreference::LowPower),
config.config.window_size,
#[cfg(target_os = "macos")]
config!(config.config, title_bar_mode).system_title_bar_hidden(),
config!(config.config, title_bar_mode).system_title_bar_is_hidden(),
));
// TODO: Allow custom styles
window_builder.apply_default_imgui_style();
Expand Down
6 changes: 3 additions & 3 deletions frontend/desktop/src/ui/config_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ mod setting;
use super::{utils::heading, Config, EmuState};
#[cfg(feature = "log")]
use crate::config::LoggingKind;
#[cfg(target_os = "macos")]
use crate::config::TitleBarMode;
use crate::{
audio,
config::{
self, saves, ModelConfig, Renderer2dKind, Renderer3dKind, Setting as _, TitleBarMode,
},
config::{self, saves, ModelConfig, Renderer2dKind, Renderer3dKind, Setting as _},
ui::utils::combo_value,
utils::HomePathBuf,
};
Expand Down
8 changes: 5 additions & 3 deletions frontend/desktop/src/ui/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ use std::{
sync::Arc,
time::{Duration, Instant},
};
#[cfg(target_os = "macos")]
use winit::platform::macos::WindowBuilderExtMacOS;
use winit::{
dpi::{LogicalSize, PhysicalSize},
event::{Event, StartCause, WindowEvent},
event_loop::EventLoop,
raw_window_handle::{HasWindowHandle, RawWindowHandle},
window::{Window as WinitWindow, WindowBuilder as WinitWindowBuilder},
};
#[cfg(target_os = "macos")]
use winit::{
platform::macos::WindowBuilderExtMacOS,
raw_window_handle::{HasWindowHandle, RawWindowHandle},
};

pub enum AdapterSelection {
Auto(wgpu::PowerPreference),
Expand Down
4 changes: 1 addition & 3 deletions render/wgpu-2d/src/common/render/bgs/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use dust_soft_2d_base::render::bgs::avx2::*;

use core::{arch::x86_64::*, mem::transmute, simd::u64x4};
use core::arch::x86_64::*;
use dust_core::gpu::{
engine_2d::{AffineBgIndex, BgIndex, Role},
SCREEN_WIDTH,
Expand Down Expand Up @@ -160,8 +160,6 @@ pub unsafe fn render_scanline_bgs_and_objs<
pub unsafe fn render_scanline_bg_3d<B: Buffers>(buffers: &B) {
// TODO: 3D layer scrolling

let zero = _mm256_setzero_si256();

let pixel_attrs =
_mm256_set1_epi64x(BgObjPixel(0).with_color_effects_mask(1).with_is_3d(true).0 as i64);

Expand Down

0 comments on commit 6efc083

Please sign in to comment.