Diggler/Game.cpp
Dorian Wouters f2062d6fe7 Faster atlas creation
Block selection
Chunk de/compression now uses internal buffer directly (0-copy)
Optimized Chunk vertices list order (faster vert access from GPU cache)
F5 Debug info: added triangle count
Implemented ladder climb
Road + jump pad makes you jump farther
Fixed bad fog color blending (alpha-channel)
Changed LZFX and enet compilation to Release, -O3
2016-01-02 20:03:37 +01:00

44 lines
879 B
C++

#include "Game.hpp"
#include "GlobalProperties.hpp"
#include "ChunkChangeHelper.hpp"
#include "Audio.hpp"
#include "KeyBinds.hpp"
namespace Diggler {
Game::Game() : players(this), CCH(nullptr), GW(nullptr), LP(nullptr), PM(nullptr) {
SC = std::make_shared<Superchunk>(this);
}
void Game::init() {
if (GlobalProperties::IsClient) {
B = new Blocks;
PM = new ProgramManager(*this);
LP = new LocalPlayer(this);
RP = new RenderProperties; { // TODO move somewhere else?
RP->bloom = true;
RP->wavingLiquids = !true;
RP->fogStart = 16;
RP->fogEnd = 32;
}
A = new Audio(*this);
KB = new KeyBinds;
}
if (GlobalProperties::IsServer) {
CCH = new ChunkChangeHelper();
}
}
Game::~Game() {
if (GlobalProperties::IsClient) {
delete B;
delete PM; delete LP;
delete RP; delete A;
delete KB;
}
if (GlobalProperties::IsServer) {
delete CCH;
}
}
}