Created
June 24, 2015 10:40
-
-
Save feliwir/912b192a2015b2697e85 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<Handler::LoadInfo> Handler::loadOrder = { | |
Handler::LoadInfo{"EALogoMovie", std::make_shared<Handler::CinematicArgs>(false), false }, | |
Handler::LoadInfo{"NewLineLogo", std::make_shared<Handler::CinematicArgs>(false), false }, | |
Handler::LoadInfo{"TolkienLogo", std::make_shared<Handler::CinematicArgs>(false), false }, | |
Handler::LoadInfo{"Overall_Game_Intro", std::make_shared<Handler::CinematicArgs>(true), false }, | |
Handler::LoadInfo{"LoadingRing", std::make_shared<Handler::CinematicArgs>(false), false } | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum GameState | |
{ | |
CINEMATIC = 0, | |
APT = 1, | |
LOADING_SCREEN = 2, | |
}; | |
struct StateArgs | |
{ | |
inline GameState& GetType() | |
{ | |
return m_state; | |
} | |
protected: | |
GameState m_state; | |
}; | |
struct StateInfo | |
{ | |
virtual bool IsDone() = 0; | |
inline GameState GetType() | |
{ | |
return state_type; | |
} | |
protected: | |
GameState state_type; | |
}; | |
struct CinematicInfo : public StateInfo | |
{ | |
inline bool IsDone() | |
{ | |
if(mp3->getStatus()==Loaders::Mp3Stream::Stopped && vp6->getStatus()==Loaders::Vp6Stream::Stopped) | |
return true; | |
return false; | |
}; | |
CinematicInfo(std::shared_ptr<Loaders::Vp6Stream> video, std::shared_ptr<Loaders::Mp3Stream> audio); | |
inline std::shared_ptr<Loaders::Vp6Stream> GetVP6() | |
{ | |
return vp6; | |
} | |
inline std::shared_ptr<Loaders::Mp3Stream> GetMP3() | |
{ | |
return mp3; | |
} | |
private: | |
std::shared_ptr<Loaders::Vp6Stream> vp6; | |
std::shared_ptr<Loaders::Mp3Stream> mp3; | |
}; | |
struct LoadingScreenInfo : public StateInfo | |
{ | |
inline bool IsDone() | |
{ | |
return false; | |
}; | |
private: | |
std::shared_ptr<Loaders::Vp6Stream> vp6; | |
sf::Image img; | |
}; | |
struct CinematicArgs : public StateArgs | |
{ | |
CinematicArgs(bool canSkip) | |
{ | |
m_state = CINEMATIC; | |
canSkip = canSkip; | |
} | |
protected: | |
bool canSkip; | |
bool loop; | |
}; | |
struct LoadInfo | |
{ | |
std::string name; | |
std::shared_ptr<StateArgs> args; | |
bool loaded; | |
}; | |
static std::vector<LoadInfo> loadOrder; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment