mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-31 19:19:03 +01:00
pch migration to modules [wip]
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
#include "stdafx.h"
|
||||
#include "environment/moon.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "world/mtable.h"
|
||||
#include "utilities/utilities.h"
|
||||
#include "simulation/simulationtime.h"
|
||||
module;
|
||||
#include <ctime>
|
||||
#include "winheaders.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include "utilities/Globals_macros.h"
|
||||
#include "utilities/utilities_macros.h"
|
||||
|
||||
module eu07.environment.moon;
|
||||
import eu07.glm;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.world.mtable;
|
||||
import eu07.utilities.utilities;
|
||||
import eu07.simulation.simulationtime;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// cSun -- class responsible for dynamic calculation of position and intensity of the Sun,
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "winheaders.h"
|
||||
|
||||
// TODO: sun and moon share code as celestial bodies, we could make a base class out of it
|
||||
module;
|
||||
#include "winheaders.h"
|
||||
|
||||
export module eu07.environment.moon;
|
||||
import eu07.glm;
|
||||
|
||||
export {
|
||||
|
||||
class cMoon {
|
||||
|
||||
@@ -97,3 +102,5 @@ protected:
|
||||
glm::vec3 m_position;
|
||||
float m_phase;
|
||||
};
|
||||
|
||||
} // export
|
||||
@@ -1,3 +1,10 @@
|
||||
module;
|
||||
#include <string>
|
||||
#include "utilities/Globals_macros.h"
|
||||
|
||||
module eu07.environment.sky;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.model.mdlmngr;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
@@ -7,10 +14,6 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "environment/sky.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "model/MdlMngr.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//GLfloat lightPos[4] = {0.0f, 0.0f, 0.0f, 1.0f};
|
||||
|
||||
@@ -7,23 +7,29 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
//---------------------------------------------------------------------------
|
||||
module;
|
||||
|
||||
export module eu07.environment.sky;
|
||||
import eu07.simcore;
|
||||
import eu07.utilities.classes;
|
||||
|
||||
export {
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utilities/Classes.h"
|
||||
|
||||
class TSky {
|
||||
|
||||
friend opengl_renderer;
|
||||
friend opengl33_renderer;
|
||||
|
||||
public:
|
||||
TSky() = default;
|
||||
|
||||
void Init();
|
||||
|
||||
private:
|
||||
public:
|
||||
// read directly by the renderers. They used to be friends, but a friend
|
||||
// declaration naming a class from another module would require importing it,
|
||||
// and that import closes a cycle the module graph does not allow.
|
||||
TModel3d *mdCloud { nullptr };
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
@@ -1,9 +1,15 @@
|
||||
module;
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include "utilities/Globals_macros.h"
|
||||
|
||||
module eu07.environment.skydome;
|
||||
import eu07.utilities.color;
|
||||
import eu07.simulation.simulationenvironment;
|
||||
import eu07.utilities.globals;
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "environment/skydome.h"
|
||||
#include "utilities/color.h"
|
||||
#include "simulation/simulationenvironment.h"
|
||||
#include "utilities/Globals.h"
|
||||
|
||||
// sky gradient based on "A practical analytic model for daylight"
|
||||
// by A. J. Preetham Peter Shirley Brian Smits (University of Utah)
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
// sky gradient based on "A practical analytic model for daylight"
|
||||
// by A. J. Preetham Peter Shirley Brian Smits (University of Utah)
|
||||
module;
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
export module eu07.environment.skydome;
|
||||
import eu07.glm;
|
||||
|
||||
export {
|
||||
|
||||
class CSkyDome {
|
||||
public:
|
||||
@@ -65,3 +72,5 @@ private:
|
||||
float PerezFunctionO2( float Perezcoeffs[ 5 ], const float Icostheta, const float Gamma, const float Cosgamma2, const float Zenithval );
|
||||
};
|
||||
|
||||
|
||||
} // export
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "stdafx.h"
|
||||
#include "environment/stars.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "model/MdlMngr.h"
|
||||
module;
|
||||
#include "utilities/Globals_macros.h"
|
||||
|
||||
module eu07.environment.stars;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.model.mdlmngr;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// cStars -- simple starfield model, simulating appearance of starry sky
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "utilities/Classes.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// cStars -- simple starfield model, simulating appearance of starry sky
|
||||
module;
|
||||
|
||||
export module eu07.environment.stars;
|
||||
import eu07.simcore;
|
||||
import eu07.utilities.classes;
|
||||
|
||||
export {
|
||||
|
||||
class cStars {
|
||||
|
||||
friend opengl_renderer;
|
||||
friend opengl33_renderer;
|
||||
|
||||
public:
|
||||
// types:
|
||||
|
||||
@@ -22,13 +23,14 @@ public:
|
||||
|
||||
// members:
|
||||
|
||||
private:
|
||||
// types:
|
||||
|
||||
// methods:
|
||||
|
||||
public:
|
||||
// read directly by the renderers. They used to be friends, but a friend
|
||||
// declaration naming a class from another module would require importing it,
|
||||
// and that import closes a cycle the module graph does not allow.
|
||||
// members:
|
||||
float m_longitude{ 19.0f }; // geograpic coordinates hardcoded roughly to Poland location, for the time being
|
||||
float m_latitude{ 52.0f };
|
||||
TModel3d *m_stars { nullptr };
|
||||
};
|
||||
|
||||
} // export
|
||||
@@ -1,9 +1,17 @@
|
||||
#include "stdafx.h"
|
||||
#include "environment/sun.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "world/mtable.h"
|
||||
#include "utilities/utilities.h"
|
||||
#include "simulation/simulationtime.h"
|
||||
module;
|
||||
#include <ctime>
|
||||
#include "winheaders.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include "utilities/Globals_macros.h"
|
||||
#include "utilities/utilities_macros.h"
|
||||
|
||||
module eu07.environment.sun;
|
||||
import eu07.glm;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.world.mtable;
|
||||
import eu07.utilities.utilities;
|
||||
import eu07.simulation.simulationtime;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// cSun -- class responsible for dynamic calculation of position and intensity of the Sun,
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "winheaders.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// cSun -- class responsible for dynamic calculation of position and intensity of the Sun,
|
||||
// given current weather, time and geographic location.
|
||||
module;
|
||||
#include "winheaders.h"
|
||||
|
||||
export module eu07.environment.sun;
|
||||
import eu07.glm;
|
||||
|
||||
export {
|
||||
|
||||
class cSun {
|
||||
|
||||
@@ -99,3 +104,5 @@ protected:
|
||||
observer m_observer;
|
||||
glm::vec3 m_position;
|
||||
};
|
||||
|
||||
} // export
|
||||
Reference in New Issue
Block a user