SyncState.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef FREESHOP_SYNCSTATE_HPP
  2. #define FREESHOP_SYNCSTATE_HPP
  3. #include "State.hpp"
  4. #include "../TweenObjects.hpp"
  5. #include <cpp3ds/Graphics/Sprite.hpp>
  6. #include <cpp3ds/Graphics/Text.hpp>
  7. #include <TweenEngine/TweenManager.h>
  8. #include <cpp3ds/System/Thread.hpp>
  9. #include <cpp3ds/System/Clock.hpp>
  10. #include <cpp3ds/Audio/Sound.hpp>
  11. #ifndef EMULATION
  12. #include <3ds.h>
  13. #endif
  14. namespace FreeShop {
  15. extern bool g_syncComplete;
  16. extern bool g_browserLoaded;
  17. class SyncState : public State
  18. {
  19. public:
  20. SyncState(StateStack& stack, Context& context, StateCallback callback);
  21. ~SyncState();
  22. virtual void renderTopScreen(cpp3ds::Window& window);
  23. virtual void renderBottomScreen(cpp3ds::Window& window);
  24. virtual bool update(float delta);
  25. virtual bool processEvent(const cpp3ds::Event& event);
  26. void startupSound();
  27. void sync();
  28. static bool exitRequired;
  29. private:
  30. bool updateFreeShop();
  31. bool updateCache();
  32. bool updateTitleKeys();
  33. bool updateEshopMusic();
  34. bool loadServices();
  35. bool loadThemeManagement();
  36. void setStatus(const std::string& message);
  37. cpp3ds::Thread m_threadSync;
  38. cpp3ds::Thread m_threadStartupSound;
  39. cpp3ds::Clock m_timer;
  40. util3ds::TweenText m_textStatus;
  41. TweenEngine::TweenManager m_tweenManager;
  42. cpp3ds::Sound m_soundStartup;
  43. cpp3ds::Sound m_soundLoading;
  44. };
  45. } // namespace FreeShop
  46. #endif // FREESHOP_SYNCSTATE_HPP