From c3b7730ff1fb347c65899c9d5b3f1e180be90223 Mon Sep 17 00:00:00 2001 From: IgorekLoschinin <igor.loschinin2014@yandex.ru> Date: Mon, 14 Jun 2021 22:46:12 +0300 Subject: [PATCH 1/2] ref #49 Fixing bug build under windows. --- src/Core/SnakeProject/defaultcontrol.h | 3 ++- src/Core/SnakeProject/guiobject.h | 3 +-- src/Core/SnakeProject/iai.h | 5 +++-- src/Core/SnakeProject/icontrol.h | 4 +++- src/Core/SnakeProject/iground.h | 4 ++-- src/Core/SnakeProject/iplayer.h | 4 ++-- src/Core/SnakeProject/irender.h | 4 ++-- src/Core/SnakeProject/iworld.h | 3 ++- src/Core/SnakeProject/iworlditem.h | 3 ++- 9 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/Core/SnakeProject/defaultcontrol.h b/src/Core/SnakeProject/defaultcontrol.h index eae756f..98192aa 100644 --- a/src/Core/SnakeProject/defaultcontrol.h +++ b/src/Core/SnakeProject/defaultcontrol.h @@ -2,11 +2,12 @@ #define DEFAULTCONTROL_H #include "icontrol.h" +#include "global.h" /** * @brief The DefaultControl class This class contains default implementation of the game menu. */ -class DefaultControl : public IControl { +class SNAKEPROJECT_EXPORT DefaultControl : public IControl { Q_OBJECT public: DefaultControl(); diff --git a/src/Core/SnakeProject/guiobject.h b/src/Core/SnakeProject/guiobject.h index ba70b2a..6acee15 100644 --- a/src/Core/SnakeProject/guiobject.h +++ b/src/Core/SnakeProject/guiobject.h @@ -11,8 +11,7 @@ /** * @brief The GuiObject class This base model for gui objects. */ -class GuiObject: public QObject, public IRender -{ +class SNAKEPROJECT_EXPORT GuiObject: public QObject, public IRender { Q_OBJECT Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(int guiId READ guiId NOTIFY guiIdChanged) diff --git a/src/Core/SnakeProject/iai.h b/src/Core/SnakeProject/iai.h index 536583c..a50799c 100644 --- a/src/Core/SnakeProject/iai.h +++ b/src/Core/SnakeProject/iai.h @@ -1,6 +1,8 @@ #ifndef IAI_H #define IAI_H +#include "global.h" + /** * @brief The IAI class Is default interface for ai classes. * @note example of use : @@ -11,8 +13,7 @@ * } * ``` */ -class IAI -{ +class SNAKEPROJECT_EXPORT IAI { public: IAI(); diff --git a/src/Core/SnakeProject/icontrol.h b/src/Core/SnakeProject/icontrol.h index 2416749..a77f2bd 100644 --- a/src/Core/SnakeProject/icontrol.h +++ b/src/Core/SnakeProject/icontrol.h @@ -1,6 +1,8 @@ #ifndef ICONTROL_H #define ICONTROL_H + #include <QObject> +#include "global.h" /** * @brief The IControl class This interface should be contains implementation of custom user interface @@ -11,7 +13,7 @@ * For more information see the DefaultControl class. * */ -class IControl : public QObject +class SNAKEPROJECT_EXPORT IControl : public QObject { Q_OBJECT Q_PROPERTY(QString view READ view NOTIFY viewChanged) diff --git a/src/Core/SnakeProject/iground.h b/src/Core/SnakeProject/iground.h index 9358158..757cfc7 100644 --- a/src/Core/SnakeProject/iground.h +++ b/src/Core/SnakeProject/iground.h @@ -2,12 +2,12 @@ #define IGROUND_H #include "iworlditem.h" +#include "global.h" /** * @brief The IGround class This is one tile of the world. Any objects of this type created automatically for filing ground plain. */ -class IGround: public IWorldItem -{ +class SNAKEPROJECT_EXPORT IGround: public IWorldItem { public: IGround(); diff --git a/src/Core/SnakeProject/iplayer.h b/src/Core/SnakeProject/iplayer.h index 698cea5..4efb124 100644 --- a/src/Core/SnakeProject/iplayer.h +++ b/src/Core/SnakeProject/iplayer.h @@ -3,14 +3,14 @@ #include "gameresult.h" #include "iworlditem.h" +#include "global.h" class IControl; /** * @brief The IPlayer class This is base class of the player functions. */ -class IPlayer: public IWorldItem -{ +class SNAKEPROJECT_EXPORT IPlayer: public IWorldItem { Q_OBJECT public: IPlayer(); diff --git a/src/Core/SnakeProject/irender.h b/src/Core/SnakeProject/irender.h index f6ebd56..90da072 100644 --- a/src/Core/SnakeProject/irender.h +++ b/src/Core/SnakeProject/irender.h @@ -1,13 +1,13 @@ #ifndef IRENDER_H #define IRENDER_H +#include "global.h" /** * @brief The IRender class This interface provide render functionality for all objects. * @note Override the render method. */ -class IRender -{ +class SNAKEPROJECT_EXPORT IRender { public: IRender(); diff --git a/src/Core/SnakeProject/iworld.h b/src/Core/SnakeProject/iworld.h index d87c255..051f4f6 100644 --- a/src/Core/SnakeProject/iworld.h +++ b/src/Core/SnakeProject/iworld.h @@ -10,6 +10,7 @@ #include <QString> #include "irender.h" #include "diff.h" +#include "global.h" class IWorldItem; class IPlayer; @@ -38,7 +39,7 @@ struct WorldObjectWraper { /** * @brief The IWorld class use this interface for implementation your own game levels */ -class IWorld : public QObject, public IRender +class SNAKEPROJECT_EXPORT IWorld : public QObject, public IRender { Q_OBJECT Q_PROPERTY(QVector3D cameraReleativePosition READ cameraReleativePosition WRITE setCameraReleativePosition NOTIFY cameraReleativePositionChanged) diff --git a/src/Core/SnakeProject/iworlditem.h b/src/Core/SnakeProject/iworlditem.h index c99676f..b523816 100644 --- a/src/Core/SnakeProject/iworlditem.h +++ b/src/Core/SnakeProject/iworlditem.h @@ -2,12 +2,13 @@ #define IWORLDITEM_H #include <SnakeProject/guiobject.h> +#include "global.h" class IWorld; /** * @brief The IWorldItem class This is World item. This class contains functions for control event system. */ -class IWorldItem: public GuiObject { +class SNAKEPROJECT_EXPORT IWorldItem: public GuiObject { Q_OBJECT public: IWorldItem(); From 35fe5077baf707163ee3fb6ff543ec0676b33189 Mon Sep 17 00:00:00 2001 From: Andrei Yankovich <EndrIIMail@gmail.com> Date: Tue, 15 Jun 2021 21:41:38 +0300 Subject: [PATCH 2/2] Apply suggestions from code review --- src/Core/private/pluginloader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/private/pluginloader.cpp b/src/Core/private/pluginloader.cpp index 24526fc..72e5703 100644 --- a/src/Core/private/pluginloader.cpp +++ b/src/Core/private/pluginloader.cpp @@ -17,7 +17,7 @@ IWorld* PluginLoader::load(const QString &pluginPath) { QuasarAppUtils::Params::log("Fail to load game module. Message: " + lib.errorString(), QuasarAppUtils::Error); - return {}; + return nullptr; } worldInstance worldFunc = (worldInstance)lib.resolve("worldInstance"); @@ -28,7 +28,7 @@ IWorld* PluginLoader::load(const QString &pluginPath) { QuasarAppUtils::Error); lib.unload(); - return {}; + return nullptr; } return worldFunc();