mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-28 22:47:28 +01:00
pch migration to modules [wip]
This commit is contained in:
@@ -1,4 +1,26 @@
|
||||
/*
|
||||
module;
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "utilities/Globals_macros.h"
|
||||
#include "vehicle/DynObj_macros.h"
|
||||
|
||||
module eu07.simulation.simulation;
|
||||
import eu07.utilities.logs;
|
||||
import eu07.application.application;
|
||||
import eu07.input.command;
|
||||
import eu07.utilities.utilities;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.simulation.simulationtime;
|
||||
import eu07.simulation.simulationenvironment;
|
||||
import eu07.simcore;
|
||||
import eu07.rendering.lightarray;
|
||||
import eu07.vehicle.train;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
@@ -7,27 +29,7 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "simulation/simulation.h"
|
||||
#include "simulation/simulationtime.h"
|
||||
#include "simulation/simulationenvironment.h"
|
||||
|
||||
#include "utilities/Globals.h"
|
||||
#include "world/Event.h"
|
||||
#include "world/MemCell.h"
|
||||
#include "world/Track.h"
|
||||
#include "world/Traction.h"
|
||||
#include "world/TractionPower.h"
|
||||
#include "audio/sound.h"
|
||||
#include "model/AnimModel.h"
|
||||
#include "vehicle/DynObj.h"
|
||||
#include "rendering/lightarray.h"
|
||||
#include "rendering/particles.h"
|
||||
#include "scene/scene.h"
|
||||
#include "vehicle/Train.h"
|
||||
#include "application/application.h"
|
||||
#include "utilities/Logs.h"
|
||||
#include "vehicle/Driver.h"
|
||||
|
||||
namespace simulation {
|
||||
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
/*
|
||||
module;
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
export module eu07.simulation.simulation;
|
||||
import eu07.utilities.classes;
|
||||
import eu07.glm;
|
||||
import eu07.audio.sound;
|
||||
import eu07.rendering.lightarray;
|
||||
import eu07.rendering.particles;
|
||||
import eu07.scripting.lua;
|
||||
import eu07.simulation.simulationstateserializer;
|
||||
import eu07.simcore;
|
||||
import eu07.vehicle.train;
|
||||
#ifdef WITH_LUA
|
||||
#endif
|
||||
|
||||
export {
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
@@ -7,16 +26,9 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "simulation/simulationstateserializer.h"
|
||||
#include "utilities/Classes.h"
|
||||
#include "world/Event.h"
|
||||
#include "vehicle/Train.h"
|
||||
#include "rendering/particles.h"
|
||||
|
||||
#ifdef WITH_LUA
|
||||
#include "scripting/lua.h"
|
||||
#endif
|
||||
|
||||
namespace simulation {
|
||||
@@ -80,7 +92,6 @@ extern instance_table Instances;
|
||||
extern vehicle_table Vehicles;
|
||||
extern train_table Trains;
|
||||
extern light_array Lights;
|
||||
extern sound_table Sounds;
|
||||
extern particle_manager Particles;
|
||||
#ifdef WITH_LUA
|
||||
extern lua Lua;
|
||||
@@ -92,8 +103,9 @@ extern TTrain *Train;
|
||||
extern uint16_t prev_train_id;
|
||||
extern bool is_ready;
|
||||
|
||||
struct deserializer_state;
|
||||
|
||||
} // simulation
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
@@ -1,4 +1,20 @@
|
||||
/*
|
||||
module;
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "utilities/Globals_macros.h"
|
||||
|
||||
module eu07.simulation.simulationenvironment;
|
||||
import eu07.simcore;
|
||||
import eu07.utilities.color;
|
||||
import eu07.utilities.utilities;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.simulation.simulationsounds;
|
||||
import eu07.utilities.timer;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
@@ -7,12 +23,7 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "simulation/simulationenvironment.h"
|
||||
|
||||
#include "simulation/simulationsounds.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "utilities/Timer.h"
|
||||
|
||||
namespace simulation {
|
||||
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
/*
|
||||
module;
|
||||
|
||||
export module eu07.simulation.simulationenvironment;
|
||||
import eu07.audio.sound;
|
||||
import eu07.environment.moon;
|
||||
import eu07.environment.sky;
|
||||
import eu07.environment.skydome;
|
||||
import eu07.environment.stars;
|
||||
import eu07.environment.sun;
|
||||
import eu07.rendering.precipitation;
|
||||
import eu07.glm;
|
||||
export {
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
@@ -7,25 +19,11 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "environment/sky.h"
|
||||
#include "environment/sun.h"
|
||||
#include "environment/moon.h"
|
||||
#include "environment/stars.h"
|
||||
#include "environment/skydome.h"
|
||||
#include "rendering/precipitation.h"
|
||||
#include "audio/sound.h"
|
||||
|
||||
class opengl_renderer;
|
||||
class opengl33_renderer;
|
||||
|
||||
// wrapper for environment elements -- sky, sun, stars, clouds etc
|
||||
class world_environment {
|
||||
|
||||
friend opengl_renderer;
|
||||
friend opengl33_renderer;
|
||||
|
||||
public:
|
||||
// methods
|
||||
void init();
|
||||
@@ -80,13 +78,18 @@ private:
|
||||
// methods
|
||||
void update_wind();
|
||||
// members
|
||||
public:
|
||||
// The renderers reach straight into these; they used to be friends, but a friend
|
||||
// declaration would make this module the first declarer of classes defined in the
|
||||
// renderer modules, which C++20 modules reject. Same treatment as in sky/stars.
|
||||
CSkyDome m_skydome;
|
||||
cStars m_stars;
|
||||
cSun m_sun;
|
||||
cMoon m_moon;
|
||||
float m_lightintensity { 1.f };
|
||||
TSky m_clouds;
|
||||
basic_precipitation m_precipitation;
|
||||
private:
|
||||
float m_lightintensity { 1.f };
|
||||
sound_source m_rainsound { sound_placement::external, -1 };
|
||||
basic_wind m_wind;
|
||||
};
|
||||
@@ -98,3 +101,5 @@ extern world_environment Environment;
|
||||
} // simulation
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
@@ -1,4 +1,7 @@
|
||||
/*
|
||||
module;
|
||||
|
||||
module eu07.simulation.simulationsounds;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
@@ -7,8 +10,6 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "simulation/simulationsounds.h"
|
||||
|
||||
namespace simulation {
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
/*
|
||||
module;
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
export module eu07.simulation.simulationsounds;
|
||||
import eu07.audio.sound;
|
||||
export {
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
@@ -7,9 +14,7 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "audio/sound.h"
|
||||
|
||||
namespace simulation {
|
||||
|
||||
@@ -21,3 +26,5 @@ extern sound_table Sounds;
|
||||
} // simulation
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
@@ -1,4 +1,37 @@
|
||||
/*
|
||||
module;
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
#include "utilities/Globals_macros.h"
|
||||
#include "vehicle/DynObj_macros.h"
|
||||
#include "utilities/crashreporter_macros.h"
|
||||
|
||||
module eu07.simulation.simulationstateserializer;
|
||||
import eu07.utilities.utilities;
|
||||
import eu07.utilities.classes;
|
||||
import eu07.glm;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.simulation.simulation;
|
||||
import eu07.simulation.simulationtime;
|
||||
import eu07.simulation.simulationsounds;
|
||||
import eu07.simulation.simulationenvironment;
|
||||
import eu07.scene.scenenodegroups;
|
||||
import eu07.rendering.particles;
|
||||
import eu07.simcore;
|
||||
import eu07.rendering.lightarray;
|
||||
import eu07.application.application;
|
||||
import eu07.rendering.renderer;
|
||||
import eu07.utilities.logs;
|
||||
import eu07.editor.editorterrainstreamer;
|
||||
import eu07.utilities.crashreporter;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
@@ -7,27 +40,7 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "simulation/simulationstateserializer.h"
|
||||
|
||||
#include "utilities/Globals.h"
|
||||
#include "simulation/simulation.h"
|
||||
#include "simulation/simulationtime.h"
|
||||
#include "simulation/simulationsounds.h"
|
||||
#include "simulation/simulationenvironment.h"
|
||||
#include "scene/scenenodegroups.h"
|
||||
#include "rendering/particles.h"
|
||||
#include "world/Event.h"
|
||||
#include "world/MemCell.h"
|
||||
#include "vehicle/Driver.h"
|
||||
#include "vehicle/DynObj.h"
|
||||
#include "model/AnimModel.h"
|
||||
#include "rendering/lightarray.h"
|
||||
#include "world/TractionPower.h"
|
||||
#include "application/application.h"
|
||||
#include "rendering/renderer.h"
|
||||
#include "utilities/Logs.h"
|
||||
#include "editor/editorTerrainStreamer.hpp"
|
||||
|
||||
namespace simulation {
|
||||
|
||||
|
||||
@@ -6,11 +6,20 @@ distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
module;
|
||||
#include <functional>
|
||||
#include <unordered_map>
|
||||
#include <memory>
|
||||
|
||||
export module eu07.simulation.simulationstateserializer;
|
||||
import eu07.glm;
|
||||
import eu07.audio.sound;
|
||||
import eu07.utilities.parser;
|
||||
import eu07.simcore;
|
||||
|
||||
export {
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utilities/parser.h"
|
||||
#include "scene/scene.h"
|
||||
|
||||
namespace simulation {
|
||||
|
||||
@@ -94,3 +103,5 @@ private:
|
||||
} // simulation
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
@@ -1,4 +1,16 @@
|
||||
/*
|
||||
module;
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include "winheaders.h"
|
||||
#include <ctime>
|
||||
#include <cmath>
|
||||
#include "utilities/Globals_macros.h"
|
||||
#include "utilities/utilities_macros.h"
|
||||
|
||||
module eu07.simulation.simulationtime;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.utilities.utilities;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
@@ -7,11 +19,7 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "simulation/simulationtime.h"
|
||||
|
||||
#include "utilities/Globals.h"
|
||||
#include "utilities/utilities.h"
|
||||
|
||||
namespace simulation {
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
/*
|
||||
module;
|
||||
#include <string>
|
||||
#include "winheaders.h"
|
||||
|
||||
export module eu07.simulation.simulationtime;
|
||||
|
||||
export {
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
@@ -7,11 +14,8 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "winheaders.h"
|
||||
|
||||
// wrapper for scenario time
|
||||
class scenario_time {
|
||||
@@ -87,3 +91,5 @@ extern scenario_time Time;
|
||||
} // simulation
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
Reference in New Issue
Block a user