v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
117
source/client/StarClientApplication.hpp
Normal file
117
source/client/StarClientApplication.hpp
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
#ifndef STAR_CLIENT_APPLICATION_HPP
|
||||
#define STAR_CLIENT_APPLICATION_HPP
|
||||
|
||||
#include "StarUniverseServer.hpp"
|
||||
#include "StarUniverseClient.hpp"
|
||||
#include "StarWorldPainter.hpp"
|
||||
#include "StarGameTypes.hpp"
|
||||
#include "StarMainInterface.hpp"
|
||||
#include "StarMainMixer.hpp"
|
||||
#include "StarTitleScreen.hpp"
|
||||
#include "StarErrorScreen.hpp"
|
||||
#include "StarCinematic.hpp"
|
||||
#include "StarKeyBindings.hpp"
|
||||
#include "StarMainApplication.hpp"
|
||||
|
||||
namespace Star {
|
||||
|
||||
class ClientApplication : public Application {
|
||||
protected:
|
||||
virtual void startup(StringList const& cmdLineArgs) override;
|
||||
virtual void shutdown() override;
|
||||
|
||||
virtual void applicationInit(ApplicationControllerPtr appController) override;
|
||||
virtual void renderInit(RendererPtr renderer) override;
|
||||
|
||||
virtual void windowChanged(WindowMode windowMode, Vec2U screenSize) override;
|
||||
|
||||
virtual void processInput(InputEvent const& event) override;
|
||||
|
||||
virtual void update() override;
|
||||
virtual void render() override;
|
||||
|
||||
virtual void getAudioData(int16_t* stream, size_t len) override;
|
||||
|
||||
private:
|
||||
enum class MainAppState {
|
||||
Quit,
|
||||
Startup,
|
||||
Mods,
|
||||
ModsWarning,
|
||||
Splash,
|
||||
Error,
|
||||
Title,
|
||||
SinglePlayer,
|
||||
MultiPlayer
|
||||
};
|
||||
|
||||
struct PendingMultiPlayerConnection {
|
||||
Variant<P2PNetworkingPeerId, HostAddressWithPort> server;
|
||||
String account;
|
||||
String password;
|
||||
};
|
||||
|
||||
void changeState(MainAppState newState);
|
||||
void setError(String const& error);
|
||||
void setError(String const& error, std::exception const& e);
|
||||
|
||||
void updateMods();
|
||||
void updateModsWarning();
|
||||
void updateSplash();
|
||||
void updateError();
|
||||
void updateTitle();
|
||||
void updateRunning();
|
||||
|
||||
bool isActionTaken(InterfaceAction action) const;
|
||||
bool isActionTakenEdge(InterfaceAction action) const;
|
||||
|
||||
void updateCamera();
|
||||
|
||||
RootUPtr m_root;
|
||||
ThreadFunction<void> m_rootLoader;
|
||||
MainAppState m_state = MainAppState::Startup;
|
||||
|
||||
// Valid after applicationInit is called
|
||||
MainMixerPtr m_mainMixer;
|
||||
GuiContextPtr m_guiContext;
|
||||
|
||||
// Valid after renderInit is called the first time
|
||||
CinematicPtr m_cinematicOverlay;
|
||||
ErrorScreenPtr m_errorScreen;
|
||||
|
||||
// Valid if main app state >= Title
|
||||
PlayerStoragePtr m_playerStorage;
|
||||
StatisticsPtr m_statistics;
|
||||
UniverseClientPtr m_universeClient;
|
||||
TitleScreenPtr m_titleScreen;
|
||||
|
||||
// Valid if main app state > Title
|
||||
PlayerPtr m_player;
|
||||
WorldPainterPtr m_worldPainter;
|
||||
WorldRenderData m_renderData;
|
||||
MainInterfacePtr m_mainInterface;
|
||||
|
||||
// Valid if main app state == SinglePlayer
|
||||
UniverseServerPtr m_universeServer;
|
||||
|
||||
float m_cameraXOffset = 0.0f;
|
||||
float m_cameraYOffset = 0.0f;
|
||||
bool m_snapBackCameraOffset = false;
|
||||
int m_cameraOffsetDownTicks = 0;
|
||||
Vec2F m_cameraPositionSmoother;
|
||||
Vec2F m_cameraSmoothDelta;
|
||||
|
||||
int m_minInterfaceScale = 2;
|
||||
int m_maxInterfaceScale = 3;
|
||||
Vec2F m_crossoverRes;
|
||||
|
||||
List<KeyDownEvent> m_heldKeyEvents;
|
||||
List<KeyDownEvent> m_edgeKeyEvents;
|
||||
|
||||
Maybe<PendingMultiPlayerConnection> m_pendingMultiPlayerConnection;
|
||||
Maybe<HostAddressWithPort> m_currentRemoteJoin;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue