Skip to content

Commit

Permalink
#5231: Move PicoModel module and exporters to core binary. Fix the br…
Browse files Browse the repository at this point in the history
…oken scaled model exporter - was unhooked by accident in f3d0f8f
  • Loading branch information
codereader committed May 25, 2020
1 parent faebae2 commit 194f0a3
Show file tree
Hide file tree
Showing 56 changed files with 651 additions and 659 deletions.
32 changes: 0 additions & 32 deletions radiant/Makefile.am
Expand Up @@ -73,38 +73,6 @@ darkradiant_SOURCES = main.cpp \
map/aas/Doom3AasFileLoader.cpp \
map/aas/Doom3AasFileSettings.cpp \
map/aas/Doom3AasFile.cpp \
modelfile/AseExporter.cpp \
modelfile/Lwo2Chunk.cpp \
modelfile/Lwo2Exporter.cpp \
modelfile/PicoModelLoader.cpp \
modelfile/PicoModelModule.cpp \
modelfile/PicoModelNode.cpp \
modelfile/RenderablePicoModel.cpp \
modelfile/RenderablePicoSurface.cpp \
modelfile/WavefrontExporter.cpp \
modelfile/picomodel/pm_md3.c \
modelfile/picomodel/pm_md2.c \
modelfile/picomodel/pm_obj.c \
modelfile/picomodel/picointernal.c \
modelfile/picomodel/picomodules.c \
modelfile/picomodel/pm_lwo.c \
modelfile/picomodel/pm_mdc.c \
modelfile/picomodel/pm_fm.c \
modelfile/picomodel/pm_ase.c \
modelfile/picomodel/picomodel.c \
modelfile/picomodel/lwo/envelope.c \
modelfile/picomodel/lwo/surface.c \
modelfile/picomodel/lwo/clip.c \
modelfile/picomodel/lwo/lwob.c \
modelfile/picomodel/lwo/lwio.c \
modelfile/picomodel/lwo/lwo2.c \
modelfile/picomodel/lwo/list.c \
modelfile/picomodel/lwo/pntspols.c \
modelfile/picomodel/lwo/vmap.c \
modelfile/picomodel/lwo/vecmath.c \
modelfile/picomodel/pm_terrain.c \
modelfile/picomodel/pm_ms3d.c \
modelfile/picomodel/pm_3ds.c \
particles/editor/ParticleEditor.cpp \
render/OpenGLModule.cpp \
render/View.cpp \
Expand Down
7 changes: 7 additions & 0 deletions radiant/map/Map.cpp
Expand Up @@ -831,6 +831,9 @@ void Map::initialiseModule(const ApplicationContext& ctx)
// Add the Map-related commands to the EventManager
registerCommands();

_scaledModelExporter.initialise();
_modelScalePreserver.reset(new ModelScalePreserver);

MapFileManager::registerFileTypes();

// Register an info file module to save the map property bag
Expand All @@ -841,8 +844,12 @@ void Map::initialiseModule(const ApplicationContext& ctx)

void Map::shutdownModule()
{
_scaledModelExporter.shutdown();

GlobalSceneGraph().removeSceneObserver(this);

_modelScalePreserver.reset();

_startupMapLoader.reset();
_mapPositionManager.reset();
}
Expand Down
4 changes: 4 additions & 0 deletions radiant/map/Map.h
Expand Up @@ -10,6 +10,8 @@
#include "imodule.h"
#include "math/Vector3.h"

#include "model/ScaledModelExporter.h"
#include "model/ModelScalePreserver.h"
#include "StartupMapLoader.h"
#include "MapPositionManager.h"

Expand Down Expand Up @@ -45,7 +47,9 @@ class Map :

// A local helper object, observing the radiant module
std::unique_ptr<StartupMapLoader> _startupMapLoader;
ScaledModelExporter _scaledModelExporter;
std::unique_ptr<MapPositionManager> _mapPositionManager;
std::unique_ptr<ModelScalePreserver> _modelScalePreserver;

// Map save timer, for displaying "changes from last n minutes will be lost"
// messages
Expand Down
20 changes: 0 additions & 20 deletions radiant/modelfile/Makefile.am

This file was deleted.

48 changes: 40 additions & 8 deletions radiantcore/Makefile.am
Expand Up @@ -114,14 +114,46 @@ libradiantcore_la_SOURCES = Radiant.cpp \
map/namespace/ComplexName.cpp \
map/namespace/Namespace.cpp \
map/namespace/NamespaceFactory.cpp \
md5model/MD5Skeleton.cpp \
md5model/MD5Module.cpp \
md5model/MD5Model.cpp \
md5model/MD5ModelLoader.cpp \
md5model/MD5AnimationCache.cpp \
md5model/MD5Surface.cpp \
md5model/MD5Anim.cpp \
md5model/MD5ModelNode.cpp \
model/md5/MD5Skeleton.cpp \
model/md5/MD5Module.cpp \
model/md5/MD5Model.cpp \
model/md5/MD5ModelLoader.cpp \
model/md5/MD5AnimationCache.cpp \
model/md5/MD5Surface.cpp \
model/md5/MD5Anim.cpp \
model/md5/MD5ModelNode.cpp \
model/export/AseExporter.cpp \
model/export/Lwo2Chunk.cpp \
model/export/Lwo2Exporter.cpp \
model/export/WavefrontExporter.cpp \
model/picomodel/PicoModelLoader.cpp \
model/picomodel/PicoModelModule.cpp \
model/picomodel/PicoModelNode.cpp \
model/picomodel/RenderablePicoModel.cpp \
model/picomodel/RenderablePicoSurface.cpp \
model/picomodel/lib/pm_md3.c \
model/picomodel/lib/pm_md2.c \
model/picomodel/lib/pm_obj.c \
model/picomodel/lib/picointernal.c \
model/picomodel/lib/picomodules.c \
model/picomodel/lib/pm_lwo.c \
model/picomodel/lib/pm_mdc.c \
model/picomodel/lib/pm_fm.c \
model/picomodel/lib/pm_ase.c \
model/picomodel/lib/picomodel.c \
model/picomodel/lib/lwo/envelope.c \
model/picomodel/lib/lwo/surface.c \
model/picomodel/lib/lwo/clip.c \
model/picomodel/lib/lwo/lwob.c \
model/picomodel/lib/lwo/lwio.c \
model/picomodel/lib/lwo/lwo2.c \
model/picomodel/lib/lwo/list.c \
model/picomodel/lib/lwo/pntspols.c \
model/picomodel/lib/lwo/vmap.c \
model/picomodel/lib/lwo/vecmath.c \
model/picomodel/lib/pm_terrain.c \
model/picomodel/lib/pm_ms3d.c \
model/picomodel/lib/pm_3ds.c \
model/ModelCache.cpp \
model/ModelFormatManager.cpp \
model/NullModel.cpp \
Expand Down
9 changes: 9 additions & 0 deletions radiantcore/model/ModelFormatManager.cpp
Expand Up @@ -9,6 +9,10 @@

#include "module/StaticModule.h"

#include "export/AseExporter.h"
#include "export/Lwo2Exporter.h"
#include "export/WavefrontExporter.h"

namespace model
{

Expand All @@ -33,6 +37,11 @@ void ModelFormatManager::initialiseModule(const ApplicationContext& ctx)
module::GlobalModuleRegistry().signal_allModulesInitialised().connect(
sigc::mem_fun(this, &ModelFormatManager::postModuleInitialisation)
);

// Register the built-in model exporters
registerExporter(std::make_shared<AseExporter>());
registerExporter(std::make_shared<Lwo2Exporter>());
registerExporter(std::make_shared<WavefrontExporter>());
}

void ModelFormatManager::postModuleInitialisation()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -4,7 +4,7 @@
#include "iarchive.h"
#include "imodelcache.h"

#include "picomodel/picomodel.h"
#include "lib/picomodel.h"

#include "os/path.h"

Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -9,13 +9,10 @@

#include "os/path.h"
#include <stdio.h>
#include "picomodel/picomodel.h"
#include "lib/picomodel.h"

#include "string/case_conv.h"
#include "PicoModelLoader.h"
#include "AseExporter.h"
#include "Lwo2Exporter.h"
#include "WavefrontExporter.h"

namespace model
{
Expand Down Expand Up @@ -73,10 +70,6 @@ class PicoModelModule :
}
}
}

GlobalModelFormatManager().registerExporter(std::make_shared<AseExporter>());
GlobalModelFormatManager().registerExporter(std::make_shared<Lwo2Exporter>());
GlobalModelFormatManager().registerExporter(std::make_shared<WavefrontExporter>());
}

private:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -3,7 +3,7 @@
#include "iundo.h"
#include "mapfile.h"
#include "imodel.h"
#include "picomodel/picomodel.h"
#include "lib/picomodel.h"
#include "math/AABB.h"
#include "imodelsurface.h"

Expand Down
File renamed without changes.
@@ -1,7 +1,7 @@
#pragma once

#include "GLProgramAttributes.h"
#include "picomodel/picomodel.h"
#include "lib/picomodel.h"
#include "render.h"
#include "math/AABB.h"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 194f0a3

Please sign in to comment.