SyncState.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 updateFreeShop3DSX();
  32. bool updateCache();
  33. bool updateTitleKeys();
  34. bool updateEshopMusic();
  35. bool loadServices();
  36. bool loadThemeManagement();
  37. void setStatus(const std::string& message);
  38. cpp3ds::Thread m_threadSync;
  39. cpp3ds::Thread m_threadStartupSound;
  40. cpp3ds::Clock m_timer;
  41. util3ds::TweenText m_textStatus;
  42. TweenEngine::TweenManager m_tweenManager;
  43. cpp3ds::Sound m_soundStartup;
  44. cpp3ds::Sound m_soundLoading;
  45. };
  46. } // namespace FreeShop
  47. #endif // FREESHOP_SYNCSTATE_HPP