|
@@ -2,14 +2,17 @@
|
|
#include "common/network/Packets.h"
|
|
#include "common/network/Packets.h"
|
|
#include "gaming-core/utils/Utils.h"
|
|
#include "gaming-core/utils/Utils.h"
|
|
|
|
|
|
-Game::Game(const Controller& controller, const Clock& fps, const Clock& tps,
|
|
|
|
- RenderSettings& settings, const Size& size, Client& client)
|
|
|
|
- : controller(controller), fps(fps), tps(tps), renderSettings(settings),
|
|
|
|
- size(size), client(client), world(blockRegistry), worldRenderer(world),
|
|
|
|
- connected(false) {
|
|
|
|
|
|
+Game::Game(TextInput& textInput, const Controller& controller, const Clock& fps,
|
|
|
|
+ const Clock& tps, RenderSettings& settings, const Size& size,
|
|
|
|
+ Client& client)
|
|
|
|
+ : textInput(textInput), controller(controller), fps(fps), tps(tps),
|
|
|
|
+ renderSettings(settings), size(size), client(client),
|
|
|
|
+ world(blockRegistry), worldRenderer(world), connected(false) {
|
|
pos = Vector3(16.0f, 30.0f, -10.0f);
|
|
pos = Vector3(16.0f, 30.0f, -10.0f);
|
|
rotation = Quaternion(Vector3(1.0f, 0.0f, 0.0f), 30) * rotation;
|
|
rotation = Quaternion(Vector3(1.0f, 0.0f, 0.0f), 30) * rotation;
|
|
rotation = Quaternion(Vector3(0.0f, 1.0f, 0.0f), 30) * rotation;
|
|
rotation = Quaternion(Vector3(0.0f, 1.0f, 0.0f), 30) * rotation;
|
|
|
|
+
|
|
|
|
+ textInput.setActive(true);
|
|
}
|
|
}
|
|
|
|
|
|
void Game::tick() {
|
|
void Game::tick() {
|
|
@@ -80,6 +83,9 @@ void Game::renderTextOverlay(float lag, Renderer& renderer, FontRenderer& fr) {
|
|
.append(" &999TPS: &722")
|
|
.append(" &999TPS: &722")
|
|
.append(tps.getUpdatesPerSecond());
|
|
.append(tps.getUpdatesPerSecond());
|
|
fr.drawString(10, 10, s);
|
|
fr.drawString(10, 10, s);
|
|
|
|
+ s.clear();
|
|
|
|
+ textInput.getInput(s);
|
|
|
|
+ fr.drawString(10, 30, s);
|
|
}
|
|
}
|
|
|
|
|
|
bool Game::isRunning() const {
|
|
bool Game::isRunning() const {
|