Simplified project files + lazy init of data files

This commit is contained in:
Michaël Lemaire 2015-10-19 01:39:22 +02:00
parent 75e32beea7
commit ca7bd84308
14 changed files with 59 additions and 344 deletions

View file

@ -13,62 +13,8 @@ DEFINES += BASICS_LIBRARY
include(../common.pri)
SOURCES += \
NoiseGenerator.cpp \
NoiseFunctionPerlin.cpp \
NoiseFunctionSimplex.cpp \
Interpolation.cpp \
Vector3.cpp \
Vector3.inline.cpp \
SpaceSegment.cpp \
Color.cpp \
Color.inline.cpp \
ColorHSL.cpp \
BoundingBox.cpp \
Matrix4.cpp \
Curve.cpp \
ColorProfile.cpp \
Geometry.cpp \
Texture2D.cpp \
Texture3D.cpp \
Texture4D.cpp \
NoiseState.cpp \
FractalNoise.cpp \
CappedCylinder.cpp \
InfiniteCylinder.cpp \
InfiniteRay.cpp \
Sphere.cpp \
InfinitePlane.cpp \
Disk.cpp \
SpaceGridIterator.cpp
HEADERS +=\
basics_global.h \
NoiseGenerator.h \
NoiseFunctionPerlin.h \
NoiseFunctionSimplex.h \
Interpolation.h \
Vector3.h \
SpaceSegment.h \
Color.h \
ColorHSL.h \
BoundingBox.h \
Matrix4.h \
Curve.h \
ColorProfile.h \
Geometry.h \
Texture2D.h \
Texture3D.h \
Texture4D.h \
NoiseState.h \
FractalNoise.h \
CappedCylinder.h \
InfiniteCylinder.h \
InfiniteRay.h \
Sphere.h \
InfinitePlane.h \
Disk.h \
SpaceGridIterator.h
SOURCES += $$files(*.cpp)
HEADERS += $$files(*.h)
unix:!symbian {
maemo5 {

View file

@ -13,64 +13,8 @@ DEFINES += DEFINITION_LIBRARY
include(../common.pri)
SOURCES += \
Layers.cpp \
WaterDefinition.cpp \
SurfaceMaterial.cpp \
CameraDefinition.cpp \
CloudsDefinition.cpp \
CloudLayerDefinition.cpp \
AtmosphereDefinition.cpp \
TexturesDefinition.cpp \
TextureLayerDefinition.cpp \
Zone.cpp \
TerrainDefinition.cpp \
TerrainHeightMap.cpp \
Scenery.cpp \
PaintedGrid.cpp \
PaintedGridBrush.cpp \
PaintedGridData.cpp \
DefinitionNode.cpp \
FloatNode.cpp \
DefinitionDiff.cpp \
FloatDiff.cpp \
DiffManager.cpp \
DefinitionWatcher.cpp \
IntNode.cpp \
IntDiff.cpp \
NoiseNode.cpp \
GodRaysDefinition.cpp \
TimeManager.cpp
HEADERS +=\
definition_global.h \
Layers.h \
WaterDefinition.h \
SurfaceMaterial.h \
CameraDefinition.h \
CloudsDefinition.h \
CloudLayerDefinition.h \
AtmosphereDefinition.h \
TexturesDefinition.h \
TextureLayerDefinition.h \
Zone.h \
TerrainDefinition.h \
TerrainHeightMap.h \
Scenery.h \
PaintedGrid.h \
PaintedGridBrush.h \
PaintedGridData.h \
DefinitionNode.h \
FloatNode.h \
DefinitionDiff.h \
FloatDiff.h \
DiffManager.h \
DefinitionWatcher.h \
IntNode.h \
IntDiff.h \
NoiseNode.h \
GodRaysDefinition.h \
TimeManager.h
SOURCES += $$files(*.cpp)
HEADERS += $$files(*.h)
unix:!symbian {
maemo5 {

View file

@ -6,10 +6,8 @@ TARGET = paysages-cli
include(../../common.pri)
SOURCES += \
main.cpp \
tests.cpp \
render.cpp
SOURCES += $$files(*.cpp)
#HEADERS += $$files(*.h)
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../system/release/ -lpaysages_system
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../system/debug/ -lpaysages_system

View file

@ -6,14 +6,8 @@ CONFIG += qt plugin
TARGET = $$qtLibraryTarget($$TARGET)
uri = Paysages
# Input
SOURCES += \
extension_plugin.cpp \
paysages.cpp
HEADERS += \
extension_plugin.h \
paysages.h
SOURCES += $$files(*.cpp)
HEADERS += $$files(*.h)
OTHER_FILES = qmldir

View file

@ -4,16 +4,8 @@ QT += qml quick widgets
include(../../../common.pri)
SOURCES += main.cpp \
OpenGLView.cpp \
MainModelerWindow.cpp \
WaterModeler.cpp \
AtmosphereModeler.cpp \
RenderPreviewProvider.cpp \
RenderProcess.cpp \
ModelerCameras.cpp \
FloatPropertyBind.cpp \
IntPropertyBind.cpp
SOURCES += $$files(*.cpp)
HEADERS += $$files(*.h)
RESOURCES += \
qml/app.qrc
@ -26,18 +18,6 @@ QML_IMPORT_PATH = ../extension
# Default rules for deployment.
include(deployment.pri)
HEADERS += \
OpenGLView.h \
modeler_global.h \
MainModelerWindow.h \
WaterModeler.h \
AtmosphereModeler.h \
RenderPreviewProvider.h \
RenderProcess.h \
ModelerCameras.h \
FloatPropertyBind.h \
IntPropertyBind.h
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../system/release/ -lpaysages_system
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../system/debug/ -lpaysages_system
else:unix: LIBS += -L$$OUT_PWD/../../../system/ -lpaysages_system

View file

@ -13,29 +13,8 @@ DEFINES += OPENGL_LIBRARY
include(../../common.pri)
SOURCES += \
OpenGLRenderer.cpp \
ExplorerChunkTerrain.cpp \
OpenGLShaderProgram.cpp \
OpenGLPart.cpp \
OpenGLSkybox.cpp \
OpenGLWater.cpp \
OpenGLSharedState.cpp \
OpenGLVariable.cpp \
OpenGLTerrain.cpp
HEADERS +=\
opengl_global.h \
OpenGLRenderer.h \
ExplorerChunkTerrain.h \
OpenGLShaderProgram.h \
OpenGLPart.h \
OpenGLSkybox.h \
OpenGLWater.h \
OpenGLSharedState.h \
OpenGLVariable.h \
OpenGLTerrain.h \
VertexArray.h
SOURCES += $$files(*.cpp)
HEADERS += $$files(*.h)
unix:!symbian {
maemo5 {

View file

@ -1147,11 +1147,15 @@ int brunetonInit()
return 1;
}
static const int _init = brunetonInit();
static int _inited;
AtmosphereModelBruneton::AtmosphereModelBruneton(SoftwareRenderer *parent):
parent(parent)
{
if (not _inited)
{
_inited = brunetonInit();
}
}
AtmosphereModelBruneton::~AtmosphereModelBruneton()

View file

@ -13,94 +13,11 @@ DEFINES += SOFTWARE_LIBRARY
include(../../common.pri)
SOURCES += SoftwareRenderer.cpp \
FluidMediumInterface.cpp \
FluidMediumManager.cpp \
AtmosphereRenderer.cpp \
CloudsRenderer.cpp \
BaseCloudLayerRenderer.cpp \
SkyRasterizer.cpp \
CloudBasicLayerRenderer.cpp \
clouds/BaseCloudsModel.cpp \
clouds/CloudModelStratoCumulus.cpp \
TerrainRasterizer.cpp \
WaterRasterizer.cpp \
LightingManager.cpp \
LightStatus.cpp \
LightFilter.cpp \
LightComponent.cpp \
AtmosphereResult.cpp \
AtmosphereModelBruneton.cpp \
TerrainRenderer.cpp \
TexturesRenderer.cpp \
WaterRenderer.cpp \
RayCastingManager.cpp \
NightSky.cpp \
TerrainRayWalker.cpp \
Canvas.cpp \
CanvasPortion.cpp \
CanvasPixel.cpp \
CanvasFragment.cpp \
SoftwareCanvasRenderer.cpp \
Rasterizer.cpp \
CanvasLiveClient.cpp \
CanvasPreview.cpp \
RenderConfig.cpp \
CanvasPixelShader.cpp \
CanvasPictureWriter.cpp \
clouds/CloudModelAltoCumulus.cpp \
clouds/CloudModelCirrus.cpp \
clouds/CloudModelCumuloNimbus.cpp \
RenderProgress.cpp \
LightSource.cpp \
RayCastingResult.cpp \
GodRaysSampler.cpp \
GodRaysResult.cpp
SOURCES += $$files(*.cpp)
HEADERS += $$files(*.h)
HEADERS += SoftwareRenderer.h\
software_global.h \
FluidMediumInterface.h \
FluidMediumManager.h \
AtmosphereRenderer.h \
CloudsRenderer.h \
BaseCloudLayerRenderer.h \
SkyRasterizer.h \
CloudBasicLayerRenderer.h \
clouds/BaseCloudsModel.h \
clouds/CloudModelStratoCumulus.h \
TerrainRasterizer.h \
WaterRasterizer.h \
LightingManager.h \
LightStatus.h \
LightFilter.h \
LightComponent.h \
AtmosphereResult.h \
AtmosphereModelBruneton.h \
TerrainRenderer.h \
TexturesRenderer.h \
WaterRenderer.h \
RayCastingManager.h \
NightSky.h \
TerrainRayWalker.h \
Canvas.h \
CanvasPortion.h \
CanvasPixel.h \
CanvasFragment.h \
SoftwareCanvasRenderer.h \
Rasterizer.h \
CanvasLiveClient.h \
CanvasPreview.h \
RenderConfig.h \
CanvasPixelShader.h \
CanvasPictureWriter.h \
clouds/CloudModelAltoCumulus.h \
clouds/CloudModelCirrus.h \
clouds/CloudModelCumuloNimbus.h \
RenderProgress.h \
LightSource.h \
RayCastingResult.h \
GodRaysSampler.h \
GodRaysResult.h
SOURCES += $$files(clouds/*.cpp)
HEADERS += $$files(clouds/*.h)
unix:!symbian {
maemo5 {

View file

@ -5,6 +5,11 @@
std::string DataFile::findFile(const std::string &relpath)
{
if (dataDir.empty())
{
dataDir = initDataDir();
}
QDir dir(QString::fromStdString(dataDir));
if (dir.exists(QString::fromStdString(relpath)))
{
@ -69,4 +74,4 @@ std::string DataFile::initDataDir()
}
}
std::string DataFile::dataDir = DataFile::initDataDir();
std::string DataFile::dataDir;

View file

@ -2,7 +2,33 @@
#include "Time.h"
static std::ostream NULL_STREAM(0);
#include <streambuf>
#include <ostream>
template <class cT, class traits = std::char_traits<cT> >
class basic_nullbuf: public std::basic_streambuf<cT, traits> {
typename traits::int_type overflow(typename traits::int_type c)
{
return traits::not_eof(c); // indicate success
}
};
template <class cT, class traits = std::char_traits<cT> >
class basic_onullstream: public std::basic_ostream<cT, traits> {
public:
basic_onullstream():
std::basic_ios<cT, traits>(&m_sbuf),
std::basic_ostream<cT, traits>(&m_sbuf)
{
this->init(&m_sbuf);
}
private:
basic_nullbuf<cT, traits> m_sbuf;
};
typedef basic_onullstream<char> onullstream;
static onullstream NULL_STREAM;
static bool enabled = true;
std::ostream &Logs::debug()

View file

@ -13,42 +13,8 @@ DEFINES += SYSTEM_LIBRARY
include(../common.pri)
SOURCES += \
Thread.cpp \
Mutex.cpp \
System.cpp \
PackStream.cpp \
RandomGenerator.cpp \
Memory.cpp \
ParallelWork.cpp \
CacheFile.cpp \
PictureWriter.cpp \
Logs.cpp \
ParallelPool.cpp \
ParallelWorker.cpp \
Semaphore.cpp \
FileSystem.cpp \
DataFile.cpp \
Time.cpp
HEADERS += \
system_global.h \
Thread.h \
Mutex.h \
System.h \
PackStream.h \
RandomGenerator.h \
Memory.h \
ParallelWork.h \
CacheFile.h \
PictureWriter.h \
Logs.h \
ParallelPool.h \
ParallelWorker.h \
Semaphore.h \
FileSystem.h \
DataFile.h \
Time.h
SOURCES += $$files(*.cpp)
HEADERS += $$files(*.h)
unix:!symbian {
maemo5 {

View file

@ -1,5 +0,0 @@
#include "BaseTestCase.h"
BaseTestCase::BaseTestCase()
{
}

View file

@ -15,10 +15,7 @@ QMAKE_CXXFLAGS += -pthread -Wno-missing-field-initializers
INCLUDEPATH += ./sources ./sources/include
SOURCES += \
sources/src/gtest-all.cc
HEADERS +=
SOURCES += sources/src/gtest-all.cc
unix:!symbian {
maemo5 {

View file

@ -6,44 +6,8 @@ TARGET = paysages-tests
include(../common.pri)
SOURCES += main.cpp \
Layers_Test.cpp \
PackStream_Test.cpp \
NoiseGenerator_Test.cpp \
TerrainPainting_Test.cpp \
Zone_Test.cpp \
Euclid_Test.cpp \
Camera_Test.cpp \
Clouds_Test.cpp \
FluidMediumManager_Test.cpp \
VertexArray_Test.cpp \
FractalNoise_Test.cpp \
SpaceSegment_Test.cpp \
Canvas_Test.cpp \
CanvasPortion_Test.cpp \
CanvasPixel_Test.cpp \
CanvasPreview_Test.cpp \
AtmosphereDefinition_Test.cpp \
Scenery_Test.cpp \
DefinitionNode_Test.cpp \
FloatNode_Test.cpp \
DiffManager_Test.cpp \
ColorHSL_Test.cpp \
RenderProgress_Test.cpp \
IntNode_Test.cpp \
LightingManager_Test.cpp \
GodRaysSampler_Test.cpp \
Interpolation_Test.cpp \
Rasterizer_Test.cpp \
CappedCylinder_Test.cpp \
InfiniteCylinder_Test.cpp \
Sphere_Test.cpp \
InfinitePlane_Test.cpp \
Disk_Test.cpp \
Vector3_Test.cpp
HEADERS += \
BaseTestCase.h
SOURCES += $$files(*.cpp)
HEADERS += $$files(*.h)
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/googletest/release/ -lgoogletest
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/googletest/debug/ -lgoogletest