diff --git a/Makefile b/Makefile index d100d46..464643d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ BUILDMODE=release BUILDPATH=./build/${BUILDMODE} -LIBRARY_PATH=${BUILDPATH}/rendering:${BUILDPATH}/exploring:${BUILDPATH}/system:${BUILDPATH}/basics:${BUILDPATH}/definition:${BUILDPATH}/render/opengl:${BUILDPATH}/render/software:${BUILDPATH}/render/preview:${BUILDPATH}/tests/googletest +LIBRARY_PATH=${BUILDPATH}/system:${BUILDPATH}/basics:${BUILDPATH}/definition:${BUILDPATH}/render/software:${BUILDPATH}/render/preview:${BUILDPATH}/render/opengl:${BUILDPATH}/tests/googletest BUILD_SPEC=linux-g++ all:build @@ -64,8 +64,8 @@ package:build cp $(BUILDPATH)/basics/libpaysages_basics.so* paysages3d-linux/lib/ cp $(BUILDPATH)/definition/libpaysages_definition.so* paysages3d-linux/lib/ cp $(BUILDPATH)/render/software/libpaysages_render_software.so* paysages3d-linux/lib/ + cp $(BUILDPATH)/render/preview/libpaysages_render_software.so* paysages3d-linux/lib/ cp $(BUILDPATH)/render/opengl/libpaysages_render_opengl.so* paysages3d-linux/lib/ - cp $(BUILDPATH)/rendering/libpaysages_rendering.so* paysages3d-linux/lib/ cp $(BUILDPATH)/interface/desktop/paysages-gui paysages3d-linux/lib/ chmod +x paysages3d-linux/lib/paysages-gui cp -r data paysages3d-linux/ diff --git a/src/definition/Layers.cpp b/src/definition/Layers.cpp index 38e731d..4413d3a 100644 --- a/src/definition/Layers.cpp +++ b/src/definition/Layers.cpp @@ -59,7 +59,7 @@ BaseDefinition* Layers::getLayer(int position) const } else { - qWarning("Asked for a undefined layer %d on a total of %d", position, layers.size()); + qWarning("Asked for a undefined layer %d on a total of %d", position, (int)layers.size()); return null_layer; } } @@ -75,7 +75,7 @@ int Layers::findLayer(BaseDefinition* layer) const } i++; } - qWarning("Layer %p not found, on a total of %d, returning %d", layer, layers.size(), -1); + qWarning("Layer %p not found, on a total of %d, returning %d", layer, (int)layers.size(), -1); return -1; } diff --git a/src/interface/commandline/commandline.pro b/src/interface/commandline/commandline.pro index bd2aa8f..209c531 100644 --- a/src/interface/commandline/commandline.pro +++ b/src/interface/commandline/commandline.pro @@ -27,12 +27,6 @@ else:unix: LIBS += -L$$OUT_PWD/../../definition/ -lpaysages_definition INCLUDEPATH += $$PWD/../../definition DEPENDPATH += $$PWD/../../definition -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../rendering/release/ -lpaysages_rendering -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../rendering/debug/ -lpaysages_rendering -else:unix: LIBS += -L$$OUT_PWD/../../rendering/ -lpaysages_rendering -INCLUDEPATH += $$PWD/../../rendering -DEPENDPATH += $$PWD/../../rendering - win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../render/software/release/ -lpaysages_render_software else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../render/software/debug/ -lpaysages_render_software else:unix: LIBS += -L$$OUT_PWD/../../render/software/ -lpaysages_render_software diff --git a/src/interface/desktop/common/mainwindow.cpp b/src/interface/desktop/common/mainwindow.cpp index c62d84b..b55b570 100644 --- a/src/interface/desktop/common/mainwindow.cpp +++ b/src/interface/desktop/common/mainwindow.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,6 @@ #include "dialogrender.h" #include "dialogexplorer.h" -#include "main.h" #include "DesktopScenery.h" #include "PackStream.h" #include "tools.h" @@ -41,6 +41,12 @@ int main(int argc, char** argv) QApplication app(argc, argv); + if (not QFileInfo("./data/.paysages_data").isReadable()) + { + QMessageBox::critical(NULL, QObject::tr("Paysages 3D - Data error"), QObject::tr("Application data were not found. Please ensure the software is run from its original directory.")); + return 1; + } + splash = new QSplashScreen(QPixmap(getDataPath("images/logo_256.png"))); splash->show(); @@ -63,7 +69,6 @@ int main(int argc, char** argv) //splash->showMessage(app.tr("Preloading..."), Qt::AlignCenter, Qt::white); app.processEvents(); - paysagesInit(); BasePreview::initDrawers(); window = new MainWindow(); @@ -79,7 +84,6 @@ int main(int argc, char** argv) delete window; - paysagesQuit(); return result; } diff --git a/src/interface/desktop/desktop.pro b/src/interface/desktop/desktop.pro index 090deeb..1bd30be 100644 --- a/src/interface/desktop/desktop.pro +++ b/src/interface/desktop/desktop.pro @@ -133,12 +133,6 @@ else:unix: LIBS += -L$$OUT_PWD/../../basics/ -lpaysages_basics INCLUDEPATH += $$PWD/../../basics DEPENDPATH += $$PWD/../../basics -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../rendering/release/ -lpaysages_rendering -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../rendering/debug/ -lpaysages_rendering -else:unix: LIBS += -L$$OUT_PWD/../../rendering/ -lpaysages_rendering -INCLUDEPATH += $$PWD/../../rendering -DEPENDPATH += $$PWD/../../rendering - win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../definition/release/ -lpaysages_definition else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../definition/debug/ -lpaysages_definition else:unix: LIBS += -L$$OUT_PWD/../../definition/ -lpaysages_definition diff --git a/src/paysages.pro b/src/paysages.pro index 6f3f563..bd05472 100644 --- a/src/paysages.pro +++ b/src/paysages.pro @@ -5,7 +5,6 @@ SUBDIRS = \ system \ basics \ definition \ - rendering \ render/software \ render/preview \ render/opengl \ diff --git a/src/render/opengl/opengl.pro b/src/render/opengl/opengl.pro index 9c9caab..cd7042e 100644 --- a/src/render/opengl/opengl.pro +++ b/src/render/opengl/opengl.pro @@ -55,12 +55,6 @@ else:unix: LIBS += -L$$OUT_PWD/../../definition/ -lpaysages_definition INCLUDEPATH += $$PWD/../../definition DEPENDPATH += $$PWD/../../definition -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../rendering/release/ -lpaysages_rendering -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../rendering/debug/ -lpaysages_rendering -else:unix: LIBS += -L$$OUT_PWD/../../rendering/ -lpaysages_rendering -INCLUDEPATH += $$PWD/../../rendering -DEPENDPATH += $$PWD/../../rendering - win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../software/release/ -lpaysages_render_software else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../software/debug/ -lpaysages_render_software else:unix: LIBS += -L$$OUT_PWD/../software/ -lpaysages_render_software diff --git a/src/render/preview/preview.pro b/src/render/preview/preview.pro index 6da7978..9e04425 100644 --- a/src/render/preview/preview.pro +++ b/src/render/preview/preview.pro @@ -66,12 +66,6 @@ else:unix: LIBS += -L$$OUT_PWD/../../definition/ -lpaysages_definition INCLUDEPATH += $$PWD/../../definition DEPENDPATH += $$PWD/../../definition -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../rendering/release/ -lpaysages_rendering -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../rendering/debug/ -lpaysages_rendering -else:unix: LIBS += -L$$OUT_PWD/../../rendering/ -lpaysages_rendering -INCLUDEPATH += $$PWD/../../rendering -DEPENDPATH += $$PWD/../../rendering - win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../software/release/ -lpaysages_render_software else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../software/debug/ -lpaysages_render_software else:unix: LIBS += -L$$OUT_PWD/../software/ -lpaysages_render_software diff --git a/src/render/software/software.pro b/src/render/software/software.pro index 8f31a62..070ad32 100644 --- a/src/render/software/software.pro +++ b/src/render/software/software.pro @@ -88,9 +88,3 @@ else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../definition/de else:unix: LIBS += -L$$OUT_PWD/../../definition/ -lpaysages_definition INCLUDEPATH += $$PWD/../../definition DEPENDPATH += $$PWD/../../definition - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../rendering/release/ -lpaysages_rendering -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../rendering/debug/ -lpaysages_rendering -else:unix: LIBS += -L$$OUT_PWD/../../rendering/ -lpaysages_rendering -INCLUDEPATH += $$PWD/../../rendering -DEPENDPATH += $$PWD/../../rendering diff --git a/src/rendering/main.cpp b/src/rendering/main.cpp deleted file mode 100644 index a20c242..0000000 --- a/src/rendering/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "main.h" - -#include -#include - -#include "tools/data.h" - -void paysagesInit() -{ - if (!dataInit()) - { - /* TODO Add error callback (for interface) */ - fprintf(stderr, "ERROR : Can't locate data files.\n"); - exit(1); - } -} - -void paysagesQuit() -{ -} diff --git a/src/rendering/main.h b/src/rendering/main.h deleted file mode 100644 index 440910f..0000000 --- a/src/rendering/main.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _PAYSAGES_MAIN_H_ -#define _PAYSAGES_MAIN_H_ - -#include "rendering_global.h" - -RENDERINGSHARED_EXPORT void paysagesInit(); -RENDERINGSHARED_EXPORT void paysagesQuit(); - -#endif diff --git a/src/rendering/rendering.pro b/src/rendering/rendering.pro deleted file mode 100644 index 8e6e3d0..0000000 --- a/src/rendering/rendering.pro +++ /dev/null @@ -1,35 +0,0 @@ -CONFIG += console -CONFIG -= app_bundle - -TEMPLATE = lib -TARGET = paysages_rendering - -DEFINES += RENDERING_LIBRARY - -include(../common.pri) - -SOURCES += main.cpp \ - tools/data.cpp - -HEADERS += \ - main.h \ - tools/data.h \ - rendering_global.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 -INCLUDEPATH += $$PWD/../system -DEPENDPATH += $$PWD/../system - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../basics/release/ -lpaysages_basics -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../basics/debug/ -lpaysages_basics -else:unix: LIBS += -L$$OUT_PWD/../basics/ -lpaysages_basics -INCLUDEPATH += $$PWD/../basics -DEPENDPATH += $$PWD/../basics - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../definition/release/ -lpaysages_definition -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../definition/debug/ -lpaysages_definition -else:unix: LIBS += -L$$OUT_PWD/../definition/ -lpaysages_definition -INCLUDEPATH += $$PWD/../definition -DEPENDPATH += $$PWD/../definition diff --git a/src/rendering/rendering_global.h b/src/rendering/rendering_global.h deleted file mode 100644 index 3225823..0000000 --- a/src/rendering/rendering_global.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef RENDERING_GLOBAL_H -#define RENDERING_GLOBAL_H - -#include -#if defined(RENDERING_LIBRARY) -# define RENDERINGSHARED_EXPORT Q_DECL_EXPORT -#else -# define RENDERINGSHARED_EXPORT Q_DECL_IMPORT -#endif - -#include "definition_global.h" - -#endif // RENDERING_GLOBAL_H diff --git a/src/rendering/tools/data.cpp b/src/rendering/tools/data.cpp deleted file mode 100644 index 6a91a89..0000000 --- a/src/rendering/tools/data.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "data.h" - -#include -#include -#include - -static const char* _datapath = NULL; - -static int _tryDataPath(const char* path) -{ - char* buffer; - - buffer = (char*)malloc(sizeof (char) * (strlen(path) + 30)); - strcpy(buffer, path); - strcat(buffer, "/.paysages_data"); - - FILE* f = fopen(buffer, "r"); - free(buffer); - if (f) - { - _datapath = path; - fclose(f); - return 1; - } - else - { - return 0; - } -} - -int dataInit() -{ - return _tryDataPath("./data") || _tryDataPath("/usr/share/paysages3d"); -} diff --git a/src/rendering/tools/data.h b/src/rendering/tools/data.h deleted file mode 100644 index f5fcbc2..0000000 --- a/src/rendering/tools/data.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _PAYSAGES_TOOLS_DATA_H_ -#define _PAYSAGES_TOOLS_DATA_H_ - -#include "../rendering_global.h" - -/* - * Data directory management. - */ - -RENDERINGSHARED_EXPORT int dataInit(); - -#endif diff --git a/src/tests/main.cpp b/src/tests/main.cpp index abf5555..28d9715 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -1,6 +1,6 @@ #include "BaseTestCase.h" + #include -#include "../rendering/main.h" void noMessageOutput(QtMsgType, const QMessageLogContext&, const QString&) { @@ -10,15 +10,11 @@ int main(int argc, char **argv) { int result; - paysagesInit(); - qInstallMessageHandler(noMessageOutput); testing::InitGoogleTest(&argc, argv); result = RUN_ALL_TESTS(); - paysagesQuit(); - return result; } diff --git a/src/tests/tests.pro b/src/tests/tests.pro index 16f6c0b..3fc8679 100644 --- a/src/tests/tests.pro +++ b/src/tests/tests.pro @@ -46,12 +46,6 @@ else:unix: LIBS += -L$$OUT_PWD/../definition/ -lpaysages_definition INCLUDEPATH += $$PWD/../definition DEPENDPATH += $$PWD/../definition -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../rendering/release/ -lpaysages_rendering -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../rendering/debug/ -lpaysages_rendering -else:unix: LIBS += -L$$OUT_PWD/../rendering/ -lpaysages_rendering -INCLUDEPATH += $$PWD/../rendering -DEPENDPATH += $$PWD/../rendering - win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../render/software/release/ -lpaysages_render_software else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../render/software/debug/ -lpaysages_render_software else:unix: LIBS += -L$$OUT_PWD/../render/software/ -lpaysages_render_software