mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-30 16:40:28 +01:00
pch migration to modules [wip]
This commit is contained in:
@@ -1,3 +1,23 @@
|
||||
module;
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
#include "utilities/Globals_macros.h"
|
||||
|
||||
module eu07.simcore;
|
||||
import eu07.model.mdlmngr;
|
||||
import eu07.rendering.renderer;
|
||||
import eu07.simulation.simulation;
|
||||
import eu07.simulation.simulationtime;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.utilities.timer;
|
||||
import eu07.utilities.logs;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
@@ -12,18 +32,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "model/AnimModel.h"
|
||||
|
||||
#include "rendering/renderer.h"
|
||||
#include "model/MdlMngr.h"
|
||||
#include "simulation/simulation.h"
|
||||
#include "simulation/simulationtime.h"
|
||||
#include "world/Event.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "utilities/Timer.h"
|
||||
#include "utilities/Logs.h"
|
||||
#include "rendering/renderer.h"
|
||||
|
||||
std::list<std::weak_ptr<TAnimContainer>> TAnimModel::acAnimList;
|
||||
|
||||
|
||||
@@ -11,14 +11,24 @@ http://mozilla.org/MPL/2.0/.
|
||||
Copyright (C) 2001-2004 Marcin Wozniak and others
|
||||
|
||||
*/
|
||||
module;
|
||||
#include <optional>
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include "vehicle/DynObj_macros.h"
|
||||
|
||||
export module eu07.simcore:animmodel;
|
||||
import :fwd;
|
||||
import eu07.utilities.classes;
|
||||
import eu07.utilities.float3d;
|
||||
import :model3d;
|
||||
import :dynobj;
|
||||
import :scenenode;
|
||||
|
||||
export {
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utilities/Classes.h"
|
||||
#include "utilities/Float3d.h"
|
||||
#include "model/Model3d.h"
|
||||
#include "vehicle/DynObj.h"
|
||||
#include "scene/scenenode.h"
|
||||
|
||||
const int iMaxNumLights = 8;
|
||||
float const DefaultDarkThresholdLevel { 0.325f };
|
||||
@@ -44,7 +54,6 @@ class TAnimVocaloidFrame
|
||||
char cBezier[64]; // krzywe Béziera do interpolacji dla x,y,z i obrotu
|
||||
};
|
||||
|
||||
class basic_event;
|
||||
|
||||
class TAnimContainer : std::enable_shared_from_this<TAnimContainer>
|
||||
{ // opakowanie submodelu, określające animację egzemplarza - obsługiwane jako lista
|
||||
@@ -106,9 +115,6 @@ class TAnimContainer : std::enable_shared_from_this<TAnimContainer>
|
||||
|
||||
// opakowanie modelu, określające stan egzemplarza
|
||||
class TAnimModel : public scene::basic_node {
|
||||
|
||||
friend opengl_renderer;
|
||||
friend opengl33_renderer;
|
||||
friend itemproperties_panel;
|
||||
|
||||
public:
|
||||
@@ -235,3 +241,5 @@ class instance_table : public basic_table<TAnimModel> {
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
@@ -1,3 +1,17 @@
|
||||
module;
|
||||
#include <typeinfo>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
#include "utilities/Globals_macros.h"
|
||||
#include "utilities/utilities_macros.h"
|
||||
|
||||
module eu07.model.mdlmngr;
|
||||
import eu07.simcore;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.utilities.logs;
|
||||
import eu07.utilities.utilities;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
@@ -13,13 +27,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "model/MdlMngr.h"
|
||||
|
||||
#include "model/Model3d.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "utilities/Logs.h"
|
||||
#include "utilities/utilities.h"
|
||||
|
||||
// wczytanie modelu do kontenerka
|
||||
TModel3d *
|
||||
|
||||
@@ -6,9 +6,19 @@ distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
#pragma once
|
||||
module;
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
export module eu07.model.mdlmngr;
|
||||
import eu07.simcore;
|
||||
import eu07.utilities.classes;
|
||||
|
||||
export {
|
||||
|
||||
#include "utilities/Classes.h"
|
||||
|
||||
class TMdlContainer {
|
||||
friend class TModelsManager;
|
||||
@@ -40,3 +50,5 @@ private:
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
@@ -1,3 +1,32 @@
|
||||
module;
|
||||
#include "utilities/utilities_macros.h"
|
||||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
#include "glad/glad.h"
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
#include "utilities/Globals_macros.h"
|
||||
#include "rendering/openglmatrixstack_macros.h"
|
||||
|
||||
module eu07.simcore;
|
||||
import eu07.glm;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.utilities.logs;
|
||||
import eu07.rendering.renderer;
|
||||
import eu07.utilities.timer;
|
||||
import eu07.simulation.simulation;
|
||||
import eu07.simulation.simulationtime;
|
||||
import eu07.world.mtable;
|
||||
import eu07.scene.sn_utils;
|
||||
import eu07.rendering.openglmatrixstack;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
@@ -12,17 +41,7 @@ Copyright (C) 2001-2004 Marcin Wozniak, Maciej Czapkiewicz and others
|
||||
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "model/Model3d.h"
|
||||
|
||||
#include "utilities/Globals.h"
|
||||
#include "utilities/Logs.h"
|
||||
#include "rendering/renderer.h"
|
||||
#include "utilities/Timer.h"
|
||||
#include "simulation/simulation.h"
|
||||
#include "simulation/simulationtime.h"
|
||||
#include "world/mtable.h"
|
||||
#include "scene/sn_utils.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
@@ -1081,7 +1100,7 @@ void TSubModel::SetRotateIK1(float3 vNewAngles)
|
||||
iAnimOwner = iInstance; // zapamiętanie czyja jest animacja
|
||||
}
|
||||
|
||||
struct ToLower
|
||||
struct to_lower_char
|
||||
{
|
||||
char operator()(char input)
|
||||
{
|
||||
@@ -1092,7 +1111,7 @@ struct ToLower
|
||||
TSubModel *TSubModel::GetFromName(std::string const &search, bool i)
|
||||
{
|
||||
TSubModel *result;
|
||||
// std::transform(search.begin(),search.end(),search.begin(),ToLower());
|
||||
// std::transform(search.begin(),search.end(),search.begin(),to_lower_char());
|
||||
// search=search.LowerCase();
|
||||
// AnsiString name=AnsiString();
|
||||
std::string search_lc = search;
|
||||
|
||||
@@ -6,14 +6,26 @@ distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
module;
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
export module eu07.simcore:model3d;
|
||||
import eu07.glm;
|
||||
import :fwd;
|
||||
import :editoruilayer;
|
||||
import eu07.utilities.parser;
|
||||
import eu07.utilities.classes;
|
||||
import eu07.utilities.float3d;
|
||||
import eu07.rendering.geometrybank;
|
||||
import eu07.gl.query;
|
||||
|
||||
export {
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utilities/Classes.h"
|
||||
#include "utilities/Float3d.h"
|
||||
#include "rendering/geometrybank.h"
|
||||
#include "model/material.h"
|
||||
#include "gl/query.h"
|
||||
|
||||
#define EU07_USE_GEOMETRYINDEXING
|
||||
|
||||
@@ -46,7 +58,6 @@ enum class TAnimType // rodzaj animacji
|
||||
};
|
||||
|
||||
namespace scene {
|
||||
class shape_node;
|
||||
}
|
||||
|
||||
class TModel3d;
|
||||
@@ -55,10 +66,9 @@ using nameoffset_sequence = std::vector<std::pair<std::string, glm::vec3>>;
|
||||
class TSubModel
|
||||
{ // klasa submodelu - pojedyncza siatka, punkt świetlny albo grupa punktów
|
||||
//m7todo: zrobić normalną serializację
|
||||
|
||||
friend opengl_renderer;
|
||||
friend opengl33_renderer;
|
||||
friend TModel3d; // temporary workaround. TODO: clean up class content/hierarchy
|
||||
// the :fwd declaration is enough for a friend; importing :dynobj here would
|
||||
// close a partition cycle model3d -> dynobj -> traction -> scenenode -> model3d
|
||||
friend TDynamicObject; // temporary etc
|
||||
friend scene::shape_node; // temporary etc
|
||||
|
||||
@@ -255,9 +265,6 @@ public:
|
||||
|
||||
class TModel3d
|
||||
{
|
||||
friend opengl_renderer;
|
||||
friend opengl33_renderer;
|
||||
|
||||
public:
|
||||
TSubModel *Root { nullptr }; // drzewo submodeli
|
||||
uint32_t iFlags { 0 }; // Ra: czy submodele mają przezroczyste tekstury
|
||||
@@ -300,3 +307,5 @@ public:
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
@@ -1,3 +1,6 @@
|
||||
module;
|
||||
|
||||
module eu07.model.resourcemanager;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
@@ -7,11 +10,8 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
/*
|
||||
#include "model/ResourceManager.h"
|
||||
#include "utilities/Logs.h"
|
||||
|
||||
ResourceManager::Resources ResourceManager::_resources;
|
||||
double ResourceManager::_expiry = 5.0f;
|
||||
|
||||
@@ -6,8 +6,16 @@ distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
module;
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
export module eu07.model.resourcemanager;
|
||||
|
||||
export {
|
||||
|
||||
#pragma once
|
||||
|
||||
enum class resource_state {
|
||||
none,
|
||||
@@ -77,3 +85,5 @@ private:
|
||||
typename Container_::size_type m_resourcesweepindex { 0 };
|
||||
std::chrono::steady_clock::time_point m_resourcetimestamp { std::chrono::steady_clock::now() };
|
||||
};
|
||||
|
||||
} // export
|
||||
@@ -1,3 +1,36 @@
|
||||
module;
|
||||
#include "glad/glad.h"
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include <ios>
|
||||
#include <istream>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
#include "utilities/Globals_macros.h"
|
||||
#include "utilities/utilities_macros.h"
|
||||
#include "stb/stb_image.h"
|
||||
#include "dds-ktx/dds-ktx.h"
|
||||
#include "winheaders.h"
|
||||
|
||||
module eu07.model.texture;
|
||||
import eu07.application.application;
|
||||
import eu07.glm;
|
||||
import eu07.simcore;
|
||||
import eu07.scripting.pyint;
|
||||
import eu07.utilities.dictionary;
|
||||
import eu07.utilities.globals;
|
||||
import eu07.utilities.logs;
|
||||
import eu07.utilities.utilities;
|
||||
import eu07.scene.sn_utils;
|
||||
import eu07.rendering.flip_s3tc;
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
@@ -13,20 +46,8 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "model/Texture.h"
|
||||
|
||||
#include "application/application.h"
|
||||
#include "utilities/dictionary.h"
|
||||
#include "utilities/Globals.h"
|
||||
#include "utilities/Logs.h"
|
||||
#include "utilities/utilities.h"
|
||||
#include "scene/sn_utils.h"
|
||||
#include "rendering/flip-s3tc.h"
|
||||
#include "stb/stb_image.h"
|
||||
//#include <png.h>
|
||||
#include "dds-ktx/dds-ktx.h"
|
||||
#include "winheaders.h"
|
||||
|
||||
#define EU07_DEFERRED_TEXTURE_UPLOAD
|
||||
|
||||
|
||||
@@ -6,15 +6,23 @@ distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
module;
|
||||
#include "glad/glad.h"
|
||||
#include <istream>
|
||||
#include "winheaders.h"
|
||||
#include <string>
|
||||
#include "model/ResourceManager.h"
|
||||
#include "gl/ubo.h"
|
||||
#include "interfaces/ITexture.h"
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
export module eu07.model.texture;
|
||||
import eu07.model.resourcemanager;
|
||||
import eu07.gl.ubo;
|
||||
import eu07.global_include.interfaces.itexture;
|
||||
|
||||
export {
|
||||
|
||||
|
||||
|
||||
struct opengl_texture : public ITexture {
|
||||
static DDSURFACEDESC2 deserialize_ddsd(std::istream&);
|
||||
@@ -252,3 +260,5 @@ downsample( std::size_t const Width, std::size_t const Height, unsigned char *Im
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
@@ -1,4 +1,29 @@
|
||||
/*
|
||||
module;
|
||||
#include <vector>
|
||||
#include "glad/glad.h"
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
#include "utilities/utilities_macros.h"
|
||||
#include "utilities/Globals_macros.h"
|
||||
|
||||
module eu07.model.material;
|
||||
import eu07.rendering.geometrybank;
|
||||
import eu07.widgets.map_objects;
|
||||
import eu07.rendering.renderer;
|
||||
import eu07.utilities.parser;
|
||||
import eu07.utilities.utilities;
|
||||
import eu07.utilities.logs;
|
||||
import eu07.scene.sn_utils;
|
||||
import eu07.utilities.globals;
|
||||
/*
|
||||
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,15 +32,7 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "model/material.h"
|
||||
#include "rendering/renderer.h"
|
||||
#include "utilities/parser.h"
|
||||
#include "utilities/utilities.h"
|
||||
#include "utilities/Logs.h"
|
||||
#include "scene/sn_utils.h"
|
||||
#include "utilities/Globals.h"
|
||||
|
||||
opengl_material::path_data opengl_material::paths;
|
||||
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
/*
|
||||
module;
|
||||
#include "global_include/interfaces/ITexture_macros.h"
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
export module eu07.model.material;
|
||||
import eu07.gl.shader;
|
||||
import eu07.glm;
|
||||
import eu07.utilities.parser;
|
||||
import eu07.audio.audio;
|
||||
import eu07.global_include.interfaces.imaterial;
|
||||
import eu07.utilities.classes;
|
||||
import eu07.model.texture;
|
||||
import eu07.gl.ubo;
|
||||
|
||||
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,13 +25,7 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "interfaces/IMaterial.h"
|
||||
#include "utilities/Classes.h"
|
||||
#include "model/Texture.h"
|
||||
#include "gl/shader.h"
|
||||
#include "gl/ubo.h"
|
||||
|
||||
// a collection of parameters for the rendering setup.
|
||||
// for modern opengl this translates to set of attributes for shaders
|
||||
@@ -140,3 +152,5 @@ private:
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
@@ -1,4 +1,10 @@
|
||||
/*
|
||||
module;
|
||||
#include <istream>
|
||||
#include <ostream>
|
||||
|
||||
module eu07.model.vertex;
|
||||
import eu07.scene.sn_utils;
|
||||
/*
|
||||
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 +13,6 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "model/vertex.h"
|
||||
#include "scene/sn_utils.h"
|
||||
|
||||
void
|
||||
world_vertex::serialize( std::ostream &s ) const {
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
/*
|
||||
module;
|
||||
#include <istream>
|
||||
#include <ostream>
|
||||
|
||||
export module eu07.model.vertex;
|
||||
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,7 +15,6 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// geometry vertex with double precision position
|
||||
struct world_vertex {
|
||||
@@ -80,6 +87,9 @@ struct world_vertex {
|
||||
( Z - Vertex1.position.z ) / ( Vertex2.position.z - Vertex1.position.z ) ); }
|
||||
};
|
||||
|
||||
} // export -- out-of-line member definitions and explicit
|
||||
// specialisations are not namespace-scope declarations, so they cannot
|
||||
// carry `export`; the class itself is exported and that is what counts.
|
||||
template <>
|
||||
world_vertex &
|
||||
world_vertex::operator+=( world_vertex const &Right );
|
||||
@@ -87,5 +97,8 @@ world_vertex::operator+=( world_vertex const &Right );
|
||||
template <>
|
||||
world_vertex &
|
||||
world_vertex::operator*=( world_vertex const &Right );
|
||||
export {
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
} // export
|
||||
Reference in New Issue
Block a user