mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
build time decreased
This commit is contained in:
parent
41ef80e938
commit
0ad3dd7ab8
15 changed files with 34 additions and 24 deletions
|
|
@ -35,6 +35,7 @@
|
||||||
#include "window/input.hpp"
|
#include "window/input.hpp"
|
||||||
#include "window/Window.hpp"
|
#include "window/Window.hpp"
|
||||||
#include "world/WorldGenerators.hpp"
|
#include "world/WorldGenerators.hpp"
|
||||||
|
#include "settings.hpp"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
#define ENGINE_HPP_
|
#define ENGINE_HPP_
|
||||||
|
|
||||||
#include "delegates.hpp"
|
#include "delegates.hpp"
|
||||||
#include "settings.hpp"
|
|
||||||
#include "typedefs.hpp"
|
#include "typedefs.hpp"
|
||||||
|
|
||||||
#include "assets/Assets.hpp"
|
#include "assets/Assets.hpp"
|
||||||
|
|
@ -27,6 +26,7 @@ class ResPaths;
|
||||||
class Batch2D;
|
class Batch2D;
|
||||||
class EngineController;
|
class EngineController;
|
||||||
class SettingsHandler;
|
class SettingsHandler;
|
||||||
|
struct EngineSettings;
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include "../objects/Player.hpp"
|
#include "../objects/Player.hpp"
|
||||||
#include "../physics/Hitbox.hpp"
|
#include "../physics/Hitbox.hpp"
|
||||||
#include "../typedefs.hpp"
|
#include "../typedefs.hpp"
|
||||||
|
#include "../settings.hpp"
|
||||||
#include "../util/data_io.hpp"
|
#include "../util/data_io.hpp"
|
||||||
#include "../voxels/Block.hpp"
|
#include "../voxels/Block.hpp"
|
||||||
#include "../voxels/Chunk.hpp"
|
#include "../voxels/Chunk.hpp"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
#include "files.hpp"
|
#include "files.hpp"
|
||||||
#include "../typedefs.hpp"
|
#include "../typedefs.hpp"
|
||||||
#include "../settings.hpp"
|
|
||||||
#include "../content/ContentPack.hpp"
|
#include "../content/ContentPack.hpp"
|
||||||
#include "../voxels/Chunk.hpp"
|
#include "../voxels/Chunk.hpp"
|
||||||
|
|
||||||
|
|
@ -24,6 +23,7 @@ class Player;
|
||||||
class Content;
|
class Content;
|
||||||
class ContentIndices;
|
class ContentIndices;
|
||||||
class World;
|
class World;
|
||||||
|
struct DebugSettings;
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include "../audio/audio.hpp"
|
#include "../audio/audio.hpp"
|
||||||
#include "../delegates.hpp"
|
#include "../delegates.hpp"
|
||||||
#include "../engine.hpp"
|
#include "../engine.hpp"
|
||||||
|
#include "../settings.hpp"
|
||||||
#include "../graphics/core/Mesh.hpp"
|
#include "../graphics/core/Mesh.hpp"
|
||||||
#include "../graphics/ui/elements/CheckBox.hpp"
|
#include "../graphics/ui/elements/CheckBox.hpp"
|
||||||
#include "../graphics/ui/elements/TextBox.hpp"
|
#include "../graphics/ui/elements/TextBox.hpp"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
#include "LevelController.hpp"
|
#include "LevelController.hpp"
|
||||||
|
|
||||||
|
#include "../settings.hpp"
|
||||||
#include "../files/WorldFiles.hpp"
|
#include "../files/WorldFiles.hpp"
|
||||||
#include "../debug/Logger.hpp"
|
#include "../debug/Logger.hpp"
|
||||||
#include "../world/Level.hpp"
|
#include "../world/Level.hpp"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
#define LOGIC_LEVEL_CONTROLLER_HPP_
|
#define LOGIC_LEVEL_CONTROLLER_HPP_
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "../settings.hpp"
|
|
||||||
|
|
||||||
#include "PlayerController.hpp"
|
#include "PlayerController.hpp"
|
||||||
#include "BlocksController.hpp"
|
#include "BlocksController.hpp"
|
||||||
|
|
@ -10,6 +9,7 @@
|
||||||
|
|
||||||
class Level;
|
class Level;
|
||||||
class Player;
|
class Player;
|
||||||
|
struct EngineSettings;
|
||||||
|
|
||||||
/// @brief LevelController manages other controllers
|
/// @brief LevelController manages other controllers
|
||||||
class LevelController {
|
class LevelController {
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
#include "../items/ItemStack.hpp"
|
#include "../items/ItemStack.hpp"
|
||||||
#include "../items/Inventory.hpp"
|
#include "../items/Inventory.hpp"
|
||||||
#include "../core_defs.hpp"
|
#include "../core_defs.hpp"
|
||||||
|
#include "../settings.hpp"
|
||||||
|
|
||||||
const float CAM_SHAKE_OFFSET = 0.025f;
|
const float CAM_SHAKE_OFFSET = 0.025f;
|
||||||
const float CAM_SHAKE_OFFSET_Y = 0.031f;
|
const float CAM_SHAKE_OFFSET_Y = 0.031f;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef PLAYER_CONTROL_HPP_
|
#ifndef PLAYER_CONTROL_HPP_
|
||||||
#define PLAYER_CONTROL_HPP_
|
#define PLAYER_CONTROL_HPP_
|
||||||
|
|
||||||
#include "../settings.hpp"
|
|
||||||
#include "../objects/Player.hpp"
|
#include "../objects/Player.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
@ -12,7 +11,9 @@
|
||||||
class Camera;
|
class Camera;
|
||||||
class Level;
|
class Level;
|
||||||
class Block;
|
class Block;
|
||||||
|
class Chunks;
|
||||||
class BlocksController;
|
class BlocksController;
|
||||||
|
struct CameraSettings;
|
||||||
|
|
||||||
class CameraControl {
|
class CameraControl {
|
||||||
std::shared_ptr<Player> player;
|
std::shared_ptr<Player> player;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#ifndef SRC_OBJECTS_PLAYER_HPP_
|
#ifndef SRC_OBJECTS_PLAYER_HPP_
|
||||||
#define SRC_OBJECTS_PLAYER_HPP_
|
#define SRC_OBJECTS_PLAYER_HPP_
|
||||||
|
|
||||||
|
#include "../settings.hpp"
|
||||||
#include "../data/dynamic.hpp"
|
#include "../data/dynamic.hpp"
|
||||||
#include "../voxels/voxel.hpp"
|
#include "../voxels/voxel.hpp"
|
||||||
#include "../settings.hpp"
|
|
||||||
#include "../interfaces/Serializable.hpp"
|
#include "../interfaces/Serializable.hpp"
|
||||||
#include "../interfaces/Object.hpp"
|
#include "../interfaces/Object.hpp"
|
||||||
|
|
||||||
|
|
@ -14,23 +14,22 @@ class Camera;
|
||||||
class Hitbox;
|
class Hitbox;
|
||||||
class Inventory;
|
class Inventory;
|
||||||
class ContentLUT;
|
class ContentLUT;
|
||||||
class PhysicsSolver;
|
|
||||||
class Chunks;
|
|
||||||
class Level;
|
class Level;
|
||||||
|
struct EngineSettings;
|
||||||
|
|
||||||
struct PlayerInput {
|
struct PlayerInput {
|
||||||
bool zoom;
|
bool zoom : 1;
|
||||||
bool cameraMode;
|
bool cameraMode : 1;
|
||||||
bool moveForward;
|
bool moveForward : 1;
|
||||||
bool moveBack;
|
bool moveBack : 1;
|
||||||
bool moveRight;
|
bool moveRight : 1;
|
||||||
bool moveLeft;
|
bool moveLeft : 1;
|
||||||
bool sprint;
|
bool sprint : 1;
|
||||||
bool shift;
|
bool shift : 1;
|
||||||
bool cheat;
|
bool cheat : 1;
|
||||||
bool jump;
|
bool jump : 1;
|
||||||
bool noclip;
|
bool noclip : 1;
|
||||||
bool flight;
|
bool flight : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Player : public Object, public Serializable {
|
class Player : public Object, public Serializable {
|
||||||
|
|
@ -46,8 +45,7 @@ public:
|
||||||
bool noclip = false;
|
bool noclip = false;
|
||||||
bool debug = false;
|
bool debug = false;
|
||||||
voxel selectedVoxel {0, 0};
|
voxel selectedVoxel {0, 0};
|
||||||
|
glm::vec2 cam {};
|
||||||
glm::vec2 cam = {};
|
|
||||||
|
|
||||||
Player(glm::vec3 position, float speed, std::shared_ptr<Inventory> inv);
|
Player(glm::vec3 position, float speed, std::shared_ptr<Inventory> inv);
|
||||||
~Player();
|
~Player();
|
||||||
|
|
@ -77,4 +75,4 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SRC_OBJECTS_PLAYER_HPP_ */
|
#endif // SRC_OBJECTS_PLAYER_HPP_
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
#include "engine.hpp"
|
#include "engine.hpp"
|
||||||
|
#include "settings.hpp"
|
||||||
#include "files/settings_io.hpp"
|
#include "files/settings_io.hpp"
|
||||||
#include "files/engine_paths.hpp"
|
#include "files/engine_paths.hpp"
|
||||||
#include "util/platform.hpp"
|
#include "util/platform.hpp"
|
||||||
#include "util/command_line.hpp"
|
#include "util/command_line.hpp"
|
||||||
#include "debug/Logger.hpp"
|
#include "debug/Logger.hpp"
|
||||||
|
#include "objects/Player.hpp"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
|
@ -11,6 +13,7 @@ static debug::Logger logger("main");
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
debug::Logger::init("latest.log");
|
debug::Logger::init("latest.log");
|
||||||
|
std::cout << sizeof(PlayerInput) << std::endl;
|
||||||
|
|
||||||
EnginePaths paths;
|
EnginePaths paths;
|
||||||
if (!parse_cmdline(argc, argv, paths))
|
if (!parse_cmdline(argc, argv, paths))
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include "Level.hpp"
|
#include "Level.hpp"
|
||||||
#include "World.hpp"
|
#include "World.hpp"
|
||||||
#include "LevelEvents.hpp"
|
#include "LevelEvents.hpp"
|
||||||
|
#include "../settings.hpp"
|
||||||
#include "../content/Content.hpp"
|
#include "../content/Content.hpp"
|
||||||
#include "../lighting/Lighting.hpp"
|
#include "../lighting/Lighting.hpp"
|
||||||
#include "../voxels/Chunk.hpp"
|
#include "../voxels/Chunk.hpp"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef WORLD_LEVEL_HPP_
|
#ifndef WORLD_LEVEL_HPP_
|
||||||
#define WORLD_LEVEL_HPP_
|
#define WORLD_LEVEL_HPP_
|
||||||
|
|
||||||
#include "../settings.hpp"
|
|
||||||
#include "../interfaces/Object.hpp"
|
#include "../interfaces/Object.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
@ -21,6 +20,7 @@ class LevelEvents;
|
||||||
class Lighting;
|
class Lighting;
|
||||||
class PhysicsSolver;
|
class PhysicsSolver;
|
||||||
class ChunksStorage;
|
class ChunksStorage;
|
||||||
|
struct EngineSettings;
|
||||||
|
|
||||||
/// @brief A level, contains chunks and objects
|
/// @brief A level, contains chunks and objects
|
||||||
class Level {
|
class Level {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "Level.hpp"
|
#include "Level.hpp"
|
||||||
|
|
||||||
|
#include "../settings.hpp"
|
||||||
#include "../content/Content.hpp"
|
#include "../content/Content.hpp"
|
||||||
#include "../content/ContentLUT.hpp"
|
#include "../content/ContentLUT.hpp"
|
||||||
#include "../debug/Logger.hpp"
|
#include "../debug/Logger.hpp"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
#define WORLD_WORLD_HPP_
|
#define WORLD_WORLD_HPP_
|
||||||
|
|
||||||
#include "../typedefs.hpp"
|
#include "../typedefs.hpp"
|
||||||
#include "../settings.hpp"
|
|
||||||
#include "../util/timeutil.hpp"
|
#include "../util/timeutil.hpp"
|
||||||
#include "../data/dynamic.hpp"
|
#include "../data/dynamic.hpp"
|
||||||
#include "../interfaces/Serializable.hpp"
|
#include "../interfaces/Serializable.hpp"
|
||||||
|
|
@ -17,6 +16,7 @@ class Content;
|
||||||
class WorldFiles;
|
class WorldFiles;
|
||||||
class Level;
|
class Level;
|
||||||
class ContentLUT;
|
class ContentLUT;
|
||||||
|
struct EngineSettings;
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue