Skip to content

Commit e9b84fd

Browse files
committed
fix: linux build
1 parent b011b55 commit e9b84fd

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

phira/src/page/settings.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ fn right_rect(w: f32) -> Rect {
264264
Rect::new(w - 0.3, (ITEM_HEIGHT - rh) / 2., INTERACT_WIDTH, rh)
265265
}
266266

267+
#[cfg(target_os = "windows")]
267268
struct GeneralList {
268269
icon_lang: SafeTexture,
269-
270270
lang_btn: ChooseButton,
271271
windows_fullscreen_btn: DRectButton,
272272
windows_multitouch_btn: DRectButton,
@@ -280,6 +280,20 @@ struct GeneralList {
280280
anys_gateway_btn: DRectButton,
281281
}
282282

283+
#[cfg(not(target_os = "windows"))]
284+
struct GeneralList {
285+
icon_lang: SafeTexture,
286+
lang_btn: ChooseButton,
287+
offline_btn: DRectButton,
288+
server_status_btn: DRectButton,
289+
mp_btn: DRectButton,
290+
mp_addr_btn: DRectButton,
291+
lowq_btn: DRectButton,
292+
insecure_btn: DRectButton,
293+
enable_anys_btn: DRectButton,
294+
anys_gateway_btn: DRectButton,
295+
}
296+
283297
impl GeneralList {
284298
pub fn new(icon_lang: SafeTexture) -> Self {
285299
Self {

prpr/src/judge.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,14 @@ pub struct Judge {
274274
}
275275

276276
static SUBSCRIBER_ID: Lazy<usize> = Lazy::new(register_input_subscriber);
277+
278+
#[cfg(target_os = "windows")]
277279
thread_local! {
278-
#[cfg(target_os = "windows")]
279280
static TOUCHES: RefCell<(HashMap<u64, Touch>, i32, u32, Vec<Touch>)> = RefCell::default();
280-
#[cfg(not(target_os = "windows"))]
281+
}
282+
283+
#[cfg(not(target_os = "windows"))]
284+
thread_local! {
281285
static TOUCHES: RefCell<(Vec<Touch>, i32, u32)> = RefCell::default();
282286
}
283287

@@ -1016,7 +1020,10 @@ impl Judge {
10161020
}
10171021
}
10181022

1023+
#[cfg(target_os = "windows")]
10191024
struct Handler(HashMap<u64, Touch>, i32, u32, Vec<Touch>);
1025+
#[cfg(not(target_os = "windows"))]
1026+
struct Handler(Vec<Touch>, i32, u32);
10201027
impl Handler {
10211028
fn finalize(&mut self) {
10221029
#[cfg(target_os = "windows")]

prpr/src/scene/game.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ impl Scene for GameScene {
796796
let time = tm.now() as f32;
797797
let time = match self.state {
798798
State::Starting => {
799+
#[cfg(target_os = "windows")]
799800
set_multitouch(self.res.config.windows_multitouch_mode, true);
800801
if time >= Self::BEFORE_TIME {
801802
self.res.alpha = 1.;
@@ -838,6 +839,7 @@ impl Scene for GameScene {
838839
time
839840
}
840841
State::Ending => {
842+
#[cfg(target_os = "windows")]
841843
set_multitouch(self.res.config.windows_multitouch_mode, false);
842844
let t = time - self.res.track_length - WAIT_TIME;
843845
if t >= AFTER_TIME + 0.3 {
@@ -1104,6 +1106,7 @@ impl Scene for GameScene {
11041106

11051107
fn next_scene(&mut self, tm: &mut TimeManager) -> NextScene {
11061108
if self.should_exit {
1109+
#[cfg(target_os = "windows")]
11071110
set_multitouch(self.res.config.windows_multitouch_mode, false);
11081111
if tm.paused() {
11091112
tm.resume();

0 commit comments

Comments
 (0)