From 76a94edde9eaf5c6521e0f835c55c6b233640a90 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Thu, 30 Sep 2021 09:47:07 -0400 Subject: [PATCH] working on making the loading screen load a texture --- game/assets/logos/game-logo.png | Bin 0 -> 3163 bytes game/src/lib.rs | 21 +++++++++++++++------ game/src/scenes/loading_screen.rs | 17 ++++++++++++----- game/src/scenes/mod.rs | 7 ++++--- 4 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 game/assets/logos/game-logo.png diff --git a/game/assets/logos/game-logo.png b/game/assets/logos/game-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..8f734b3cabc4bf60ad12ea837b330be38d2df2b4 GIT binary patch literal 3163 zcmV-h45agkP)EX>4Tx04R}tkv&MmKpe$i(~6=M1q+HeWT@g`K~%(1t5Adrp;l;o12rOi_^|?Psx08P93mETO{_FA%bObU6meM9bjlY} z9;=+UIBUf+tKXBqFqqL-mbp%I2r(>T2@*soD5HQPY(!|)NwJWi{b&pSpzD{&rI4!t zMveuPph0&1;D7MDTPr&`;Uxv5K--Jsd<+BayFjhtIN!&PQ#%3t&%l-5@RzE<%qQuU zh88{odbWX!>xQQ60hc?#z>^`HvMc#%3fV01en#Jv2KsJ+&NZ*M`aVt{fFyMlzX1*o zfsq_#ueW%2M{{rgo~ifu16Pc4oIyI?u>b%724YJ`L;(K){{a7>y{D4^000SaNLh0L z04^f{04^f|c%?sf00007bV*G`2jv785Df=~|Dovs000?uMObu0Z*6U5Zgc=ca%Ew3 zWn>_CX>@2HM@dakSAh-}000UyNkl5?|aVgoaemndEfK<&OE~m?>W!y`<(ASm*4OARADd}(tv@$g}??HU<~jHU^Fls_%KlGQZ=y8rM~yC#;2~f_3fk2dxDt2-*zReJ9t73__W+*;`e%)wtO|7w z__#+>Z;vUIr4;I*4`c;!g`4@9P{&6da2N1iLY%dhsGSYKw}F2bVO+KY4*(Zsg`X@7 z^#V`C_5&WrV{`7xmu6Pqh-HXRA)13$DOloz$g*5c_Ysn1m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H3GmRg={FqQ5!CJ)JEG*`e&KoQYr9%#Q zTKUd(9?Ne)&JZ+M8RD5`$~>_$7`_JAKn7rL|`@DS;|e4;G*F`+&hPq;0OAS^+DRh1zdc$VOJ=f~nF9=^qoM%Z## z2y}*c?v0Q$@1B@QI=4W|k{=W5qtO*|raafW%1~f=tv&BJ2bdM3%o^Y^H zo`wE;xgR6JzKoyb`6-AMgbzX3nLwwvD9T?QGS6YIuKDs=6EdH=1p7wQ?i?_sf`u`S zeQ_KT^h+D2^IH+hs&`{sTh_b?Wi29F_|dzSBGnU`wzXuOpG*n0FPKoLQ>cBXSMtV?W6F$KG1SC+uwv0AlNQAy_M6QvF(yrH$;AYh+5b8?h$AsF1+Jssu)F2+OQSv^5LAFcrCMb`%m#u0L`^_?d{U@z)UN zs;-2Dx>ETup*Ep5p;iiYE%0KA>vwFL<)P1Kq^wO*g}Q9`vBN}zAvx?vA`EUxNqv3} z-0mTt`M_<)Px1IMp*9$j#e2X-=woL1#{Ebzt(>R)e&F&uX#6D4j|sKGkUX{{2TPBY zpzH(4-Jdt2b6N?5MZm@A?UIv1u2T6ip*9$bgFT4V!*zsns`7ysfD1|1?tdL(XFQwI zg;e+>a5b>X_~{*Xn3x}Sm{=U7`7p82*tp9ryOXF>D@Oux6%(TnONxC(==UwacY&sa zzTJxA$AsF1+Jrhf1_0M1fr2_>)}syh8UEr@#6g2w%KrwPd0nB@?)vFg;EW=*BQ^X~ zVK5ldfPuhRB+P6xa$VDK#5T7E@$BnFEERSjx3av69D= Result<(), Box Result<(), Box Self { + pub fn new(raylib_handle: &HackedRaylibHandle, thread: &RaylibThread) -> Self { + + // Load the game logo asset + // TODO: in-memory texture loading + // raylib_handle.load_texture_from_image(, image) + + Self { start_timestamp: None, } @@ -78,8 +88,5 @@ impl ScreenSpaceRender for LoadingScreen { // Calculate the loading screen fade in/out value // This makes the loading screen fade in/out over the duration of the loading screen - - - } } diff --git a/game/src/scenes/mod.rs b/game/src/scenes/mod.rs index c4f3252..a4d84a3 100644 --- a/game/src/scenes/mod.rs +++ b/game/src/scenes/mod.rs @@ -1,5 +1,6 @@ use dirty_fsm::StateMachine; -use crate::context::GameContext; +use raylib::RaylibThread; +use crate::{context::GameContext, utilities::non_ref_raylib::HackedRaylibHandle}; use self::{fsm_error_screen::FsmErrorScreen, loading_screen::LoadingScreen}; pub mod fsm_error_screen; @@ -18,13 +19,13 @@ pub enum Scenes { pub enum ScreenError {} /// Build the state machine for all scenes -pub fn build_screen_state_machine() -> Result< +pub fn build_screen_state_machine(raylib_handle: &HackedRaylibHandle, thread: &RaylibThread) -> Result< // StateMachine>)>>, StateMachine, ScreenError, > { let mut machine = StateMachine::new(); machine.add_action(Scenes::FsmErrorScreen, FsmErrorScreen::new())?; - machine.add_action(Scenes::LoadingScreen, LoadingScreen::new())?; + machine.add_action(Scenes::LoadingScreen, LoadingScreen::new(raylib_handle, thread))?; Ok(machine) }