Commit 434f1b5d authored by 魔大农's avatar 魔大农

Switched to Dry engine

parent a4eb55c6
......@@ -36,10 +36,10 @@ Makefile*
# QtCtreator CMake
CMakeLists.txt.user
# Urho3D
/Urho3D
# Dry
/Dry
/Data
/CoreData
edddy
*.blend*
\ No newline at end of file
*.blend*
......@@ -2,7 +2,8 @@ TARGET = edddy
QT += core gui widgets
LIBS += ../Edddy/Urho3D/lib/libUrho3D.a \
LIBS += \
$${PWD}/Dry/lib/libDry.a \
-lpthread \
-ldl \
-lGL
......@@ -10,8 +11,8 @@ LIBS += ../Edddy/Urho3D/lib/libUrho3D.a \
QMAKE_CXXFLAGS += -std=c++11 -O2
INCLUDEPATH += \
../Edddy/Urho3D/include \
../Edddy/Urho3D/include/Urho3D/ThirdParty \
Dry/include \
Dry/include/Dry/ThirdParty \
TEMPLATE = app
CONFIG += console
......
......@@ -26,9 +26,9 @@
void Block::RegisterAttributes(Context* context)
{
URHO3D_ATTRIBUTE("id", unsigned, id_, 0, AM_FILE);
URHO3D_ATTRIBUTE("name", String, name_, "", AM_FILE);
// URHO3D_ATTRIBUTE("material", String, material_, "", AM_FILE);
DRY_ATTRIBUTE("id", unsigned, id_, 0, AM_FILE);
DRY_ATTRIBUTE("name", String, name_, "", AM_FILE);
// DRY_ATTRIBUTE("material", String, material_, "", AM_FILE);
}
Block::Block(Context* context) : QObject(), Serializable(context),
......
......@@ -20,12 +20,12 @@
#ifndef BLOCK_H
#define BLOCK_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
class Blockset;
URHO3D_EVENT(E_BLOCKCHANGED, BlockChanged){}
DRY_EVENT(E_BLOCKCHANGED, BlockChanged){}
#define SINGLE M_MAX_UNSIGNED
......@@ -36,7 +36,7 @@ class Block : public QObject, public Serializable
friend class EditMaster;
Q_OBJECT
URHO3D_OBJECT(Block, Serializable);
DRY_OBJECT(Block, Serializable);
public:
Block(Context* context);
static void RegisterAttributes(Context *context);
......
......@@ -33,7 +33,7 @@
class BlockDialog : public QDialog, public Object
{
Q_OBJECT
URHO3D_OBJECT(BlockDialog, Object);
DRY_OBJECT(BlockDialog, Object);
public:
explicit BlockDialog(Context* context, Vector<Block*> blocks, QWidget* parent = nullptr);
protected:
......
......@@ -51,7 +51,7 @@ void BlockInstance::SetBlock(Block* block, Quaternion rotation)
block_ = block;
update();
SubscribeToEvent(block_, E_BLOCKCHANGED, URHO3D_HANDLER(BlockInstance, update));
SubscribeToEvent(block_, E_BLOCKCHANGED, DRY_HANDLER(BlockInstance, update));
}
blockNode_->SetRotation(rotation);
......
......@@ -20,7 +20,7 @@
#ifndef BLOCKINSTANCE_H
#define BLOCKINSTANCE_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
#include "block.h"
......@@ -28,7 +28,7 @@ class BlockInstance : public Component
{
friend class BlockMap;
URHO3D_OBJECT(BlockInstance, Component);
DRY_OBJECT(BlockInstance, Component);
public:
BlockInstance(Context* context);
......
......@@ -36,7 +36,7 @@ void BlockListItem::UpdateBlockPreview()
{
block_->UpdatePreview();
SubscribeToEvent(E_ENDRENDERING, URHO3D_HANDLER(BlockListItem, UpdateIcon));
SubscribeToEvent(E_ENDRENDERING, DRY_HANDLER(BlockListItem, UpdateIcon));
}
void BlockListItem::UpdateIcon(const StringHash, VariantMap&)
{
......
......@@ -26,7 +26,7 @@ class Block;
class BlockListItem : public QListWidgetItem, public Object
{
URHO3D_OBJECT(BlockListItem, Object)
DRY_OBJECT(BlockListItem, Object)
public:
BlockListItem(Context* context, Block* block);
......
......@@ -20,7 +20,7 @@
#ifndef BLOCKMAP_H
#define BLOCKMAP_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
#include "freeblock.h"
......@@ -36,7 +36,7 @@ typedef HashMap<int, Sheet> GridMap;
class BlockMap : public QObject, public Component
{
Q_OBJECT
URHO3D_OBJECT(BlockMap, Component)
DRY_OBJECT(BlockMap, Component)
public:
BlockMap(Context* context);
void OnNodeSet(Node* node) override;
......
......@@ -20,7 +20,7 @@
#ifndef BLOCKSET_H
#define BLOCKSET_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
#include "block.h"
......@@ -30,7 +30,7 @@
class Blockset : public QObject, public Serializable
{
Q_OBJECT
URHO3D_OBJECT(Blockset, Serializable);
DRY_OBJECT(Blockset, Serializable);
public:
Blockset(Context* context);
......
......@@ -29,7 +29,7 @@
class BlocksPanel : public QWidget, public Object
{
Q_OBJECT
URHO3D_OBJECT(BlocksPanel, Object);
DRY_OBJECT(BlocksPanel, Object);
public:
explicit BlocksPanel(Context* context, QWidget *parent = nullptr);
......
......@@ -19,12 +19,12 @@
#ifndef BRUSH_H
#define BRUSH_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "tool.h"
class Brush : public Tool
{
URHO3D_OBJECT(Brush, Tool);
DRY_OBJECT(Brush, Tool);
public:
Brush(Context* context);
void Apply(bool shiftDown, bool ctrlDown, bool altDown) override;
......
......@@ -20,12 +20,12 @@
#ifndef CASTMASTER_H
#define CASTMASTER_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
class CastMaster : public Object
{
URHO3D_OBJECT(CastMaster, Object);
DRY_OBJECT(CastMaster, Object);
public:
CastMaster(Context* context);
bool PhysicsRayCast(Scene* scene, PODVector<PhysicsRaycastResult>& hitResults, const Ray ray, const float distance, const unsigned collisionMask);
......
......@@ -20,11 +20,11 @@
#ifndef EDDDYCAM_H
#define EDDDYCAM_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
using namespace Urho3D;
using namespace Dry;
class View3D;
......@@ -35,7 +35,7 @@ enum MoveType { MT_ROTATE, MT_PAN, MT_FOV };
class EdddyCam : public Camera
{
URHO3D_OBJECT(EdddyCam, Camera);
DRY_OBJECT(EdddyCam, Camera);
public:
EdddyCam(Context *context);
void OnNodeSet(Node* node) override;
......
......@@ -80,7 +80,7 @@ void EdddyCursor::OnNodeSet(Node *node)
}
AddInstanceNode(blockNode_);
SubscribeToEvent(E_CURRENTBLOCKCHANGE, URHO3D_HANDLER(EdddyCursor, UpdateModel));
SubscribeToEvent(E_CURRENTBLOCKCHANGE, DRY_HANDLER(EdddyCursor, UpdateModel));
}
void EdddyCursor::SetBlockMap(BlockMap* blockMap)
{
......
......@@ -20,14 +20,14 @@
#ifndef EDDDYCURSOR_H
#define EDDDYCURSOR_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
URHO3D_EVENT(E_CURSORSTEP, CursorStep){}
DRY_EVENT(E_CURSORSTEP, CursorStep){}
class EdddyCursor : public LogicComponent
{
URHO3D_OBJECT(EdddyCursor, LogicComponent);
DRY_OBJECT(EdddyCursor, LogicComponent);
public:
static EdddyCursor* cursor_;
EdddyCursor(Context* context);
......
......@@ -17,5 +17,5 @@
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "Urho3D/Core/Object.h"
#include "Dry/Core/Object.h"
//#include "block.h"
......@@ -20,18 +20,18 @@
#ifndef EDITMASTER_H
#define EDITMASTER_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
URHO3D_EVENT(E_CURRENTBLOCKCHANGE, CurrentBlockChange){
URHO3D_PARAM(P_BLOCK, Block*);
DRY_EVENT(E_CURRENTBLOCKCHANGE, CurrentBlockChange){
DRY_PARAM(P_BLOCK, Block*);
}
URHO3D_EVENT(E_CURRENTMAPCHANGE, CurrentMapChange){
URHO3D_PARAM(P_MAP, BlockMap*);
DRY_EVENT(E_CURRENTMAPCHANGE, CurrentMapChange){
DRY_PARAM(P_MAP, BlockMap*);
}
URHO3D_EVENT(E_CURRENTTOOLCHANGE, CurrentToolChange){
URHO3D_PARAM(P_TOOL, Tool*);
DRY_EVENT(E_CURRENTTOOLCHANGE, CurrentToolChange){
DRY_PARAM(P_TOOL, Tool*);
}
class EdddyCursor;
......@@ -50,7 +50,7 @@ typedef Vector<BlockChange> UndoStep;
class EditMaster : public QObject, public Object
{
Q_OBJECT
URHO3D_OBJECT(EditMaster, Object);
DRY_OBJECT(EditMaster, Object);
public:
EditMaster(Context* context);
EdddyCursor* GetCursor() const { return cursor_; }
......
......@@ -19,7 +19,7 @@
#ifndef EFFECTMASTER_H
#define EFFECTMASTER_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
#define WAYPOINTS 42
......@@ -27,7 +27,7 @@
class EffectMaster : public Object
{
URHO3D_OBJECT(EffectMaster, Object);
DRY_OBJECT(EffectMaster, Object);
public:
EffectMaster(Context* context);
......
......@@ -36,7 +36,7 @@ bool EmpFile::BeginLoad(Deserializer& source)
loadXMLFile_ = new XMLFile(context_);
if (!loadXMLFile_->Load(source))
{
URHO3D_LOGERROR("Load XML failed " + source.GetName());
DRY_LOGERROR("Load XML failed " + source.GetName());
loadXMLFile_.Reset();
return false;
}
......@@ -44,7 +44,7 @@ bool EmpFile::BeginLoad(Deserializer& source)
XMLElement rootElem = loadXMLFile_->GetRoot("blockmap");
if (!rootElem)
{
URHO3D_LOGERROR("Invalid EMP file " + source.GetName());
DRY_LOGERROR("Invalid EMP file " + source.GetName());
loadXMLFile_.Reset();
return false;
}
......
......@@ -19,13 +19,13 @@
#ifndef EMPFILE_H
#define EMPFILE_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
#include "blockmapdefs.h"
class EmpFile : public Resource
{
URHO3D_OBJECT(EmpFile, Resource);
DRY_OBJECT(EmpFile, Resource);
public:
/// Construct
explicit EmpFile(Context* context);
......
......@@ -19,14 +19,14 @@
#ifndef FILL_H
#define FILL_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "tool.h"
class Block;
class Fill : public Tool
{
URHO3D_OBJECT(Fill, Tool);
DRY_OBJECT(Fill, Tool);
public:
Fill(Context* context);
void Apply(bool shiftDown, bool ctrlDown, bool altDown) override;
......
......@@ -20,12 +20,12 @@
#ifndef FREEBLOCK_H
#define FREEBLOCK_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "blockinstance.h"
class FreeBlock : public BlockInstance
{
URHO3D_OBJECT(FreeBlock, BlockInstance);
DRY_OBJECT(FreeBlock, BlockInstance);
public:
FreeBlock(Context* context);
void OnNodeSet(Node* node) override;
......
......@@ -42,7 +42,7 @@ void GridBlock::OnNodeSet(Node *node)
CreateSideNodes();
SubscribeToEvent(EdddyCursor::cursor_, E_CURSORSTEP, URHO3D_HANDLER(GridBlock, UpdateCenter));
SubscribeToEvent(EdddyCursor::cursor_, E_CURSORSTEP, DRY_HANDLER(GridBlock, UpdateCenter));
}
void GridBlock::CreateSideNodes()
{
......
......@@ -20,13 +20,13 @@
#ifndef GRIDBLOCK_H
#define GRIDBLOCK_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "blockinstance.h"
class GridBlock : public BlockInstance
{
URHO3D_OBJECT(GridBlock, BlockInstance);
DRY_OBJECT(GridBlock, BlockInstance);
public:
GridBlock(Context* context);
void OnNodeSet(Node* node) override;
......
......@@ -27,9 +27,9 @@
History::History(Context* context) : Object(context),
steps_{},
stepIndex_{0},
lastSavedIndex_{LOSTSTEP},
previousModifiedState_{true},
stepIndex_{ 0 },
lastSavedIndex_{ LOSTSTEP },
previousModifiedState_{ true },
currentStep_{}
{
}
......
......@@ -19,7 +19,7 @@
#ifndef HISTORY_H
#define HISTORY_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
......@@ -53,7 +53,7 @@ public:
class History : public Object
{
URHO3D_OBJECT(History, Object);
DRY_OBJECT(History, Object);
public:
History(Context* context);
......
......@@ -64,17 +64,17 @@ InputMaster::InputMaster(Context* context) : Object(context),
keyBindings_[KEY_B] = ACTION_BRUSH;
keyBindings_[KEY_F] = ACTION_FILL;
SubscribeToEvent(E_KEYDOWN, URHO3D_HANDLER(InputMaster, HandleKeyDown));
SubscribeToEvent(E_KEYUP, URHO3D_HANDLER(InputMaster, HandleKeyUp));
SubscribeToEvent(E_JOYSTICKBUTTONDOWN, URHO3D_HANDLER(InputMaster, HandleJoyButtonDown));
SubscribeToEvent(E_JOYSTICKBUTTONUP, URHO3D_HANDLER(InputMaster, HandleJoyButtonUp));
SubscribeToEvent(E_JOYSTICKAXISMOVE, URHO3D_HANDLER(InputMaster, HandleJoystickAxisMove));
SubscribeToEvent(E_MOUSEMOVE, URHO3D_HANDLER(InputMaster, HandleMouseMove));
SubscribeToEvent(E_MOUSEBUTTONDOWN, URHO3D_HANDLER(InputMaster, HandleMouseButtonDown));
SubscribeToEvent(E_MOUSEBUTTONUP, URHO3D_HANDLER(InputMaster, HandleMouseButtonUp));
SubscribeToEvent(E_BEGINFRAME, URHO3D_HANDLER(InputMaster, HandleUpdate));
SubscribeToEvent(E_CURSORSTEP, URHO3D_HANDLER(InputMaster, HandleCursorStep));
SubscribeToEvent(E_KEYDOWN, DRY_HANDLER(InputMaster, HandleKeyDown));
SubscribeToEvent(E_KEYUP, DRY_HANDLER(InputMaster, HandleKeyUp));
SubscribeToEvent(E_JOYSTICKBUTTONDOWN, DRY_HANDLER(InputMaster, HandleJoyButtonDown));
SubscribeToEvent(E_JOYSTICKBUTTONUP, DRY_HANDLER(InputMaster, HandleJoyButtonUp));
SubscribeToEvent(E_JOYSTICKAXISMOVE, DRY_HANDLER(InputMaster, HandleJoystickAxisMove));
SubscribeToEvent(E_MOUSEMOVE, DRY_HANDLER(InputMaster, HandleMouseMove));
SubscribeToEvent(E_MOUSEBUTTONDOWN, DRY_HANDLER(InputMaster, HandleMouseButtonDown));
SubscribeToEvent(E_MOUSEBUTTONUP, DRY_HANDLER(InputMaster, HandleMouseButtonUp));
SubscribeToEvent(E_BEGINFRAME, DRY_HANDLER(InputMaster, HandleUpdate));
SubscribeToEvent(E_CURSORSTEP, DRY_HANDLER(InputMaster, HandleCursorStep));
INPUT->SetMouseVisible(true);
}
......
......@@ -20,10 +20,10 @@
#ifndef INPUTMASTER_H
#define INPUTMASTER_H
#include <Urho3D/Urho3D.h>
#include <Dry/Dry.h>
#include "luckey.h"
namespace Urho3D {
namespace Dry {
class Drawable;
class Node;
class Scene;
......@@ -46,7 +46,7 @@ class EdddyCursor;
class InputMaster : public Object
{
URHO3D_OBJECT(InputMaster, Object);
DRY_OBJECT(InputMaster, Object);
public:
InputMaster(Context* context);
......
......@@ -52,8 +52,8 @@ float LucKey::Distance(Vector2 from, Vector2 to)
Vector3 LucKey::Scale(const Vector3 lhs, const Vector3 rhs) {
return Vector3(lhs.x_ * rhs.x_, lhs.y_ * rhs.y_, lhs.z_ * rhs.z_);
}
Urho3D::IntVector2 LucKey::Scale(const Urho3D::IntVector2 lhs, const Urho3D::IntVector2 rhs) {
return Urho3D::IntVector2(lhs.x_ * rhs.x_, lhs.y_ * rhs.y_);
Dry::IntVector2 LucKey::Scale(const Dry::IntVector2 lhs, const Dry::IntVector2 rhs) {
return Dry::IntVector2(lhs.x_ * rhs.x_, lhs.y_ * rhs.y_);
}
Vector2 LucKey::Rotate(const Vector2 vec2, const float angle){
float x{vec2.x_};
......
......@@ -19,81 +19,81 @@
#ifndef LUCKEY_H
#define LUCKEY_H
#include <Urho3D/Urho3D.h>
#include <Urho3D/Audio/Audio.h>
#include <Urho3D/Audio/Sound.h>
#include <Urho3D/Audio/SoundSource.h>
#include <Urho3D/Container/HashBase.h>
#include <Urho3D/Container/HashMap.h>
#include <Urho3D/Container/Vector.h>
#include <Urho3D/Core/Attribute.h>
#include <Urho3D/Core/CoreEvents.h>
#include <Urho3D/Core/Object.h>
#include <Urho3D/Engine/Application.h>
#include <Urho3D/Engine/Console.h>
#include <Urho3D/Engine/DebugHud.h>
#include <Urho3D/Engine/Engine.h>
#include <Urho3D/Engine/EngineDefs.h>
#include <Urho3D/Graphics/AnimatedModel.h>
#include <Urho3D/Graphics/AnimationController.h>
#include <Urho3D/Graphics/Animation.h>
#include <Urho3D/Graphics/AnimationState.h>
#include <Urho3D/Graphics/Camera.h>
#include <Urho3D/Graphics/DebugRenderer.h>
#include <Urho3D/Graphics/DecalSet.h>
#include <Urho3D/Graphics/Graphics.h>
#include <Urho3D/Graphics/GraphicsEvents.h>
#include <Urho3D/Graphics/Light.h>
#include <Urho3D/Graphics/Material.h>
#include <Urho3D/Graphics/Model.h>
#include <Urho3D/Graphics/Octree.h>
#include <Urho3D/Graphics/OctreeQuery.h>
#include <Urho3D/Graphics/ParticleEffect.h>
#include <Urho3D/Graphics/ParticleEmitter.h>
#include <Urho3D/Graphics/Renderer.h>
#include <Urho3D/Graphics/RenderPath.h>
#include <Urho3D/Graphics/Skybox.h>
#include <Urho3D/Graphics/StaticModel.h>
#include <Urho3D/Graphics/StaticModelGroup.h>
#include <Urho3D/Graphics/Texture2D.h>
#include <Urho3D/Graphics/Viewport.h>
#include <Urho3D/Graphics/Zone.h>
#include <Urho3D/Input/InputEvents.h>
#include <Urho3D/Input/Input.h>
#include <Urho3D/IO/FileSystem.h>
#include <Urho3D/IO/Log.h>
#include <Urho3D/IO/MemoryBuffer.h>
#include <Urho3D/Math/MathDefs.h>
#include <Urho3D/Math/Plane.h>
#include <Urho3D/Math/Sphere.h>
#include <Urho3D/Math/Vector2.h>
#include <Urho3D/Math/Vector3.h>
#include <Urho3D/Physics/CollisionShape.h>
#include <Urho3D/Physics/Constraint.h>
#include <Urho3D/Physics/PhysicsEvents.h>
#include <Urho3D/Physics/PhysicsWorld.h>
#include <Urho3D/Physics/RigidBody.h>
#include <Urho3D/Resource/ResourceCache.h>
#include <Urho3D/Resource/XMLFile.h>
#include <Urho3D/Scene/LogicComponent.h>
#include <Urho3D/Scene/Component.h>
#include <Urho3D/Scene/Node.h>
#include <Urho3D/Scene/SceneEvents.h>
#include <Urho3D/Scene/Scene.h>
#include <Urho3D/UI/Button.h>
#include <Urho3D/UI/Font.h>
#include <Urho3D/UI/LineEdit.h>
#include <Urho3D/UI/Menu.h>
#include <Urho3D/UI/Text.h>
#include <Urho3D/UI/ToolTip.h>
#include <Urho3D/UI/UI.h>
#include <Urho3D/UI/UIEvents.h>
#include <Urho3D/UI/Window.h>
#include <Urho3D/Urho2D/TileMap2D.h>
#include <Urho3D/Urho2D/TmxFile2D.h>
#include <Urho3D/Scene/ValueAnimation.h>
#include <Dry/Dry.h>
#include <Dry/Audio/Audio.h>
#include <Dry/Audio/Sound.h>
#include <Dry/Audio/SoundSource.h>
#include <Dry/Container/HashBase.h>
#include <Dry/Container/HashMap.h>
#include <Dry/Container/Vector.h>
#include <Dry/Core/Attribute.h>
#include <Dry/Core/CoreEvents.h>
#include <Dry/Core/Object.h>
#include <Dry/Engine/Application.h>
#include <Dry/Engine/Console.h>
#include <Dry/Engine/DebugHud.h>
#include <Dry/Engine/Engine.h>
#include <Dry/Engine/EngineDefs.h>
#include <Dry/Graphics/AnimatedModel.h>
#include <