From 92ffa6eb1dc92d0ba83bdcbe261895375a1623c7 Mon Sep 17 00:00:00 2001 From: mateuszb Date: Sat, 16 Feb 2013 15:11:38 +0000 Subject: [PATCH] * Setting up (map) editor project. It requires Qt (possibly even 5.0 since it's the version I use) so you can exclude it from compilation if you don't have Qt. --- Editor/Editor.cpp | 34 +++++++++ Editor/Editor.h | 25 +++++++ Editor/Editor.vcxproj | 158 ++++++++++++++++++++++++++++++++++++++++++ Editor/Main.cpp | 11 +++ Editor/StdInc.cpp | 1 + Editor/StdInc.h | 2 + Editor/editor.qrc | 4 ++ Editor/editor.ui | 29 ++++++++ VCMI_VS11.sln | 48 +++++++++++++ 9 files changed, 312 insertions(+) create mode 100644 Editor/Editor.cpp create mode 100644 Editor/Editor.h create mode 100644 Editor/Editor.vcxproj create mode 100644 Editor/Main.cpp create mode 100644 Editor/StdInc.cpp create mode 100644 Editor/StdInc.h create mode 100644 Editor/editor.qrc create mode 100644 Editor/editor.ui diff --git a/Editor/Editor.cpp b/Editor/Editor.cpp new file mode 100644 index 000000000..d9174c2c8 --- /dev/null +++ b/Editor/Editor.cpp @@ -0,0 +1,34 @@ +#include "StdInc.h" +#include "Editor.h" +#include "../lib/VCMI_Lib.h" +#include "../lib/VCMIDirs.h" +#include "../lib/Filesystem/CResourceLoader.h" + +Editor::Editor(QWidget *parent) + : QMainWindow(parent) +{ + logfile = new std::ofstream((GVCMIDirs.UserPath + "/VCMI_Editor_log.txt").c_str()); + console = new CConsoleHandler; + + preinitDLL(console,logfile); + loadDLLClasses(); + + ui.setupUi(this); + + createMenus(); +} + +Editor::~Editor() +{ + +} + +void Editor::createMenus() +{ + QMenu * fileMenu = menuBar()->addMenu(tr("File")); + QMenu * editMenu = menuBar()->addMenu(tr("Edit")); + QMenu * viewMenu = menuBar()->addMenu(tr("View")); + QMenu * toolsMenu = menuBar()->addMenu(tr("Tools")); + QMenu * playerMenu = menuBar()->addMenu(tr("Player")); + QMenu * helpMenu = menuBar()->addMenu(tr("Help")); +} diff --git a/Editor/Editor.h b/Editor/Editor.h new file mode 100644 index 000000000..3ca428241 --- /dev/null +++ b/Editor/Editor.h @@ -0,0 +1,25 @@ +#ifndef EDITOR_H +#define EDITOR_H + +#include +#include "ui_editor.h" + +class CConsoleHandler; + +class Editor : public QMainWindow +{ + Q_OBJECT + +public: + Editor(QWidget *parent = 0); + ~Editor(); + void createMenus(); +private: + + std::ofstream * logfile; + CConsoleHandler * console; + + Ui::EditorClass ui; +}; + +#endif // EDITOR_H diff --git a/Editor/Editor.vcxproj b/Editor/Editor.vcxproj new file mode 100644 index 000000000..a6c29b45f --- /dev/null +++ b/Editor/Editor.vcxproj @@ -0,0 +1,158 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {B12702AD-ABFB-343A-A199-8E24837244A3} + Qt4VSv1.0 + + + + Application + v110 + + + Application + v110 + + + + + + + + + + + + + + + <_ProjectFileVersion>11.0.51106.1 + + + $(SolutionDir) + + + $(SolutionDir)$(Platform)\$(Configuration)\ + + + + UNICODE;WIN32;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + false + Use + stdafx.h + $(IntDir)$(TargetName).pch + -Zm200 %(AdditionalOptions) + + + Windows + $(SolutionDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + true + VCMI_lib.lib;qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;%(AdditionalDependencies) + + + + + UNICODE;WIN32;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;%(AdditionalIncludeDirectories) + + MultiThreadedDLL + false + Use + stdafx.h + $(IntDir)$(TargetName).pch + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + false + qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;%(AdditionalDependencies) + + + + + StdInc.h + + + true + + + + + + + + + true + + + StdInc.h + + + Create + Create + StdInc.h + + + + + + $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing Editor.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../Editor.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" + $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing Editor.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" "-fstdafx.h" "-f../../Editor.h" -DUNICODE -DWIN32 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" + + + + + + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + $(QTDIR)\bin\uic.exe;%(AdditionalInputs) + Uic%27ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h;%(Outputs) + "$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)" + + + + + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp + + + + + + + + + + + \ No newline at end of file diff --git a/Editor/Main.cpp b/Editor/Main.cpp new file mode 100644 index 000000000..3bd176f13 --- /dev/null +++ b/Editor/Main.cpp @@ -0,0 +1,11 @@ +#include "StdInc.h" +#include "Editor.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + Editor w; + w.show(); + return a.exec(); +} diff --git a/Editor/StdInc.cpp b/Editor/StdInc.cpp new file mode 100644 index 000000000..b64b59be5 --- /dev/null +++ b/Editor/StdInc.cpp @@ -0,0 +1 @@ +#include "StdInc.h" diff --git a/Editor/StdInc.h b/Editor/StdInc.h new file mode 100644 index 000000000..9e83a24d8 --- /dev/null +++ b/Editor/StdInc.h @@ -0,0 +1,2 @@ +#include "../Global.h" +#include diff --git a/Editor/editor.qrc b/Editor/editor.qrc new file mode 100644 index 000000000..0c399a5b2 --- /dev/null +++ b/Editor/editor.qrc @@ -0,0 +1,4 @@ + + + + diff --git a/Editor/editor.ui b/Editor/editor.ui new file mode 100644 index 000000000..3cf11c399 --- /dev/null +++ b/Editor/editor.ui @@ -0,0 +1,29 @@ + + EditorClass + + + EditorClass + + + + 0 + 0 + 600 + 400 + + + + Editor + + + + + + + + + + + + + diff --git a/VCMI_VS11.sln b/VCMI_VS11.sln index 31764179a..c0993aa6c 100644 --- a/VCMI_VS11.sln +++ b/VCMI_VS11.sln @@ -30,12 +30,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BattleAI", "AI\BattleAI\Bat {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} = {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Editor", "Editor\Editor.vcxproj", "{B12702AD-ABFB-343A-A199-8E24837244A3}" + ProjectSection(ProjectDependencies) = postProject + {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} = {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 RD|Win32 = RD|Win32 RD|x64 = RD|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8355EBA8-65C2-44A4-BC2D-78053E1BF2D6}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -46,6 +53,10 @@ Global {8355EBA8-65C2-44A4-BC2D-78053E1BF2D6}.RD|Win32.Build.0 = RD|Win32 {8355EBA8-65C2-44A4-BC2D-78053E1BF2D6}.RD|x64.ActiveCfg = RD|x64 {8355EBA8-65C2-44A4-BC2D-78053E1BF2D6}.RD|x64.Build.0 = RD|x64 + {8355EBA8-65C2-44A4-BC2D-78053E1BF2D6}.Release|Win32.ActiveCfg = RD|Win32 + {8355EBA8-65C2-44A4-BC2D-78053E1BF2D6}.Release|Win32.Build.0 = RD|Win32 + {8355EBA8-65C2-44A4-BC2D-78053E1BF2D6}.Release|x64.ActiveCfg = RD|x64 + {8355EBA8-65C2-44A4-BC2D-78053E1BF2D6}.Release|x64.Build.0 = RD|x64 {B952FFC5-3039-4DE1-9F08-90ACDA483D8F}.Debug|Win32.ActiveCfg = Debug|Win32 {B952FFC5-3039-4DE1-9F08-90ACDA483D8F}.Debug|Win32.Build.0 = Debug|Win32 {B952FFC5-3039-4DE1-9F08-90ACDA483D8F}.Debug|x64.ActiveCfg = Debug|x64 @@ -54,6 +65,10 @@ Global {B952FFC5-3039-4DE1-9F08-90ACDA483D8F}.RD|Win32.Build.0 = RD|Win32 {B952FFC5-3039-4DE1-9F08-90ACDA483D8F}.RD|x64.ActiveCfg = RD|x64 {B952FFC5-3039-4DE1-9F08-90ACDA483D8F}.RD|x64.Build.0 = RD|x64 + {B952FFC5-3039-4DE1-9F08-90ACDA483D8F}.Release|Win32.ActiveCfg = RD|Win32 + {B952FFC5-3039-4DE1-9F08-90ACDA483D8F}.Release|Win32.Build.0 = RD|Win32 + {B952FFC5-3039-4DE1-9F08-90ACDA483D8F}.Release|x64.ActiveCfg = RD|x64 + {B952FFC5-3039-4DE1-9F08-90ACDA483D8F}.Release|x64.Build.0 = RD|x64 {8AF697C3-465E-4910-B31B-576A9ECDB309}.Debug|Win32.ActiveCfg = Debug|Win32 {8AF697C3-465E-4910-B31B-576A9ECDB309}.Debug|Win32.Build.0 = Debug|Win32 {8AF697C3-465E-4910-B31B-576A9ECDB309}.Debug|x64.ActiveCfg = Debug|x64 @@ -62,6 +77,10 @@ Global {8AF697C3-465E-4910-B31B-576A9ECDB309}.RD|Win32.Build.0 = RD|Win32 {8AF697C3-465E-4910-B31B-576A9ECDB309}.RD|x64.ActiveCfg = RD|x64 {8AF697C3-465E-4910-B31B-576A9ECDB309}.RD|x64.Build.0 = RD|x64 + {8AF697C3-465E-4910-B31B-576A9ECDB309}.Release|Win32.ActiveCfg = RD|Win32 + {8AF697C3-465E-4910-B31B-576A9ECDB309}.Release|Win32.Build.0 = RD|Win32 + {8AF697C3-465E-4910-B31B-576A9ECDB309}.Release|x64.ActiveCfg = RD|x64 + {8AF697C3-465E-4910-B31B-576A9ECDB309}.Release|x64.Build.0 = RD|x64 {15DABC90-234A-4B6B-9EEB-777C4768B82B}.Debug|Win32.ActiveCfg = Debug|Win32 {15DABC90-234A-4B6B-9EEB-777C4768B82B}.Debug|Win32.Build.0 = Debug|Win32 {15DABC90-234A-4B6B-9EEB-777C4768B82B}.Debug|x64.ActiveCfg = Debug|x64 @@ -70,6 +89,10 @@ Global {15DABC90-234A-4B6B-9EEB-777C4768B82B}.RD|Win32.Build.0 = RD|Win32 {15DABC90-234A-4B6B-9EEB-777C4768B82B}.RD|x64.ActiveCfg = RD|x64 {15DABC90-234A-4B6B-9EEB-777C4768B82B}.RD|x64.Build.0 = RD|x64 + {15DABC90-234A-4B6B-9EEB-777C4768B82B}.Release|Win32.ActiveCfg = RD|Win32 + {15DABC90-234A-4B6B-9EEB-777C4768B82B}.Release|Win32.Build.0 = RD|Win32 + {15DABC90-234A-4B6B-9EEB-777C4768B82B}.Release|x64.ActiveCfg = RD|x64 + {15DABC90-234A-4B6B-9EEB-777C4768B82B}.Release|x64.Build.0 = RD|x64 {8F202F43-106D-4F63-AD9D-B1D43E803E8C}.Debug|Win32.ActiveCfg = Debug|Win32 {8F202F43-106D-4F63-AD9D-B1D43E803E8C}.Debug|Win32.Build.0 = Debug|Win32 {8F202F43-106D-4F63-AD9D-B1D43E803E8C}.Debug|x64.ActiveCfg = Debug|x64 @@ -78,18 +101,30 @@ Global {8F202F43-106D-4F63-AD9D-B1D43E803E8C}.RD|Win32.Build.0 = RD|Win32 {8F202F43-106D-4F63-AD9D-B1D43E803E8C}.RD|x64.ActiveCfg = RD|x64 {8F202F43-106D-4F63-AD9D-B1D43E803E8C}.RD|x64.Build.0 = RD|x64 + {8F202F43-106D-4F63-AD9D-B1D43E803E8C}.Release|Win32.ActiveCfg = RD|Win32 + {8F202F43-106D-4F63-AD9D-B1D43E803E8C}.Release|Win32.Build.0 = RD|Win32 + {8F202F43-106D-4F63-AD9D-B1D43E803E8C}.Release|x64.ActiveCfg = RD|x64 + {8F202F43-106D-4F63-AD9D-B1D43E803E8C}.Release|x64.Build.0 = RD|x64 {276C3DB0-7A6B-4417-8E5C-322B08633AAC}.Debug|Win32.ActiveCfg = Debug|Win32 {276C3DB0-7A6B-4417-8E5C-322B08633AAC}.Debug|Win32.Build.0 = Debug|Win32 {276C3DB0-7A6B-4417-8E5C-322B08633AAC}.Debug|x64.ActiveCfg = Debug|Win32 {276C3DB0-7A6B-4417-8E5C-322B08633AAC}.RD|Win32.ActiveCfg = RD|Win32 {276C3DB0-7A6B-4417-8E5C-322B08633AAC}.RD|Win32.Build.0 = RD|Win32 {276C3DB0-7A6B-4417-8E5C-322B08633AAC}.RD|x64.ActiveCfg = RD|Win32 + {276C3DB0-7A6B-4417-8E5C-322B08633AAC}.Release|Win32.ActiveCfg = RD|Win32 + {276C3DB0-7A6B-4417-8E5C-322B08633AAC}.Release|Win32.Build.0 = RD|Win32 + {276C3DB0-7A6B-4417-8E5C-322B08633AAC}.Release|x64.ActiveCfg = RD|x64 + {276C3DB0-7A6B-4417-8E5C-322B08633AAC}.Release|x64.Build.0 = RD|x64 {D15B34EC-A32C-4968-9B0B-66998B579364}.Debug|Win32.ActiveCfg = Debug|Win32 {D15B34EC-A32C-4968-9B0B-66998B579364}.Debug|Win32.Build.0 = Debug|Win32 {D15B34EC-A32C-4968-9B0B-66998B579364}.Debug|x64.ActiveCfg = Debug|Win32 {D15B34EC-A32C-4968-9B0B-66998B579364}.RD|Win32.ActiveCfg = RD|Win32 {D15B34EC-A32C-4968-9B0B-66998B579364}.RD|Win32.Build.0 = RD|Win32 {D15B34EC-A32C-4968-9B0B-66998B579364}.RD|x64.ActiveCfg = RD|Win32 + {D15B34EC-A32C-4968-9B0B-66998B579364}.Release|Win32.ActiveCfg = RD|Win32 + {D15B34EC-A32C-4968-9B0B-66998B579364}.Release|Win32.Build.0 = RD|Win32 + {D15B34EC-A32C-4968-9B0B-66998B579364}.Release|x64.ActiveCfg = RD|x64 + {D15B34EC-A32C-4968-9B0B-66998B579364}.Release|x64.Build.0 = RD|x64 {C0300513-E845-43B4-9A4F-E8817EAEF57C}.Debug|Win32.ActiveCfg = Debug|Win32 {C0300513-E845-43B4-9A4F-E8817EAEF57C}.Debug|Win32.Build.0 = Debug|Win32 {C0300513-E845-43B4-9A4F-E8817EAEF57C}.Debug|x64.ActiveCfg = Debug|x64 @@ -98,6 +133,19 @@ Global {C0300513-E845-43B4-9A4F-E8817EAEF57C}.RD|Win32.Build.0 = RD|Win32 {C0300513-E845-43B4-9A4F-E8817EAEF57C}.RD|x64.ActiveCfg = RD|x64 {C0300513-E845-43B4-9A4F-E8817EAEF57C}.RD|x64.Build.0 = RD|x64 + {C0300513-E845-43B4-9A4F-E8817EAEF57C}.Release|Win32.ActiveCfg = RD|Win32 + {C0300513-E845-43B4-9A4F-E8817EAEF57C}.Release|Win32.Build.0 = RD|Win32 + {C0300513-E845-43B4-9A4F-E8817EAEF57C}.Release|x64.ActiveCfg = RD|x64 + {C0300513-E845-43B4-9A4F-E8817EAEF57C}.Release|x64.Build.0 = RD|x64 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|Win32.ActiveCfg = Debug|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|Win32.Build.0 = Debug|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.ActiveCfg = Debug|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.RD|Win32.ActiveCfg = Release|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.RD|Win32.Build.0 = Release|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.RD|x64.ActiveCfg = Release|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|Win32.ActiveCfg = Release|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|Win32.Build.0 = Release|Win32 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE