aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/tools')
-rw-r--r--src/others/irrlicht-1.8.1/tools/FileToHeader/FileToHeader.cbp48
-rw-r--r--src/others/irrlicht-1.8.1/tools/FileToHeader/Makefile35
-rw-r--r--src/others/irrlicht-1.8.1/tools/FileToHeader/main.cpp175
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttribute.h169
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.cpp120
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.h54
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h68
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIColorAttribute.h179
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h59
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.cpp120
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.h53
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.cpp356
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.h88
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.cpp927
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.h168
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEnumAttribute.h114
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.cpp340
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.h128
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h70
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureAttribute.h140
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.cpp336
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.h88
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.cpp95
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.h73
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/EGUIEditTypes.h61
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.sln20
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.vcproj295
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.sln20
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.vcproj293
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj213
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj.filters88
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj217
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj.filters88
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/GUIEditor_gcc.cbp77
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/Makefile43
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/main.cpp76
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CFontTool.cpp801
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CFontTool.h78
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CVectorFontTool.h1199
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/Makefile38
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v8.sln20
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v8.vcproj201
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v9.sln20
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v9.vcproj202
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc10.sln20
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc10.vcxproj203
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc11.sln20
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc11.vcxproj207
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/main.cpp493
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/oldFontTool/source.zipbin0 -> 37849 bytes
-rw-r--r--src/others/irrlicht-1.8.1/tools/IrrFontTool/readme.txt13
-rw-r--r--src/others/irrlicht-1.8.1/tools/MeshConverter/Makefile38
-rw-r--r--src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter.cbp54
-rw-r--r--src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_v9.vcproj187
-rw-r--r--src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_vc10.vcxproj192
-rw-r--r--src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_vc11.vcxproj196
-rw-r--r--src/others/irrlicht-1.8.1/tools/MeshConverter/main.cpp108
-rw-r--r--src/others/irrlicht-1.8.1/tools/irrEdit/irrEdit.jpgbin0 -> 41602 bytes
-rw-r--r--src/others/irrlicht-1.8.1/tools/irrEdit/irrEdit.txt7
59 files changed, 9791 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/tools/FileToHeader/FileToHeader.cbp b/src/others/irrlicht-1.8.1/tools/FileToHeader/FileToHeader.cbp
new file mode 100644
index 0000000..e6c1a2d
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/FileToHeader/FileToHeader.cbp
@@ -0,0 +1,48 @@
1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2<CodeBlocks_project_file>
3 <FileVersion major="1" minor="6" />
4 <Project>
5 <Option title="FileToHeader" />
6 <Option pch_mode="0" />
7 <Option compiler="gcc" />
8 <Build>
9 <Target title="Linux">
10 <Option platforms="Unix;" />
11 <Option output="..\..\bin\Linux\FileToHeader" prefix_auto="0" extension_auto="0" />
12 <Option type="1" />
13 <Option compiler="gcc" />
14 <Compiler>
15 <Add option="-g" />
16 <Add option="-D_IRR_STATIC_LIB_" />
17 </Compiler>
18 <Linker>
19 <Add directory="..\..\lib\Linux" />
20 </Linker>
21 </Target>
22 <Target title="Windows">
23 <Option platforms="Windows;" />
24 <Option output="..\..\bin\Win32-gcc\FileToHeader" prefix_auto="0" extension_auto="1" />
25 <Option type="1" />
26 <Option compiler="gcc" />
27 <Compiler>
28 <Add option="-g" />
29 </Compiler>
30 <Linker>
31 <Add directory="..\..\lib\Win32-gcc" />
32 </Linker>
33 </Target>
34 </Build>
35 <VirtualTargets>
36 <Add alias="All" targets="Windows;Linux;" />
37 </VirtualTargets>
38 <Compiler>
39 <Add option="-g" />
40 </Compiler>
41 <Unit filename="main.cpp" />
42 <Extensions>
43 <code_completion />
44 <debugger />
45 <envvars />
46 </Extensions>
47 </Project>
48</CodeBlocks_project_file>
diff --git a/src/others/irrlicht-1.8.1/tools/FileToHeader/Makefile b/src/others/irrlicht-1.8.1/tools/FileToHeader/Makefile
new file mode 100644
index 0000000..e9cd818
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/FileToHeader/Makefile
@@ -0,0 +1,35 @@
1# Makefile for FileToHeader
2Target = FileToHeader
3Sources = main.cpp
4
5# general compiler settings
6CPPFLAGS = -I../../include
7CXXFLAGS = -O3 -ffast-math -Wall
8#CXXFLAGS = -g -Wall
9
10#default target is Linux
11all: all_linux
12
13ifeq ($(HOSTTYPE), x86_64)
14LIBSELECT=64
15endif
16
17# target specific settings
18all_linux clean_linux: SYSTEM=Linux
19all_win32: LDFLAGS = -L../../lib/Win32-gcc
20all_win32 clean_win32: SYSTEM=Win32-gcc
21all_win32 clean_win32: SUF=.exe
22# name of the binary - only valid for targets which set SYSTEM
23DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
24
25all_linux all_win32:
26 $(warning Building...)
27 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
28
29clean: clean_linux clean_win32
30 $(warning Cleaning...)
31
32clean_linux clean_win32:
33 @$(RM) $(DESTPATH)
34
35.PHONY: all all_win32 clean clean_linux clean_win32
diff --git a/src/others/irrlicht-1.8.1/tools/FileToHeader/main.cpp b/src/others/irrlicht-1.8.1/tools/FileToHeader/main.cpp
new file mode 100644
index 0000000..b3cc7a7
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/FileToHeader/main.cpp
@@ -0,0 +1,175 @@
1// Copyright (C) 2012 Gaz Davidson
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5/***
6 This tool creates a .h file from a given input file by encoding it into a C string,
7 allowing you to build your resources directly into your binaries, just like Irrlicht's
8 built-in font.
9
10 To distribute your app as a single executable file of minimal size:
11
12 1. Put all your resources into a single directory and add it to Irrlicht's filesystem
13 as a folder through IFileSystem::addArchive. Develop and test your app as usual.
14 2. Open IrrCompileConfig.h and comment out all the options that your app does not use.
15 This will reduce the size of the Irrlicht library considerably.
16 * You should remove the D3D video drivers, because they rely on external DLLs.
17 * You should keep either the TAR or ZIP archive loader, used in step 6.
18 * If you remove the JPEG loader, you don't have to say you use JPEG code in your
19 documentation.
20 3. Recompile Irrlicht as a static library, editing the IRR_STATIC_LIB line in
21 IrrCompileConfig.h.
22 The next time you compile your application it will take a while longer, but
23 Irrlicht will be built into your binary.
24 4. TAR or ZIP your resource directory using your favourite archiving tool (ie 7zip).
25 * If you chose ZIP but compiled without zlib, don't compress this archive or it
26 won't open.
27 5. Run this tool to convert your resource file into a .h file, like so:
28 FileToHeader res.zip > EmbeddedResources.h
29 6. Add the .h file to your project, create the embedded read file then mount as a
30 ZIP or TAR archive instead of the folder, like so:
31 io::IReadFile *f = io::createEmbeddedFile(device->getFileSystem(), "res.zip");
32 device->getFileSystem()->addFileArchive(f);
33 archive->drop();
34 7. Recompile your app.
35 * If you use Microsoft's compiler, make sure your CRT (common run-time) is
36 the static library version, otherwise you'll have a dependency on the CRT DLLs.
37 Your binary should now be completely portable; you can distribute just the exe file.
38 8. Optional: Use UPX (upx.sf.net) to compress your binary.
39*/
40
41#include <iostream>
42#include <fstream>
43#include <sstream>
44
45using namespace std;
46
47int main(int argc, char* argv[])
48{
49 if (argc < 2)
50 {
51 // print usage
52 cerr << "You must to specify at least one input file" << endl;
53 cerr << "usage: " << argv[0] << "<file1> [file2...]" << endl;
54 cerr << "outputs a header file to stdout, so for example use";
55 return 1;
56 }
57
58 int i = 1;
59
60 // write file header
61 cout << "// File made by FileToHeader, part of the Irrlicht Engine" << endl
62 << endl
63 << "#ifndef _EMBEDDED_FILES_H_INCLUDED_" << endl
64 << "#define _EMBEDDED_FILES_H_INCLUDED_" << endl
65 << endl
66 << "#include \"irrTypes.h\"" << endl
67 << "#include \"IReadFile.h\"" << endl
68 << "#include \"IFileSystem.h\"" << endl
69 << endl
70 << "namespace irr" << endl
71 << "{" << endl
72 << "namespace io" << endl
73 << "{" << endl
74 << endl
75 << " const c8* EmbeddedFileData[] = " << endl
76 << " {" << endl;
77
78 // store sizes and file names
79 stringstream sizes;
80 stringstream names;
81 sizes << "const u32 EmbeddedFileSizes[] = {";
82 names << "const c8* EmbeddedFileNames[] = {";
83 int fileCount = 0;
84
85 // char to hex digit table, probably doesn't help for speed due to fstream. better than using sprintf though
86 char hextable[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
87
88 while (i < argc)
89 {
90 // open and seek to end of file
91 ifstream input;
92 input.open(argv[i], ios::in | ios::binary | ios::ate);
93
94 if (input.is_open())
95 {
96 int size = input.tellg();
97 input.seekg(0, ios::beg);
98 // read the file into RAM
99 char *entireFile = new char[size];
100 input.read(entireFile, size);
101
102 if (fileCount)
103 {
104 sizes << ", ";
105 names << ", ";
106 cout << "," << endl;
107 }
108
109 // save file size and name
110 sizes << size;
111 names << '"' << argv[i] << '"';
112
113 // write the file data
114 cout << " \"";
115 for (int count=0; count < size; ++count)
116 {
117 if (count && (count % 16) == 0)
118 cout << "\"" << endl << " \"";
119
120 cout << "\\x" << hextable[(entireFile[count] >> 4) & 0xF] << hextable[entireFile[count] & 0x0F];
121 }
122 cout << "\"";
123
124 delete [] entireFile;
125 //
126 input.close();
127
128 fileCount++;
129 }
130 else
131 {
132 cerr << "Failed to open file: " << argv[i] << endl;
133 }
134
135 ++i;
136 }
137
138 // close binary file list and write file metadata
139 cout << endl
140 << " , 0};" << endl
141 << endl
142 << " const u32 EmbeddedFileCount = " << fileCount << ";" << endl
143 << " " << sizes.str() << "};" << endl
144 << " " << names.str() << "};" << endl
145 << endl;
146
147 // write functions to create embedded IReadFiles
148 cout << " IReadFile* createEmbeddedFile(IFileSystem *fs, u32 index)" << endl
149 << " {" << endl
150 << " if (EmbeddedFileCount < index)" << endl
151 << " return 0;" << endl
152 << endl
153 << " return fs->createMemoryReadFile((void*)EmbeddedFileData[index], " << endl
154 << " EmbeddedFileSizes[index], EmbeddedFileNames[index]);" << endl
155 << " }" << endl
156 << endl
157 << " IReadFile* createEmbeddedFile(IFileSystem *fs, path filename)" << endl
158 << " {" << endl
159 << " for (u32 i=0; i < EmbeddedFileCount; ++i)" << endl
160 << " if (filename == EmbeddedFileNames[i])" << endl
161 << " return createEmbeddedFile(fs, i);" << endl
162 << endl
163 << " return 0;" << endl
164 << " }" << endl
165 << endl;
166
167 // write footer
168 cout << "} // namespace io" << endl
169 << "} // namespace irr" << endl
170 << endl
171 << "#endif // _EMBEDDED_FILES_H_INCLUDED_" << endl;
172
173 return 0;
174}
175
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttribute.h
new file mode 100644
index 0000000..0585498
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttribute.h
@@ -0,0 +1,169 @@
1/*
2 This base class is used by the Attribute editor for making your own attribute types.
3
4 The attribute editor will try and create an attribute called "AttribType_attribute",
5 and if it fails, it will create a "string_attribute".
6
7*/
8
9#ifndef __C_GUI_ATTRIBUTE_H_INCLUDED__
10#define __C_GUI_ATTRIBUTE_H_INCLUDED__
11
12#include "IGUIElement.h"
13#include "IGUIEnvironment.h"
14#include "IGUIFont.h"
15#include "IGUIStaticText.h"
16#include "IAttributes.h"
17#include "CGUIEditWorkspace.h"
18
19namespace irr
20{
21
22namespace gui
23{
24
25 const u32 ATTRIBEDIT_ATTRIB_CHANGED=MAKE_IRR_ID('A','T','T','R');
26
27 class CGUIAttribute : public IGUIElement
28 {
29 public:
30 //! constructor
31 CGUIAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
32 IGUIElement(EGUIET_ELEMENT, environment, parent, -1, core::rect<s32>(0, 0, 100, 100) ),
33 AttribName(0), Attribs(0), Index(0), MyParentID(myParentID)
34 {
35
36 #ifdef _DEBUG
37 setDebugName("CGUIAttribute");
38 #endif
39
40 AttribName = environment->addStaticText(0,
41 core::rect<s32>(0, 0,
42 100, Environment->getSkin()->getFont()->getDimension(L"A").Height),
43 false, false, this, -1, false);
44 AttribName->grab();
45 AttribName->setSubElement(true);
46 AttribName->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
47 }
48
49 virtual ~CGUIAttribute()
50 {
51 if (Attribs)
52 Attribs->drop();
53 if (AttribName)
54 AttribName->drop();
55 }
56
57 virtual bool OnEvent(const SEvent &e)
58 {
59 if (IsEnabled)
60 {
61 switch (e.EventType)
62 {
63 case EET_GUI_EVENT:
64 switch (e.GUIEvent.EventType)
65 {
66 case EGET_ELEMENT_FOCUSED:
67 if (Parent && isMyChild(e.GUIEvent.Caller))
68 Parent->bringToFront(this);
69 break;
70 case EGET_ELEMENT_HOVERED:
71 case EGET_ELEMENT_LEFT:
72 return IGUIElement::OnEvent(e);
73 case EGET_ELEMENT_FOCUS_LOST:
74 updateAttrib();
75 return IGUIElement::OnEvent(e);
76 default:
77 return updateAttrib();
78 }
79 break;
80 case EET_KEY_INPUT_EVENT:
81 return true;
82 default:
83 break;
84 }
85 }
86
87 return IGUIElement::OnEvent(e);
88 }
89
90 //! sets the attribute to use
91 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
92 {
93 if (Attribs)
94 Attribs->drop();
95 Attribs = attribs;
96 if (Attribs)
97 Attribs->grab();
98 Index = attribIndex;
99
100 core::stringw name(attribs->getAttributeName(attribIndex));
101 name += L" (";
102 name += attribs->getAttributeTypeString(attribIndex);
103 name += L")";
104 AttribName->setText(name.c_str());
105
106 core::rect<s32> r = Parent->getAbsolutePosition();
107 core::rect<s32> r2(0, 5,
108 r.getWidth(), Environment->getSkin()->getFont()->getDimension(L"A").Height + 10 );
109
110 AttribName->setRelativePosition(r2);
111
112 // get minimum height
113 s32 y=0;
114 core::list<IGUIElement*>::Iterator it = Children.begin();
115 for (; it != Children.end(); ++it)
116 {
117 if (y < (*it)->getRelativePosition().LowerRightCorner.Y)
118 y = (*it)->getRelativePosition().LowerRightCorner.Y;
119 }
120 setMinSize( core::dimension2du(0, y+5));
121
122 updateAttrib(false);
123 }
124
125 //! sets the parent ID, for identifying where events came from
126 void setParentID(s32 parentID)
127 {
128 MyParentID = parentID;
129 }
130
131 //! save the attribute and possibly post the event to its parent
132 virtual bool updateAttrib(bool sendEvent=true)
133 {
134 if (Attribs && IsEnabled && sendEvent)
135 {
136 // build event and pass to parent
137 SEvent event;
138 event.EventType = (EEVENT_TYPE)ATTRIBEDIT_ATTRIB_CHANGED;
139 event.UserEvent.UserData1 = MyParentID;
140 event.UserEvent.UserData2 = Index;
141 return Parent->OnEvent(event);
142 }
143
144 return true;
145 }
146
147 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0)
148 {
149 IGUIElement::serializeAttributes(out, options);
150 }
151
152 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
153 {
154 IGUIElement::deserializeAttributes(in, options);
155 if (AttribName)
156 AttribName->setText(Text.c_str());
157 }
158
159 protected:
160 IGUIStaticText* AttribName;
161 io::IAttributes* Attribs;
162 u32 Index;
163 s32 MyParentID;
164 };
165
166} // namespace gui
167} // namespace irr
168
169#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.cpp
new file mode 100644
index 0000000..45913b6
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.cpp
@@ -0,0 +1,120 @@
1
2#include "CGUIAttributeEditor.h"
3#include "IGUIEnvironment.h"
4#include "IFileSystem.h"
5#include "IVideoDriver.h"
6#include "IAttributes.h"
7#include "IGUIFont.h"
8#include "IGUIScrollBar.h"
9#include "CGUIEditWorkspace.h"
10#include "CGUIAttribute.h"
11#include "CGUIStringAttribute.h"
12
13namespace irr
14{
15namespace gui
16{
17
18using namespace core;
19using namespace io;
20
21CGUIAttributeEditor::CGUIAttributeEditor(IGUIEnvironment* environment, s32 id, IGUIElement *parent) :
22 CGUIPanel(environment, parent, id, rect<s32>(0, 0, 100, 100)),
23 Attribs(0), Panel(0)
24{
25 #ifdef _DEBUG
26 setDebugName("CGUIAttributeEditor");
27 #endif
28
29 // create attributes
30 Attribs = environment->getFileSystem()->createEmptyAttributes(Environment->getVideoDriver());
31
32 calculateClientArea();
33 resizeInnerPane();
34
35 // refresh attrib list
36 refreshAttribs();
37
38 IGUIScrollBar* sb = getVScrollBar();
39 core::rect<s32> r = sb->getRelativePosition();
40 r.LowerRightCorner.Y -= 16;
41 sb->setRelativePosition(r);
42}
43
44CGUIAttributeEditor::~CGUIAttributeEditor()
45{
46 for (u32 i=0; i<AttribList.size(); ++i)
47 {
48 AttribList[i]->remove();
49 AttribList[i]->drop();
50 }
51 AttribList.clear();
52
53 Attribs->drop();
54}
55
56
57IAttributes* CGUIAttributeEditor::getAttribs()
58{
59 return Attribs;
60}
61
62void CGUIAttributeEditor::refreshAttribs()
63{
64 // clear the attribute list
65 u32 i;
66 for (i=0; i<AttribList.size(); ++i)
67 {
68 AttribList[i]->remove();
69 AttribList[i]->drop();
70 }
71 AttribList.clear();
72
73 position2di top(10, 5);
74 rect<s32> r(top.X, top.Y,
75 getClientArea().getWidth() - 10,
76 5 + Environment->getSkin()->getFont()->getDimension(L"A").Height);
77
78 // add attribute elements
79 u32 c = Attribs->getAttributeCount();
80 for (i=0; i<c; ++i)
81 {
82
83 // try to create attribute
84 stringc str = Attribs->getAttributeTypeString(i);
85 str += "_attribute";
86 CGUIAttribute* n = (CGUIAttribute*)Environment->addGUIElement(str.c_str(), 0);
87
88 // if this doesn't exist, use a string editor
89 if (!n)
90 n = (CGUIAttribute*)Environment->addGUIElement("string_attribute", 0);
91
92 if (n)
93 {
94 AttribList.push_back(n);
95 n->setParentID(getID());
96 n->grab();
97 }
98
99 // We can't set "this" as parent above as we need functionality
100 // of the overloaded addChild which isn't called in the constructor.
101 // (that's a general Irrlicht messup with too fat constructors)
102 addChild(n);
103
104 AttribList[i]->setSubElement(true);
105 AttribList[i]->setRelativePosition(r);
106 AttribList[i]->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
107 AttribList[i]->setAttrib(Attribs, i);
108 r += position2di(0, AttribList[i]->getRelativePosition().getHeight() + 5);
109 }
110}
111
112void CGUIAttributeEditor::updateAttribs()
113{
114 for (u32 i=0; i<AttribList.size(); ++i)
115 AttribList[i]->updateAttrib(false);
116}
117
118} // namespace gui
119} // namespace irr
120
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.h
new file mode 100644
index 0000000..0bcdab5
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIAttributeEditor.h
@@ -0,0 +1,54 @@
1#ifndef __C_GUI_ATTRIBUTE_EDITOR_H_INCLUDED__
2#define __C_GUI_ATTRIBUTE_EDITOR_H_INCLUDED__
3
4#include "IGUIElement.h"
5#include "CGUIPanel.h"
6#include "irrArray.h"
7#include "IAttributes.h"
8#include "EGUIEditTypes.h"
9
10namespace irr
11{
12namespace gui
13{
14
15 class CGUIAttribute;
16
17
18 class CGUIAttributeEditor : public CGUIPanel
19 {
20 public:
21
22 //! constructor
23 CGUIAttributeEditor(IGUIEnvironment* environment, s32 id, IGUIElement *parent=0);
24
25 //! destructor
26 ~CGUIAttributeEditor();
27
28 // gets the current attributes list
29 virtual io::IAttributes* getAttribs();
30
31 // update the attribute list after making a change
32 void refreshAttribs();
33
34 // save the attributes
35 void updateAttribs();
36
37 //! Returns the type name of the gui element.
38 virtual const c8* getTypeName() const
39 {
40 return GUIEditElementTypeNames[EGUIEDIT_ATTRIBUTEEDITOR];
41 }
42
43 private:
44
45 core::array<CGUIAttribute*> AttribList; // attributes editing controls
46 io::IAttributes* Attribs; // current attributes
47 CGUIPanel* Panel;
48 };
49
50} // end namespace gui
51} // end namespace irr
52
53#endif // __C_GUI_ATTRIBUTE_EDITOR_H_INCLUDED__
54
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h
new file mode 100644
index 0000000..b0521db
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h
@@ -0,0 +1,68 @@
1#ifndef __C_GUI_BOOL_ATTRIBUTE_H_INCLUDED__
2#define __C_GUI_BOOL_ATTRIBUTE_H_INCLUDED__
3
4#include "CGUIAttribute.h"
5#include "IGUICheckBox.h"
6#include "EGUIEditTypes.h"
7
8namespace irr
9{
10namespace gui
11{
12
13 class CGUIBoolAttribute : public CGUIAttribute
14 {
15 public:
16 //
17 CGUIBoolAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
18 CGUIAttribute(environment, parent, myParentID), AttribCheckBox(0)
19 {
20
21 core::rect<s32> r = getAbsolutePosition();
22 core::rect<s32> r2(0, Environment->getSkin()->getFont()->getDimension(L"A").Height + 10,
23 r.getWidth() - 5,
24 Environment->getSkin()->getFont()->getDimension(L"A").Height*2 + 15 );
25
26 AttribCheckBox = environment->addCheckBox(false, r2, this);
27 AttribCheckBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
28 AttribCheckBox->setSubElement(true);
29 AttribCheckBox->grab();
30 }
31
32 virtual ~CGUIBoolAttribute()
33 {
34 if (AttribCheckBox)
35 AttribCheckBox->drop();
36 }
37
38 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
39 {
40 AttribCheckBox->setChecked(attribs->getAttributeAsBool(attribIndex));
41 CGUIAttribute::setAttrib(attribs, attribIndex);
42 }
43
44 // save the attribute and possibly post the event to its parent
45 virtual bool updateAttrib(bool sendEvent=true)
46 {
47 if (!Attribs)
48 return true;
49
50 Attribs->setAttribute(Index, AttribCheckBox->isChecked());
51
52 return CGUIAttribute::updateAttrib(sendEvent);
53 }
54
55 //! Returns the type name of the gui element.
56 virtual const c8* getTypeName() const
57 {
58 return GUIEditElementTypeNames[EGUIEDIT_BOOLATTRIBUTE];
59 }
60
61 private:
62 IGUICheckBox* AttribCheckBox;
63 };
64
65} // namespace gui
66} // namespace irr
67
68#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIColorAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIColorAttribute.h
new file mode 100644
index 0000000..e0c5212
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIColorAttribute.h
@@ -0,0 +1,179 @@
1#ifndef __C_GUI_COLOR_ATTRIBUTE_H_INCLUDED__
2#define __C_GUI_COLOR_ATTRIBUTE_H_INCLUDED__
3
4#include "CGUIAttribute.h"
5#include "IGUIStaticText.h"
6#include "IGUIScrollBar.h"
7#include "IGUITabControl.h"
8#include "EGUIEditTypes.h"
9
10namespace irr
11{
12namespace gui
13{
14 class CGUIColorAttribute : public CGUIAttribute
15 {
16 public:
17 //
18 CGUIColorAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
19 CGUIAttribute(environment, parent, myParentID),
20 AttribSliderA(0), AttribSliderR(0), AttribSliderG(0), AttribSliderB(0),
21 AttribEditBox(0), AttribColor(0)
22 {
23 s32 fh = Environment->getSkin()->getFont()->getDimension(L"A").Height;
24
25 core::rect<s32> r0(getAbsolutePosition()),
26 r2(0, fh + 5, r0.getWidth() - 5, fh*2 + 10 ),
27 r3(r2),
28 r4(r2.getWidth() - 20, 3, r2.getWidth() - 3, r2.getHeight()-3);
29
30 AttribColor = Environment->addTab(r4, this, 0);
31 AttribColor->grab();
32 AttribColor->setDrawBackground(true);
33 AttribColor->setSubElement(true);
34 AttribColor->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
35
36 s32 h=2;
37 r2 += core::position2di(0, h*4 + Environment->getSkin()->getSize(EGDS_WINDOW_BUTTON_WIDTH)*2);
38 r3.LowerRightCorner.Y = r3.UpperLeftCorner.Y + Environment->getSkin()->getSize(EGDS_WINDOW_BUTTON_WIDTH)/2;
39
40 AttribSliderA = environment->addScrollBar(true, r3, this, -1);
41 AttribSliderA->setMax(255);
42 AttribSliderA->grab();
43 AttribSliderA->setSubElement(true);
44 AttribSliderA->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
45 r3 += core::position2di(0, r3.getHeight()+h);
46 AttribSliderR = environment->addScrollBar(true, r3, this, -1);
47 AttribSliderR->setMax(255);
48 AttribSliderR->grab();
49 AttribSliderR->setSubElement(true);
50 AttribSliderR->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
51 r3 += core::position2di(0, r3.getHeight()+h);
52 AttribSliderG = environment->addScrollBar(true, r3, this, -1);
53 AttribSliderG->setMax(255);
54 AttribSliderG->grab();
55 AttribSliderG->setSubElement(true);
56 AttribSliderG->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
57 r3 += core::position2di(0, r3.getHeight()+h);
58 AttribSliderB = environment->addScrollBar(true, r3, this, -1);
59 AttribSliderB->setMax(255);
60 AttribSliderB->grab();
61 AttribSliderB->setSubElement(true);
62 AttribSliderB->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
63
64 // add editbox
65 AttribEditBox = environment->addEditBox(
66 L"",
67 r2,
68 true, this, -1);
69 AttribEditBox->grab();
70 AttribEditBox->setSubElement(true);
71 AttribEditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
72 }
73
74 virtual ~CGUIColorAttribute()
75 {
76 if (AttribSliderA)
77 AttribSliderA->drop();
78 if (AttribSliderR)
79 AttribSliderR->drop();
80 if (AttribSliderG)
81 AttribSliderG->drop();
82 if (AttribSliderB)
83 AttribSliderB->drop();
84 if (AttribEditBox)
85 AttribEditBox->drop();
86 if (AttribColor)
87 AttribColor->drop();
88 }
89
90 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
91 {
92 video::SColor col = attribs->getAttributeAsColor(attribIndex);
93
94 AttribSliderA->setPos(col.getAlpha());
95 AttribSliderR->setPos(col.getRed());
96 AttribSliderG->setPos(col.getGreen());
97 AttribSliderB->setPos(col.getBlue());
98 AttribEditBox->setText( attribs->getAttributeAsStringW(attribIndex).c_str() );
99 AttribColor->setBackgroundColor(col);
100
101 CGUIAttribute::setAttrib(attribs, attribIndex);
102 }
103
104 virtual bool OnEvent(const SEvent &e)
105 {
106 switch (e.EventType)
107 {
108
109 case EET_GUI_EVENT:
110 switch (e.GUIEvent.EventType)
111 {
112 case EGET_EDITBOX_ENTER:
113 case EGET_ELEMENT_FOCUS_LOST:
114 if (e.GUIEvent.Caller == AttribEditBox)
115 {
116 // update scrollbars from textbox
117 Attribs->setAttribute(Index, AttribEditBox->getText());
118 video::SColor col = Attribs->getAttributeAsColor(Index);
119 AttribSliderA->setPos(col.getAlpha());
120 AttribSliderR->setPos(col.getRed());
121 AttribSliderG->setPos(col.getGreen());
122 AttribSliderB->setPos(col.getBlue());
123 // update colour
124 AttribColor->setBackgroundColor(col);
125 }
126 break;
127 case EGET_SCROLL_BAR_CHANGED:
128 {
129 // update editbox from scrollbars
130 video::SColor col( AttribSliderA->getPos(), AttribSliderR->getPos(),
131 AttribSliderG->getPos(), AttribSliderB->getPos());
132
133 Attribs->setAttribute(Index, col);
134 AttribEditBox->setText( Attribs->getAttributeAsStringW(Index).c_str());
135 // update colour
136 AttribColor->setBackgroundColor(col);
137 }
138 return updateAttrib();
139 default:
140 break;
141 }
142 break;
143 default:
144 break;
145 }
146 return CGUIAttribute::OnEvent(e);
147 }
148
149 // save the attribute and possibly post the event to its parent
150 virtual bool updateAttrib(bool sendEvent=true)
151 {
152 if (!Attribs)
153 return true;
154
155 Attribs->setAttribute(Index, AttribEditBox->getText());
156 AttribEditBox->setText(Attribs->getAttributeAsStringW(Index).c_str());
157 return CGUIAttribute::updateAttrib(sendEvent);
158 }
159
160 //! Returns the type name of the gui element.
161 virtual const c8* getTypeName() const
162 {
163 return GUIEditElementTypeNames[EGUIEDIT_COLORATTRIBUTE];
164 }
165
166 private:
167 IGUIScrollBar* AttribSliderA;
168 IGUIScrollBar* AttribSliderR;
169 IGUIScrollBar* AttribSliderG;
170 IGUIScrollBar* AttribSliderB;
171 IGUIEditBox* AttribEditBox;
172 IGUITab* AttribColor;
173 };
174
175} // namespace gui
176} // namespace irr
177
178#endif
179
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h
new file mode 100644
index 0000000..635501a
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h
@@ -0,0 +1,59 @@
1/*
2 This is a custom editor for stubbing problematic elements out,
3 for example elements which include modal screens
4*/
5
6#ifndef __C_GUI_DUMMY_EDITOR_STUB_H_INCLUDED__
7#define __C_GUI_DUMMY_EDITOR_STUB_H_INCLUDED__
8
9#include "IGUIElement.h"
10#include "IGUIEnvironment.h"
11#include "IGUIStaticText.h"
12
13namespace irr
14{
15
16namespace gui
17{
18 class CGUIDummyEditorStub : public IGUIElement
19 {
20 public:
21 //! constructor
22 CGUIDummyEditorStub(IGUIEnvironment* environment, IGUIElement *parent, const char *text) :
23 IGUIElement(EGUIET_ELEMENT, environment, parent, -1, core::rect<s32>(0, 0, 100, 100) ),
24 TextBox(0), TypeName(text)
25 {
26
27 #ifdef _DEBUG
28 setDebugName("CGUIDummyEditorStub");
29 #endif
30
31 core::dimension2du d = Environment->getSkin()->getFont()->getDimension(L"A");
32 s32 h = d.Height / 2;
33 s32 w = d.Width / 2;
34
35 TextBox = environment->addStaticText(core::stringw(text).c_str(),
36 core::rect<s32>(50-w, 50-h, 50+w, 50+h),
37 false, false, this, -1, false);
38 TextBox->grab();
39 TextBox->setSubElement(true);
40 TextBox->setAlignment(EGUIA_CENTER, EGUIA_CENTER, EGUIA_CENTER, EGUIA_CENTER);
41 }
42
43 virtual ~CGUIDummyEditorStub()
44 {
45 if (TextBox)
46 TextBox->drop();
47 }
48 virtual const c8* getTypeName() const { return TypeName.c_str(); }
49
50 protected:
51 IGUIStaticText* TextBox;
52 core::stringc TypeName;
53
54 };
55
56} // namespace gui
57} // namespace irr
58
59#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.cpp
new file mode 100644
index 0000000..9552745
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.cpp
@@ -0,0 +1,120 @@
1#include "CGUIEditFactory.h"
2#include "IGUIEnvironment.h"
3#include "irrString.h"
4
5#include "EGUIEditTypes.h"
6
7#include "CGUIEditWorkspace.h"
8#include "CGUIEditWindow.h"
9#include "CGUIPanel.h"
10#include "CGUITextureCacheBrowser.h"
11#include "CGUIAttributeEditor.h"
12#include "CGUIStringAttribute.h"
13#include "CGUIBoolAttribute.h"
14#include "CGUIEnumAttribute.h"
15#include "CGUIColorAttribute.h"
16#include "CGUITextureAttribute.h"
17#include "CGUIDummyEditorStub.h"
18
19namespace irr
20{
21namespace gui
22{
23
24CGUIEditFactory::CGUIEditFactory(IGUIEnvironment* env)
25: Environment(env)
26{
27 #ifdef _DEBUG
28 setDebugName("CGUIEditFactory");
29 #endif
30
31 // don't grab the gui environment here to prevent cyclic references
32}
33
34
35CGUIEditFactory::~CGUIEditFactory()
36{
37}
38
39
40//! adds an element to the environment based on its type name
41IGUIElement* CGUIEditFactory::addGUIElement(const c8* typeName, IGUIElement* parent)
42{
43 /*
44 here we create elements, add them to the manager, and then drop them
45 */
46
47 core::stringc elementType(typeName);
48 IGUIElement* ret=0;
49 if (!parent)
50 parent = Environment->getRootGUIElement();
51
52 // editor workspace
53 if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIEDIT]))
54 ret = new CGUIEditWorkspace(Environment, -1, 0);
55 // editor window
56 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIEDITWINDOW]))
57 ret = new CGUIEditWindow(Environment, core::rect<s32>(0,0,100,100), 0);
58 // Klasker's GUI Panel
59 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_GUIPANEL]))
60 ret = new CGUIPanel(Environment, 0);
61 // texture cache browser
62 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_TEXTUREBROWSER]))
63 ret = new CGUITextureCacheBrowser(Environment, -1, 0);
64 // block of attribute editors
65 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_ATTRIBUTEEDITOR]))
66 ret = new CGUIAttributeEditor(Environment, -1, 0);
67 //! single attribute editors
68 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_STRINGATTRIBUTE]))
69 ret = new CGUIStringAttribute(Environment, 0, -1);
70 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_BOOLATTRIBUTE]))
71 ret = new CGUIBoolAttribute(Environment, 0, -1);
72 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_ENUMATTRIBUTE]))
73 ret = new CGUIEnumAttribute(Environment, 0, -1);
74 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORATTRIBUTE]))
75 ret = new CGUIColorAttribute(Environment, 0, -1);
76 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORFATTRIBUTE]))
77 ret = new CGUIColorAttribute(Environment, 0, -1);
78 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_TEXTUREATTRIBUTE]))
79 ret = new CGUITextureAttribute(Environment, 0, -1);
80 // stubs and custom editors
81 else if (elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_CONTEXTMENUEDITOR]) ||
82 elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_MENUEDITOR]) ||
83 elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_FILEDIALOGEDITOR]) ||
84 elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_COLORDIALOGEDITOR]) ||
85 elementType == core::stringc(GUIEditElementTypeNames[EGUIEDIT_MODALSCREENEDITOR]) )
86 ret = new CGUIDummyEditorStub(Environment, 0, typeName);
87
88 // add the element to its parent
89 if (ret)
90 parent->addChild(ret);
91
92 // the environment now has the reference, so we can drop the element
93 if (ret)
94 ret->drop();
95
96 return ret;
97}
98
99
100//! returns amount of element types this factory is able to create
101s32 CGUIEditFactory::getCreatableGUIElementTypeCount() const
102{
103 return EGUIEDIT_COUNT;
104}
105
106
107//! returns type name of a createable element type
108const c8* CGUIEditFactory::getCreateableGUIElementTypeName(s32 idx) const
109{
110 if (idx>=0 && idx<EGUIEDIT_COUNT)
111 return GUIEditElementTypeNames[idx];
112
113 return 0;
114}
115
116
117
118} // end namespace gui
119} // end namespace irr
120
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.h
new file mode 100644
index 0000000..e6f8815
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditFactory.h
@@ -0,0 +1,53 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_GUIEDIT_FACTORY_H_INCLUDED__
6#define __C_GUIEDIT_FACTORY_H_INCLUDED__
7
8#include "IGUIElementFactory.h"
9
10namespace irr
11{
12namespace gui
13{
14 class IGUIElement;
15 class IGUIEnvironment;
16
17 //! Interface making it possible to dynamicly create gui elements
18 class CGUIEditFactory : public IGUIElementFactory
19 {
20 public:
21
22 CGUIEditFactory(IGUIEnvironment* env);
23 ~CGUIEditFactory();
24
25 //! adds a GUI element to the GUI Environment based on its type name
26 /** \param typeName: Type name of the element to add.
27 \param parent: Parent scene node of the new element, can be null to add it to the root.
28 \return Returns pointer to the new element or null if not successful. */
29 virtual IGUIElement* addGUIElement(const c8* typeName, IGUIElement* parent=0);
30
31 //! returns amount of GUI element types this factory is able to create
32 virtual s32 getCreatableGUIElementTypeCount() const;
33
34 //! returns type name of a createable GUI element type by index
35 /** \param idx: Index of the type in this factory. Must be a value between 0 and
36 getCreatableGUIElementTypeCount() */
37 virtual const c8* getCreateableGUIElementTypeName(s32 idx) const;
38
39 // not used:
40 virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type) const {return 0;} ;
41 virtual EGUI_ELEMENT_TYPE getCreateableGUIElementType(s32 idx) const { return EGUIET_ELEMENT;};
42 virtual IGUIElement* addGUIElement(EGUI_ELEMENT_TYPE type, IGUIElement* parent=0) {return 0;};
43 private:
44
45 IGUIEnvironment* Environment;
46 };
47
48
49} // end namespace scene
50} // end namespace irr
51
52#endif
53
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.cpp
new file mode 100644
index 0000000..2ff96ae
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.cpp
@@ -0,0 +1,356 @@
1
2#include "CGUIEditWindow.h"
3#include "IGUISkin.h"
4#include "IGUIEnvironment.h"
5#include "IGUIElementFactory.h"
6#include "IAttributes.h"
7#include "IGUIFont.h"
8#include "IGUITabControl.h"
9#include "IGUITreeView.h"
10#include "CGUIEditWorkspace.h"
11
12using namespace irr;
13using namespace gui;
14
15//! constructor
16CGUIEditWindow::CGUIEditWindow(IGUIEnvironment* environment, core::rect<s32> rectangle, IGUIElement *parent)
17 : IGUIWindow(environment, parent, -1, rectangle),
18 Dragging(false), IsDraggable(true), Resizing(false), SelectedElement(0),
19 AttribEditor(0), OptionEditor(0), EnvEditor(0)
20{
21 #ifdef _DEBUG
22 setDebugName("CGUIEditWindow");
23 #endif
24
25 // we can't tab out of this window
26 setTabGroup(true);
27 // we can ctrl+tab to it
28 setTabStop(true);
29 // the tab order number is auto-assigned
30 setTabOrder(-1);
31
32 // set window text
33 setText(L"GUI Editor");
34
35 // return if we have no skin.
36 IGUISkin *skin = environment->getSkin();
37 if (!skin)
38 return;
39
40 s32 th = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH);
41
42 setRelativePosition(core::rect<s32>(50,50,250,500));
43 setMinSize(core::dimension2du(200,200));
44
45 IGUITabControl *TabControl = environment->addTabControl(core::rect<s32>(1,th+5,199,449), this, false, true);
46 TabControl->setSubElement(true);
47 TabControl->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
48
49 TabControl->addTab(L"Tools");
50 //L"Texture Cache Browser"
51 //L"Font Browser"
52 //L"Font Generator"
53 //L"Sprite Editor"
54 //Environment->addGUIElement("textureCacheBrowser", this);
55
56 IGUITab* EditorTab = TabControl->addTab(L"Editor");
57 OptionEditor = (CGUIAttributeEditor*) environment->addGUIElement("attributeEditor", EditorTab);
58 OptionEditor->grab();
59 OptionEditor->setID(EGUIEDCE_OPTION_EDITOR);
60 OptionEditor->setRelativePositionProportional(core::rect<f32>(0.0f, 0.0f, 1.0f, 1.0f));
61 OptionEditor->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
62
63 if (Parent && Parent->getParent() == Environment->getRootGUIElement())
64 {
65 IGUITab* EnvTab = TabControl->addTab(L"Env");
66 EnvEditor = (CGUIAttributeEditor*) environment->addGUIElement("attributeEditor", EnvTab);
67 EnvEditor->grab();
68 EnvEditor->setID(EGUIEDCE_ENV_EDITOR);
69 EnvEditor->setRelativePositionProportional(core::rect<f32>(0.0f, 0.0f, 1.0f, 1.0f));
70 EnvEditor->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
71 }
72 IGUITab* ElementTab = TabControl->addTab(L"Element");
73
74 AttribEditor = (CGUIAttributeEditor*) environment->addGUIElement("attributeEditor", ElementTab);
75 AttribEditor->grab();
76 AttribEditor->setID(EGUIEDCE_ATTRIB_EDITOR);
77 AttribEditor->setRelativePositionProportional(core::rect<f32>(0.0f, 0.0f, 1.0f, 1.0f));
78 AttribEditor->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
79
80 IGUITab* TreeTab = TabControl->addTab(L"Tree");
81 TreeView = environment->addTreeView(core::rect<s32>(0,0,0,0), TreeTab);
82 TreeView->setRelativePositionProportional(core::rect<f32>(0.0f, 0.0f, 1.0f, 1.0f));
83 TreeView->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
84 IGUITreeViewNode* treenode = TreeView->getRoot();
85 //treenode->addChildFront(L"Elements");
86 ResizeButton = environment->addButton(core::rect<s32>(199-th,449-th,199,449), this);
87 ResizeButton->setDrawBorder(false);
88 ResizeButton->setEnabled(false);
89 ResizeButton->setSpriteBank(skin->getSpriteBank());
90 ResizeButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_RESIZE), skin->getColor(EGDC_WINDOW_SYMBOL));
91 ResizeButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_WINDOW_RESIZE), skin->getColor(EGDC_WINDOW_SYMBOL));
92 ResizeButton->grab();
93 ResizeButton->setSubElement(true);
94 ResizeButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT);
95 updateTree();
96}
97
98
99//! destructor
100CGUIEditWindow::~CGUIEditWindow()
101{
102 // drop everything
103 if (AttribEditor)
104 AttribEditor->drop();
105 if (EnvEditor)
106 EnvEditor->drop();
107 if (OptionEditor)
108 OptionEditor->drop();
109 if (ResizeButton)
110 ResizeButton->drop();
111}
112
113IGUITreeView* CGUIEditWindow::getTreeView() const
114{
115 return TreeView;
116}
117CGUIAttributeEditor* CGUIEditWindow::getEnvironmentEditor() const
118{
119 return EnvEditor;
120}
121
122CGUIAttributeEditor* CGUIEditWindow::getAttributeEditor() const
123{
124 return AttribEditor;
125}
126
127CGUIAttributeEditor* CGUIEditWindow::getOptionEditor() const
128{
129 return OptionEditor;
130}
131
132IGUITreeViewNode* CGUIEditWindow::getTreeNode(IGUIElement* element, IGUITreeViewNode* searchnode)
133{
134 IGUITreeViewNode* child = searchnode->getFirstChild();
135 while (child)
136 {
137 if (((IGUIElement*) child->getData()) == element)
138 return child;
139
140 if (child->hasChildren())
141 {
142 IGUITreeViewNode* foundnode = getTreeNode(element, child);
143 if (foundnode)
144 return foundnode;
145 }
146 child = child->getNextSibling();
147 }
148 return 0;
149}
150
151void CGUIEditWindow::addChildrenToTree(IGUIElement* parentElement, IGUITreeViewNode* treenode)
152{
153 core::stringw name = core::stringw(parentElement->getTypeName());
154 if (parentElement->getID() != -1)
155 name += core::stringw(L" [") + core::stringw(parentElement->getID()) + core::stringw(L"]");
156
157 IGUITreeViewNode* newnode = treenode->addChildBack(name.c_str());
158 newnode->setData((void*)parentElement);
159 core::list<IGUIElement*> children = parentElement->getChildren();
160
161 for (core::list<IGUIElement*>::Iterator i = children.begin(); i != children.end(); i++ )
162 {
163 if(core::stringc((*i)->getTypeName()) != "GUIEditor" && !(*i)->isSubElement())
164 addChildrenToTree(*i, newnode);
165 }
166}
167
168void CGUIEditWindow::updateTree()
169{
170 TreeView->getRoot()->clearChildren();
171 IGUIElement* root = Environment->getRootGUIElement();
172 addChildrenToTree(root, TreeView->getRoot());
173 TreeView->getRoot()->getFirstChild()->setExpanded(true);
174}
175
176void CGUIEditWindow::setSelectedElement(IGUIElement *sel)
177{
178 // save changes
179 AttribEditor->updateAttribs();
180 IGUITreeViewNode* elementTreeNode = getTreeNode(sel, TreeView->getRoot());
181
182 if (elementTreeNode)
183 {
184 elementTreeNode->setSelected(true);
185 while (elementTreeNode)
186 {
187 elementTreeNode->setExpanded(true);
188 elementTreeNode = elementTreeNode->getParent();
189 }
190 }
191
192 io::IAttributes* Attribs = AttribEditor->getAttribs();
193
194 if (SelectedElement && sel != SelectedElement)
195 {
196 // deserialize attributes
197 SelectedElement->deserializeAttributes(Attribs);
198 }
199 // clear the attributes list
200 Attribs->clear();
201 SelectedElement = sel;
202
203 // get the new attributes
204 if (SelectedElement)
205 SelectedElement->serializeAttributes(Attribs);
206
207 AttribEditor->refreshAttribs();
208}
209
210//! draws the element and its children.
211//! same code as for a window
212void CGUIEditWindow::draw()
213{
214 if (!IsVisible)
215 return;
216
217 IGUISkin* skin = Environment->getSkin();
218
219 core::rect<s32> rect = AbsoluteRect;
220
221 // draw body fast
222 rect = skin->draw3DWindowBackground(this, true, skin->getColor(EGDC_ACTIVE_BORDER),
223 AbsoluteRect, &AbsoluteClippingRect);
224
225 if (Text.size())
226 {
227 rect.UpperLeftCorner.X += skin->getSize(EGDS_TEXT_DISTANCE_X);
228 rect.UpperLeftCorner.Y += skin->getSize(EGDS_TEXT_DISTANCE_Y);
229 rect.LowerRightCorner.X -= skin->getSize(EGDS_WINDOW_BUTTON_WIDTH) + 5;
230
231 IGUIFont* font = skin->getFont();
232 if (font)
233 font->draw(Text.c_str(), rect, skin->getColor(EGDC_ACTIVE_CAPTION), false, true, &AbsoluteClippingRect);
234 }
235
236 IGUIElement::draw();
237}
238
239
240//! called if an event happened.
241bool CGUIEditWindow::OnEvent(const SEvent &event)
242{
243 switch(event.EventType)
244 {
245 case EET_GUI_EVENT:
246 switch(event.GUIEvent.EventType)
247 {
248 case EGET_ELEMENT_FOCUS_LOST:
249 if (event.GUIEvent.Caller == this ||
250 event.GUIEvent.Caller == ResizeButton)
251 {
252 Dragging = false;
253 Resizing = false;
254 }
255 break;
256 default:
257 break;
258 }
259
260 break;
261 case EET_MOUSE_INPUT_EVENT:
262 switch(event.MouseInput.Event)
263 {
264 case EMIE_LMOUSE_PRESSED_DOWN:
265 {
266 DragStart.X = event.MouseInput.X;
267 DragStart.Y = event.MouseInput.Y;
268
269 IGUIElement* clickedElement = getElementFromPoint(DragStart);
270
271 if (clickedElement == this)
272 {
273 Dragging = IsDraggable;
274 //Environment->setFocus(this);
275 if (Parent)
276 Parent->bringToFront(this);
277 return true;
278 }
279 else if (clickedElement == ResizeButton)
280 {
281 Resizing = true;
282 //Environment->setFocus(this);
283 if (Parent)
284 Parent->bringToFront(this);
285 return true;
286 }
287 break;
288 }
289 case EMIE_LMOUSE_LEFT_UP:
290 if (Dragging || Resizing)
291 {
292 Dragging = false;
293 Resizing = false;
294 return true;
295 }
296 break;
297 case EMIE_MOUSE_MOVED:
298 if (Dragging || Resizing)
299 {
300 // gui window should not be dragged outside of its parent
301 if (Parent)
302 if (event.MouseInput.X < Parent->getAbsolutePosition().UpperLeftCorner.X +1 ||
303 event.MouseInput.Y < Parent->getAbsolutePosition().UpperLeftCorner.Y +1 ||
304 event.MouseInput.X > Parent->getAbsolutePosition().LowerRightCorner.X -1 ||
305 event.MouseInput.Y > Parent->getAbsolutePosition().LowerRightCorner.Y -1)
306
307 return true;
308 core::position2di diff(event.MouseInput.X - DragStart.X, event.MouseInput.Y - DragStart.Y);
309 if (Dragging)
310 {
311 move(diff);
312 DragStart.X = event.MouseInput.X;
313 DragStart.Y = event.MouseInput.Y;
314 }
315 else if (Resizing)
316 {
317 core::position2di dp = RelativeRect.LowerRightCorner + diff;
318 setRelativePosition(core::rect<s32>(RelativeRect.UpperLeftCorner, dp));
319 DragStart += dp - RelativeRect.LowerRightCorner + diff;
320 }
321
322 return true;
323 }
324 break;
325 default:
326 break;
327 }
328 default:
329 break;
330 }
331
332 return Parent ? Parent->OnEvent(event) : false;
333}
334
335bool CGUIEditWindow::isDraggable() const
336{
337 return IsDraggable;
338}
339
340void CGUIEditWindow::setDraggable(bool draggable)
341{
342 IsDraggable = draggable;
343
344 if (Dragging && !IsDraggable)
345 Dragging = false;
346}
347
348
349// we're supposed to supply these if we're creating an IGUIWindow
350// but we don't need them so we'll just return null
351
352//! Returns the rectangle of the drawable area (without border, without titlebar and without scrollbars)
353core::rect<s32> CGUIEditWindow::getClientRect() const {return core::recti();}
354IGUIButton* CGUIEditWindow::getCloseButton() const {return 0;}
355IGUIButton* CGUIEditWindow::getMinimizeButton() const {return 0;}
356IGUIButton* CGUIEditWindow::getMaximizeButton() const {return 0;}
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.h
new file mode 100644
index 0000000..4b1d72f
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWindow.h
@@ -0,0 +1,88 @@
1#ifndef __C_GUI_EDITOR_H_INCLUDED__
2#define __C_GUI_EDITOR_H_INCLUDED__
3
4
5#include "IGUIWindow.h"
6#include "CGUIAttributeEditor.h"
7//#include "IGUIStaticText.h"
8#include "IGUIButton.h"
9#include "IGUITreeView.h"
10#include "irrArray.h"
11#include "IAttributes.h"
12#include "EGUIEditTypes.h"
13
14namespace irr
15{
16namespace gui
17{
18 class CGUIEditWindow : public IGUIWindow
19 {
20 public:
21
22 //! constructor
23 CGUIEditWindow(IGUIEnvironment* environment, core::rect<s32> rectangle, IGUIElement *parent);
24
25 //! destructor
26 ~CGUIEditWindow();
27
28 //! this part draws the window
29 virtual void draw();
30 //! handles events
31 virtual bool OnEvent(const SEvent &event);
32
33 //! change selection
34 virtual void setSelectedElement(IGUIElement *sel);
35
36 //! get draggable
37 virtual bool isDraggable() const;
38
39 //! get draggable
40 virtual void setDraggable(bool draggable);
41
42 // not used
43 virtual core::rect<s32> getClientRect() const;
44 virtual IGUIButton* getCloseButton() const;
45 virtual IGUIButton* getMinimizeButton() const;
46 virtual IGUIButton* getMaximizeButton() const;
47 virtual void setDrawBackground(bool draw) { }
48 virtual bool getDrawBackground() const { return true; }
49 virtual void setDrawTitlebar(bool draw) { }
50 virtual bool getDrawTitlebar() const { return true; }
51
52 IGUITreeView* getTreeView() const;
53 CGUIAttributeEditor* getAttributeEditor() const;
54 CGUIAttributeEditor* getOptionEditor() const;
55 CGUIAttributeEditor* getEnvironmentEditor() const;
56
57 //! Returns the type name of the gui element.
58 virtual const c8* getTypeName() const
59 {
60 return GUIEditElementTypeNames[EGUIEDIT_GUIEDITWINDOW];
61 }
62
63 void updateTree();
64 private:
65
66 void addChildrenToTree(IGUIElement* parentElement, IGUITreeViewNode* treenode);
67 IGUITreeViewNode* getTreeNode(IGUIElement* element, IGUITreeViewNode* searchnode);
68 // for dragging the window
69 bool Dragging;
70 bool IsDraggable;
71 bool Resizing;
72 core::position2d<s32> DragStart;
73
74 IGUIElement* SelectedElement; // current selected element
75
76 CGUIAttributeEditor* AttribEditor; // edits the current attribute
77 CGUIAttributeEditor* OptionEditor; // edits the options for the window
78 CGUIAttributeEditor* EnvEditor; // edits attributes for the environment
79 IGUITreeView* TreeView; // tree view of all elements in scene
80 IGUIButton* ResizeButton;
81
82 };
83
84} // end namespace gui
85} // end namespace irr
86
87#endif // __C_GUI_EDITOR_H_INCLUDED__
88
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.cpp
new file mode 100644
index 0000000..a45e5d3
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.cpp
@@ -0,0 +1,927 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt / Gaz Davidson
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5// Thanks to Midnight for all his testing, bug fixes and patches :)
6
7#include "CGUIEditWorkspace.h"
8#include "IGUIEnvironment.h"
9#include "IVideoDriver.h"
10#include "IOSOperator.h"
11#include "IReadFile.h"
12#include "IFileSystem.h"
13#include "IXMLWriter.h"
14#include "IGUISkin.h"
15#include "IGUIElementFactory.h"
16#include "CGUIEditWindow.h"
17#include "IGUIContextMenu.h"
18#include "IGUIFileOpenDialog.h"
19#include "IGUITreeView.h"
20#include "CGUIAttribute.h"
21#include "CMemoryReadWriteFile.h"
22
23namespace irr
24{
25namespace gui
26{
27
28//! constructor
29CGUIEditWorkspace::CGUIEditWorkspace(IGUIEnvironment* environment, s32 id, IGUIElement *parent)
30: IGUIElement(EGUIET_ELEMENT, environment, parent ? parent : environment->getRootGUIElement(), id, environment->getRootGUIElement()->getAbsolutePosition()),
31 CurrentMode(EGUIEDM_SELECT), MouseOverMode(EGUIEDM_SELECT),
32 GridSize(10,10), MenuCommandStart(0x3D17), DrawGrid(false), UseGrid(true),
33 MouseOverElement(0), SelectedElement(0), EditorWindow(0)
34{
35 #ifdef _DEBUG
36 setDebugName("CGUIEditWorkspace");
37 #endif
38
39 // this element is never saved.
40 setSubElement(true);
41
42 // it resizes to fit a resizing window
43 setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
44
45 EditorWindow = (CGUIEditWindow*) Environment->addGUIElement("GUIEditWindow", this);
46 if (EditorWindow)
47 {
48 EditorWindow->grab();
49 EditorWindow->setSubElement(true);
50
51 Environment->setFocus(EditorWindow);
52 serializeAttributes(EditorWindow->getOptionEditor()->getAttribs());
53 EditorWindow->getOptionEditor()->refreshAttribs();
54
55 if (EditorWindow->getEnvironmentEditor())
56 {
57 Environment->serializeAttributes(EditorWindow->getEnvironmentEditor()->getAttribs());
58 EditorWindow->getEnvironmentEditor()->refreshAttribs();
59 }
60 }
61}
62
63
64//! destructor
65CGUIEditWorkspace::~CGUIEditWorkspace()
66{
67 if (EditorWindow)
68 EditorWindow->drop();
69}
70
71
72void CGUIEditWorkspace::setMenuCommandIDStart(s32 id)
73{
74 MenuCommandStart = id;
75}
76
77CGUIEditWorkspace::EGUIEDIT_MODE CGUIEditWorkspace::getModeFromPos(core::position2di p)
78{
79 if (SelectedElement)
80 {
81 core::rect<s32> r = SelectedElement->getAbsolutePosition();
82
83 if (TLRect.isPointInside(p))
84 return EGUIEDM_RESIZE_TL;
85
86 else if (TRRect.isPointInside(p))
87 return EGUIEDM_RESIZE_TR;
88
89 else if (BLRect.isPointInside(p) )
90 return EGUIEDM_RESIZE_BL;
91
92 else if (BRRect.isPointInside(p))
93 return EGUIEDM_RESIZE_BR;
94
95 else if (TopRect.isPointInside(p))
96 return EGUIEDM_RESIZE_T;
97
98 else if (BRect.isPointInside(p))
99 return EGUIEDM_RESIZE_B;
100
101 else if (LRect.isPointInside(p))
102 return EGUIEDM_RESIZE_L;
103
104 else if (RRect.isPointInside(p))
105 return EGUIEDM_RESIZE_R;
106
107 else if (getEditableElementFromPoint(SelectedElement, p) == SelectedElement)
108 return EGUIEDM_MOVE;
109
110 else
111 return EGUIEDM_SELECT;
112 }
113
114 return EGUIEDM_SELECT;
115
116}
117
118IGUIElement* CGUIEditWorkspace::getEditableElementFromPoint(IGUIElement *start, const core::position2di &point, s32 index )
119{
120 IGUIElement* target = 0;
121
122 // we have to search from back to front.
123
124 core::list<IGUIElement*>::ConstIterator it = start->getChildren().getLast();
125 s32 count=0;
126 while(it != start->getChildren().end())
127 {
128 target = getEditableElementFromPoint((*it),point);
129 if (target)
130 {
131 if (!target->isSubElement() && !isMyChild(target) && target != this)
132 {
133 if (index == count)
134 return target;
135 else
136 count++;
137 }
138 else
139 target = 0;
140 }
141 --it;
142 }
143
144 if (start->getAbsolutePosition().isPointInside(point))
145 target = start;
146
147 return target;
148}
149
150void CGUIEditWorkspace::setSelectedElement(IGUIElement *sel)
151{
152 IGUIElement* focus = Environment->getFocus();
153 // we only give focus back to children
154 if (!isMyChild(focus))
155 focus = 0;
156
157 if (SelectedElement != Parent)
158 {
159 if (SelectedElement != sel && EditorWindow)
160 {
161 EditorWindow->setSelectedElement(sel);
162 SelectedElement = sel;
163 }
164 }
165 else
166 SelectedElement = 0;
167
168 if (focus)
169 Environment->setFocus(focus);
170 else
171 Environment->setFocus(this);
172}
173
174IGUIElement* CGUIEditWorkspace::getSelectedElement()
175{
176 return SelectedElement;
177}
178void CGUIEditWorkspace::selectNextSibling()
179{
180 IGUIElement* p=0;
181
182 if (SelectedElement && SelectedElement->getParent())
183 p = SelectedElement->getParent();
184 else
185 p = Parent;
186
187 core::list<IGUIElement*>::ConstIterator it = p->getChildren().begin();
188 // find selected element
189 if (SelectedElement)
190 while (*it != SelectedElement)
191 ++it;
192 if (it !=p->getChildren().end())
193 ++it;
194 // find next non sub-element
195 while (it != p->getChildren().end() && (*it)->isSubElement())
196 ++it;
197
198 if (it != p->getChildren().end())
199 setSelectedElement(*it);
200}
201void CGUIEditWorkspace::selectPreviousSibling()
202{
203 IGUIElement* p=0;
204
205 if (SelectedElement && SelectedElement->getParent())
206 p = SelectedElement->getParent();
207 else
208 p = Parent;
209
210 core::list<IGUIElement*>::ConstIterator it = p->getChildren().getLast();
211 // find selected element
212 if (SelectedElement)
213 while (*it != SelectedElement)
214 --it;
215 if (it != p->getChildren().end())
216 --it;
217 // find next non sub-element
218 while (it != p->getChildren().end() && (*it)->isSubElement())
219 --it;
220
221 if (it != p->getChildren().end())
222 setSelectedElement(*it);
223}
224
225//! called if an event happened.
226bool CGUIEditWorkspace::OnEvent(const SEvent &e)
227{
228 IGUIFileOpenDialog* dialog=0;
229 switch(e.EventType)
230 {
231 case ATTRIBEDIT_ATTRIB_CHANGED:
232 {
233 switch (e.UserEvent.UserData1)
234 {
235 case EGUIEDCE_ATTRIB_EDITOR:
236 {
237 // update selected items attributes
238 if (SelectedElement)
239 {
240 SelectedElement->deserializeAttributes(EditorWindow->getAttributeEditor()->getAttribs());
241 EditorWindow->updateTree();
242 }
243 return true;
244 }
245 case EGUIEDCE_OPTION_EDITOR:
246 {
247 // update editor options
248 deserializeAttributes(EditorWindow->getOptionEditor()->getAttribs());
249 return true;
250 }
251 case EGUIEDCE_ENV_EDITOR:
252 {
253 // update environment
254 Environment->deserializeAttributes(EditorWindow->getEnvironmentEditor()->getAttribs());
255 return true;
256 }
257 }
258 }
259 break;
260
261 case EET_KEY_INPUT_EVENT:
262 if (!e.KeyInput.PressedDown)
263 {
264 switch (e.KeyInput.Key)
265 {
266 case KEY_DELETE:
267 if (SelectedElement)
268 {
269 IGUIElement* el = SelectedElement;
270 setSelectedElement(0);
271 MouseOverElement = 0;
272 el->remove();
273 EditorWindow->updateTree();
274 }
275 break;
276 case KEY_KEY_X:
277 if (e.KeyInput.Control && SelectedElement)
278 {
279 // cut
280 CopySelectedElementXML();
281 // delete element
282 IGUIElement *el = SelectedElement;
283 setSelectedElement(0);
284 MouseOverElement = 0;
285 el->remove();
286 }
287 break;
288 case KEY_KEY_C:
289 // copy
290 if (e.KeyInput.Control && SelectedElement)
291 {
292 CopySelectedElementXML();
293 }
294 break;
295 case KEY_KEY_V:
296 // paste
297 if (e.KeyInput.Control)
298 {
299 PasteXMLToSelectedElement();
300 }
301 break;
302 default:
303 break;
304 }
305
306 return true;
307 }
308 break;
309
310 case EET_MOUSE_INPUT_EVENT:
311
312 switch(e.MouseInput.Event)
313 {
314 case EMIE_MOUSE_WHEEL:
315 {
316 f32 wheel = e.MouseInput.Wheel;
317
318 if (wheel > 0)
319 selectPreviousSibling();
320 else
321 selectNextSibling();
322 }
323 break;
324 case EMIE_LMOUSE_PRESSED_DOWN:
325 {
326 core::position2di p = core::position2di(e.MouseInput.X,e.MouseInput.Y);
327
328 IGUIElement* newSelection = getElementFromPoint(p);
329
330 if (newSelection != this && isMyChild(newSelection) ) // redirect event
331 {
332 Environment->setFocus(newSelection);
333 return true;
334 }
335
336 // hide the gui editor
337 if (EditorWindow)
338 EditorWindow->setVisible(false);
339
340 if (CurrentMode == EGUIEDM_SELECT)
341 {
342 if (SelectedElement)
343 {
344 // start moving or dragging
345 CurrentMode = getModeFromPos(p);
346
347 if (CurrentMode == EGUIEDM_MOVE)
348 StartMovePos = SelectedElement->getAbsolutePosition().UpperLeftCorner;
349
350 DragStart = p;
351 SelectedArea = SelectedElement->getAbsolutePosition();
352 }
353
354 if (CurrentMode < EGUIEDM_MOVE)
355 {
356 // selecting an element...
357 MouseOverElement = getEditableElementFromPoint(Parent, p);
358
359 if (MouseOverElement == Parent)
360 MouseOverElement = 0;
361
362 setSelectedElement(MouseOverElement);
363 }
364 }
365
366 break;
367 }
368 case EMIE_RMOUSE_PRESSED_DOWN:
369 if (CurrentMode == EGUIEDM_SELECT_NEW_PARENT || CurrentMode >= EGUIEDM_MOVE)
370 {
371 // cancel dragging
372 CurrentMode = EGUIEDM_SELECT;
373 }
374 else
375 {
376 DragStart = core::position2di(e.MouseInput.X,e.MouseInput.Y);
377 // root menu
378 IGUIContextMenu* mnu = Environment->addContextMenu(
379 core::rect<s32>(e.MouseInput.X, e.MouseInput.Y, e.MouseInput.Y+100, e.MouseInput.Y+100),this);
380 mnu->addItem(L"File",-1,true,true);
381 mnu->addItem(L"Edit",-1,true,true);
382 mnu->addItem(L"View",-1,true,true);
383 mnu->addItem(SelectedElement ? L"Add child" : L"Add" ,-1,true,true);
384
385 // file menu
386 IGUIContextMenu* sub = mnu->getSubMenu(0);
387 IGUIContextMenu* sub2 =0;
388
389 sub->addItem(L"New", MenuCommandStart + EGUIEDMC_FILE_NEW );
390 sub->addItem(L"Load...",MenuCommandStart + EGUIEDMC_FILE_LOAD);
391 sub->addItem(L"Save...",MenuCommandStart + EGUIEDMC_FILE_SAVE);
392
393 // edit menu
394 sub = mnu->getSubMenu(1);
395 sub->addItem(L"Cut (ctrl+x)", MenuCommandStart + EGUIEDMC_CUT_ELEMENT, (SelectedElement != 0));
396 sub->addItem(L"Copy (ctrl+c)", MenuCommandStart + EGUIEDMC_COPY_ELEMENT, (SelectedElement != 0));
397 sub->addItem(L"Paste (ctrl+v)", MenuCommandStart + EGUIEDMC_PASTE_ELEMENT,
398 (core::stringc(Environment->getOSOperator()->getTextFromClipboard()) != ""));
399 sub->addItem(L"Delete (del)", MenuCommandStart + EGUIEDMC_DELETE_ELEMENT, (SelectedElement != 0));
400 sub->addSeparator();
401 sub->addItem(L"Set parent", MenuCommandStart + EGUIEDMC_SET_PARENT, (SelectedElement != 0));
402 sub->addItem(L"Bring to front", MenuCommandStart + EGUIEDMC_BRING_TO_FRONT, (SelectedElement != 0));
403 sub->addSeparator();
404 sub->addItem(L"Save to XML...", MenuCommandStart + EGUIEDMC_SAVE_ELEMENT, (SelectedElement != 0));
405
406 sub = mnu->getSubMenu(2);
407 // view menu
408 if (EditorWindow)
409 sub->addItem(EditorWindow->isVisible() ? L"Hide window" : L"Show window", MenuCommandStart + EGUIEDMC_TOGGLE_EDITOR);
410
411 sub = mnu->getSubMenu(3);
412
413 s32 i,j,c=0;
414 sub->addItem(L"Default factory",-1,true, true);
415
416 // add elements from each factory
417 for (i=0; u32(i) < Environment->getRegisteredGUIElementFactoryCount(); ++i)
418 {
419 sub2 = sub->getSubMenu(i);
420
421 IGUIElementFactory *f = Environment->getGUIElementFactory(i);
422
423 for (j=0; j< f->getCreatableGUIElementTypeCount(); ++j)
424 {
425 sub2->addItem(core::stringw(f->getCreateableGUIElementTypeName(j)).c_str(), MenuCommandStart + EGUIEDMC_COUNT + c);
426 c++;
427 }
428
429 if (u32(i+1) < Environment->getRegisteredGUIElementFactoryCount())
430 {
431 core::stringw strFact;
432 strFact = L"Factory ";
433 strFact += i+1;
434 sub->addItem(strFact.c_str(),-1, true, true);
435 }
436 }
437 sub->addSeparator();
438 sub->addItem(L"From XML...", MenuCommandStart + EGUIEDMC_INSERT_XML);
439
440 // set focus to menu
441 Environment->setFocus(mnu);
442
443 }
444 break;
445 case EMIE_LMOUSE_LEFT_UP:
446
447 // make window visible again
448 if (EditorWindow)
449 EditorWindow->setVisible(true);
450 if (CurrentMode == EGUIEDM_SELECT_NEW_PARENT)
451 {
452 if (SelectedElement)
453 {
454 MouseOverElement = getEditableElementFromPoint(Parent,
455 core::position2di(e.MouseInput.X,e.MouseInput.Y));
456 if (MouseOverElement)
457 {
458 MouseOverElement->addChild(SelectedElement);
459 setSelectedElement(0);
460 setSelectedElement(SelectedElement);
461 }
462 }
463 CurrentMode = EGUIEDM_SELECT;
464 }
465 else if (CurrentMode >= EGUIEDM_MOVE)
466 {
467 IGUIElement *sel = SelectedElement;
468 // unselect
469 setSelectedElement(0);
470
471 // move
472 core::position2d<s32> p(0,0);
473 if (sel->getParent())
474 p = sel->getParent()->getAbsolutePosition().UpperLeftCorner;
475
476 sel->setRelativePosition(SelectedArea - p);
477
478 // select
479 setSelectedElement(sel);
480
481 // reset selection mode...
482 CurrentMode = EGUIEDM_SELECT;
483 }
484 break;
485 case EMIE_MOUSE_MOVED:
486 // always on top
487 Parent->bringToFront(this);
488
489 // if selecting
490 if (CurrentMode == EGUIEDM_SELECT || CurrentMode == EGUIEDM_SELECT_NEW_PARENT)
491 {
492
493 core::position2di p = core::position2di(e.MouseInput.X,e.MouseInput.Y);
494
495 // highlight the element that the mouse is over
496 MouseOverElement = getEditableElementFromPoint(Parent, p);
497 if (MouseOverElement == Parent)
498 {
499 MouseOverElement = 0;
500 }
501
502 if (CurrentMode == EGUIEDM_SELECT)
503 {
504 MouseOverMode = getModeFromPos(p);
505 if (MouseOverMode > EGUIEDM_MOVE)
506 {
507 MouseOverElement = SelectedElement;
508 }
509 }
510 }
511 else if (CurrentMode == EGUIEDM_MOVE)
512 {
513 // get difference
514 core::position2di p = core::position2di(e.MouseInput.X,e.MouseInput.Y);
515 p -= DragStart;
516
517 // apply to top corner
518 p = StartMovePos + p;
519 if (UseGrid)
520 {
521 p.X = (p.X/GridSize.Width)*GridSize.Width;
522 p.Y = (p.Y/GridSize.Height)*GridSize.Height;
523 }
524
525 SelectedArea += p - SelectedArea.UpperLeftCorner;
526 }
527 else if (CurrentMode > EGUIEDM_MOVE)
528 {
529 // get difference from start position
530 core::position2di p = core::position2di(e.MouseInput.X,e.MouseInput.Y);
531 if (UseGrid)
532 {
533 p.X = (p.X/GridSize.Width)*GridSize.Width;
534 p.Y = (p.Y/GridSize.Height)*GridSize.Height;
535 }
536
537 switch(CurrentMode)
538 {
539 case EGUIEDM_RESIZE_T:
540 SelectedArea.UpperLeftCorner.Y = p.Y;
541 break;
542 case EGUIEDM_RESIZE_B:
543 SelectedArea.LowerRightCorner.Y = p.Y;
544 break;
545 case EGUIEDM_RESIZE_L:
546 SelectedArea.UpperLeftCorner.X = p.X;
547 break;
548 case EGUIEDM_RESIZE_R:
549 SelectedArea.LowerRightCorner.X = p.X;
550 break;
551 case EGUIEDM_RESIZE_TL:
552 SelectedArea.UpperLeftCorner = p;
553 break;
554 case EGUIEDM_RESIZE_TR:
555 SelectedArea.UpperLeftCorner.Y = p.Y;
556 SelectedArea.LowerRightCorner.X = p.X;
557 break;
558 case EGUIEDM_RESIZE_BL:
559 SelectedArea.UpperLeftCorner.X = p.X;
560 SelectedArea.LowerRightCorner.Y = p.Y;
561 break;
562 case EGUIEDM_RESIZE_BR:
563 SelectedArea.LowerRightCorner = p;
564 break;
565 default:
566 break;
567 }
568 }
569
570 break;
571 default:
572 break;
573 }
574 break;
575
576 case EET_GUI_EVENT:
577 switch(e.GUIEvent.EventType)
578 {
579 case EGET_TREEVIEW_NODE_SELECT:
580 {
581 IGUITreeViewNode* eventnode = ((IGUITreeView*)e.GUIEvent.Caller)->getLastEventNode();
582 if(!eventnode->isRoot())
583 setSelectedElement((IGUIElement*)(eventnode->getData()));
584 break;
585 }
586 // load a gui file
587 case EGET_FILE_SELECTED:
588 dialog = (IGUIFileOpenDialog*)e.GUIEvent.Caller;
589 Environment->loadGUI(core::stringc(dialog->getFileName()).c_str());
590 break;
591
592 case EGET_MENU_ITEM_SELECTED:
593 {
594 IGUIContextMenu *menu = (IGUIContextMenu*)e.GUIEvent.Caller;
595 s32 cmdID = menu->getItemCommandId(menu->getSelectedItem()) - MenuCommandStart;
596
597 IGUIElement* el;
598
599 switch(cmdID)
600 {
601
602 //! file commands
603 case EGUIEDMC_FILE_NEW:
604 // clear all elements belonging to our parent
605 setSelectedElement(0);
606 MouseOverElement = 0;
607 el = Parent;
608 grab();
609 // remove all children
610 while(Children.end() != el->getChildren().begin())
611 el->removeChild(*(el->getChildren().begin()));
612 // attach to parent again
613 el->addChild(this);
614 drop();
615
616 break;
617 case EGUIEDMC_FILE_LOAD:
618 Environment->addFileOpenDialog(L"Please select a GUI file to open", false, this);
619 break;
620 case EGUIEDMC_FILE_SAVE:
621 Environment->saveGUI("guiTest.xml");
622 break;
623
624 //! edit menu
625 case EGUIEDMC_CUT_ELEMENT:
626 {
627 CopySelectedElementXML();
628 // delete element
629 el = SelectedElement;
630 setSelectedElement(0);
631 MouseOverElement = 0;
632 el->remove();
633 break;
634 }
635 case EGUIEDMC_COPY_ELEMENT:
636 CopySelectedElementXML();
637 break;
638 case EGUIEDMC_PASTE_ELEMENT:
639 PasteXMLToSelectedElement();
640 break;
641 case EGUIEDMC_DELETE_ELEMENT:
642 el = SelectedElement;
643 setSelectedElement(0);
644 MouseOverElement = 0;
645 el->remove();
646 break;
647 case EGUIEDMC_SET_PARENT:
648 CurrentMode = EGUIEDM_SELECT_NEW_PARENT;
649 break;
650 case EGUIEDMC_BRING_TO_FRONT:
651 if (SelectedElement->getParent())
652 SelectedElement->getParent()->bringToFront(SelectedElement);
653 break;
654
655 case EGUIEDMC_SAVE_ELEMENT:
656 //TODO: add 'save' dialog.
657 Environment->saveGUI("guiTest.xml", SelectedElement ? SelectedElement : Environment->getRootGUIElement() );
658 break;
659
660 //! toggle edit window
661 case EGUIEDMC_TOGGLE_EDITOR:
662 break;
663
664 case EGUIEDMC_INSERT_XML:
665 Environment->loadGUI("guiTest.xml", SelectedElement ? SelectedElement : Environment->getRootGUIElement() );
666 break;
667
668 default:
669 // create element from factory?
670 if (cmdID >= EGUIEDMC_COUNT)
671 {
672
673 s32 num = cmdID - EGUIEDMC_COUNT; // get index
674 // loop through all factories
675 s32 i, c=Environment->getRegisteredGUIElementFactoryCount();
676 for (i=0; i<c && num > Environment->getGUIElementFactory(i)->getCreatableGUIElementTypeCount(); ++i)
677 {
678 num -= Environment->getGUIElementFactory(i)->getCreatableGUIElementTypeCount();
679 }
680 if (num < Environment->getGUIElementFactory(i)->getCreatableGUIElementTypeCount() )
681 {
682 core::stringc name = Environment->getGUIElementFactory(i)->getCreateableGUIElementTypeName(num);
683 IGUIElement *parentElement = SelectedElement ? SelectedElement : Environment->getRootGUIElement();
684 // add it
685 IGUIElement *newElement = Environment->getGUIElementFactory(i)->addGUIElement(name.c_str(),parentElement);
686 if (newElement)
687 {
688 core::position2di p = DragStart - parentElement->getAbsolutePosition().UpperLeftCorner;
689 newElement->setRelativePosition(core::rect<s32>(p,p+core::position2di(100,100)));
690 //Environment->removeFocus(newElement);
691 }
692 }
693 }
694 break;
695 }
696 EditorWindow->updateTree();
697 }
698 return true;
699 default:
700 break;
701 }
702 break;
703
704 default:
705 break;
706 }
707
708 // even if we didn't absorb the event,
709 // we never pass events back to the GUI we're editing!
710 return false;
711}
712
713
714//! draws the element and its children
715void CGUIEditWorkspace::draw()
716{
717 video::IVideoDriver *driver = Environment->getVideoDriver();
718
719 if (DrawGrid)
720 {
721 // draw the grid
722
723 core::rect<s32> r = getAbsolutePosition();
724
725 s32 cy = r.UpperLeftCorner.Y;
726 while (cy < r.LowerRightCorner.Y)
727 {
728 s32 cx = r.UpperLeftCorner.X;
729 while (cx < r.LowerRightCorner.X)
730 {
731 driver->draw2DRectangle(video::SColor(40,0,0,90),core::rect<s32>(cx+1,cy+1,GridSize.Width+cx,GridSize.Height+cy));
732 cx += GridSize.Width;
733 }
734 cy += GridSize.Height;
735 }
736 }
737 if (MouseOverElement &&
738 MouseOverElement != SelectedElement &&
739 MouseOverElement != Parent)
740 {
741 core::rect<s32> r = MouseOverElement->getAbsolutePosition();
742 driver->draw2DRectangle(video::SColor(100,0,0,255), r);
743 }
744 if (SelectedElement && CurrentMode == EGUIEDM_SELECT)
745 {
746 driver->draw2DRectangle(video::SColor(100,0,255,0),SelectedElement->getAbsolutePosition());
747 }
748 if (CurrentMode >= EGUIEDM_MOVE)
749 {
750 driver->draw2DRectangle(video::SColor(100,255,0,0),SelectedArea);
751 }
752
753 if ( (SelectedElement && CurrentMode >= EGUIEDM_MOVE) ||
754 (SelectedElement && MouseOverElement == SelectedElement && MouseOverMode >= EGUIEDM_MOVE) )
755 {
756 // draw handles for moving
757 EGUIEDIT_MODE m = CurrentMode;
758 core::rect<s32> r = SelectedArea;
759 if (m < EGUIEDM_MOVE)
760 {
761 m = MouseOverMode;
762 r = SelectedElement->getAbsolutePosition();
763 }
764
765 core::position2di d = core::position2di(4,4);
766
767 TLRect = core::rect<s32>(r.UpperLeftCorner, r.UpperLeftCorner + d );
768 TRRect = core::rect<s32>(r.LowerRightCorner.X-4, r.UpperLeftCorner.Y, r.LowerRightCorner.X, r.UpperLeftCorner.Y+4);
769 TopRect = core::rect<s32>(r.getCenter().X-2, r.UpperLeftCorner.Y,r.getCenter().X+2, r.UpperLeftCorner.Y+4 );
770 BLRect = core::rect<s32>(r.UpperLeftCorner.X, r.LowerRightCorner.Y-4, r.UpperLeftCorner.X+4, r.LowerRightCorner.Y);
771 LRect = core::rect<s32>(r.UpperLeftCorner.X,r.getCenter().Y-2, r.UpperLeftCorner.X+4, r.getCenter().Y+2 );
772 RRect = core::rect<s32>(r.LowerRightCorner.X-4,r.getCenter().Y-2, r.LowerRightCorner.X, r.getCenter().Y+2 );
773 BRRect = core::rect<s32>(r.LowerRightCorner-d, r.LowerRightCorner);
774 BRect = core::rect<s32>(r.getCenter().X-2, r.LowerRightCorner.Y-4,r.getCenter().X+2, r.LowerRightCorner.Y );
775
776 // top left
777 if (m == EGUIEDM_RESIZE_T || m == EGUIEDM_RESIZE_L || m == EGUIEDM_RESIZE_TL || m == EGUIEDM_MOVE )
778 driver->draw2DRectangle(video::SColor(100,255,255,255), TLRect);
779
780 if (m == EGUIEDM_RESIZE_T || m == EGUIEDM_RESIZE_R || m == EGUIEDM_RESIZE_TR || m == EGUIEDM_MOVE )
781 driver->draw2DRectangle(video::SColor(100,255,255,255), TRRect);
782
783 if (m == EGUIEDM_RESIZE_T || m == EGUIEDM_MOVE )
784 driver->draw2DRectangle(video::SColor(100,255,255,255), TopRect);
785
786 if (m == EGUIEDM_RESIZE_L || m == EGUIEDM_RESIZE_BL || m == EGUIEDM_RESIZE_B || m == EGUIEDM_MOVE )
787 driver->draw2DRectangle(video::SColor(100,255,255,255), BLRect);
788
789 if (m == EGUIEDM_RESIZE_L || m == EGUIEDM_MOVE )
790 driver->draw2DRectangle(video::SColor(100,255,255,255), LRect);
791
792 if (m == EGUIEDM_RESIZE_R || m == EGUIEDM_MOVE )
793 driver->draw2DRectangle(video::SColor(100,255,255,255), RRect);
794
795 if (m == EGUIEDM_RESIZE_R || m == EGUIEDM_RESIZE_BR || m == EGUIEDM_RESIZE_B || m == EGUIEDM_MOVE )
796 driver->draw2DRectangle(video::SColor(100,255,255,255), BRRect );
797
798 if (m == EGUIEDM_RESIZE_B || m == EGUIEDM_MOVE )
799 driver->draw2DRectangle(video::SColor(100,255,255,255), BRect);
800
801
802 }
803
804 IGUIElement::draw();
805}
806
807
808void CGUIEditWorkspace::setDrawGrid(bool drawGrid)
809{
810 DrawGrid = drawGrid;
811}
812
813void CGUIEditWorkspace::setGridSize(const core::dimension2di& gridSize)
814{
815 GridSize = gridSize;
816 if (GridSize.Width < 2)
817 GridSize.Width = 2;
818 if (GridSize.Height < 2)
819 GridSize.Height = 2;
820}
821
822void CGUIEditWorkspace::setUseGrid(bool useGrid)
823{
824 UseGrid = useGrid;
825}
826
827
828//! Removes a child.
829void CGUIEditWorkspace::removeChild(IGUIElement* child)
830{
831 IGUIElement::removeChild(child);
832
833 if (Children.empty())
834 remove();
835}
836
837
838void CGUIEditWorkspace::updateAbsolutePosition()
839{
840 core::rect<s32> parentRect(0,0,0,0);
841
842 if (Parent)
843 {
844 parentRect = Parent->getAbsolutePosition();
845 RelativeRect.UpperLeftCorner.X = 0;
846 RelativeRect.UpperLeftCorner.Y = 0;
847 RelativeRect.LowerRightCorner.X = parentRect.getWidth();
848 RelativeRect.LowerRightCorner.Y = parentRect.getHeight();
849 }
850
851 IGUIElement::updateAbsolutePosition();
852}
853
854void CGUIEditWorkspace::CopySelectedElementXML()
855{
856 core::stringc XMLText;
857 core::stringw wXMLText;
858 // create memory write file
859 io::CMemoryReadWriteFile* memWrite = new io::CMemoryReadWriteFile("#Clipboard#");
860 // save gui to mem file
861 io::IXMLWriter* xml = Environment->getFileSystem()->createXMLWriter(memWrite);
862 Environment->writeGUIElement(xml, SelectedElement);
863
864 // copy to clipboard- wide chars not supported yet :(
865 wXMLText = (wchar_t*)&memWrite->getData()[0];
866 u32 i = memWrite->getData().size()/sizeof(wchar_t);
867 if (wXMLText.size() > i)
868 wXMLText[i] = L'\0';
869 XMLText = wXMLText.c_str();
870 memWrite->drop();
871 xml->drop();
872 Environment->getOSOperator()->copyToClipboard(XMLText.c_str());
873}
874
875void CGUIEditWorkspace::PasteXMLToSelectedElement()
876{
877 // get clipboard data
878 core::stringc XMLText = Environment->getOSOperator()->getTextFromClipboard();
879 // convert to stringw
880 core::stringw wXMLText = XMLText.c_str();
881
882 io::CMemoryReadWriteFile* memWrite = new io::CMemoryReadWriteFile("#Clipboard#");
883
884 io::IXMLWriter* xmlw = Environment->getFileSystem()->createXMLWriter(memWrite);
885 xmlw->writeXMLHeader(); // it needs one of those
886 xmlw->drop();
887
888 // write clipboard data
889 memWrite->write((void*)&wXMLText[0], wXMLText.size() * sizeof(wchar_t));
890
891 // rewind file
892 memWrite->seek(0, false);
893
894 // read xml
895 Environment->loadGUI(memWrite, SelectedElement);
896
897 // reset focus
898 Environment->setFocus(this);
899
900 // drop the read file
901 memWrite->drop();
902}
903
904void CGUIEditWorkspace::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options)
905{
906 out->addBool("DrawGrid", DrawGrid);
907 out->addBool("UseGrid", UseGrid);
908 out->addPosition2d("GridSize", core::position2di(GridSize.Width, GridSize.Height));
909 out->addInt("MenuCommandStart", MenuCommandStart);
910}
911
912void CGUIEditWorkspace::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
913{
914 setDrawGrid(in->getAttributeAsBool("DrawGrid"));
915 setUseGrid(in->getAttributeAsBool("UseGrid"));
916
917 core::position2di tmpp = in->getAttributeAsPosition2d("GridSize");
918 core::dimension2di tmpd(tmpp.X, tmpp.Y);
919 setGridSize(tmpd);
920 setMenuCommandIDStart(in->getAttributeAsInt("MenuCommandStart"));
921}
922
923
924} // end namespace gui
925} // end namespace irr
926
927
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.h
new file mode 100644
index 0000000..3f21258
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEditWorkspace.h
@@ -0,0 +1,168 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt / Gaz Davidson
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_GUIEDIT_WORKSPACE_H_INCLUDED__
6#define __C_GUIEDIT_WORKSPACE_H_INCLUDED__
7
8#include "IGUIElement.h"
9#include "CGUIEditWindow.h"
10#include "EGUIEditTypes.h"
11
12namespace irr
13{
14namespace gui
15{
16
17 //! Adding the GUI Editor Workspace to an element allows you
18 /** to create, edit, load and save any elements supported
19 by any loaded factories.
20 When you add it without a parent (to the root element)
21 it will also allow you to edit, load and save settings in
22 the current skin.
23 */
24
25 // custom events
26 enum EGUIEDIT_CUSTOM_EVENTS
27 {
28 EGUIEDCE_ATTRIB_EDITOR = MAKE_IRR_ID('g','A','t','t'),
29 EGUIEDCE_OPTION_EDITOR = MAKE_IRR_ID('g','O','p','t'),
30 EGUIEDCE_ENV_EDITOR = MAKE_IRR_ID('g','E','n','v')
31 };
32
33 class CGUIEditWorkspace : public IGUIElement
34 {
35 public:
36
37 //! constructor
38 CGUIEditWorkspace(IGUIEnvironment* environment, s32 id=-1, IGUIElement *parent=0);
39
40 //! destructor
41 ~CGUIEditWorkspace();
42
43 //! called if an event happened.
44 virtual bool OnEvent(const SEvent &event);
45
46 //! Removes a child.
47 virtual void removeChild(IGUIElement* child);
48
49 //! draws the element and its children
50 virtual void draw();
51
52 //! Updates the absolute position.
53 virtual void updateAbsolutePosition();
54
55 //! Sets the menu command id's
56 /** The GUI editor defaults to command ID's from 0xED17 to 0xED17+EGUIEDMC_COUNT
57 In the rare case that these are already in use and you wish to use menus
58 while the editor is present you can set a new offset here.
59 */
60 virtual void setMenuCommandIDStart(s32 id);
61
62 //! grid drawing...
63 virtual void setDrawGrid(bool drawGrid);
64 virtual void setGridSize(const core::dimension2di& gridSize);
65 virtual void setUseGrid(bool useGrid);
66
67 //! returns the first editable element under the mouse
68 virtual IGUIElement* getEditableElementFromPoint(IGUIElement *start, const core::position2di &point, s32 index=0 );
69
70 //! selecting elements
71 virtual void setSelectedElement(IGUIElement *sel);
72 virtual void selectNextSibling();
73 virtual void selectPreviousSibling();
74
75 //! returns the selected element
76 virtual IGUIElement* getSelectedElement();
77
78 //! copies the xml of the selected element and all children to the clipboard
79 virtual void CopySelectedElementXML();
80
81 //! copies the xml of the selected element and all children to the clipboard
82 virtual void PasteXMLToSelectedElement();
83
84 virtual const c8* getTypeName() const
85 {
86 return GUIEditElementTypeNames[EGUIEDIT_GUIEDIT];
87 }
88
89 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0);
90 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
91
92 private:
93
94 enum EGUIEDIT_MODE
95 {
96 // when we are currently selecting an element
97 EGUIEDM_SELECT=0,
98 // selecting a new parent for the selected element
99 EGUIEDM_SELECT_NEW_PARENT,
100
101 // moving the selected element
102 EGUIEDM_MOVE,
103 // resizing the selected element
104 EGUIEDM_RESIZE_TL,
105 EGUIEDM_RESIZE_T,
106 EGUIEDM_RESIZE_TR,
107 EGUIEDM_RESIZE_R,
108 EGUIEDM_RESIZE_BR,
109 EGUIEDM_RESIZE_B,
110 EGUIEDM_RESIZE_BL,
111 EGUIEDM_RESIZE_L
112 };
113
114 enum EGUIEDIT_MENUCOMMANDS
115 {
116 //! file commands
117 EGUIEDMC_FILE_NEW,
118 EGUIEDMC_FILE_LOAD,
119 EGUIEDMC_FILE_SAVE,
120 //! edit menu
121 EGUIEDMC_CUT_ELEMENT,
122 EGUIEDMC_COPY_ELEMENT,
123 EGUIEDMC_PASTE_ELEMENT,
124 EGUIEDMC_DELETE_ELEMENT,
125 EGUIEDMC_SET_PARENT,
126 EGUIEDMC_BRING_TO_FRONT,
127 EGUIEDMC_SAVE_ELEMENT,
128 //! grid
129 EGUIEDMC_TOGGLE_EDITOR,
130
131 EGUIEDMC_INSERT_XML,
132
133 //! number of menu options
134 EGUIEDMC_COUNT
135 };
136
137 EGUIEDIT_MODE getModeFromPos(core::position2di p);
138
139 EGUIEDIT_MODE CurrentMode;
140 EGUIEDIT_MODE MouseOverMode;
141 core::position2di DragStart;
142 core::position2di StartMovePos;
143 core::rect<s32> SelectedArea;
144
145 core::dimension2di GridSize;
146 s32 MenuCommandStart;
147 bool DrawGrid, UseGrid;
148
149 IGUIElement *MouseOverElement,
150 *SelectedElement;
151 CGUIEditWindow *EditorWindow;
152
153 core::rect<s32> TLRect;
154 core::rect<s32> TRRect;
155 core::rect<s32> TopRect;
156 core::rect<s32> BLRect;
157 core::rect<s32> LRect;
158 core::rect<s32> RRect;
159 core::rect<s32> BRRect;
160 core::rect<s32> BRect;
161 };
162
163
164} // end namespace gui
165} // end namespace irr
166
167#endif
168
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEnumAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEnumAttribute.h
new file mode 100644
index 0000000..9e3958d
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIEnumAttribute.h
@@ -0,0 +1,114 @@
1#ifndef __C_GUI_ENUM_ATTRIBUTE_H_INCLUDED__
2#define __C_GUI_ENUM_ATTRIBUTE_H_INCLUDED__
3
4#include "CGUIAttribute.h"
5#include "IGUIComboBox.h"
6#include "IGUIEditBox.h"
7#include "EGUIEditTypes.h"
8
9namespace irr
10{
11namespace gui
12{
13
14 class CGUIEnumAttribute : public CGUIAttribute
15 {
16 public:
17 //
18 CGUIEnumAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
19 CGUIAttribute(environment, parent, myParentID),
20 AttribComboBox(0), AttribEditBox(0)
21 {
22
23 }
24
25 virtual ~CGUIEnumAttribute()
26 {
27 if (AttribComboBox)
28 AttribComboBox->drop();
29 if (AttribEditBox)
30 AttribEditBox->drop();
31 }
32
33 // save the attribute and possibly post the event to its parent
34 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
35 {
36
37 if (AttribComboBox)
38 {
39 AttribComboBox->remove();
40 AttribComboBox->drop();
41 AttribComboBox = 0;
42 }
43
44 if (AttribEditBox)
45 {
46 AttribEditBox->remove();
47 AttribEditBox->drop();
48 AttribEditBox = 0;
49 }
50
51 core::array<core::stringc> outLiterals;
52 attribs->getAttributeEnumerationLiteralsOfEnumeration(attribIndex, outLiterals);
53
54 core::rect<s32> r = getAbsolutePosition();
55 core::rect<s32> r2(0, Environment->getSkin()->getFont()->getDimension(L"A").Height + 10,
56 r.getWidth() - 5,
57 Environment->getSkin()->getFont()->getDimension(L"A").Height*2 + 20 );
58
59 if (outLiterals.size() > 0)
60 {
61 AttribComboBox = Environment->addComboBox(r2, this, -1);
62 for (u32 i=0; i<outLiterals.size(); ++i)
63 AttribComboBox->addItem( core::stringw(outLiterals[i].c_str()).c_str());
64
65 AttribComboBox->setSelected( attribs->getAttributeAsInt(attribIndex) );
66
67 AttribComboBox->grab();
68 AttribComboBox->setSubElement(true);
69 AttribComboBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
70 }
71 else
72 {
73
74 AttribEditBox = Environment->addEditBox(
75 attribs->getAttributeAsStringW(attribIndex).c_str(),
76 r2, true, this, -1);
77 AttribEditBox->grab();
78 AttribEditBox->setSubElement(true);
79 AttribEditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
80 }
81
82 CGUIAttribute::setAttrib(attribs, attribIndex);
83 }
84
85 //! save the attribute and possibly post the event to its parent
86 virtual bool updateAttrib(bool sendEvent=true)
87 {
88 if (!Attribs)
89 return true;
90
91 if (AttribComboBox)
92 Attribs->setAttribute(Index, AttribComboBox->getText());
93 else if (AttribEditBox)
94 Attribs->setAttribute(Index, AttribEditBox->getText());
95
96 return CGUIAttribute::updateAttrib(sendEvent);
97 }
98
99 //! Returns the type name of the gui element.
100 virtual const c8* getTypeName() const
101 {
102 return GUIEditElementTypeNames[EGUIEDIT_ENUMATTRIBUTE];
103 }
104
105 private:
106 IGUIComboBox* AttribComboBox;
107 IGUIEditBox* AttribEditBox;
108 };
109
110} // namespace gui
111} // namespace irr
112
113#endif
114
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.cpp
new file mode 100644
index 0000000..4135b7a
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.cpp
@@ -0,0 +1,340 @@
1// Copyright 2006-2012 Asger Feldthaus
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5/*
6 Originally Klasker's but I've messed around with it lots - Gaz
7*/
8
9#include "CGUIPanel.h"
10#include "IGUIEnvironment.h"
11#include "IGUIScrollBar.h"
12#include "IGUITabControl.h"
13#include "IVideoDriver.h"
14
15const int SCROLL_BAR_SIZE = 16; // Scroll bars are 16 pixels wide
16const int BORDER_WIDTH = 2;
17
18namespace irr
19{
20namespace gui
21{
22
23CGUIPanel::CGUIPanel(IGUIEnvironment* environment, IGUIElement* parent, s32 id, const core::rect<s32>& rectangle,
24 bool border, E_SCROLL_BAR_MODE vMode, E_SCROLL_BAR_MODE hMode)
25 : IGUIElement(EGUIET_ELEMENT, environment, parent, id, rectangle),
26 VScrollBar(0), HScrollBar(0), ClipPane(0), InnerPane(0),
27 VScrollBarMode(vMode), HScrollBarMode(hMode), NeedsUpdate(true), Border(border)
28{
29 #ifdef _DEBUG
30 setDebugName("CGUIPanel");
31 #endif
32
33 s32 width = rectangle.getWidth();
34 s32 height = rectangle.getHeight();
35
36 core::rect<s32> rct = core::rect<s32>(width - SCROLL_BAR_SIZE,0, width, height);
37
38 VScrollBar = environment->addScrollBar(false, rct, 0, id);
39 VScrollBar->setSubElement(true);
40 VScrollBar->setTabStop(false);
41 VScrollBar->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
42 VScrollBar->grab();
43 IGUIElement::addChild(VScrollBar);
44
45 rct = core::rect<s32>(0, height - SCROLL_BAR_SIZE, width - SCROLL_BAR_SIZE,height );
46
47 HScrollBar = environment->addScrollBar(true, rct, 0, id);
48 HScrollBar->setSubElement(true);
49 HScrollBar->setTabStop(false);
50 HScrollBar->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT);
51 HScrollBar->grab();
52 IGUIElement::addChild(HScrollBar);
53
54 rct = core::rect<s32>(0,0, width - SCROLL_BAR_SIZE, height - SCROLL_BAR_SIZE);
55
56 ClipPane = environment->addTab( rct, 0, -1);
57 ClipPane->setSubElement(true);
58 ClipPane->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
59 ClipPane->grab();
60 IGUIElement::addChild(ClipPane);
61
62 InnerPane = environment->addTab(rct, ClipPane, -1);
63 InnerPane->setSubElement(true);
64 InnerPane->grab();
65
66 calculateClientArea();
67 resizeInnerPane();
68}
69
70CGUIPanel::~CGUIPanel()
71{
72 // because the inner pane has the list of children, we need to remove the outer ones manually
73 IGUIElement::removeChild(VScrollBar);
74 IGUIElement::removeChild(HScrollBar);
75 IGUIElement::removeChild(ClipPane);
76
77 // now we can drop the others
78 VScrollBar->drop();
79 HScrollBar->drop();
80 ClipPane->drop();
81 InnerPane->drop();
82}
83
84
85void CGUIPanel::draw()
86{
87 if (NeedsUpdate)
88 {
89 calculateClientArea();
90 resizeInnerPane();
91 NeedsUpdate = false;
92 }
93
94 IGUISkin* skin = Environment->getSkin();
95 if (Border && skin)
96 {
97 skin->draw3DSunkenPane( this, skin->getColor( EGDC_APP_WORKSPACE), false, true, AbsoluteRect, &AbsoluteClippingRect );
98 }
99
100 IGUIElement::draw();
101}
102
103void CGUIPanel::addChild(IGUIElement *child)
104{
105 // add the child to the inner pane
106 InnerPane->addChild(child);
107
108 NeedsUpdate = true;
109}
110
111void CGUIPanel::removeChild(IGUIElement *child)
112{
113 InnerPane->removeChild(child);
114
115 NeedsUpdate = true;
116}
117
118//! returns children of the inner pane
119const core::list<IGUIElement*>& CGUIPanel::getChildren()
120{
121 return InnerPane->getChildren();
122}
123
124bool CGUIPanel::hasBorder() const
125{
126 return Border;
127}
128
129void CGUIPanel::setBorder( bool enabled )
130{
131 Border = enabled;
132}
133
134IGUIScrollBar* CGUIPanel::getVScrollBar() const
135{
136 return VScrollBar;
137}
138
139IGUIScrollBar* CGUIPanel::getHScrollBar() const
140{
141 return HScrollBar;
142}
143
144E_SCROLL_BAR_MODE CGUIPanel::getVScrollBarMode() const
145{
146 return VScrollBarMode;
147}
148
149void CGUIPanel::setVScrollBarMode( E_SCROLL_BAR_MODE mode )
150{
151 VScrollBarMode = mode;
152 NeedsUpdate = true;
153}
154
155E_SCROLL_BAR_MODE CGUIPanel::getHScrollBarMode() const
156{
157 return HScrollBarMode;
158}
159
160void CGUIPanel::setHScrollBarMode(E_SCROLL_BAR_MODE mode)
161{
162 HScrollBarMode = mode;
163 NeedsUpdate = true;
164}
165
166bool CGUIPanel::OnEvent(const SEvent &event)
167{
168 // Redirect mouse wheel to scrollbar
169 if (event.EventType == EET_MOUSE_INPUT_EVENT && event.MouseInput.Event == EMIE_MOUSE_WHEEL)
170 {
171 if (VScrollBar->isVisible())
172 {
173 Environment->setFocus(VScrollBar);
174 VScrollBar->OnEvent(event);
175 return true;
176 }
177 else if (VScrollBar->isVisible())
178 {
179 Environment->setFocus(HScrollBar);
180 HScrollBar->OnEvent(event);
181 return true;
182 }
183 }
184 else
185 {
186 if (event.EventType == EET_GUI_EVENT && event.GUIEvent.EventType == EGET_SCROLL_BAR_CHANGED &&
187 (event.GUIEvent.Caller == HScrollBar || event.GUIEvent.Caller == VScrollBar) )
188 {
189 moveInnerPane();
190
191 return true;
192 }
193 }
194
195 return IGUIElement::OnEvent(event);
196}
197
198void CGUIPanel::moveInnerPane()
199{
200 core::dimension2d<s32> dim = InnerPane->getAbsolutePosition().getSize();
201 core::position2d<s32> newpos(HScrollBar->isVisible() ? -HScrollBar->getPos() : 0 , VScrollBar->isVisible() ? -VScrollBar->getPos() : 0);
202 core::rect<s32> r(newpos, newpos + dim);
203 InnerPane->setRelativePosition(r);
204}
205
206
207void CGUIPanel::updateAbsolutePosition()
208{
209 IGUIElement::updateAbsolutePosition();
210 calculateClientArea();
211 resizeInnerPane();
212}
213
214
215void CGUIPanel::resizeInnerPane()
216{
217 if (!HScrollBar || !VScrollBar || !InnerPane || !ClipPane)
218 return;
219
220 // get outer pane size
221 core::rect<s32> outerRect = ClipPane->getRelativePosition();
222
223 // resize flexible children depending on outer pane
224 InnerPane->setRelativePosition(outerRect);
225
226 // get desired size (total size of all children)
227 core::rect<s32> totalRect(0, 0, 0, 0);
228
229 core::list<IGUIElement*>::ConstIterator it;
230
231 for (it = InnerPane->getChildren().begin();
232 it != InnerPane->getChildren().end(); ++it)
233 {
234 core::rect<s32> rct = (*it)->getRelativePosition();
235 totalRect.addInternalPoint(rct.UpperLeftCorner);
236 totalRect.addInternalPoint(rct.LowerRightCorner);
237 }
238
239 // move children if pane needs to grow
240 core::position2di adjustedMovement(0,0);
241
242 if (totalRect.UpperLeftCorner.X < 0)
243 adjustedMovement.X = -totalRect.UpperLeftCorner.X;
244 if (totalRect.UpperLeftCorner.Y < 0)
245 adjustedMovement.Y = -totalRect.UpperLeftCorner.Y;
246
247 if (adjustedMovement.X > 0 || adjustedMovement.Y > 0)
248 {
249 totalRect += adjustedMovement;
250
251 for (it = InnerPane->getChildren().begin();
252 it != InnerPane->getChildren().end(); ++it )
253 {
254 (*it)->move(adjustedMovement);
255 }
256 }
257
258 // make sure the inner pane is at least as big as the outer
259 if (totalRect.getWidth() < outerRect.getWidth())
260 {
261 totalRect.UpperLeftCorner.X = 0;
262 totalRect.LowerRightCorner.X = outerRect.getWidth();
263 }
264 if (totalRect.getHeight() < outerRect.getHeight())
265 {
266 totalRect.UpperLeftCorner.Y = 0;
267 totalRect.LowerRightCorner.Y = outerRect.getHeight();
268 }
269
270 InnerPane->setRelativePosition(totalRect);
271
272 // scrollbars
273 if ( HScrollBarMode != ESBM_ALWAYS_INVISIBLE &&
274 (totalRect.getWidth() > outerRect.getWidth() || HScrollBarMode == ESBM_ALWAYS_VISIBLE) )
275 {
276 HScrollBar->setVisible(true);
277 HScrollBar->setMax(totalRect.getWidth() - outerRect.getWidth());
278 bringToFront(HScrollBar);
279 }
280 else
281 HScrollBar->setVisible(false);
282
283 if ( VScrollBarMode != ESBM_ALWAYS_INVISIBLE &&
284 (totalRect.getHeight() > outerRect.getHeight() || VScrollBarMode == ESBM_ALWAYS_VISIBLE) )
285 {
286 VScrollBar->setVisible(true);
287 VScrollBar->setMax(totalRect.getHeight() - outerRect.getHeight());
288 bringToFront(VScrollBar);
289 }
290 else
291 VScrollBar->setVisible(false);
292
293 // move to adjust for scrollbar pos
294 moveInnerPane();
295}
296
297void CGUIPanel::calculateClientArea()
298{
299 core::rect<s32> ClientArea(0,0, AbsoluteRect.getWidth(),AbsoluteRect.getHeight());
300
301 if (VScrollBar->isVisible())
302 ClientArea.LowerRightCorner.X -= VScrollBar->getRelativePosition().getWidth();
303
304 if (HScrollBar->isVisible())
305 ClientArea.LowerRightCorner.Y -= HScrollBar->getRelativePosition().getHeight();
306
307 if (Border)
308 {
309 ClientArea.UpperLeftCorner += core::position2d<s32>( BORDER_WIDTH, BORDER_WIDTH );
310 ClientArea.LowerRightCorner -= core::position2d<s32>( BORDER_WIDTH, BORDER_WIDTH );
311 }
312
313 ClipPane->setRelativePosition(ClientArea);
314}
315
316core::rect<s32> CGUIPanel::getClientArea() const
317{
318 return ClipPane->getRelativePosition();
319}
320
321void CGUIPanel::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options)
322{
323 IGUIElement::serializeAttributes(out, options);
324
325 out->addBool("border", Border);
326 out->addEnum("horizontalScrollBar", HScrollBarMode, GUIScrollBarModeNames );
327 out->addEnum("verticalScrollBar", VScrollBarMode, GUIScrollBarModeNames );
328}
329
330void CGUIPanel::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)
331{
332 IGUIElement::deserializeAttributes(in, options);
333
334 setBorder(in->getAttributeAsBool("border"));
335 setHScrollBarMode((E_SCROLL_BAR_MODE)in->getAttributeAsEnumeration("horizontalScrollBar", GUIScrollBarModeNames));
336 setVScrollBarMode((E_SCROLL_BAR_MODE)in->getAttributeAsEnumeration("verticalScrollBar", GUIScrollBarModeNames));
337}
338
339} // namespace gui
340} // namespace irr
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.h
new file mode 100644
index 0000000..cb6f79a
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIPanel.h
@@ -0,0 +1,128 @@
1// Copyright 2006-2012 Asger Feldthaus
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef _C_GUI_PANEL_H_
6#define _C_GUI_PANEL_H_
7
8#include "IGUIElement.h"
9#include "EGUIEditTypes.h"
10
11namespace irr
12{
13namespace gui
14{
15
16class IGUIScrollBar;
17class IGUITab;
18
19enum E_SCROLL_BAR_MODE
20{
21 //! The scrollbar will only show up when needed.
22 ESBM_AUTOMATIC = 0,
23
24 //! The scrollbar will never be visible.
25 ESBM_ALWAYS_INVISIBLE,
26
27 //! The scrollbar will always the visible.
28 ESBM_ALWAYS_VISIBLE,
29
30 //! just a count of how many are in this enum
31 ESBM_COUNT
32};
33
34const c8* const GUIScrollBarModeNames[] =
35{
36 "automatic",
37 "alwaysInvisible",
38 "alwaysVisible",
39 0
40};
41
42class CGUIPanel : public IGUIElement
43{
44public:
45 CGUIPanel( IGUIEnvironment* environment, IGUIElement* parent, s32 id=-1,
46 const core::rect<s32>& rectangle = core::rect<s32>(0,0,100,100),
47 bool border=false,
48 E_SCROLL_BAR_MODE vMode=ESBM_AUTOMATIC,
49 E_SCROLL_BAR_MODE hMode=ESBM_ALWAYS_INVISIBLE );
50
51 virtual ~CGUIPanel();
52
53 //! draws the panel and its children
54 virtual void draw();
55
56 //! returns true if it has a border, false if not
57 bool hasBorder() const;
58
59 //! sets whether the element draws a border
60 void setBorder(bool enabled);
61
62 //! returns a pointer to the vertical scrollbar
63 IGUIScrollBar* getVScrollBar() const;
64
65 //! returns a pointer to the horizontal scrollbar
66 IGUIScrollBar* getHScrollBar() const;
67
68 //! returns the vertical scrollbar visibility rule
69 E_SCROLL_BAR_MODE getVScrollBarMode() const;
70
71 //! sets the vertical scrollbar visibility rule
72 void setVScrollBarMode(E_SCROLL_BAR_MODE mode);
73
74 //! returns the horizontal scrollbar visibility rule
75 E_SCROLL_BAR_MODE getHScrollBarMode() const;
76
77 //! sets the horizontal scrollbar visibility rule
78 void setHScrollBarMode(E_SCROLL_BAR_MODE mode);
79
80 //! returns the visible area inside the panel, excluding scrollbar and border
81 core::rect<s32> getClientArea() const;
82
83 virtual bool OnEvent(const SEvent &event);
84
85 //! adds a child to the panel
86 virtual void addChild(IGUIElement* child);
87
88 //! removes a child from the panel
89 virtual void removeChild(IGUIElement* child);
90
91 //! updates the absolute position
92 virtual void updateAbsolutePosition();
93
94 //! returns children of the inner pane
95 virtual const core::list<IGUIElement*>& getChildren();
96
97 //! Returns the type name of the gui element.
98 virtual const c8* getTypeName() const
99 {
100 return GUIEditElementTypeNames[EGUIEDIT_GUIPANEL];
101 }
102
103 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0);
104 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
105
106protected:
107 void moveInnerPane();
108 void resizeInnerPane();
109 void calculateClientArea();
110
111private:
112
113 IGUIScrollBar* VScrollBar;
114 IGUIScrollBar* HScrollBar;
115 IGUITab* ClipPane;
116 IGUITab* InnerPane;
117
118 E_SCROLL_BAR_MODE VScrollBarMode;
119 E_SCROLL_BAR_MODE HScrollBarMode;
120
121 bool NeedsUpdate;
122 bool Border;
123};
124
125} // namespace gui
126} // namespace irr
127
128#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h
new file mode 100644
index 0000000..af9ac03
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h
@@ -0,0 +1,70 @@
1#ifndef __C_GUI_STRING_ATTRIBUTE_H_INCLUDED__
2#define __C_GUI_STRING_ATTRIBUTE_H_INCLUDED__
3
4#include "CGUIAttribute.h"
5#include "IGUIEditBox.h"
6#include "EGUIEditTypes.h"
7
8namespace irr
9{
10namespace gui
11{
12
13 class CGUIStringAttribute : public CGUIAttribute
14 {
15 public:
16 //
17 CGUIStringAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
18 CGUIAttribute(environment, parent, myParentID),
19 AttribEditBox(0)
20 {
21 core::rect<s32> r = getAbsolutePosition();
22 core::rect<s32> r2(0, Environment->getSkin()->getFont()->getDimension(L"A").Height + 10,
23 r.getWidth() - 5,
24 Environment->getSkin()->getFont()->getDimension(L"A").Height*2 + 15 );
25
26 AttribEditBox = environment->addEditBox(0, r2, true, this, -1);
27 AttribEditBox->grab();
28 AttribEditBox->setSubElement(true);
29 AttribEditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
30
31 }
32
33 virtual ~CGUIStringAttribute()
34 {
35 if (AttribEditBox)
36 AttribEditBox->drop();
37 }
38
39 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
40 {
41 AttribEditBox->setText(attribs->getAttributeAsStringW(attribIndex).c_str());
42 CGUIAttribute::setAttrib(attribs, attribIndex);
43 }
44
45 //! save the attribute and possibly post the event to its parent
46 virtual bool updateAttrib(bool sendEvent=true)
47 {
48 if (!Attribs)
49 return true;
50
51 Attribs->setAttribute(Index, AttribEditBox->getText());
52 AttribEditBox->setText(Attribs->getAttributeAsStringW(Index).c_str());
53
54 return CGUIAttribute::updateAttrib(sendEvent);
55 }
56
57 //! Returns the type name of the gui element.
58 virtual const c8* getTypeName() const
59 {
60 return GUIEditElementTypeNames[EGUIEDIT_STRINGATTRIBUTE];
61 }
62
63 private:
64 IGUIEditBox* AttribEditBox;
65 };
66
67} // namespace gui
68} // namespace irr
69
70#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureAttribute.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureAttribute.h
new file mode 100644
index 0000000..6a4fef2
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureAttribute.h
@@ -0,0 +1,140 @@
1#ifndef __C_GUI_TEXTURE_ATTRIBUTE_H_INCLUDED__
2#define __C_GUI_TEXTURE_ATTRIBUTE_H_INCLUDED__
3
4#include "CGUIAttribute.h"
5#include "IGUIEditBox.h"
6#include "IGUIImage.h"
7#include "IGUIButton.h"
8#include "EGUIEditTypes.h"
9
10namespace irr
11{
12namespace gui
13{
14
15 class CGUITextureAttribute : public CGUIAttribute
16 {
17 public:
18 //
19 CGUITextureAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) :
20 CGUIAttribute(environment, parent, myParentID),
21 AttribEditBox(0), AttribImage(0), AttribButton(0)
22 {
23 IGUISkin* skin = Environment->getSkin();
24
25 core::rect<s32> r = getAbsolutePosition();
26 s32 topy = skin->getFont()->getDimension(L"A").Height + 10;
27 s32 h = skin->getFont()->getDimension(L"A").Height + 5;
28
29 AttribImage = environment->addImage(0, core::position2di(0, topy), false, this);
30 AttribImage->setRelativePosition( core::rect<s32>(0,topy, r.getWidth() - 5, 100+topy));
31 AttribImage->grab();
32 AttribImage->setSubElement(true);
33 AttribImage->setScaleImage(true);
34 AttribImage->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
35
36 topy += 105;
37
38 core::rect<s32> r2(0, topy, r.getWidth() - 15 - skin->getSize(EGDS_CHECK_BOX_WIDTH), topy + h);
39 core::rect<s32> br(r.getWidth() - 10 - skin->getSize(EGDS_CHECK_BOX_WIDTH), topy, r.getWidth(), topy + h);
40
41 AttribEditBox = environment->addEditBox(0, r2, true, this, -1);
42 AttribEditBox->grab();
43 AttribEditBox->setSubElement(true);
44 AttribEditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
45
46 AttribButton = environment->addButton(br, this, -1, L"...");
47 AttribButton->grab();
48 AttribButton->setSubElement(true);
49 AttribButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
50 //AttribButton->setSpriteBank(skin->getSpriteBank());
51 //AttribButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_FILE), skin->getColor(EGDC_WINDOW_SYMBOL));
52 //AttribButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_FILE), skin->getColor(EGDC_WINDOW_SYMBOL), true);
53 }
54
55 virtual ~CGUITextureAttribute()
56 {
57 if (AttribEditBox)
58 AttribEditBox->drop();
59 if (AttribImage)
60 AttribImage->drop();
61 if (AttribButton)
62 AttribButton->drop();
63 }
64
65 virtual bool OnEvent(const SEvent &e)
66 {
67
68 if (IsEnabled)
69 {
70 switch (e.EventType)
71 {
72 case EET_GUI_EVENT:
73 switch (e.GUIEvent.EventType)
74 {
75 case EGET_BUTTON_CLICKED:
76 // button click: open file dialog
77 if (e.GUIEvent.Caller == AttribButton)
78 {
79 //Environment->addGUIElement("textureBrowser", Environment->getRootGUIElement());
80 return true;
81 }
82 break;
83 case EGET_FILE_SELECTED:
84 // file selected: change editbox value and set event
85
86 return true;
87 case EGET_FILE_CHOOSE_DIALOG_CANCELLED:
88
89 return true;
90 default:
91 break;
92 }
93 break;
94 case EET_KEY_INPUT_EVENT:
95 return true;
96 default:
97 break;
98 }
99 }
100 return CGUIAttribute::OnEvent(e);
101 }
102
103 virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex)
104 {
105 AttribEditBox->setText(attribs->getAttributeAsStringW(attribIndex).c_str());
106 AttribImage->setImage(attribs->getAttributeAsTexture(Index));
107
108 CGUIAttribute::setAttrib(attribs, attribIndex);
109 }
110
111 //! save the attribute and possibly post the event to its parent
112 virtual bool updateAttrib(bool sendEvent=true)
113 {
114 if (!Attribs)
115 return true;
116
117 Attribs->setAttribute(Index, AttribEditBox->getText());
118 core::stringw tmp = Attribs->getAttributeAsStringW(Index);
119 AttribEditBox->setText(Attribs->getAttributeAsStringW(Index).c_str());
120 AttribImage->setImage(Attribs->getAttributeAsTexture(Index));
121
122 return CGUIAttribute::updateAttrib(sendEvent);
123 }
124
125 //! Returns the type name of the gui element.
126 virtual const c8* getTypeName() const
127 {
128 return GUIEditElementTypeNames[EGUIEDIT_TEXTUREATTRIBUTE];
129 }
130
131 private:
132 IGUIEditBox* AttribEditBox;
133 IGUIImage* AttribImage;
134 IGUIButton* AttribButton;
135 };
136
137} // namespace gui
138} // namespace irr
139
140#endif
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.cpp
new file mode 100644
index 0000000..bac5233
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.cpp
@@ -0,0 +1,336 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt / Gaz Davidson
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#include "CGUITextureCacheBrowser.h"
6#include "IGUIEnvironment.h"
7#include "IGUIButton.h"
8#include "IGUISkin.h"
9#include "IGUIFont.h"
10#include "IVideoDriver.h"
11
12namespace irr
13{
14namespace gui
15{
16
17CGUITextureCacheBrowser::CGUITextureCacheBrowser(IGUIEnvironment* environment, s32 id, IGUIElement *parent)
18: IGUIWindow(environment, parent, id, core::rect<s32>(0,0,300,200)),
19 CloseButton(0), Panel(0), SelectedTexture(-1), Dragging(false), IsDraggable(true)
20{
21 #ifdef _DEBUG
22 setDebugName("CGUITextureCacheBrowser");
23 #endif
24
25 IGUISkin* skin = 0;
26 IGUISpriteBank* sprites = 0;
27 video::SColor color(255,255,255,255);
28
29 if (environment)
30 skin = environment->getSkin();
31
32 s32 buttonw = 15;
33 if (skin)
34 {
35 buttonw = skin->getSize(EGDS_WINDOW_BUTTON_WIDTH);
36 sprites = skin->getSpriteBank();
37 color = skin->getColor(EGDC_WINDOW_SYMBOL);
38 }
39 s32 posx = RelativeRect.getWidth() - buttonw - 4;
40
41 CloseButton = Environment->addButton(core::rect<s32>(posx, 3, posx + buttonw, 3 + buttonw), this, -1,
42 L"", skin ? skin->getDefaultText(EGDT_WINDOW_CLOSE) : L"Close" );
43 CloseButton->setSubElement(true);
44 CloseButton->setAlignment(EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT);
45 if (sprites)
46 {
47 CloseButton->setSpriteBank(sprites);
48 CloseButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_CLOSE), color);
49 CloseButton->setSprite(EGBS_BUTTON_DOWN, skin->getIcon(EGDI_WINDOW_CLOSE), color);
50 }
51
52 CloseButton->grab();
53
54 // window title
55 Text = L"Texture Browser";
56
57 // panel element
58 Panel = new CGUIPanel(environment, this);
59 Panel->setRelativePosition( core::rect<s32>(1, buttonw + 5, 151, RelativeRect.getHeight() - 1));
60 Panel->setAlignment(EGUIA_UPPERLEFT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
61 Panel->setBorder(true);
62 Panel->setSubElement(true);
63
64 // some buttons
65
66
67 // add images from texture cache
68 updateImageList();
69
70}
71
72CGUITextureCacheBrowser::~CGUITextureCacheBrowser()
73{
74 if (CloseButton)
75 CloseButton->drop();
76 if (Panel)
77 Panel->drop();
78
79 // drop images
80 u32 i;
81 for (i=0; i<Images.size(); ++i)
82 {
83 Images[i]->drop();
84 Images[i]->remove();
85 }
86 Images.clear();
87}
88void CGUITextureCacheBrowser::updateImageList()
89{
90 if (!Panel)
91 return;
92
93 video::IVideoDriver* Driver = Environment->getVideoDriver();
94
95 // clear images
96 u32 i;
97 for (i=0; i<Images.size(); ++i)
98 {
99 Images[i]->drop();
100 Images[i]->remove();
101 }
102 Images.clear();
103
104 u32 count = (u32)Driver->getTextureCount();
105
106 s32 h = Panel->getClientArea().getWidth()-10;
107 s32 hw = h/2;
108 core::rect<s32> pos(Panel->getClientArea().getCenter().X - Panel->getAbsolutePosition().UpperLeftCorner.X - hw, 5,
109 Panel->getClientArea().getCenter().X - Panel->getAbsolutePosition().UpperLeftCorner.X + hw, h+5);
110
111 core::position2di moveDist(0, h+5);
112
113 for (u32 i=0; i<count; ++i)
114 {
115 core::stringw details;
116 video::ITexture* tex = Driver->getTextureByIndex(i);
117 details = L"File name: ";
118 details += tex->getName();
119 details += L"\nFormat: ";
120 video::ECOLOR_FORMAT cf = tex->getColorFormat();
121
122 bool alpha = false;
123
124 switch (cf)
125 {
126 case video::ECF_A1R5G5B5:
127 details += L"A1R5G5B5 (16-bit with 1-bit alpha channel)\n";
128 alpha = true;
129 break;
130 case video::ECF_R5G6B5:
131 details += L"R5G6B5 (16-bit, no alpha channel)\n";
132 break;
133 case video::ECF_R8G8B8:
134 details += L"R8G8B8 (16-bit, no alpha channel)\n";
135 break;
136 case video::ECF_A8R8G8B8:
137 details += L"R8G8B8 (32-bit with 8-bit alpha channel)\n";
138 alpha = true;
139 break;
140 default:
141 details += L"Unknown\n";
142 }
143
144 core::dimension2du osize = tex->getOriginalSize();
145 core::dimension2du size = tex->getOriginalSize();
146
147 details += "Size: ";
148 details += size.Width;
149 details += "x";
150 details += size.Height;
151
152 if (osize != size)
153 {
154 details += "\nOriginal Size: ";
155 details += osize.Width;
156 details += "x";
157 details += osize.Height;
158 }
159
160 details += L"\nMip-maps: ";
161
162 if (tex->hasMipMaps())
163 details += L"Yes\n";
164 else
165 details += L"No\n";
166
167 IGUIImage* img = Environment->addImage(tex, core::position2di(1,1), alpha, Panel, i);
168 img->grab();
169 Images.push_back(img);
170 img->setRelativePosition(pos);
171 img->setToolTipText(details.c_str());
172 img->setScaleImage(true);
173 img->setColor( SelectedTexture == (s32)i ? video::SColor(255,255,255,255) : video::SColor(128,128,128,128) );
174
175 pos = pos + moveDist;
176 }
177}
178
179void CGUITextureCacheBrowser::updateAbsolutePosition()
180{
181 IGUIWindow::updateAbsolutePosition();
182 updateImageList();
183}
184
185//! called if an event happened.
186bool CGUITextureCacheBrowser::OnEvent(const SEvent &event)
187{
188 switch(event.EventType)
189 {
190 case EET_GUI_EVENT:
191 if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUS_LOST)
192 {
193 if (event.GUIEvent.Caller == (IGUIElement*)this)
194 Dragging = false;
195 return true;
196 }
197 else
198 if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED)
199 {
200 if (event.GUIEvent.Caller == CloseButton)
201 {
202 remove();
203 return true;
204 }
205 }
206 break;
207 case EET_MOUSE_INPUT_EVENT:
208 switch(event.MouseInput.Event)
209 {
210 case EMIE_LMOUSE_PRESSED_DOWN:
211 DragStart.X = event.MouseInput.X;
212 DragStart.Y = event.MouseInput.Y;
213
214 if (getElementFromPoint(DragStart) == this)
215 {
216 if (!Environment->hasFocus(this))
217 {
218 Dragging = IsDraggable;
219 //Environment->setFocus(this);
220 if (Parent)
221 Parent->bringToFront(this);
222 }
223 return true;
224 }
225 else
226 {
227 if (Panel->getAbsolutePosition().isPointInside(DragStart))
228 {
229 // select an image
230 IGUIElement* el = Panel->getElementFromPoint(DragStart);
231 if (el && el != Panel)
232 {
233 if (el->getType() == EGUIET_IMAGE)
234 {
235 setSelected(el->getID());
236 }
237 }
238 else
239 {
240 setSelected();
241 }
242 }
243 }
244 break;
245 case EMIE_LMOUSE_LEFT_UP:
246 Dragging = false;
247 //Environment->removeFocus(this);
248 return true;
249 case EMIE_MOUSE_MOVED:
250 if (Dragging)
251 {
252 // gui window should not be dragged outside its parent
253 if (Parent)
254 if (event.MouseInput.X < Parent->getAbsolutePosition().UpperLeftCorner.X +1 ||
255 event.MouseInput.Y < Parent->getAbsolutePosition().UpperLeftCorner.Y +1 ||
256 event.MouseInput.X > Parent->getAbsolutePosition().LowerRightCorner.X -1 ||
257 event.MouseInput.Y > Parent->getAbsolutePosition().LowerRightCorner.Y -1)
258
259 return true;
260
261
262 move(core::position2d<s32>(event.MouseInput.X - DragStart.X, event.MouseInput.Y - DragStart.Y));
263 DragStart.X = event.MouseInput.X;
264 DragStart.Y = event.MouseInput.Y;
265 return true;
266 }
267 break;
268 default:
269 break;
270 }
271 default:
272 break;
273 }
274
275 return Parent ? Parent->OnEvent(event) : false;
276}
277
278void CGUITextureCacheBrowser::setSelected(s32 index)
279{
280 SelectedTexture = index;
281 updateImageList();
282 printf("Texture %d selected\n", index);
283}
284
285void CGUITextureCacheBrowser::draw()
286{
287 if (!IsVisible)
288 return;
289
290 IGUISkin* skin = Environment->getSkin();
291
292 core::rect<s32> rect = AbsoluteRect;
293 core::rect<s32> *cl = &AbsoluteClippingRect;
294
295 // draw body fast
296 rect = skin->draw3DWindowBackground(this, true, skin->getColor(EGDC_ACTIVE_BORDER),
297 AbsoluteRect, &AbsoluteClippingRect);
298
299 // draw window text
300 if (Text.size())
301 {
302 rect.UpperLeftCorner.X += skin->getSize(EGDS_TEXT_DISTANCE_X);
303 rect.UpperLeftCorner.Y += skin->getSize(EGDS_TEXT_DISTANCE_Y);
304 rect.LowerRightCorner.X -= skin->getSize(EGDS_WINDOW_BUTTON_WIDTH) + 5;
305
306 IGUIFont* font = skin->getFont();
307 if (font)
308 font->draw(Text.c_str(), rect, skin->getColor(EGDC_ACTIVE_CAPTION), false, true, cl);
309 }
310
311 IGUIElement::draw();
312}
313
314
315bool CGUITextureCacheBrowser::isDraggable() const
316{
317 return IsDraggable;
318}
319
320void CGUITextureCacheBrowser::setDraggable(bool draggable)
321{
322 IsDraggable = draggable;
323
324 if (Dragging && !IsDraggable)
325 Dragging = false;
326}
327
328
329//! Returns the rectangle of the drawable area (without border, without titlebar and without scrollbars)
330core::rect<s32> CGUITextureCacheBrowser::getClientRect() const
331{
332 return core::recti();
333}
334
335} // namespace gui
336} // namespace irr
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.h
new file mode 100644
index 0000000..108d4d6
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUITextureCacheBrowser.h
@@ -0,0 +1,88 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt / Gaz Davidson
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_GUI_TEXTURE_CACHE_BROWSER_H_INCLUDED__
6#define __C_GUI_TEXTURE_CACHE_BROWSER_H_INCLUDED__
7
8#include "IGUIWindow.h"
9#include "CGUIPanel.h"
10#include "IGUIImage.h"
11#include "EGUIEditTypes.h"
12
13namespace irr
14{
15namespace gui
16{
17
18 //! Texture cache browser
19
20 const u32 TEXTURE_BROWSER_TEXTURE_SELECTED = 0x5E1EC7ED; // custom event number for texture selected
21
22 class CGUITextureCacheBrowser : public IGUIWindow
23 {
24 public:
25
26 //! constructor
27 CGUITextureCacheBrowser(IGUIEnvironment* environment, s32 id=-1, IGUIElement *parent=0);
28
29 //! destructor
30 ~CGUITextureCacheBrowser();
31
32 //! event handler
33 virtual bool OnEvent(const SEvent &event);
34
35 //! draws the element
36 virtual void draw();
37
38 //! update absolute position
39 virtual void updateAbsolutePosition();
40
41 //! this shoudln't be serialized, but this is included as it's an example
42 virtual const c8* getTypeName() const { return "textureCacheBrowser"; }
43
44 //! Returns pointer to the close button
45 virtual IGUIButton* getCloseButton() const { return CloseButton; }
46
47 //! Returns pointer to the minimize button
48 virtual IGUIButton* getMinimizeButton() const { return 0;}
49
50 //! Returns pointer to the maximize button
51 virtual IGUIButton* getMaximizeButton() const { return 0;}
52
53 //! get draggable
54 virtual bool isDraggable() const;
55
56 //! get draggable
57 virtual void setDraggable(bool draggable);
58
59 //! not used
60 virtual core::rect<s32> getClientRect() const;
61 virtual void setDrawBackground(bool draw) { }
62 virtual bool getDrawBackground() const { return true; }
63 virtual void setDrawTitlebar(bool draw) { }
64 virtual bool getDrawTitlebar() const { return true; }
65
66
67 void setSelected(s32 index=-1);
68
69 private:
70
71 void updateImageList();
72
73 core::array<IGUIImage*> Images;
74 core::position2d<s32> DragStart;
75
76 IGUIButton* CloseButton;
77 CGUIPanel* Panel;
78 s32 SelectedTexture;
79 bool Dragging;
80 bool IsDraggable;
81 };
82
83
84} // end namespace gui
85} // end namespace irr
86
87#endif
88
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.cpp
new file mode 100644
index 0000000..0a69587
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.cpp
@@ -0,0 +1,95 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#include "CMemoryReadWriteFile.h"
6
7using namespace irr;
8using namespace io;
9
10CMemoryReadWriteFile::CMemoryReadWriteFile(const c8* filename)
11: Data(), FileName(filename), Pos(0)
12{
13}
14
15
16s32 CMemoryReadWriteFile::write(const void* buffer, u32 sizeToWrite)
17{
18 // no point in writing 0 bytes
19 if (sizeToWrite < 1)
20 return 0;
21
22 // expand size
23 if (Pos + sizeToWrite > Data.size())
24 Data.set_used(Pos+sizeToWrite);
25
26 // copy data
27 memcpy( (void*) &Data[Pos], buffer, (size_t) sizeToWrite);
28
29 Pos += sizeToWrite;
30
31 return sizeToWrite;
32
33}
34
35bool CMemoryReadWriteFile::seek(long finalPos, bool relativeMovement)
36{
37 if (relativeMovement)
38 {
39 if (finalPos + Pos < 0)
40 return 0;
41 else
42 Pos += finalPos;
43 }
44 else
45 {
46 Pos = finalPos;
47 }
48
49 if (Pos > (s32)Data.size())
50 Data.set_used(Pos+1);
51
52 return true;
53
54}
55
56const io::path& CMemoryReadWriteFile::getFileName() const
57{
58 return FileName;
59}
60
61long CMemoryReadWriteFile::getPos() const
62{
63 return Pos;
64}
65
66core::array<c8>& CMemoryReadWriteFile::getData()
67{
68 return Data;
69}
70
71
72long CMemoryReadWriteFile::getSize() const
73{
74 return Data.size();
75}
76
77
78s32 CMemoryReadWriteFile::read(void* buffer, u32 sizeToRead)
79{
80 // cant read past the end
81 if (Pos + sizeToRead >= Data.size())
82 sizeToRead = Data.size() - Pos;
83
84 // cant read 0 bytes
85 if (!sizeToRead)
86 return 0;
87
88 // copy data
89 memcpy( buffer, (void*) &Data[Pos], (size_t) sizeToRead);
90
91 Pos += sizeToRead;
92
93 return sizeToRead;
94}
95
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.h
new file mode 100644
index 0000000..de20ae7
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/CMemoryReadWriteFile.h
@@ -0,0 +1,73 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_MEMORY_READ_WRITE_FILE_H_INCLUDED__
6#define __C_MEMORY_READ_WRITE_FILE_H_INCLUDED__
7
8#include "IWriteFile.h"
9#include "IReadFile.h"
10#include "irrArray.h"
11#include "irrString.h"
12#include "memory.h"
13
14namespace irr
15{
16namespace io
17{
18
19 //! Provides write acess to an array as if it is a file.
20 class CMemoryReadWriteFile : public virtual IWriteFile, public virtual IReadFile
21 {
22 public:
23
24 CMemoryReadWriteFile(const c8* filename=0);
25
26 //! Reads an amount of bytes from the file.
27 //! \param buffer: Pointer to buffer of bytes to write.
28 //! \param sizeToWrite: Amount of bytes to wrtie to the file.
29 //! \return Returns how much bytes were written.
30 virtual s32 write(const void* buffer, u32 sizeToWrite);
31
32 //! Changes position in file, returns true if successful.
33 //! \param finalPos: Destination position in the file.
34 //! \param relativeMovement: If set to true, the position in the file is
35 //! changed relative to current position. Otherwise the position is changed
36 //! from begin of file.
37 //! \return Returns true if successful, otherwise false.
38 virtual bool seek(long finalPos, bool relativeMovement = false);
39
40 //! Returns size of file.
41 //! \return Returns the size of the file in bytes.
42 virtual long getSize() const;
43
44 //! Reads an amount of bytes from the file.
45 //! \param buffer: Pointer to buffer where to read bytes will be written to.
46 //! \param sizeToRead: Amount of bytes to read from the file.
47 //! \return Returns how much bytes were read.
48 virtual s32 read(void* buffer, u32 sizeToRead);
49
50 //! Returns the current position in the file.
51 //! \return Returns the current position in the file in bytes.
52 virtual long getPos() const;
53
54 //! Returns name of file.
55 //! \return Returns the file name as zero terminated character string.
56 virtual const io::path& getFileName() const;
57
58 //! Returns file data as an array
59 core::array<c8>& getData();
60
61 private:
62
63 core::array<c8> Data;
64 io::path FileName;
65 long Pos;
66 };
67
68
69
70} // end namespace io
71} // end namespace irr
72
73#endif // __C_MEMORY_READ_WRITE_FILE_H_INCLUDED__
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/EGUIEditTypes.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/EGUIEditTypes.h
new file mode 100644
index 0000000..88d119e
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/EGUIEditTypes.h
@@ -0,0 +1,61 @@
1#ifndef __C_GUIEDIT_TYPES_H_INCLUDED__
2#define __C_GUIEDIT_TYPES_H_INCLUDED__
3
4#include "irrTypes.h"
5
6namespace irr {
7namespace gui {
8
9enum EGUIEDIT_ELEMENT_TYPES
10{
11 // GUI Editor
12 EGUIEDIT_GUIEDIT=0,
13 EGUIEDIT_GUIEDITWINDOW,
14 // Generic
15 EGUIEDIT_GUIPANEL,
16 EGUIEDIT_TEXTUREBROWSER,
17 // Attribute editors
18 EGUIEDIT_ATTRIBUTEEDITOR,
19 EGUIEDIT_STRINGATTRIBUTE,
20 EGUIEDIT_BOOLATTRIBUTE,
21 EGUIEDIT_ENUMATTRIBUTE,
22 EGUIEDIT_COLORATTRIBUTE,
23 EGUIEDIT_COLORFATTRIBUTE,
24 EGUIEDIT_TEXTUREATTRIBUTE,
25 // Dummy editor stubs
26 EGUIEDIT_CONTEXTMENUEDITOR,
27 EGUIEDIT_MENUEDITOR,
28 EGUIEDIT_FILEDIALOGEDITOR,
29 EGUIEDIT_COLORDIALOGEDITOR,
30 EGUIEDIT_MODALSCREENEDITOR,
31 // Count
32 EGUIEDIT_COUNT
33};
34
35const c8* const GUIEditElementTypeNames[] =
36{
37 "GUIEditor",
38 "GUIEditWindow",
39 "panel",
40 "textureCacheBrowser",
41 "attributeEditor",
42 "string_attribute",
43 "bool_attribute",
44 "enum_attribute",
45 "color_attribute",
46 "colorf_attribute",
47 "texture_attribute",
48 // dummy editors
49 "contextMenu_editor",
50 "menu_editor",
51 "fileOpenDialog_editor",
52 "colorSelectDialog_editor",
53 "modalScreen_editor",
54 0
55};
56
57} // gui
58} // irr
59
60#endif
61
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.sln b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.sln
new file mode 100644
index 0000000..6f76269
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.sln
@@ -0,0 +1,20 @@
1
2Microsoft Visual Studio Solution File, Format Version 9.00
3# Visual C++ Express 2005
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUI Editor", "GUI Editor.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Debug|Win32 = Debug|Win32
9 Release|Win32 = Release|Win32
10 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32
13 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32
14 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32
15 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32
16 EndGlobalSection
17 GlobalSection(SolutionProperties) = preSolution
18 HideSolutionNode = FALSE
19 EndGlobalSection
20EndGlobal
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.vcproj b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.vcproj
new file mode 100644
index 0000000..81c6fa9
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v8.vcproj
@@ -0,0 +1,295 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="GUI Editor"
6 ProjectGUID="{853A396E-C031-4C26-A716-5B4E176BE11D}"
7 RootNamespace="GUI Editor"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="Debug"
21 IntermediateDirectory="Debug"
22 ConfigurationType="1"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="2"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 FavorSizeOrSpeed="0"
45 WholeProgramOptimization="false"
46 AdditionalIncludeDirectories="..\..\include"
47 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
48 MinimalRebuild="true"
49 BasicRuntimeChecks="3"
50 RuntimeLibrary="1"
51 UsePrecompiledHeader="0"
52 WarningLevel="3"
53 Detect64BitPortabilityProblems="true"
54 DebugInformationFormat="4"
55 />
56 <Tool
57 Name="VCManagedResourceCompilerTool"
58 />
59 <Tool
60 Name="VCResourceCompilerTool"
61 />
62 <Tool
63 Name="VCPreLinkEventTool"
64 />
65 <Tool
66 Name="VCLinkerTool"
67 AdditionalOptions=" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib "
68 OutputFile="../../bin/Win32-visualstudio/GUIEditor.exe"
69 LinkIncremental="2"
70 AdditionalLibraryDirectories="&quot;..\..\lib\Win32-visualstudio&quot;"
71 GenerateDebugInformation="true"
72 ProgramDatabaseFile="$(OutDir)/GUIEditor.pdb"
73 SubSystem="1"
74 TargetMachine="1"
75 />
76 <Tool
77 Name="VCALinkTool"
78 />
79 <Tool
80 Name="VCManifestTool"
81 />
82 <Tool
83 Name="VCXDCMakeTool"
84 />
85 <Tool
86 Name="VCBscMakeTool"
87 />
88 <Tool
89 Name="VCFxCopTool"
90 />
91 <Tool
92 Name="VCAppVerifierTool"
93 />
94 <Tool
95 Name="VCWebDeploymentTool"
96 />
97 <Tool
98 Name="VCPostBuildEventTool"
99 />
100 </Configuration>
101 <Configuration
102 Name="Release|Win32"
103 OutputDirectory="Release"
104 IntermediateDirectory="Release"
105 ConfigurationType="1"
106 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
107 CharacterSet="2"
108 >
109 <Tool
110 Name="VCPreBuildEventTool"
111 />
112 <Tool
113 Name="VCCustomBuildTool"
114 />
115 <Tool
116 Name="VCXMLDataGeneratorTool"
117 />
118 <Tool
119 Name="VCWebServiceProxyGeneratorTool"
120 />
121 <Tool
122 Name="VCMIDLTool"
123 />
124 <Tool
125 Name="VCCLCompilerTool"
126 Optimization="3"
127 WholeProgramOptimization="true"
128 AdditionalIncludeDirectories="..\..\include"
129 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
130 RuntimeLibrary="0"
131 UsePrecompiledHeader="0"
132 WarningLevel="3"
133 Detect64BitPortabilityProblems="true"
134 DebugInformationFormat="3"
135 />
136 <Tool
137 Name="VCManagedResourceCompilerTool"
138 />
139 <Tool
140 Name="VCResourceCompilerTool"
141 />
142 <Tool
143 Name="VCPreLinkEventTool"
144 />
145 <Tool
146 Name="VCLinkerTool"
147 OutputFile="../../bin/Win32-visualstudio/GUIEditor.exe"
148 LinkIncremental="1"
149 GenerateDebugInformation="true"
150 SubSystem="1"
151 OptimizeReferences="2"
152 EnableCOMDATFolding="2"
153 TargetMachine="1"
154 />
155 <Tool
156 Name="VCALinkTool"
157 />
158 <Tool
159 Name="VCManifestTool"
160 />
161 <Tool
162 Name="VCXDCMakeTool"
163 />
164 <Tool
165 Name="VCBscMakeTool"
166 />
167 <Tool
168 Name="VCFxCopTool"
169 />
170 <Tool
171 Name="VCAppVerifierTool"
172 />
173 <Tool
174 Name="VCWebDeploymentTool"
175 />
176 <Tool
177 Name="VCPostBuildEventTool"
178 />
179 </Configuration>
180 </Configurations>
181 <References>
182 </References>
183 <Files>
184 <Filter
185 Name="gui"
186 >
187 <File
188 RelativePath=".\CGUIEditFactory.cpp"
189 >
190 </File>
191 <File
192 RelativePath=".\CGUIEditFactory.h"
193 >
194 </File>
195 <File
196 RelativePath=".\CGUIEditWindow.cpp"
197 >
198 </File>
199 <File
200 RelativePath=".\CGUIEditWindow.h"
201 >
202 </File>
203 <File
204 RelativePath=".\CGUIEditWorkspace.cpp"
205 >
206 </File>
207 <File
208 RelativePath=".\CGUIEditWorkspace.h"
209 >
210 </File>
211 <File
212 RelativePath=".\CGUITextureCacheBrowser.cpp"
213 >
214 </File>
215 <File
216 RelativePath=".\CGUITextureCacheBrowser.h"
217 >
218 </File>
219 <Filter
220 Name="GUIAttributes"
221 >
222 <File
223 RelativePath=".\CGUIAttribute.h"
224 >
225 </File>
226 <File
227 RelativePath=".\CGUIAttributeEditor.cpp"
228 >
229 </File>
230 <File
231 RelativePath=".\CGUIAttributeEditor.h"
232 >
233 </File>
234 <File
235 RelativePath=".\CGUIBoolAttribute.h"
236 >
237 </File>
238 <File
239 RelativePath=".\CGUIColorAttribute.h"
240 >
241 </File>
242 <File
243 RelativePath=".\CGUIEnumAttribute.h"
244 >
245 </File>
246 <File
247 RelativePath=".\CGUIStringAttribute.h"
248 >
249 </File>
250 <File
251 RelativePath=".\CGUITextureAttribute.h"
252 >
253 </File>
254 </Filter>
255 <Filter
256 Name="Useful GUI Elements"
257 >
258 <File
259 RelativePath=".\CGUIPanel.cpp"
260 >
261 </File>
262 <File
263 RelativePath=".\CGUIPanel.h"
264 >
265 </File>
266 </Filter>
267 <Filter
268 Name="Element Editors"
269 >
270 <File
271 RelativePath=".\CGUIDummyEditorStub.h"
272 >
273 </File>
274 </Filter>
275 </Filter>
276 <Filter
277 Name="io"
278 >
279 <File
280 RelativePath=".\CMemoryReadWriteFile.cpp"
281 >
282 </File>
283 <File
284 RelativePath=".\CMemoryReadWriteFile.h"
285 >
286 </File>
287 </Filter>
288 <File
289 RelativePath=".\main.cpp"
290 >
291 </File>
292 </Files>
293 <Globals>
294 </Globals>
295</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.sln b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.sln
new file mode 100644
index 0000000..0acf300
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.sln
@@ -0,0 +1,20 @@
1
2Microsoft Visual Studio Solution File, Format Version 10.00
3# Visual C++ Express 2008
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUI Editor_v9", "GUI Editor_v9.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Debug|Win32 = Debug|Win32
9 Release|Win32 = Release|Win32
10 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32
13 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32
14 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32
15 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32
16 EndGlobalSection
17 GlobalSection(SolutionProperties) = preSolution
18 HideSolutionNode = FALSE
19 EndGlobalSection
20EndGlobal
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.vcproj b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.vcproj
new file mode 100644
index 0000000..6d73d03
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_v9.vcproj
@@ -0,0 +1,293 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="9,00"
5 Name="GUI Editor_v9"
6 ProjectGUID="{853A396E-C031-4C26-A716-5B4E176BE11D}"
7 RootNamespace="GUI Editor"
8 Keyword="Win32Proj"
9 TargetFrameworkVersion="131072"
10 >
11 <Platforms>
12 <Platform
13 Name="Win32"
14 />
15 </Platforms>
16 <ToolFiles>
17 </ToolFiles>
18 <Configurations>
19 <Configuration
20 Name="Debug|Win32"
21 OutputDirectory="Debug"
22 IntermediateDirectory="Debug"
23 ConfigurationType="1"
24 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
25 CharacterSet="2"
26 >
27 <Tool
28 Name="VCPreBuildEventTool"
29 />
30 <Tool
31 Name="VCCustomBuildTool"
32 />
33 <Tool
34 Name="VCXMLDataGeneratorTool"
35 />
36 <Tool
37 Name="VCWebServiceProxyGeneratorTool"
38 />
39 <Tool
40 Name="VCMIDLTool"
41 />
42 <Tool
43 Name="VCCLCompilerTool"
44 Optimization="0"
45 FavorSizeOrSpeed="0"
46 WholeProgramOptimization="false"
47 AdditionalIncludeDirectories="..\..\include"
48 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
49 MinimalRebuild="true"
50 BasicRuntimeChecks="3"
51 RuntimeLibrary="1"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 DebugInformationFormat="4"
55 />
56 <Tool
57 Name="VCManagedResourceCompilerTool"
58 />
59 <Tool
60 Name="VCResourceCompilerTool"
61 />
62 <Tool
63 Name="VCPreLinkEventTool"
64 />
65 <Tool
66 Name="VCLinkerTool"
67 AdditionalOptions=" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib "
68 OutputFile="../../bin/Win32-visualstudio/GUIEditor.exe"
69 LinkIncremental="2"
70 AdditionalLibraryDirectories="&quot;..\..\lib\Win32-visualstudio&quot;"
71 GenerateDebugInformation="true"
72 ProgramDatabaseFile="$(OutDir)/GUIEditor.pdb"
73 SubSystem="1"
74 RandomizedBaseAddress="1"
75 DataExecutionPrevention="0"
76 TargetMachine="1"
77 />
78 <Tool
79 Name="VCALinkTool"
80 />
81 <Tool
82 Name="VCManifestTool"
83 />
84 <Tool
85 Name="VCXDCMakeTool"
86 />
87 <Tool
88 Name="VCBscMakeTool"
89 />
90 <Tool
91 Name="VCFxCopTool"
92 />
93 <Tool
94 Name="VCAppVerifierTool"
95 />
96 <Tool
97 Name="VCPostBuildEventTool"
98 />
99 </Configuration>
100 <Configuration
101 Name="Release|Win32"
102 OutputDirectory="Release"
103 IntermediateDirectory="Release"
104 ConfigurationType="1"
105 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
106 CharacterSet="2"
107 >
108 <Tool
109 Name="VCPreBuildEventTool"
110 />
111 <Tool
112 Name="VCCustomBuildTool"
113 />
114 <Tool
115 Name="VCXMLDataGeneratorTool"
116 />
117 <Tool
118 Name="VCWebServiceProxyGeneratorTool"
119 />
120 <Tool
121 Name="VCMIDLTool"
122 />
123 <Tool
124 Name="VCCLCompilerTool"
125 Optimization="3"
126 AdditionalIncludeDirectories="..\..\include"
127 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
128 RuntimeLibrary="0"
129 UsePrecompiledHeader="0"
130 WarningLevel="3"
131 Detect64BitPortabilityProblems="false"
132 DebugInformationFormat="3"
133 />
134 <Tool
135 Name="VCManagedResourceCompilerTool"
136 />
137 <Tool
138 Name="VCResourceCompilerTool"
139 />
140 <Tool
141 Name="VCPreLinkEventTool"
142 />
143 <Tool
144 Name="VCLinkerTool"
145 OutputFile="../../bin/Win32-visualstudio/GUIEditor.exe"
146 LinkIncremental="1"
147 AdditionalLibraryDirectories="../../lib/Win32-Visualstudio"
148 GenerateDebugInformation="true"
149 SubSystem="1"
150 OptimizeReferences="2"
151 EnableCOMDATFolding="2"
152 RandomizedBaseAddress="1"
153 DataExecutionPrevention="0"
154 TargetMachine="1"
155 />
156 <Tool
157 Name="VCALinkTool"
158 />
159 <Tool
160 Name="VCManifestTool"
161 />
162 <Tool
163 Name="VCXDCMakeTool"
164 />
165 <Tool
166 Name="VCBscMakeTool"
167 />
168 <Tool
169 Name="VCFxCopTool"
170 />
171 <Tool
172 Name="VCAppVerifierTool"
173 />
174 <Tool
175 Name="VCPostBuildEventTool"
176 />
177 </Configuration>
178 </Configurations>
179 <References>
180 </References>
181 <Files>
182 <Filter
183 Name="gui"
184 >
185 <File
186 RelativePath=".\CGUIEditFactory.cpp"
187 >
188 </File>
189 <File
190 RelativePath=".\CGUIEditFactory.h"
191 >
192 </File>
193 <File
194 RelativePath=".\CGUIEditWindow.cpp"
195 >
196 </File>
197 <File
198 RelativePath=".\CGUIEditWindow.h"
199 >
200 </File>
201 <File
202 RelativePath=".\CGUIEditWorkspace.cpp"
203 >
204 </File>
205 <File
206 RelativePath=".\CGUIEditWorkspace.h"
207 >
208 </File>
209 <File
210 RelativePath=".\CGUITextureCacheBrowser.cpp"
211 >
212 </File>
213 <File
214 RelativePath=".\CGUITextureCacheBrowser.h"
215 >
216 </File>
217 <Filter
218 Name="GUIAttributes"
219 >
220 <File
221 RelativePath=".\CGUIAttribute.h"
222 >
223 </File>
224 <File
225 RelativePath=".\CGUIAttributeEditor.cpp"
226 >
227 </File>
228 <File
229 RelativePath=".\CGUIAttributeEditor.h"
230 >
231 </File>
232 <File
233 RelativePath=".\CGUIBoolAttribute.h"
234 >
235 </File>
236 <File
237 RelativePath=".\CGUIColorAttribute.h"
238 >
239 </File>
240 <File
241 RelativePath=".\CGUIEnumAttribute.h"
242 >
243 </File>
244 <File
245 RelativePath=".\CGUIStringAttribute.h"
246 >
247 </File>
248 <File
249 RelativePath=".\CGUITextureAttribute.h"
250 >
251 </File>
252 </Filter>
253 <Filter
254 Name="Useful GUI Elements"
255 >
256 <File
257 RelativePath=".\CGUIPanel.cpp"
258 >
259 </File>
260 <File
261 RelativePath=".\CGUIPanel.h"
262 >
263 </File>
264 </Filter>
265 <Filter
266 Name="Element Editors"
267 >
268 <File
269 RelativePath=".\CGUIDummyEditorStub.h"
270 >
271 </File>
272 </Filter>
273 </Filter>
274 <Filter
275 Name="io"
276 >
277 <File
278 RelativePath=".\CMemoryReadWriteFile.cpp"
279 >
280 </File>
281 <File
282 RelativePath=".\CMemoryReadWriteFile.h"
283 >
284 </File>
285 </Filter>
286 <File
287 RelativePath=".\main.cpp"
288 >
289 </File>
290 </Files>
291 <Globals>
292 </Globals>
293</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj
new file mode 100644
index 0000000..7022876
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj
@@ -0,0 +1,213 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectGuid>{853A396E-C031-4C26-A716-5B4E176BE11D}</ProjectGuid>
23 <RootNamespace>GUI Editor</RootNamespace>
24 <Keyword>Win32Proj</Keyword>
25 <ProjectName>GUIEditor</ProjectName>
26 </PropertyGroup>
27 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
29 <ConfigurationType>Application</ConfigurationType>
30 <CharacterSet>MultiByte</CharacterSet>
31 </PropertyGroup>
32 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
33 <ConfigurationType>Application</ConfigurationType>
34 <CharacterSet>MultiByte</CharacterSet>
35 </PropertyGroup>
36 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
37 <ConfigurationType>Application</ConfigurationType>
38 <CharacterSet>MultiByte</CharacterSet>
39 </PropertyGroup>
40 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
41 <ConfigurationType>Application</ConfigurationType>
42 <CharacterSet>MultiByte</CharacterSet>
43 </PropertyGroup>
44 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
45 <ImportGroup Label="ExtensionSettings">
46 </ImportGroup>
47 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
48 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
49 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
50 </ImportGroup>
51 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
52 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
53 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
54 </ImportGroup>
55 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
56 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
58 </ImportGroup>
59 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
60 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
62 </ImportGroup>
63 <PropertyGroup Label="UserMacros" />
64 <PropertyGroup>
65 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
66 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
67 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
68 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
69 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
70 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
71 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
72 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
73 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
74 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
75 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
76 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
77 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
78 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
79 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
80 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
81 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
82 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
83 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
84 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
85 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
86 </PropertyGroup>
87 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
88 <ClCompile>
89 <Optimization>Disabled</Optimization>
90 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
91 <WholeProgramOptimization>false</WholeProgramOptimization>
92 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
93 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
94 <MinimalRebuild>true</MinimalRebuild>
95 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
96 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
97 <PrecompiledHeader>
98 </PrecompiledHeader>
99 <WarningLevel>Level3</WarningLevel>
100 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
101 </ClCompile>
102 <Link>
103 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
104 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
105 <GenerateDebugInformation>true</GenerateDebugInformation>
106 <SubSystem>Console</SubSystem>
107 <DataExecutionPrevention>
108 </DataExecutionPrevention>
109 </Link>
110 </ItemDefinitionGroup>
111 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
112 <ClCompile>
113 <Optimization>Disabled</Optimization>
114 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
115 <WholeProgramOptimization>false</WholeProgramOptimization>
116 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
117 <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
119 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
120 <PrecompiledHeader>
121 </PrecompiledHeader>
122 <WarningLevel>Level3</WarningLevel>
123 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
124 </ClCompile>
125 <Link>
126 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
127 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
128 <GenerateDebugInformation>true</GenerateDebugInformation>
129 <SubSystem>Console</SubSystem>
130 <DataExecutionPrevention>
131 </DataExecutionPrevention>
132 </Link>
133 </ItemDefinitionGroup>
134 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
135 <ClCompile>
136 <Optimization>Full</Optimization>
137 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
138 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
139 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
140 <PrecompiledHeader>
141 </PrecompiledHeader>
142 <WarningLevel>Level3</WarningLevel>
143 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
144 </ClCompile>
145 <Link>
146 <OutputFile>../../bin/Win32-visualstudio/GUIEditor.exe</OutputFile>
147 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
148 <GenerateDebugInformation>true</GenerateDebugInformation>
149 <SubSystem>Console</SubSystem>
150 <OptimizeReferences>true</OptimizeReferences>
151 <EnableCOMDATFolding>true</EnableCOMDATFolding>
152 <DataExecutionPrevention>
153 </DataExecutionPrevention>
154 </Link>
155 </ItemDefinitionGroup>
156 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
157 <ClCompile>
158 <Optimization>Full</Optimization>
159 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
160 <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
161 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
162 <PrecompiledHeader>
163 </PrecompiledHeader>
164 <WarningLevel>Level3</WarningLevel>
165 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
166 </ClCompile>
167 <Link>
168 <OutputFile>../../bin/Win32-visualstudio/GUIEditor.exe</OutputFile>
169 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
170 <GenerateDebugInformation>true</GenerateDebugInformation>
171 <SubSystem>Console</SubSystem>
172 <OptimizeReferences>true</OptimizeReferences>
173 <EnableCOMDATFolding>true</EnableCOMDATFolding>
174 <DataExecutionPrevention>
175 </DataExecutionPrevention>
176 </Link>
177 </ItemDefinitionGroup>
178 <ItemGroup>
179 <ClCompile Include="CGUIEditFactory.cpp" />
180 <ClCompile Include="CGUIEditWindow.cpp" />
181 <ClCompile Include="CGUIEditWorkspace.cpp" />
182 <ClCompile Include="CGUITextureCacheBrowser.cpp" />
183 <ClCompile Include="CGUIAttributeEditor.cpp" />
184 <ClCompile Include="CGUIPanel.cpp" />
185 <ClCompile Include="CMemoryReadWriteFile.cpp" />
186 <ClCompile Include="main.cpp" />
187 </ItemGroup>
188 <ItemGroup>
189 <ClInclude Include="CGUIEditFactory.h" />
190 <ClInclude Include="CGUIEditWindow.h" />
191 <ClInclude Include="CGUIEditWorkspace.h" />
192 <ClInclude Include="CGUITextureCacheBrowser.h" />
193 <ClInclude Include="CGUIAttribute.h" />
194 <ClInclude Include="CGUIAttributeEditor.h" />
195 <ClInclude Include="CGUIBoolAttribute.h" />
196 <ClInclude Include="CGUIColorAttribute.h" />
197 <ClInclude Include="CGUIEnumAttribute.h" />
198 <ClInclude Include="CGUIStringAttribute.h" />
199 <ClInclude Include="CGUITextureAttribute.h" />
200 <ClInclude Include="CGUIPanel.h" />
201 <ClInclude Include="CGUIDummyEditorStub.h" />
202 <ClInclude Include="CMemoryReadWriteFile.h" />
203 </ItemGroup>
204 <ItemGroup>
205 <ProjectReference Include="..\..\source\Irrlicht\Irrlicht10.0.vcxproj">
206 <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project>
207 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
208 </ProjectReference>
209 </ItemGroup>
210 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
211 <ImportGroup Label="ExtensionTargets">
212 </ImportGroup>
213</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj.filters b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj.filters
new file mode 100644
index 0000000..1d06fa4
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc10.vcxproj.filters
@@ -0,0 +1,88 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="gui">
5 <UniqueIdentifier>{f6ad9df9-ebaa-4c0f-997b-c8101c1fc669}</UniqueIdentifier>
6 </Filter>
7 <Filter Include="gui\GUIAttributes">
8 <UniqueIdentifier>{7fd14cb1-d2e7-4fd0-85c1-68fc9d1249f7}</UniqueIdentifier>
9 </Filter>
10 <Filter Include="gui\Useful GUI Elements">
11 <UniqueIdentifier>{ab2c3f3a-1d99-4619-b5df-47fdd9449f3f}</UniqueIdentifier>
12 </Filter>
13 <Filter Include="gui\Element Editors">
14 <UniqueIdentifier>{740a4255-37cc-4ac4-94e9-f2f0970491a8}</UniqueIdentifier>
15 </Filter>
16 <Filter Include="io">
17 <UniqueIdentifier>{a28a0b21-3336-432f-9759-ff2dc064874a}</UniqueIdentifier>
18 </Filter>
19 </ItemGroup>
20 <ItemGroup>
21 <ClCompile Include="CGUIEditFactory.cpp">
22 <Filter>gui</Filter>
23 </ClCompile>
24 <ClCompile Include="CGUIEditWindow.cpp">
25 <Filter>gui</Filter>
26 </ClCompile>
27 <ClCompile Include="CGUIEditWorkspace.cpp">
28 <Filter>gui</Filter>
29 </ClCompile>
30 <ClCompile Include="CGUITextureCacheBrowser.cpp">
31 <Filter>gui</Filter>
32 </ClCompile>
33 <ClCompile Include="CGUIAttributeEditor.cpp">
34 <Filter>gui\GUIAttributes</Filter>
35 </ClCompile>
36 <ClCompile Include="CGUIPanel.cpp">
37 <Filter>gui\Useful GUI Elements</Filter>
38 </ClCompile>
39 <ClCompile Include="CMemoryReadWriteFile.cpp">
40 <Filter>io</Filter>
41 </ClCompile>
42 <ClCompile Include="main.cpp" />
43 </ItemGroup>
44 <ItemGroup>
45 <ClInclude Include="CGUIEditFactory.h">
46 <Filter>gui</Filter>
47 </ClInclude>
48 <ClInclude Include="CGUIEditWindow.h">
49 <Filter>gui</Filter>
50 </ClInclude>
51 <ClInclude Include="CGUIEditWorkspace.h">
52 <Filter>gui</Filter>
53 </ClInclude>
54 <ClInclude Include="CGUITextureCacheBrowser.h">
55 <Filter>gui</Filter>
56 </ClInclude>
57 <ClInclude Include="CGUIAttribute.h">
58 <Filter>gui\GUIAttributes</Filter>
59 </ClInclude>
60 <ClInclude Include="CGUIAttributeEditor.h">
61 <Filter>gui\GUIAttributes</Filter>
62 </ClInclude>
63 <ClInclude Include="CGUIBoolAttribute.h">
64 <Filter>gui\GUIAttributes</Filter>
65 </ClInclude>
66 <ClInclude Include="CGUIColorAttribute.h">
67 <Filter>gui\GUIAttributes</Filter>
68 </ClInclude>
69 <ClInclude Include="CGUIEnumAttribute.h">
70 <Filter>gui\GUIAttributes</Filter>
71 </ClInclude>
72 <ClInclude Include="CGUIStringAttribute.h">
73 <Filter>gui\GUIAttributes</Filter>
74 </ClInclude>
75 <ClInclude Include="CGUITextureAttribute.h">
76 <Filter>gui\GUIAttributes</Filter>
77 </ClInclude>
78 <ClInclude Include="CGUIPanel.h">
79 <Filter>gui\Useful GUI Elements</Filter>
80 </ClInclude>
81 <ClInclude Include="CGUIDummyEditorStub.h">
82 <Filter>gui\Element Editors</Filter>
83 </ClInclude>
84 <ClInclude Include="CMemoryReadWriteFile.h">
85 <Filter>io</Filter>
86 </ClInclude>
87 </ItemGroup>
88</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj
new file mode 100644
index 0000000..6c6f28b
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj
@@ -0,0 +1,217 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectGuid>{853A396E-C031-4C26-A716-5B4E176BE11D}</ProjectGuid>
23 <RootNamespace>GUI Editor</RootNamespace>
24 <Keyword>Win32Proj</Keyword>
25 <ProjectName>GUIEditor</ProjectName>
26 </PropertyGroup>
27 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
29 <ConfigurationType>Application</ConfigurationType>
30 <CharacterSet>MultiByte</CharacterSet>
31 <PlatformToolset>v110</PlatformToolset>
32 </PropertyGroup>
33 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
34 <ConfigurationType>Application</ConfigurationType>
35 <CharacterSet>MultiByte</CharacterSet>
36 <PlatformToolset>v110</PlatformToolset>
37 </PropertyGroup>
38 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
39 <ConfigurationType>Application</ConfigurationType>
40 <CharacterSet>MultiByte</CharacterSet>
41 <PlatformToolset>v110</PlatformToolset>
42 </PropertyGroup>
43 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
44 <ConfigurationType>Application</ConfigurationType>
45 <CharacterSet>MultiByte</CharacterSet>
46 <PlatformToolset>v110</PlatformToolset>
47 </PropertyGroup>
48 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
49 <ImportGroup Label="ExtensionSettings">
50 </ImportGroup>
51 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
52 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
53 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
54 </ImportGroup>
55 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
56 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
58 </ImportGroup>
59 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
60 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
62 </ImportGroup>
63 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
64 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
66 </ImportGroup>
67 <PropertyGroup Label="UserMacros" />
68 <PropertyGroup>
69 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
70 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
71 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
72 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
73 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
74 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
75 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
76 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
77 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
78 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
79 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
80 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
81 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
82 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
83 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
84 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
85 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
86 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
87 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
88 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
89 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
90 </PropertyGroup>
91 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
92 <ClCompile>
93 <Optimization>Disabled</Optimization>
94 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
95 <WholeProgramOptimization>false</WholeProgramOptimization>
96 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
97 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
98 <MinimalRebuild>true</MinimalRebuild>
99 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
100 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
101 <PrecompiledHeader>
102 </PrecompiledHeader>
103 <WarningLevel>Level3</WarningLevel>
104 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
105 </ClCompile>
106 <Link>
107 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
108 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
109 <GenerateDebugInformation>true</GenerateDebugInformation>
110 <SubSystem>Console</SubSystem>
111 <DataExecutionPrevention>
112 </DataExecutionPrevention>
113 </Link>
114 </ItemDefinitionGroup>
115 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
116 <ClCompile>
117 <Optimization>Disabled</Optimization>
118 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
119 <WholeProgramOptimization>false</WholeProgramOptimization>
120 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
121 <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
122 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
123 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
124 <PrecompiledHeader>
125 </PrecompiledHeader>
126 <WarningLevel>Level3</WarningLevel>
127 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
128 </ClCompile>
129 <Link>
130 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
131 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
132 <GenerateDebugInformation>true</GenerateDebugInformation>
133 <SubSystem>Console</SubSystem>
134 <DataExecutionPrevention>
135 </DataExecutionPrevention>
136 </Link>
137 </ItemDefinitionGroup>
138 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
139 <ClCompile>
140 <Optimization>Full</Optimization>
141 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
142 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
143 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
144 <PrecompiledHeader>
145 </PrecompiledHeader>
146 <WarningLevel>Level3</WarningLevel>
147 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
148 </ClCompile>
149 <Link>
150 <OutputFile>../../bin/Win32-visualstudio/GUIEditor.exe</OutputFile>
151 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
152 <GenerateDebugInformation>true</GenerateDebugInformation>
153 <SubSystem>Console</SubSystem>
154 <OptimizeReferences>true</OptimizeReferences>
155 <EnableCOMDATFolding>true</EnableCOMDATFolding>
156 <DataExecutionPrevention>
157 </DataExecutionPrevention>
158 </Link>
159 </ItemDefinitionGroup>
160 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
161 <ClCompile>
162 <Optimization>Full</Optimization>
163 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
164 <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
165 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
166 <PrecompiledHeader>
167 </PrecompiledHeader>
168 <WarningLevel>Level3</WarningLevel>
169 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
170 </ClCompile>
171 <Link>
172 <OutputFile>../../bin/Win32-visualstudio/GUIEditor.exe</OutputFile>
173 <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
174 <GenerateDebugInformation>true</GenerateDebugInformation>
175 <SubSystem>Console</SubSystem>
176 <OptimizeReferences>true</OptimizeReferences>
177 <EnableCOMDATFolding>true</EnableCOMDATFolding>
178 <DataExecutionPrevention>
179 </DataExecutionPrevention>
180 </Link>
181 </ItemDefinitionGroup>
182 <ItemGroup>
183 <ClCompile Include="CGUIEditFactory.cpp" />
184 <ClCompile Include="CGUIEditWindow.cpp" />
185 <ClCompile Include="CGUIEditWorkspace.cpp" />
186 <ClCompile Include="CGUITextureCacheBrowser.cpp" />
187 <ClCompile Include="CGUIAttributeEditor.cpp" />
188 <ClCompile Include="CGUIPanel.cpp" />
189 <ClCompile Include="CMemoryReadWriteFile.cpp" />
190 <ClCompile Include="main.cpp" />
191 </ItemGroup>
192 <ItemGroup>
193 <ClInclude Include="CGUIEditFactory.h" />
194 <ClInclude Include="CGUIEditWindow.h" />
195 <ClInclude Include="CGUIEditWorkspace.h" />
196 <ClInclude Include="CGUITextureCacheBrowser.h" />
197 <ClInclude Include="CGUIAttribute.h" />
198 <ClInclude Include="CGUIAttributeEditor.h" />
199 <ClInclude Include="CGUIBoolAttribute.h" />
200 <ClInclude Include="CGUIColorAttribute.h" />
201 <ClInclude Include="CGUIEnumAttribute.h" />
202 <ClInclude Include="CGUIStringAttribute.h" />
203 <ClInclude Include="CGUITextureAttribute.h" />
204 <ClInclude Include="CGUIPanel.h" />
205 <ClInclude Include="CGUIDummyEditorStub.h" />
206 <ClInclude Include="CMemoryReadWriteFile.h" />
207 </ItemGroup>
208 <ItemGroup>
209 <ProjectReference Include="..\..\source\Irrlicht\Irrlicht11.0.vcxproj">
210 <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project>
211 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
212 </ProjectReference>
213 </ItemGroup>
214 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
215 <ImportGroup Label="ExtensionTargets">
216 </ImportGroup>
217</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj.filters b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj.filters
new file mode 100644
index 0000000..1d06fa4
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUI Editor_vc11.vcxproj.filters
@@ -0,0 +1,88 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup>
4 <Filter Include="gui">
5 <UniqueIdentifier>{f6ad9df9-ebaa-4c0f-997b-c8101c1fc669}</UniqueIdentifier>
6 </Filter>
7 <Filter Include="gui\GUIAttributes">
8 <UniqueIdentifier>{7fd14cb1-d2e7-4fd0-85c1-68fc9d1249f7}</UniqueIdentifier>
9 </Filter>
10 <Filter Include="gui\Useful GUI Elements">
11 <UniqueIdentifier>{ab2c3f3a-1d99-4619-b5df-47fdd9449f3f}</UniqueIdentifier>
12 </Filter>
13 <Filter Include="gui\Element Editors">
14 <UniqueIdentifier>{740a4255-37cc-4ac4-94e9-f2f0970491a8}</UniqueIdentifier>
15 </Filter>
16 <Filter Include="io">
17 <UniqueIdentifier>{a28a0b21-3336-432f-9759-ff2dc064874a}</UniqueIdentifier>
18 </Filter>
19 </ItemGroup>
20 <ItemGroup>
21 <ClCompile Include="CGUIEditFactory.cpp">
22 <Filter>gui</Filter>
23 </ClCompile>
24 <ClCompile Include="CGUIEditWindow.cpp">
25 <Filter>gui</Filter>
26 </ClCompile>
27 <ClCompile Include="CGUIEditWorkspace.cpp">
28 <Filter>gui</Filter>
29 </ClCompile>
30 <ClCompile Include="CGUITextureCacheBrowser.cpp">
31 <Filter>gui</Filter>
32 </ClCompile>
33 <ClCompile Include="CGUIAttributeEditor.cpp">
34 <Filter>gui\GUIAttributes</Filter>
35 </ClCompile>
36 <ClCompile Include="CGUIPanel.cpp">
37 <Filter>gui\Useful GUI Elements</Filter>
38 </ClCompile>
39 <ClCompile Include="CMemoryReadWriteFile.cpp">
40 <Filter>io</Filter>
41 </ClCompile>
42 <ClCompile Include="main.cpp" />
43 </ItemGroup>
44 <ItemGroup>
45 <ClInclude Include="CGUIEditFactory.h">
46 <Filter>gui</Filter>
47 </ClInclude>
48 <ClInclude Include="CGUIEditWindow.h">
49 <Filter>gui</Filter>
50 </ClInclude>
51 <ClInclude Include="CGUIEditWorkspace.h">
52 <Filter>gui</Filter>
53 </ClInclude>
54 <ClInclude Include="CGUITextureCacheBrowser.h">
55 <Filter>gui</Filter>
56 </ClInclude>
57 <ClInclude Include="CGUIAttribute.h">
58 <Filter>gui\GUIAttributes</Filter>
59 </ClInclude>
60 <ClInclude Include="CGUIAttributeEditor.h">
61 <Filter>gui\GUIAttributes</Filter>
62 </ClInclude>
63 <ClInclude Include="CGUIBoolAttribute.h">
64 <Filter>gui\GUIAttributes</Filter>
65 </ClInclude>
66 <ClInclude Include="CGUIColorAttribute.h">
67 <Filter>gui\GUIAttributes</Filter>
68 </ClInclude>
69 <ClInclude Include="CGUIEnumAttribute.h">
70 <Filter>gui\GUIAttributes</Filter>
71 </ClInclude>
72 <ClInclude Include="CGUIStringAttribute.h">
73 <Filter>gui\GUIAttributes</Filter>
74 </ClInclude>
75 <ClInclude Include="CGUITextureAttribute.h">
76 <Filter>gui\GUIAttributes</Filter>
77 </ClInclude>
78 <ClInclude Include="CGUIPanel.h">
79 <Filter>gui\Useful GUI Elements</Filter>
80 </ClInclude>
81 <ClInclude Include="CGUIDummyEditorStub.h">
82 <Filter>gui\Element Editors</Filter>
83 </ClInclude>
84 <ClInclude Include="CMemoryReadWriteFile.h">
85 <Filter>io</Filter>
86 </ClInclude>
87 </ItemGroup>
88</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/GUIEditor_gcc.cbp b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUIEditor_gcc.cbp
new file mode 100644
index 0000000..2b57608
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/GUIEditor_gcc.cbp
@@ -0,0 +1,77 @@
1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2<CodeBlocks_project_file>
3 <FileVersion major="1" minor="6" />
4 <Project>
5 <Option title="GUI Editor" />
6 <Option pch_mode="0" />
7 <Option compiler="gcc" />
8 <Build>
9 <Target title="Windows">
10 <Option platforms="Windows;" />
11 <Option output="..\..\bin\win32-gcc\GUIEditor.exe" prefix_auto="0" extension_auto="0" />
12 <Option type="1" />
13 <Option compiler="gcc" />
14 <Option projectResourceIncludeDirsRelation="1" />
15 <Compiler>
16 <Add option="-g" />
17 </Compiler>
18 <Linker>
19 <Add directory="..\..\lib\Win32-gcc" />
20 </Linker>
21 </Target>
22 <Target title="Linux">
23 <Option platforms="Unix;" />
24 <Option output="..\..\bin\Linux\GUIEditor" prefix_auto="0" extension_auto="0" />
25 <Option type="1" />
26 <Option compiler="gcc" />
27 <Option projectResourceIncludeDirsRelation="1" />
28 <Compiler>
29 <Add option="-g" />
30 <Add option="-D_IRR_STATIC_LIB_" />
31 </Compiler>
32 <Linker>
33 <Add library="Irrlicht" />
34 <Add library="Xxf86vm" />
35 <Add library="GL" />
36 <Add directory="..\..\lib\Linux" />
37 </Linker>
38 </Target>
39 </Build>
40 <VirtualTargets>
41 <Add alias="All" targets="Windows;Linux;" />
42 </VirtualTargets>
43 <Compiler>
44 <Add directory="..\..\include" />
45 </Compiler>
46 <Linker>
47 <Add library="Irrlicht" />
48 </Linker>
49 <Unit filename="CGUIAttribute.h" />
50 <Unit filename="CGUIAttributeEditor.cpp" />
51 <Unit filename="CGUIAttributeEditor.h" />
52 <Unit filename="CGUIBoolAttribute.h" />
53 <Unit filename="CGUIColorAttribute.h" />
54 <Unit filename="CGUIEditFactory.cpp" />
55 <Unit filename="CGUIEditFactory.h" />
56 <Unit filename="CGUIEditWindow.cpp" />
57 <Unit filename="CGUIEditWindow.h" />
58 <Unit filename="CGUIEditWorkspace.cpp" />
59 <Unit filename="CGUIEditWorkspace.h" />
60 <Unit filename="CGUIEnumAttribute.h" />
61 <Unit filename="CGUIPanel.cpp" />
62 <Unit filename="CGUIPanel.h" />
63 <Unit filename="CGUIStringAttribute.h" />
64 <Unit filename="CGUITextureAttribute.h" />
65 <Unit filename="CGUITextureCacheBrowser.cpp" />
66 <Unit filename="CGUITextureCacheBrowser.h" />
67 <Unit filename="CMemoryReadWriteFile.cpp" />
68 <Unit filename="CMemoryReadWriteFile.h" />
69 <Unit filename="EGUIEditTypes.h" />
70 <Unit filename="main.cpp" />
71 <Extensions>
72 <code_completion />
73 <debugger />
74 <envvars />
75 </Extensions>
76 </Project>
77</CodeBlocks_project_file>
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/Makefile b/src/others/irrlicht-1.8.1/tools/GUIEditor/Makefile
new file mode 100644
index 0000000..02f8189
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/Makefile
@@ -0,0 +1,43 @@
1# Irrlicht Engine GUIEditor Makefile
2Target = GUIEditor
3Sources = CGUIAttributeEditor.cpp CGUIEditFactory.cpp CGUIEditWindow.cpp CGUIEditWorkspace.cpp CGUIPanel.cpp CGUITextureCacheBrowser.cpp CMemoryReadWriteFile.cpp main.cpp
4
5CPPFLAGS = -I../../include -I/usr/X11R6/include
6CXXFLAGS = -Wall -O3 -ffast-math
7
8ifeq ($(HOSTTYPE), x86_64)
9LIBSELECT=64
10endif
11
12all: all_linux
13
14# target specific settings
15all_linux: SYSTEM=Linux
16all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/$(SYSTEM) -lIrrlicht -lGL -lXxf86vm -lXext -lX11
17
18all_win32 clean_win32: SYSTEM=Win32-gcc
19all_win32: LDFLAGS = -L../../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm
20
21# if you enable sound add the proper library for linking
22#LDFLAGS += -lIrrKlang
23#LDFLAGS += -laudiere
24#LDFLAGS += -lSDL_mixer -lSDL
25
26all_win32 clean_win32: SUF=.exe
27# name of the binary - only valid for targets which set SYSTEM
28DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
29
30OBJ = $(Sources:.cpp=.o)
31
32all_linux all_win32: $(OBJ)
33 $(warning Building...)
34 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS)
35
36clean: clean_linux clean_win32
37 $(warning Cleaning...)
38 @$(RM) $(OBJ)
39
40clean_linux clean_win32:
41 @$(RM) $(DESTPATH)
42
43.PHONY: all all_win32 clean clean_linux clean_win32
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/main.cpp b/src/others/irrlicht-1.8.1/tools/GUIEditor/main.cpp
new file mode 100644
index 0000000..e8434b2
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/GUIEditor/main.cpp
@@ -0,0 +1,76 @@
1#include <irrlicht.h>
2#include "driverChoice.h"
3
4// include the gui creator element factory
5#include "CGUIEditFactory.h"
6
7using namespace irr;
8using namespace gui;
9
10#ifdef _MSC_VER
11#pragma comment(lib, "Irrlicht.lib")
12#endif
13
14int main()
15{
16 // ask user for driver
17 video::E_DRIVER_TYPE driverType=driverChoiceConsole();
18 if (driverType==video::EDT_COUNT)
19 return 1;
20
21 IrrlichtDevice *device = createDevice(driverType, core::dimension2du(800, 600));
22 video::IVideoDriver* driver = device->getVideoDriver();
23 scene::ISceneManager* smgr = device->getSceneManager();
24 gui::IGUIEnvironment *env = device->getGUIEnvironment();
25
26 device->setResizable(true);
27
28 /*
29 first we create the factory which can make new GUI elements
30 and register it with the gui environment.
31 */
32
33 IGUIElementFactory* factory = new CGUIEditFactory(env);
34 env->registerGUIElementFactory(factory);
35 // remember to drop since we created with a create call
36 factory->drop();
37
38 IGUISkin *skin = env->createSkin(EGST_WINDOWS_METALLIC);
39 env->setSkin(skin);
40
41 IGUIFont *font = env->getFont("../../media/lucida.xml");
42 if (font)
43 skin->setFont(font);
44 skin->drop();
45
46 // change transparency of skin
47 for (s32 i=0; i<gui::EGDC_COUNT ; ++i)
48 {
49 video::SColor col = env->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i);
50 col.setAlpha(250);
51 env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col);
52 }
53
54 /*
55 now we add the GUI Editor Workspace
56 */
57
58 env->addGUIElement("GUIEditor");
59
60 while(device->run())
61 {
62 device->sleep(10);
63
64 if (device->isWindowActive())
65 {
66 driver->beginScene(true, true, video::SColor(0,200,200,200));
67 smgr->drawAll();
68 env->drawAll();
69 driver->endScene();
70 }
71 }
72
73 device->drop();
74
75 return 0;
76}
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CFontTool.cpp b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CFontTool.cpp
new file mode 100644
index 0000000..780e9b0
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CFontTool.cpp
@@ -0,0 +1,801 @@
1#include "CFontTool.h"
2#include "IXMLWriter.h"
3
4using namespace irr;
5
6const int fontsizes[] = {4,6,8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,56,68,72,0};
7
8inline u32 getTextureSizeFromSurfaceSize(u32 size)
9{
10 u32 ts = 0x01;
11 while(ts < size)
12 ts <<= 1;
13
14 return ts;
15}
16
17// windows specific
18#ifdef _IRR_WINDOWS_
19
20 const DWORD charsets[] = { ANSI_CHARSET, DEFAULT_CHARSET, OEM_CHARSET, BALTIC_CHARSET, GB2312_CHARSET, CHINESEBIG5_CHARSET,
21 EASTEUROPE_CHARSET, GREEK_CHARSET, HANGUL_CHARSET, MAC_CHARSET, RUSSIAN_CHARSET,
22 SHIFTJIS_CHARSET, SYMBOL_CHARSET, TURKISH_CHARSET, VIETNAMESE_CHARSET, JOHAB_CHARSET,
23 ARABIC_CHARSET, HEBREW_CHARSET, THAI_CHARSET, 0};
24
25 const wchar_t *setnames[] = {L"ANSI", L"All Available", L"OEM", L"Baltic", L"Chinese Simplified", L"Chinese Traditional",
26 L"Eastern European", L"Greek", L"Hangul", L"Macintosh", L"Russian",
27 L"Japanese", L"Symbol", L"Turkish", L"Vietnamese", L"Johab",
28 L"Arabic", L"Hebrew", L"Thai", 0};
29
30 // callback for adding font names
31 int CALLBACK EnumFontFamExProc( ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme,
32 DWORD FontType, LPARAM lParam)
33 {
34 CFontTool* t = (CFontTool*) lParam;
35 t->FontNames.push_back( core::stringw(lpelfe->elfFullName));
36 return 1;
37 }
38
39 //
40 // Constructor
41 //
42
43 CFontTool::CFontTool(IrrlichtDevice* device) : FontSizes(fontsizes),
44 Device(device), UseAlphaChannel(false),
45 // win specific
46 dc(0)
47 {
48 // init display context
49 dc = CreateDC(L"DISPLAY", L"DISPLAY", 0 ,0 );
50
51 // populate list of available character set names
52 for (int i=0; setnames[i] != 0; ++i)
53 CharSets.push_back( core::stringw(setnames[i]));
54
55 selectCharSet(0);
56 }
57
58 void CFontTool::selectCharSet(u32 currentCharSet)
59 {
60 if ( currentCharSet >= CharSets.size() )
61 return;
62
63 LOGFONTW lf;
64 lf.lfFaceName[0] = L'\0';
65 lf.lfCharSet = (BYTE) charsets[currentCharSet];
66 // HRESULT hr; // no error checking(!)
67
68 // clear font list
69 FontNames.clear();
70
71 // create list of available fonts
72 EnumFontFamiliesExW( dc, (LPLOGFONTW) &lf, (FONTENUMPROCW) EnumFontFamExProc, (LPARAM) this, 0);
73 }
74
75 bool CFontTool::makeBitmapFont(u32 fontIndex, u32 charsetIndex, s32 fontSize, u32 textureWidth, u32 textureHeight, bool bold, bool italic, bool aa, bool alpha)
76 {
77 if (fontIndex >= FontNames.size() || charsetIndex >= CharSets.size() )
78 return false;
79
80 UseAlphaChannel = alpha;
81 u32 currentImage = 0;
82
83 // create the font
84 HFONT font = CreateFontW(
85 -MulDiv(fontSize, GetDeviceCaps(dc, LOGPIXELSY), 72), 0,
86 0,0,
87 bold ? FW_BOLD : 0,
88 italic, 0,0, charsets[charsetIndex], 0,0,
89 aa ? ANTIALIASED_QUALITY : 0,
90 0, FontNames[fontIndex].c_str() );
91
92 if (!font)
93 return false;
94
95 SelectObject(dc, font);
96 SetTextAlign (dc,TA_LEFT | TA_TOP | TA_NOUPDATECP);
97
98 // get rid of the current textures/images
99 for (u32 i=0; i<currentTextures.size(); ++i)
100 currentTextures[i]->drop();
101 currentTextures.clear();
102
103 for (u32 i=0; i<currentImages.size(); ++i)
104 currentImages[i]->drop();
105 currentImages.clear();
106
107 // clear current image mappings
108 CharMap.clear();
109 // clear array
110 Areas.clear();
111
112 // get information about this font's unicode ranges.
113 s32 size = GetFontUnicodeRanges( dc, 0);
114 c8 *buf = new c8[size];
115 LPGLYPHSET glyphs = (LPGLYPHSET)buf;
116
117 GetFontUnicodeRanges( dc, glyphs);
118
119 // s32 TotalCharCount = glyphs->cGlyphsSupported;
120
121 s32 currentx=0, currenty=0, maxy=0;
122
123 for (u32 range=0; range < glyphs->cRanges; range++)
124 {
125 WCRANGE* current = &glyphs->ranges[range];
126
127 //maxy=0;
128
129 // loop through each glyph and write its size and position
130 for (s32 ch=current->wcLow; ch< current->wcLow + current->cGlyphs; ch++)
131 {
132 wchar_t currentchar = ch;
133
134 if ( IsDBCSLeadByte((BYTE) ch))
135 continue; // surragate pairs unsupported
136
137 // get the dimensions
138 SIZE size;
139 ABC abc;
140 GetTextExtentPoint32W(dc, &currentchar, 1, &size);
141 SFontArea fa;
142 fa.underhang = 0;
143 fa.overhang = 0;
144
145 if (GetCharABCWidthsW(dc, currentchar, currentchar, &abc)) // for unicode fonts, get overhang, underhang, width
146 {
147 size.cx = abc.abcB;
148 fa.underhang = abc.abcA;
149 fa.overhang = abc.abcC;
150
151 if (abc.abcB-abc.abcA+abc.abcC<1)
152 continue; // nothing of width 0
153 }
154 if (size.cy < 1)
155 continue;
156
157 //GetGlyphOutline(dc, currentchar, GGO_METRICS, &gm, 0, 0, 0);
158
159 //size.cx++; size.cy++;
160
161 // wrap around?
162 if (currentx + size.cx > (s32) textureWidth)
163 {
164 currenty += maxy;
165 currentx = 0;
166 if ((u32)(currenty + maxy) > textureHeight)
167 {
168 currentImage++; // increase Image count
169 currenty=0;
170 }
171 maxy = 0;
172 }
173 // add this char dimension to the current map
174
175 fa.rectangle = core::rect<s32>(currentx, currenty, currentx + size.cx, currenty + size.cy);
176 fa.sourceimage = currentImage;
177
178 CharMap.insert(currentchar, Areas.size());
179 Areas.push_back( fa );
180
181 currentx += size.cx +1;
182
183 if (size.cy+1 > maxy)
184 maxy = size.cy+1;
185 }
186 }
187 currenty += maxy;
188
189 u32 lastTextureHeight = getTextureSizeFromSurfaceSize(currenty);
190
191 // delete the glyph set
192 delete [] buf;
193
194 currentImages.set_used(currentImage+1);
195 currentTextures.set_used(currentImage+1);
196
197 for (currentImage=0; currentImage < currentImages.size(); ++currentImage)
198 {
199 core::stringc logmsg = "Creating image ";
200 logmsg += (s32) (currentImage+1);
201 logmsg += " of ";
202 logmsg += (s32) currentImages.size();
203 Device->getLogger()->log(logmsg.c_str());
204 // no need for a huge final texture
205 u32 texHeight = textureHeight;
206 if (currentImage == currentImages.size()-1 )
207 texHeight = lastTextureHeight;
208
209 // make a new bitmap
210 HBITMAP bmp = CreateCompatibleBitmap(dc, textureWidth, texHeight);
211 HDC bmpdc = CreateCompatibleDC(dc);
212
213 LOGBRUSH lbrush;
214 lbrush.lbColor = RGB(0,0,0);
215 lbrush.lbHatch = 0;
216 lbrush.lbStyle = BS_SOLID;
217
218 HBRUSH brush = CreateBrushIndirect(&lbrush);
219 HPEN pen = CreatePen(PS_NULL, 0, 0);
220
221 HGDIOBJ oldbmp = SelectObject(bmpdc, bmp);
222 HGDIOBJ oldbmppen = SelectObject(bmpdc, pen);
223 HGDIOBJ oldbmpbrush = SelectObject(bmpdc, brush);
224 HGDIOBJ oldbmpfont = SelectObject(bmpdc, font);
225
226 SetTextColor(bmpdc, RGB(255,255,255));
227
228 Rectangle(bmpdc, 0,0,textureWidth,texHeight);
229 SetBkMode(bmpdc, TRANSPARENT);
230
231 // draw the letters...
232
233 // iterate through the tree
234 core::map<wchar_t, u32>::Iterator it = CharMap.getIterator();
235 while (!it.atEnd())
236 {
237 s32 currentArea = (*it).getValue();
238 wchar_t wch = (*it).getKey();
239 // sloppy but I couldnt be bothered rewriting it
240 if (Areas[currentArea].sourceimage == currentImage)
241 {
242 // draw letter
243 s32 sx = Areas[currentArea].rectangle.UpperLeftCorner.X - Areas[currentArea].underhang;
244 TextOutW(bmpdc, sx, Areas[currentArea].rectangle.UpperLeftCorner.Y, &wch, 1);
245
246 // if ascii font...
247 //SetPixel(bmpdc, Areas[currentArea].rectangle.UpperLeftCorner.X, Areas[currentArea].rectangle.UpperLeftCorner.Y, RGB(255,255,0));// left upper corner mark
248 }
249 it++;
250 }
251
252 // copy the font bitmap into a new irrlicht image
253 BITMAP b;
254 PBITMAPINFO pbmi;
255 WORD cClrBits;
256 u32 cformat;
257
258 // Retrieve the bitmap color format, width, and height.
259 GetObject(bmp, sizeof(BITMAP), (LPSTR)&b);
260
261 // Convert the color format to a count of bits.
262 cClrBits = (WORD)(b.bmPlanes * b.bmBitsPixel);
263
264 if (cClrBits <= 8) // we're not supporting these
265 cformat = -1;
266 else if (cClrBits <= 16)
267 cformat = video::ECF_A1R5G5B5;
268 else if (cClrBits <= 24)
269 cformat = video::ECF_R8G8B8;
270 else
271 cformat = video::ECF_A8R8G8B8;
272
273 pbmi = (PBITMAPINFO) LocalAlloc(LPTR,
274 sizeof(BITMAPINFOHEADER));
275
276 // Initialize the fields in the BITMAPINFO structure.
277
278 pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
279 pbmi->bmiHeader.biWidth = b.bmWidth;
280 pbmi->bmiHeader.biHeight = b.bmHeight;
281 pbmi->bmiHeader.biPlanes = b.bmPlanes;
282 pbmi->bmiHeader.biBitCount = b.bmBitsPixel;
283
284 // If the bitmap is not compressed, set the BI_RGB flag.
285 pbmi->bmiHeader.biCompression = BI_RGB;
286
287 // Compute the number of bytes in the array of color
288 // indices and store the result in biSizeImage.
289 // For Windows NT, the width must be DWORD aligned unless
290 // the bitmap is RLE compressed. This example shows this.
291 // For Windows 95/98/Me, the width must be WORD aligned unless the
292 // bitmap is RLE compressed.
293 pbmi->bmiHeader.biSizeImage = ((pbmi->bmiHeader.biWidth * cClrBits +31) & ~31) /8
294 * pbmi->bmiHeader.biHeight;
295 // Set biClrImportant to 0, indicating that all of the
296 // device colors are important.
297 pbmi->bmiHeader.biClrImportant = 0;
298
299 LPBYTE lpBits; // memory pointer
300
301 PBITMAPINFOHEADER pbih = (PBITMAPINFOHEADER) pbmi;
302 lpBits = (LPBYTE) GlobalAlloc(GMEM_FIXED, pbih->biSizeImage);
303
304 GetDIBits(dc, bmp, 0, (WORD) pbih->biHeight, lpBits, pbmi, DIB_RGB_COLORS);
305
306 // DEBUG- copy to clipboard
307 //OpenClipboard(hWnd);
308 //EmptyClipboard();
309 //SetClipboardData(CF_BITMAP, bmp);
310 //CloseClipboard();
311
312 // flip bitmap
313 s32 rowsize = ((pbmi->bmiHeader.biWidth * cClrBits +31) & ~31) /8;
314 c8 *row = new c8[rowsize];
315 for (s32 i=0; i < (pbih->biHeight/2); ++i)
316 {
317 // grab a row
318 memcpy(row, lpBits + (rowsize * i), rowsize);
319 // swap row
320 memcpy(lpBits + (rowsize * i), lpBits + ((pbih->biHeight-1 -i) * rowsize ) , rowsize);
321 memcpy(lpBits + ((pbih->biHeight-1 -i) * rowsize ), row , rowsize);
322 }
323
324 bool ret = false;
325
326 if (cformat == video::ECF_A8R8G8B8)
327 {
328 // in this case the font should have an alpha channel, but since windows doesn't draw one
329 // we have to set one manually by going through all the pixels.. *sigh*
330
331 u8* m;
332 for (m = lpBits; m < lpBits + pbih->biSizeImage; m+=4)
333 {
334 if (UseAlphaChannel)
335 {
336 if (m[0] > 0) // pixel has colour
337 {
338 m[3]=m[0]; // set alpha
339 m[0]=m[1]=m[2] = 255; // everything else is full
340 }
341 }
342 else
343 m[3]=255; // all pixels are full alpha
344 }
345
346 }
347 else if (cformat == video::ECF_A1R5G5B5)
348 {
349 u8* m;
350 for (m = lpBits; m < lpBits + pbih->biSizeImage; m+=2)
351 {
352 WORD *p = (WORD*)m;
353 if (m[0] > 0 || !UseAlphaChannel) // alpha should be set
354 *p |= 0x8000; // set alpha bit
355 }
356 }
357 else
358 {
359 cformat = -1;
360 }
361
362 // make a texture from the image
363 if (cformat != -1)
364 {
365 // turn mip-mapping off
366 bool b = Device->getVideoDriver()->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS);
367 currentImages[currentImage] = Device->getVideoDriver()->createImageFromData((video::ECOLOR_FORMAT)cformat, core::dimension2d<u32>(textureWidth,texHeight), (void*)lpBits);
368 Device->getVideoDriver()->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS,b);
369 }
370 else
371 {
372 Device->getLogger()->log("Couldn't create font, your pixel format is unsupported.");
373 }
374
375 // free memory and windows resources
376 // sloppy I know, but I only intended to create one image at first.
377 delete [] row;
378 LocalFree(pbmi);
379 GlobalFree(lpBits);
380 DeleteDC(bmpdc);
381 DeleteObject(brush);
382 DeleteObject(pen);
383 DeleteObject(bmp);
384
385 if (currentImages[currentImage])
386 {
387 // add texture
388 currentTextures[currentImage] = Device->getVideoDriver()->addTexture("GUIFontImage",currentImages[currentImage]);
389 currentTextures[currentImage]->grab();
390 }
391 else
392 {
393 Device->getLogger()->log("Something went wrong, aborting.");
394 // drop all images
395 DeleteObject(font);
396 return false;
397 }
398 } // looping through each texture
399 DeleteObject(font);
400 return true;
401 }
402
403#else
404
405 CFontTool::CFontTool(IrrlichtDevice *device) : FontSizes(fontsizes), Device(device), UseAlphaChannel(false)
406 {
407 if (!XftInitFtLibrary())
408 {
409 core::stringc logmsg = "XFT not found\n";
410 Device->getLogger()->log(logmsg.c_str());
411 exit(EXIT_FAILURE);
412 }
413
414 /* Get a list of the font foundries, storing them in a set to sort */
415 std::set<core::stringw> foundries;
416 Display* display = (Display*)Device->getVideoDriver()->getExposedVideoData().OpenGLLinux.X11Display;
417 XftFontSet* fonts = XftListFonts(display, DefaultScreen(display), 0, XFT_FOUNDRY, 0);
418 for (int i = 0; i < fonts->nfont; i++)
419 {
420 char *foundry;
421 XftPatternGetString(fonts->fonts[i], XFT_FOUNDRY, 0, &foundry);
422 core::stringw tmp(foundry);
423 foundries.insert(tmp);
424 }
425 XftFontSetDestroy(fonts);
426
427 /* Copy the sorted list into the array */
428 CharSets.clear();
429 for (std::set<core::stringw>::iterator i = foundries.begin(); i != foundries.end(); i++)
430 CharSets.push_back((*i).c_str());
431 selectCharSet(0);
432 }
433
434 /* Note: There must be some trick for using strings as pattern parameters to XftListFonts because
435 no matter how I specify a string, I end up with an intermittent segfault. Since XftFontList is
436 just calling FcFontList, that's what I'll do too since that works OK */
437 void CFontTool::selectCharSet(u32 currentCharSet)
438 {
439 /* Get a list of the font families, storing them in a set to sort */
440 char foundry[256];
441 sprintf(&foundry[0],"%ls",CharSets[currentCharSet].c_str());
442 std::set<core::stringw> families;
443 XftPattern *pattern = FcPatternCreate();
444 XftPatternAddString(pattern, FC_FOUNDRY, &foundry[0]);
445 XftObjectSet *objectset = FcObjectSetCreate();
446 XftObjectSetAdd(objectset, XFT_FOUNDRY);
447 XftObjectSetAdd(objectset, XFT_FAMILY);
448 FcFontSet *fonts = FcFontList(NULL, pattern, objectset);
449
450 for (int i = 0; i < fonts->nfont; i++)
451 {
452 char* ptr;
453 XftPatternGetString(fonts->fonts[i], XFT_FAMILY, 0, &ptr);
454 core::stringw family(ptr);
455 families.insert(family);
456 }
457 XftPatternDestroy(pattern);
458 FcObjectSetDestroy(objectset);
459
460 /* Copy the sorted list into the array */
461 FontNames.clear();
462 for (std::set<core::stringw>::iterator i = families.begin(); i != families.end(); i++)
463 FontNames.push_back((*i).c_str());
464 }
465
466 bool CFontTool::makeBitmapFont(u32 fontIndex, u32 charsetIndex, s32 fontSize, u32 textureWidth, u32 textureHeight, bool bold, bool italic, bool aa, bool alpha)
467 {
468 if (fontIndex >= FontNames.size() || charsetIndex >= CharSets.size() )
469 return false;
470
471 Display *display = (Display*) Device->getVideoDriver()->getExposedVideoData().OpenGLLinux.X11Display;
472 u32 screen = DefaultScreen(display);
473 Window win = RootWindow(display, screen);
474 Visual *visual = DefaultVisual(display, screen);
475 UseAlphaChannel = alpha;
476 u32 currentImage = 0;
477
478 XftResult result;
479 XftPattern *request = XftPatternCreate();
480 char foundry[256], family[256];
481 sprintf(&foundry[0],"%ls",CharSets[charsetIndex].c_str());
482 sprintf(&family[0],"%ls",FontNames[fontIndex].c_str());
483 XftPatternAddString(request, XFT_FOUNDRY, &foundry[0]);
484 XftPatternAddString(request, XFT_FAMILY, &family[0]);
485 XftPatternAddInteger(request, XFT_PIXEL_SIZE, fontSize);
486 XftPatternAddInteger(request, XFT_WEIGHT, bold ? XFT_WEIGHT_BLACK : XFT_WEIGHT_LIGHT);
487 XftPatternAddInteger(request, XFT_SLANT, italic ? XFT_SLANT_ITALIC : XFT_SLANT_ROMAN);
488 XftPatternAddBool(request, XFT_ANTIALIAS, aa);
489
490 /* Find the closest font that matches the user choices and open it and check if the returned
491 font has anti aliasing enabled by default, even if it wasn't requested */
492 FcBool aaEnabled;
493 XftPattern *found = XftFontMatch(display, DefaultScreen(display), request, &result);
494 XftPatternGetBool(found, XFT_ANTIALIAS, 0, &aaEnabled);
495 aa = aaEnabled;
496 XftFont *font = XftFontOpenPattern(display, found);
497
498 // get rid of the current textures/images
499 for (u32 i=0; i<currentTextures.size(); ++i)
500 currentTextures[i]->drop();
501 currentTextures.clear();
502 for (u32 i=0; i<currentImages.size(); ++i)
503 currentImages[i]->drop();
504 currentImages.clear();
505 CharMap.clear();
506 Areas.clear();
507
508 /* Calculate the max height of the font. Annoyingly, it seems that the height property of the font
509 is the maximum height of any single character, but a string of characters, aligned along their
510 baselines, can exceed this figure. Because I don't know any better way of doing it, I'm going to
511 have to use the brute force method.
512
513 Note: There will be a certain number of charters in a font, however they may not be grouped
514 consecutively, and could in fact be spread out with many gaps */
515 u32 maxY = 0;
516 u32 charsFound = 0;
517 for (FT_UInt charCode = 0; charsFound < FcCharSetCount(font->charset); charCode++)
518 {
519 if (!XftCharExists(display, font, charCode))
520 continue;
521
522 charsFound++;
523
524 XGlyphInfo extents;
525 XftTextExtents32(display, font, &charCode, 1, &extents);
526 if ((extents.xOff <= 0) && (extents.height <= 0))
527 continue;
528
529 /* Calculate the width and height, adding 1 extra pixel if anti aliasing is enabled */
530 u32 chWidth = extents.xOff + (aa ? 1 : 0);
531 u32 chHeight = (font->ascent - extents.y + extents.height) + (aa ? 1 : 0);
532 if (chHeight > maxY)
533 maxY = chHeight;
534
535 /* Store the character details here */
536 SFontArea fontArea;
537 fontArea.rectangle = core::rect<s32>(0, 0, chWidth, chHeight);
538 CharMap.insert(charCode, Areas.size());
539 Areas.push_back(fontArea);
540 }
541 core::stringc logmsg = "Found ";
542 logmsg += (s32) (CharMap.size() + 1);
543 logmsg += " characters";
544 Device->getLogger()->log(logmsg.c_str());
545
546 /* Get the size of the chars and allocate them a position on a texture. If the next character that
547 is added would be outside the width or height of the texture, then a new texture is added */
548 u32 currentX = 0, currentY = 0, rowY = 0;
549 for (core::map<wchar_t, u32>::Iterator it = CharMap.getIterator(); !it.atEnd(); it++)
550 {
551 s32 currentArea = (*it).getValue();
552 SFontArea *fontArea = &Areas[currentArea];
553 u32 chWidth = fontArea->rectangle.LowerRightCorner.X;
554 u32 chHeight = fontArea->rectangle.LowerRightCorner.Y;
555
556 /* If the width of this char will exceed the textureWidth then start a new row */
557 if ((currentX + chWidth) > textureWidth)
558 {
559 currentY += rowY;
560 currentX = 0;
561
562 /* If the new row added to the texture exceeds the textureHeight then start a new texture */
563 if ((currentY + rowY) > textureHeight)
564 {
565 currentImage++;
566 currentY = 0;
567 }
568 rowY = 0;
569 }
570
571 /* Update the area with the current x and y and texture */
572 fontArea->rectangle = core::rect<s32>(currentX, currentY, currentX + chWidth, currentY + chHeight);
573 fontArea->sourceimage = currentImage;
574 currentX += chWidth + 1;
575 if (chHeight + 1 > rowY)
576 rowY = chHeight + 1;
577 }
578
579 /* The last row of chars and the last texture weren't accounted for in the loop, so add them here */
580 currentY += rowY;
581 u32 lastTextureHeight = getTextureSizeFromSurfaceSize(currentY);
582 currentImages.set_used(currentImage + 1);
583 currentTextures.set_used(currentImage + 1);
584
585 /* Initialise colours */
586 XftColor colFore, colBack;
587 XRenderColor xFore = {0xffff, 0xffff, 0xffff, 0xffff};
588 XRenderColor xBack = {0x0000, 0x0000, 0x0000, 0xffff};
589 XftColorAllocValue(display, DefaultVisual(display, screen), DefaultColormap(display, screen), &xFore, &colFore);
590 XftColorAllocValue(display, DefaultVisual(display, screen), DefaultColormap(display, screen), &xBack, &colBack);
591
592 /* Create a pixmap that is large enough to hold any character in the font */
593 Pixmap pixmap = XCreatePixmap(display, win, textureWidth, maxY, DefaultDepth(display, screen));
594 XftDraw *draw = XftDrawCreate(display, pixmap, visual, DefaultColormap(display, screen));
595
596 /* Render the chars */
597 for (currentImage = 0; currentImage < currentImages.size(); ++currentImage)
598 {
599 core::stringc logmsg = "Creating image ";
600 logmsg += (s32) (currentImage+1);
601 logmsg += " of ";
602 logmsg += (s32) currentImages.size();
603 Device->getLogger()->log(logmsg.c_str());
604
605 /* The last texture that is saved is vertically shrunk to fit the characters drawn on it */
606 u32 texHeight = textureHeight;
607 if (currentImage == currentImages.size() - 1)
608 texHeight = lastTextureHeight;
609
610 /* The texture that holds this "page" of characters */
611 currentImages[currentImage] = Device->getVideoDriver()->createImage(video::ECF_A8R8G8B8, core::dimension2du(textureWidth, texHeight));
612 currentImages[currentImage]->fill(video::SColor(alpha ? 0 : 255,0,0,0));
613
614 for (core::map<wchar_t, u32>::Iterator it = CharMap.getIterator(); !it.atEnd(); it++)
615 {
616 FcChar32 wch = (*it).getKey();
617 s32 currentArea = (*it).getValue();
618 if (Areas[currentArea].sourceimage == currentImage)
619 {
620 SFontArea *fontArea = &Areas[currentArea];
621 u32 chWidth = fontArea->rectangle.LowerRightCorner.X - fontArea->rectangle.UpperLeftCorner.X;
622 u32 chHeight = fontArea->rectangle.LowerRightCorner.Y - fontArea->rectangle.UpperLeftCorner.Y;
623
624 /* Draw the glyph onto the pixmap */
625 XGlyphInfo extents;
626 XftDrawRect(draw, &colBack, 0, 0, chWidth, chHeight);
627 XftTextExtents32(display, font, &wch, 1, &extents);
628 XftDrawString32(draw, &colFore, font, extents.x, extents.y, &wch, 1);
629
630 /* Convert the pixmap into an image, then copy it onto the Irrlicht texture, pixel by pixel.
631 There's bound to be a faster way, but this is adequate */
632 u32 xDest = fontArea->rectangle.UpperLeftCorner.X;
633 u32 yDest = fontArea->rectangle.UpperLeftCorner.Y + font->ascent - extents.y;
634 XImage *image = XGetImage(display, pixmap, 0, 0, chWidth, chHeight, 0xffffff, XYPixmap);
635 if (image)
636 {
637 for (u32 ySrc = 0; ySrc < chHeight; ySrc++)
638 for (u32 xSrc = 0; xSrc < chWidth; xSrc++)
639 {
640 /* Get the pixel colour and break it down into rgb components */
641 u32 col = XGetPixel(image, xSrc, ySrc);
642 u32 a = 255;
643 u32 r = col & visual->red_mask;
644 u32 g = col & visual->green_mask;
645 u32 b = col & visual->blue_mask;
646 while (r > 0xff) r >>= 8;
647 while (g > 0xff) g >>= 8;
648 while (b > 0xff) b >>= 8;
649
650 /* To make the background transparent, set the colour to 100% white and the alpha to
651 the average of the three rgb colour components to maintain the anti-aliasing */
652 if (alpha)
653 {
654 a = (r + g + b) / 3;
655 r = 255;
656 g = 255;
657 b = 255;
658 }
659 currentImages[currentImage]->setPixel(xDest + xSrc,yDest + ySrc,video::SColor(a,r,g,b));
660 }
661 image->f.destroy_image(image);
662 }
663 }
664 }
665
666 /* Add the texture to the list */
667 currentTextures[currentImage] = Device->getVideoDriver()->addTexture("GUIFontImage",currentImages[currentImage]);
668 currentTextures[currentImage]->grab();
669 }
670
671 XftColorFree (display, visual, DefaultColormap(display, screen), &colFore);
672 XftColorFree (display, visual, DefaultColormap(display, screen), &colBack);
673 XftFontClose(display,font);
674 XftPatternDestroy(request);
675 XftDrawDestroy(draw);
676 XFreePixmap(display, pixmap);
677 return true;
678 }
679#endif
680
681 CFontTool::~CFontTool()
682 {
683#ifdef _IRR_WINDOWS_
684 // destroy display context
685 if (dc)
686 DeleteDC(dc);
687#endif
688
689 // drop textures+images
690 for (u32 i=0; i<currentTextures.size(); ++i)
691 currentTextures[i]->drop();
692 currentTextures.clear();
693
694 for (u32 i=0; i<currentImages.size(); ++i)
695 currentImages[i]->drop();
696 currentImages.clear();
697 }
698
699bool CFontTool::saveBitmapFont(const c8 *filename, const c8* format)
700{
701 if (currentImages.size() == 0)
702 {
703 Device->getLogger()->log("No image data to write, aborting.");
704 return false;
705 }
706
707 core::stringc fn = filename;
708 core::stringc imagename = filename;
709 fn += ".xml";
710
711 io::IXMLWriter *writer = Device->getFileSystem()->createXMLWriter(fn.c_str());
712
713 // header and line breaks
714 writer->writeXMLHeader();
715 writer->writeLineBreak();
716
717 // write information
718 writer->writeElement(L"font", false, L"type", L"bitmap");
719 writer->writeLineBreak();
720 writer->writeLineBreak();
721
722 // write images and link to them
723 for (u32 i=0; i<currentImages.size(); ++i)
724 {
725 imagename = filename;
726 imagename += (s32)i;
727 imagename += ".";
728 imagename += format;
729 Device->getVideoDriver()->writeImageToFile(currentImages[i],imagename.c_str());
730
731 writer->writeElement(L"Texture", true,
732 L"index", core::stringw(i).c_str(),
733 L"filename", core::stringw(imagename.c_str()).c_str(),
734 L"hasAlpha", UseAlphaChannel ? L"true" : L"false");
735 writer->writeLineBreak();
736 }
737
738 writer->writeLineBreak();
739
740 // write each character
741 core::map<wchar_t, u32>::Iterator it = CharMap.getIterator();
742 while (!it.atEnd())
743 {
744 SFontArea &fa = Areas[(*it).getValue()];
745
746 wchar_t c[2];
747 c[0] = (*it).getKey();
748 c[1] = L'\0';
749 core::stringw area, under, over, image;
750 area = core::stringw(fa.rectangle.UpperLeftCorner.X);
751 area += L", ";
752 area += fa.rectangle.UpperLeftCorner.Y;
753 area += L", ";
754 area += fa.rectangle.LowerRightCorner.X;
755 area += L", ";
756 area += fa.rectangle.LowerRightCorner.Y;
757
758 core::array<core::stringw> names;
759 core::array<core::stringw> values;
760 names.clear();
761 values.clear();
762 // char
763 names.push_back(core::stringw(L"c"));
764 values.push_back(core::stringw(c));
765 // image number
766 if (fa.sourceimage != 0)
767 {
768 image = core::stringw(fa.sourceimage);
769 names.push_back(core::stringw(L"i"));
770 values.push_back(image);
771 }
772 // rectangle
773 names.push_back(core::stringw(L"r"));
774 values.push_back(area);
775
776 if (fa.underhang != 0)
777 {
778 under = core::stringw(fa.underhang);
779 names.push_back(core::stringw(L"u"));
780 values.push_back(under);
781 }
782 if (fa.overhang != 0)
783 {
784 over = core::stringw(fa.overhang);
785 names.push_back(core::stringw(L"o"));
786 values.push_back(over);
787 }
788 writer->writeElement(L"c", true, names, values);
789
790 writer->writeLineBreak();
791 it++;
792 }
793
794 writer->writeClosingTag(L"font");
795
796 writer->drop();
797
798 Device->getLogger()->log("Bitmap font saved.");
799
800 return true;
801}
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CFontTool.h b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CFontTool.h
new file mode 100644
index 0000000..5a35938
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CFontTool.h
@@ -0,0 +1,78 @@
1#ifndef __IRR_FONT_TOOL_INCLUDED__
2#define __IRR_FONT_TOOL_INCLUDED__
3
4
5#include "irrlicht.h"
6
7#if defined(_IRR_WINDOWS_)
8 #ifdef _MBCS
9 #undef _MBCS
10 #endif
11
12 #define UNICODE
13 #define _WIN32_WINNT 0x0500
14 #include "windows.h"
15#else
16 #ifdef _IRR_COMPILE_WITH_X11_
17 #include <X11/Xlib.h>
18 #endif
19 #include <X11/Xft/Xft.h>
20 #include <set>
21#endif
22
23
24namespace irr {
25 class CFontTool : public irr::IReferenceCounted
26 {
27 public:
28 CFontTool(irr::IrrlichtDevice* device);
29 ~CFontTool();
30
31 virtual bool makeBitmapFont(u32 fontIndex, u32 charsetIndex,
32 s32 fontSize, u32 texturewidth, u32 textureHeight,
33 bool bold, bool italic, bool aa, bool alpha);
34
35 virtual bool saveBitmapFont(const c8* filename, const c8* format);
36
37 virtual void selectCharSet(u32 currentCharSet);
38
39 struct SFontArea
40 {
41 SFontArea() : rectangle(), underhang(0), overhang(0), sourceimage(0) {}
42 core::rect<s32> rectangle;
43 s32 underhang;
44 s32 overhang;
45 u32 sourceimage;
46 };
47
48 /* struct SFontMap
49 {
50 SFontMap() : areas(), start(0), count(0) {}
51 core::array< SFontArea > areas;
52 s32 start;
53 s32 count;
54 };*/
55
56
57
58 core::array<core::stringw> FontNames;
59 core::array<core::stringw> CharSets;
60 //core::array<SFontMap> Mappings;
61 core::array<SFontArea> Areas;
62 core::map<wchar_t, u32> CharMap;
63
64 core::array<video::ITexture*> currentTextures;
65 core::array<video::IImage*> currentImages;
66 const int *FontSizes;
67 IrrlichtDevice *Device;
68
69 bool UseAlphaChannel;
70
71 // windows
72 #ifdef _IRR_WINDOWS_
73 HDC dc;
74 #endif
75
76 };
77}
78#endif // __IRR_FONT_TOOL_INCLUDED__
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CVectorFontTool.h b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CVectorFontTool.h
new file mode 100644
index 0000000..05a9c79
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/CVectorFontTool.h
@@ -0,0 +1,1199 @@
1/*
2 Vector font tool - Gaz Davidson December 2006-2012
3
4 I noticed bitmap fonts were taking massive amounts of video memory at reasonable sizes,
5 so I decided to make a vector font. I always wanted to try converting pixels to triangles...
6
7 And I failed! This is a collection of the ugliest, bloated, most inneficient algorithms
8 i've ever written, but its kinda working so I'm not changing it.
9*/
10
11#ifndef __VECTOR_FONT_TOOL_INCLUDED__
12#define __VECTOR_FONT_TOOL_INCLUDED__
13
14#include "irrlicht.h"
15#include "CFontTool.h"
16#include <assert.h>
17
18using namespace irr;
19using namespace video;
20
21struct STriangleList
22{
23 core::array<core::vector2df> positions;
24 core::array<u16> indexes;
25
26 // for adding one triangle list to another,
27 // these triangles share positions, but dont share triangles
28 STriangleList& operator+=(STriangleList &other)
29 {
30 core::matrix4 m;
31 core::array<s32> map;
32 map.set_used(other.positions.size());
33
34 for (u32 i=0; i<map.size(); ++i)
35 map[i]=-1;
36
37 for (u32 i=0; i<positions.size(); ++i)
38 for (u32 j=0; j<map.size(); ++j)
39 if ( positions[i] == other.positions[j] )
40 map[j] = i;
41
42 for (u32 i=0; i<map.size(); ++i)
43 if (map[i] == -1)
44 {
45 positions.push_back(other.positions[i]);
46 map[i] = positions.size()-1;
47 }
48
49 // add triangles
50 for (u32 i=0; i<other.indexes.size(); ++i)
51 indexes.push_back((u32)map[other.indexes[i]]);
52
53 return *this;
54 }
55
56 // functions for building triangles for shapes,
57 // each shape can't have duplicate triangles
58 bool hasTriangle(core::vector2df a, core::vector2df b, core::vector2df c)
59 {
60 // make sure the triangle is wound correctly
61 if (core::line2df(a,b).getPointOrientation(c) < 0)
62 { core::vector2df tmp=a; a=b; b=tmp; }
63
64 u32 ia=0xffffffff, ib=0xffffffff, ic=0xffffffff;
65 // Find each vertex
66 for (u32 i=0; i < positions.size() && (ia==(u32)-1||ib==(u32)-1||ic==(u32)-1) ; ++i)
67 {
68 if (positions[i] == a)
69 ia = i;
70 if (positions[i] == b)
71 ib = i;
72 if (positions[i] == c)
73 ic = i;
74 }
75
76 if (ia==0xffffffff)
77 {
78 return false;
79 }
80 if (ib==0xffffffff)
81 {
82 return false;
83 }
84 if (ic==0xffffffff)
85 {
86 return false;
87 }
88
89 for (u32 i=0; i<indexes.size(); i+=3)
90 if ( (indexes[i] == ia && indexes[i+1] == ib && indexes[i+2] == ic) ||
91 (indexes[i] == ic && indexes[i+1] == ia && indexes[i+2] == ib) ||
92 (indexes[i] == ib && indexes[i+1] == ic && indexes[i+2] == ia) )
93 return true;
94
95 return false;
96 }
97
98 void add(core::vector2df a, core::vector2df b, core::vector2df c)
99 {
100
101 // make sure the triangle is wound correctly
102 if (core::line2df(a,b).getPointOrientation(c) < 0)
103 {
104 core::vector2df tmp=a; a=b; b=tmp;
105 }
106
107 u32 ia=0xffffffff, ib=0xffffffff, ic=0xffffffff;
108 // no duplicate vertex positions allowed...
109 for (u32 i=0; i < positions.size() && (ia==-1||ib==-1||ic==-1) ; ++i)
110 {
111 if (positions[i] == a)
112 ia = i;
113 if (positions[i] == b)
114 ib = i;
115 if (positions[i] == c)
116 ic = i;
117 }
118 bool found=true;
119 if (ia==0xffffffff)
120 {
121 ia = positions.size();
122 positions.push_back(a);
123 found=false;
124 }
125 if (ib==0xffffffff)
126 {
127 ib = positions.size();
128 positions.push_back(b);
129 found=false;
130 }
131 if (ic==0xffffffff)
132 {
133 ic = positions.size();
134 positions.push_back(c);
135 found=false;
136 }
137
138 // no duplicate triangles allowed
139 if (found)
140 {
141 found=false;
142 for (u32 i=0; i<indexes.size(); i+=3)
143 {
144 if ( (indexes[i] == ia && indexes[i+1] == ib && indexes[i+2] == ic) ||
145 (indexes[i] == ic && indexes[i+1] == ia && indexes[i+2] == ib) ||
146 (indexes[i] == ib && indexes[i+1] == ic && indexes[i+2] == ia) )
147 {
148 found=true;
149 break;
150 }
151 }
152 }
153
154 if (!found)
155 {
156 indexes.push_back(ia);
157 indexes.push_back(ib);
158 indexes.push_back(ic);
159 }
160 }
161};
162
163// finds groups of pixels and triangulates them
164class CGroupFinder
165{
166public:
167 CGroupFinder(bool *memory, s32 w, s32 h, IrrlichtDevice *dev):
168 width(w), height(h), mem(memory), Device(dev)
169 {
170 refbuffer.set_used(w*h);
171 for (u32 i=0; i<refbuffer.size(); ++i)
172 refbuffer[i]=0;
173 // find groups of pixels
174 findGroups();
175 removeGroups();
176
177 // triangulate
178 for (u32 i=0; i<groups.size(); ++i)
179 {
180 groups[i].triangulate();
181 }
182 }
183
184 // contains a clockwise edge line
185 struct SEdge
186 {
187 SEdge() : positions() { }
188
189 core::array<core::position2di> positions;
190
191 bool isMember(s32 x, s32 y)
192 {
193 for (u32 i=0; i<positions.size(); ++i)
194 if (positions[i].X == x && positions[i].Y == y)
195 return true;
196 return false;
197 }
198
199 // reduces the number of points in the edge
200 void reduce(s32 level=0)
201 {
202 // level 0- remove points on the same line
203 for (u32 i=1; i < positions.size()-1; ++i)
204 {
205 // same point as the last one?! shouldnt happen, dunno why it does :|
206 if (positions[i-1] == positions[i])
207 {
208 positions.erase(i--);
209 continue;
210 }
211
212 // get headings
213 core::vector2d<f32> h1((f32)(positions[i-1].X - positions[i].X),(f32)(positions[i-1].Y - positions[i].Y)),
214 h2((f32)(positions[i].X - positions[i+1].X),(f32)(positions[i].Y - positions[i+1].Y));
215 h1.normalize();
216 h2.normalize();
217
218 if (h1==h2) // erase the current point
219 positions.erase(i--);
220 }
221
222 // level 1- if point1 points at point3, we can skip point2
223 // level 2+ allow a deviation of level-1
224
225 }
226
227 };
228
229 // contains an array of lines for triangulation
230 struct SLineList
231 {
232 core::array<core::line2df> lines;
233 SLineList() : lines() { }
234 void addEdge(const SEdge &edge)
235 {
236 // adds lines to the buffer
237 for (u32 i=1; i<edge.positions.size(); ++i)
238 addLine(core::line2df((f32)edge.positions[i-1].X, (f32)edge.positions[i-1].Y,
239 (f32)edge.positions[i].X, (f32)edge.positions[i].Y ));
240 }
241 void addLine( const core::line2df &line )
242 {
243 // no dupes!
244 if (!hasLine(line))
245 lines.push_back(line);
246 }
247 bool hasLine( const core::line2df &line )
248 {
249 for (u32 i=0; i<lines.size(); ++i)
250 if (line == lines[i] || (line.start == lines[i].end && line.end == lines[i].start) )
251 return true;
252 return false;
253 }
254
255 bool crossesWith( core::line2df l, core::vector2df p)
256 {
257 // inside checks only work with clockwise triangles
258 if (l.getPointOrientation(p) < 0)
259 { core::vector2df tmp=l.start; l.start=l.end; l.end=tmp; }
260
261 // make the 3 triangle edges
262 core::line2df &la=l, lb(l.end,p), lc(p,l.start);
263
264 // test every line in the list
265 for (u32 i=0; i<lines.size(); ++i)
266 {
267 core::line2df &l2 = lines[i];
268
269 // the triangle isn't allowed to enclose any points
270 // triangles are clockwise, so if to the right of all 3 lines, it's enclosed
271 if (la.getPointOrientation(l2.start) > 0 &&
272 lb.getPointOrientation(l2.start) > 0 &&
273 lc.getPointOrientation(l2.start) > 0)
274 return true;
275 //if (la.getPointOrientation(l2.start) < 0 &&
276 // lb.getPointOrientation(l2.start) < 0 &&
277 // lc.getPointOrientation(l2.start) < 0)
278 // return true;
279
280 core::vector2df out;
281 //if (la.intersectWith(l2,out))
282 // if (out != la.start && out != la.end &&
283 // out != l2.start && out != l2.end)
284 // return true;
285 if (lb.intersectWith(l2,out))
286 if (!out.equals(lb.start) && !out.equals(lb.end) &&
287 !out.equals(l2.start) && !out.equals(l2.end))
288 return true;
289 if (lc.intersectWith(l2,out))
290 if (!out.equals(lc.start) && !out.equals(lc.end) &&
291 !out.equals(l2.start) && !out.equals(l2.end))
292 return true;
293
294 // my shit intersection code only works with lines in certain directions :(
295 if (l2.intersectWith(lb,out))
296 if (!out.equals(lb.start) && !out.equals(lb.end) &&
297 !out.equals(l2.start) && !out.equals(l2.end))
298 return true;
299 if (l2.intersectWith(lc,out))
300 if (!out.equals(lc.start) && !out.equals(lc.end) &&
301 !out.equals(l2.start) && !out.equals(l2.end))
302 return true;
303
304
305 if (lb.isPointOnLine(l2.start) && l2.start != lb.start && l2.start != lb.end)
306 return true;
307 if (lc.isPointOnLine(l2.start) && l2.start != lc.start && l2.start != lc.end)
308 return true;
309
310 }
311 return false;
312 }
313 };
314
315 // an area of adjacent pixels
316 struct SPixelGroup
317 {
318 SPixelGroup(IrrlichtDevice *device) : triangles(), pixelWidth(0), pixelHeight(0),
319 Device(device) {}
320
321 core::array<core::position2di> pixels;
322 core::array<SEdge> edges;
323 STriangleList triangles;
324 core::array<SLineList> ll;
325 core::array<bool> isMemberCache;
326 s32 pixelWidth;
327 s32 pixelHeight;
328 IrrlichtDevice *Device;
329
330 void triangulate()
331 {
332
333 // find edges in this group
334 makeEdges();
335
336 // triangulate the group
337 makeTriangles();
338
339 }
340
341 void drawTriangle( core::line2df line, core::vector2df point)
342 {
343 //const u32 endt = Device->getTimer()->getTime() + t;
344 f32 scale = 5;
345
346
347 //while(Device->getTimer()->getTime() < endt )
348 //{
349 Device->run();
350 Device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0));
351 for (u32 v=0;v<ll.size(); ++v)
352 for (u32 h=0;h<ll[v].lines.size(); ++h)
353 {
354 core::line2df &currentline = ll[v].lines[h];
355 core::position2di st = core::position2di((s32)(currentline.start.X*scale)+50, (s32)(currentline.start.Y*scale)+50);
356 core::position2di en = core::position2di((s32)(currentline.end.X*scale)+50, (s32)(currentline.end.Y*scale)+50);
357
358 Device->getVideoDriver()->draw2DLine(st,en, SColor(255,255,255,255));
359 }
360 // draw this triangle
361 const core::position2di st((s32)(line.start.X*scale)+50, (s32)(line.start.Y*scale)+50);
362 const core::position2di en((s32)(line.end.X*scale)+50, (s32)(line.end.Y*scale)+50);
363 const core::position2di p((s32)(point.X*scale)+50, (s32)(point.Y*scale)+50);
364 Device->getVideoDriver()->draw2DLine(st,en, SColor(255,255,0,0));
365 Device->getVideoDriver()->draw2DLine(en,p, SColor(255,0,255,0));
366 Device->getVideoDriver()->draw2DLine(p,st, SColor(255,0,0,255));
367
368 Device->getVideoDriver()->endScene();
369 //}
370 }
371
372 void makeTriangles()
373 {
374 // make lines from edges, because they're easier to deal with
375 ll.clear();
376 for (u32 i=0; i < edges.size(); ++i)
377 {
378 SLineList l;
379 l.addEdge(edges[i]);
380 ll.push_back(l);
381 }
382 // add an extra one for inside edges
383 SLineList innerlines;
384 ll.push_back(innerlines);
385
386 // loop through each edge and make triangles
387 for (u32 i=0; i<ll.size(); ++i)
388 {
389 // loop through each line in the edge
390 for (u32 cl=0; cl<ll[i].lines.size(); ++cl)
391 {
392
393 core::line2df &currentLine = ll[i].lines[cl];
394 f32 bestScore = -10.0f;
395 s32 bestEdge = -1;
396 s32 bestPoint = -1;
397 // find the best scoring point to join to this line
398 for (u32 k=0; k<ll.size(); ++k)
399 for (u32 j=0; j< ll[k].lines.size(); ++j)
400 {
401 f32 score = 0.0f;
402 core::vector2df point(ll[k].lines[j].start.X,
403 ll[k].lines[j].start.Y);
404 core::line2df line1(point,currentLine.start);
405 core::line2df line2(currentLine.end,point);
406
407 // can't be part of the current line
408 if (point == currentLine.start || point == currentLine.end)
409 continue;
410
411 // must be to the right hand side (triangles are wound clockwise)
412 // unless its part of the inside...
413 f32 side1 = currentLine.getPointOrientation(point);
414 f32 side2 = core::line2df(point,currentLine.start).getPointOrientation(currentLine.end);
415 f32 side3 = core::line2df(currentLine.end,point).getPointOrientation(currentLine.start);
416 if (i<ll.size()-1)
417 if (side1 <= 0 || side2 <= 0 || side3 <=0)
418 continue;
419
420 // can't already have this triangle
421 if (triangles.hasTriangle(currentLine.start,currentLine.end,point))
422 continue;
423
424 // must not cross any other lines or enclose any points
425 bool itCrossed = false;
426 for (u32 v=0; v<ll.size(); ++v)
427 if (ll[v].crossesWith(currentLine, point))
428 {
429 itCrossed = true;
430 break;
431 }
432 if (itCrossed)
433 continue;
434
435
436 // so, we like this triangle, but how much?
437 // is it better than all the others?
438
439 // we prefer points from other edges, unless its on the inside
440 if (k==i && i != ll.size()-1)
441 score = 1;
442 else
443 score = 2;
444
445 // we prefer evenly shaped triangles
446
447 // we prefer triangles with a large area
448
449 // do we like this one more than the others?
450 if (score>bestScore)
451 {
452 bestScore = score;
453 bestEdge = k;
454 bestPoint = j;
455 }
456 }
457 // hopefully we found one
458 if (bestEdge >= 0 && bestPoint >= 0 && bestScore >= 0.0f)
459 {
460 //assert(bestEdge >= 0 && bestPoint >= 0);
461 //assert(bestScore >= 0.0f);
462
463 core::vector2df point(ll[bestEdge].lines[bestPoint].start.X, ll[bestEdge].lines[bestPoint].start.Y);
464
465 // add it to the triangles list
466 triangles.add(currentLine.start, currentLine.end, point);
467
468 // add inner lines to the line buffer, but only if they arent in others
469
470 core::line2df la(point,currentLine.start);
471 core::line2df lb(currentLine.end,point);
472
473 bool found = false;
474 for (u32 lineno=0;lineno<ll.size()-1; ++lineno)
475 if (ll[lineno].hasLine(la))
476 { found=true; break; }
477 if (!found)
478 ll[ll.size()-1].addLine(la);
479
480 for (u32 lineno=0;lineno<ll.size()-1; ++lineno)
481 if (ll[lineno].hasLine(lb))
482 { found=true; break; }
483 if (!found)
484 ll[ll.size()-1].addLine(lb);
485
486 //drawTriangle(currentLine, point);
487
488 }
489
490 }
491 }
492 }
493
494 // finds the edges
495 void makeEdges()
496 {
497
498 // speed it up
499 refreshIsMemberCache();
500
501 // clear the edges
502 edges.clear();
503
504 // loop through each pixel
505 for (u32 i=0; i < pixels.size(); ++i)
506 {
507 core::position2di &p = pixels[i];
508 s32 &x=p.X, &y=p.Y;
509 bool ul = isMember(p.X-1,p.Y-1);
510 bool u = isMember(p.X,p.Y-1);
511 bool ur = isMember(p.X+1,p.Y-1);
512 bool l = isMember(p.X-1,p.Y);
513 bool r = isMember(p.X+1,p.Y);
514 bool bl = isMember(p.X-1,p.Y+1);
515 bool b = isMember(p.X,p.Y+1);
516 bool br = isMember(p.X+1,p.Y+1);
517
518 // walls already added?
519 bool top=u, bottom=b, left=l, right=r;
520
521 if (!(ul | u | ur | l | r | bl | b | br))
522 {
523 // lone square
524 SEdge a;
525 a.positions.push_back( core::position2di(x,y));
526 a.positions.push_back( core::position2di(x+1,y));
527 a.positions.push_back( core::position2di(x+1,y+1));
528 a.positions.push_back( core::position2di(x,y+1));
529 a.positions.push_back( core::position2di(x,y));
530 edges.push_back(a);
531 top=bottom=left=right=true;
532 }
533 else
534 {
535 if (!(ul|u|l) && (b&r) )
536 {
537 // upper outer diagonal "/"
538 addToEdges(x,y+1,x+1,y);
539 top=left=true;
540 } else if ( !(u|ur|r) && (b&l) )
541 {
542 // upper outer diagonal "\"
543 addToEdges(x,y,x+1,y+1);
544 top=right=true;
545 } else if ( !(l|bl|b) && (r&u) )
546 {
547 // lower outer diagonal "\"
548 addToEdges(x+1,y+1,x,y);
549 left=bottom=true;
550 } else if ( !(r|br|b) && (l&u) )
551 {
552 // lower outer diagonal "/"
553 addToEdges(x+1,y,x,y+1);
554 right=bottom=true;
555 }/* else if (!(b) && (l&bl) )
556 {
557 // upper inner diagonal "/"
558 addToEdges(x+1,y+1,x,y+2);
559 //bottom=true;
560 } else if ( !(b) && (r&br) )
561 {
562 // upper inner diagonal "\"
563 addToEdges(x+1,y+2,x,y+1);
564 //bottom=true;
565 } else if ( !(r) && (b&br) )
566 {
567 // lower inner diagonal "\"
568 addToEdges(x+1,y,x+2,y+1);
569 //right=true;
570 } else if ( !(l) && (b&bl) )
571 {
572 // lower inner diagonal "/"
573 addToEdges(x-1,y+1,x,y);
574 //left=true;
575 }*/
576
577 // add flat edges
578 if (!left /*&& !( (u&ul) || (b&bl)) */) addToEdges(x,y+1,x,y);
579 if (!top /*&& !( (l&ul) || (r&ur)) */) addToEdges(x,y,x+1,y);
580 if (!right /*&& !( (u&ur) || (b&br)) */) addToEdges(x+1,y,x+1,y+1);
581 if (!bottom /*&& !( (l&bl) || (r&br)) */) addToEdges(x+1,y+1,x,y+1);
582 } // lone square
583 } // for
584
585 // reduce the number of points in each edge
586 for (u32 i=0; i<edges.size(); ++i)
587 {
588 edges[i].reduce(1);
589
590 // all edges should have at least 3 points
591 assert(edges[i].positions.size() >= 3);
592
593 // all edges should be closed
594 assert(edges[i].positions[0] == edges[i].positions[edges[i].positions.size()-1] );
595 }
596 }
597
598 // adds a line to the edges arrays
599 void addToEdges(s32 x1, s32 y1, s32 x2, s32 y2)
600 {
601 bool found=false;
602 // loop through each edge
603 for (u32 i=0; i<edges.size(); ++i)
604 {
605 // if this line starts at the end of an edge
606 if ( edges[i].positions[edges[i].positions.size()-1] == core::position2di(x1,y1))
607 {
608 // add it to the end
609 edges[i].positions.push_back(core::position2di(x2,y2));
610 found=true;
611 break;
612 }
613 // if the line ends at the start of the edge
614 if ( edges[i].positions[0]== core::position2di(x2,y2))
615 {
616 // add it to the front
617 edges[i].positions.push_front(core::position2di(x1,y1));
618 found=true;
619 break;
620 }
621 }
622 if (!found)
623 {
624 // we make a new edge
625 SEdge n;
626 n.positions.push_back(core::position2di(x1,y1));
627 n.positions.push_back(core::position2di(x2,y2));
628 edges.push_back(n);
629 }
630
631 joinEdges();
632 }
633
634 void joinEdges()
635 {
636 // touching edges are joined
637
638 for (u32 i=0; i < edges.size(); ++i)
639 for (u32 j=0; j < edges.size(); ++j)
640 {
641 if (i != j && edges[j].positions.size() && edges[i].positions.size())
642 {
643 if (edges[j].positions[0] == edges[i].positions[edges[i].positions.size()-1])
644 {
645 for (u32 k=0; k < edges[j].positions.size(); ++k)
646 edges[i].positions.push_back(edges[j].positions[k]);
647 edges[j].positions.clear();
648 }
649 }
650 }
651
652 // remove empty edges
653 for (u32 i=0; i<edges.size(); ++i)
654 if (edges[i].positions.size() == 0)
655 edges.erase(i--);
656 }
657
658 // tells if this x,y position is a member of this group
659 bool isMember(s32 x, s32 y)
660 {
661 //for (u32 i=0; i<pixels.size(); ++i)
662 // if (pixels[i].X == x && pixels[i].Y == y)
663 // return true;
664 if (x>pixelWidth || y>pixelHeight || x<0 || y<0)
665 return false;
666 else
667 return isMemberCache[pixelWidth*y + x];
668 }
669
670 void refreshIsMemberCache()
671 {
672 isMemberCache.clear();
673 pixelWidth=0; pixelHeight=0;
674 for (u32 i=0; i<pixels.size(); ++i)
675 {
676 if (pixels[i].X>pixelWidth) pixelWidth=pixels[i].X;
677 if (pixels[i].Y>pixelHeight) pixelHeight=pixels[i].Y;
678 }
679 pixelWidth+=2; pixelHeight+=2;
680 isMemberCache.set_used(pixelWidth*pixelHeight+1);
681 for (u32 i=0; i<isMemberCache.size(); ++i)
682 isMemberCache[i] = false;
683 for (u32 i=0; i<pixels.size(); ++i)
684 isMemberCache[pixelWidth*pixels[i].Y + pixels[i].X] = true;
685 }
686 };
687
688
689 void drawEdges(IrrlichtDevice *device, u32 t, s32 scale)
690 {
691 const u32 stt = device->getTimer()->getTime();
692 const u32 endt = stt + t;
693
694 while(device->getTimer()->getTime() < endt )
695 {
696 const f32 phase = f32((device->getTimer()->getTime()-stt) % 500) / 500.0f;
697
698 device->run();
699 device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0));
700 for (u32 g=0;g<groups.size(); ++g)
701 for (u32 v=0;v<groups[g].edges.size(); ++v)
702 for (u32 p=1;p<groups[g].edges[v].positions.size(); ++p)
703 {
704 core::position2di st = core::position2di(groups[g].edges[v].positions[p-1].X*scale+50, groups[g].edges[v].positions[p-1].Y*scale+50) ;
705 core::position2di en = core::position2di(groups[g].edges[v].positions[p].X*scale+50, groups[g].edges[v].positions[p].Y*scale+50) ;
706 core::position2di ep = en-st;
707 ep = st + core::position2di((s32)(ep.X*phase), (s32)(ep.Y*phase));
708 device->getVideoDriver()->draw2DLine(st,en);
709 device->getVideoDriver()->draw2DLine(st,ep,video::SColor(255,255,0,0) );
710 }
711 device->getVideoDriver()->endScene();
712 }
713 }
714
715 void drawTriangles(IrrlichtDevice *device, u32 t, s32 scale)
716 {
717 const u32 stt = device->getTimer()->getTime();
718 const u32 endt = stt + t;
719
720 while(device->getTimer()->getTime() < endt )
721 {
722 const f32 phase = f32((device->getTimer()->getTime()-stt) % 500) / 500.0f;
723
724 device->run();
725 device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0));
726 for (u32 g=0;g<groups.size(); ++g)
727 for (u32 v=0;v<groups[g].triangles.indexes.size()*phase; v+=3)
728 {
729 STriangleList &t = groups[g].triangles;
730 core::position2di st((s32)(t.positions[t.indexes[v+0]].X*scale)+50,(s32)(t.positions[t.indexes[v+0]].Y*scale)+50);
731 core::position2di en((s32)(t.positions[t.indexes[v+1]].X*scale)+50,(s32)(t.positions[t.indexes[v+1]].Y*scale)+50);
732 device->getVideoDriver()->draw2DLine(st,en, SColor(255,255,0,0));
733 st = core::position2di((s32)(t.positions[t.indexes[v+1]].X*scale)+50,(s32)(t.positions[t.indexes[v+1]].Y*scale)+50);
734 en = core::position2di((s32)(t.positions[t.indexes[v+2]].X*scale)+50,(s32)(t.positions[t.indexes[v+2]].Y*scale)+50);
735 device->getVideoDriver()->draw2DLine(st,en, SColor(255,0,255,0));
736 st = core::position2di((s32)(t.positions[t.indexes[v+2]].X*scale)+50,(s32)(t.positions[t.indexes[v+2]].Y*scale)+50);
737 en = core::position2di((s32)(t.positions[t.indexes[v+0]].X*scale)+50,(s32)(t.positions[t.indexes[v+0]].Y*scale)+50);
738 device->getVideoDriver()->draw2DLine(st,en, SColor(255,0,0,255));
739 }
740 device->getVideoDriver()->endScene();
741 }
742 }
743
744 void drawTriLines(IrrlichtDevice *device, u32 t, s32 scale)
745 {
746 const u32 endt = device->getTimer()->getTime() + t;
747
748 while(device->getTimer()->getTime() < endt )
749 {
750 device->run();
751 device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0));
752 for (u32 g=0;g<groups.size(); ++g)
753 for (u32 v=0;v<groups[g].ll.size()-1; ++v)
754 for (u32 h=0;h<groups[g].ll[v].lines.size(); ++h)
755 {
756 core::line2df &currentline = groups[g].ll[v].lines[h];
757 const core::position2di st((s32)(currentline.start.X*scale)+50, (s32)(currentline.start.Y*scale)+50);
758 const core::position2di en((s32)(currentline.end.X*scale)+50, (s32)(currentline.end.Y*scale)+50);
759 device->getVideoDriver()->draw2DLine(st,en, SColor(255,255,0,0));
760 }
761
762 device->getVideoDriver()->endScene();
763 }
764 }
765 void drawTri3D(IrrlichtDevice *device, u32 t)
766 {
767 for (u32 g=0;g<groups.size(); ++g)
768 {
769 STriangleList &t = groups[g].triangles;
770 core::array<S3DVertex> verts;
771 verts.clear();
772 for(u32 v=0; v< t.positions.size(); ++v)
773 {
774 verts.push_back(S3DVertex(
775 -t.positions[v].X, -t.positions[v].Y, -100,
776 0,0,1,SColor(255,255,255,255),0,0));
777 }
778
779 device->getVideoDriver()->drawIndexedTriangleList(verts.pointer(),verts.size(),t.indexes.pointer(), t.indexes.size()/3 );
780 }
781 }
782
783
784 // process all pixels
785 void findGroups()
786 {
787 for (int y=0; y<height; ++y)
788 for (int x=0; x<width; ++x)
789 processPixel(x,y);
790
791 }
792
793 // remove groups with no pixels
794 void removeGroups()
795 {
796 for (u32 i=0; i<groups.size(); ++i)
797 if (groups[i].pixels.size() == 0)
798 groups.erase(i--);
799
800 /*for (s32 y=0; y <height; ++y)
801 {
802 printf("\n");
803 for (s32 x=0; x <width; ++x)
804 {
805 s32 i;
806 for (i=0; i<groups.size(); ++i)
807 {
808 bool k = groups[i].isMember(x,y);
809 if (k)
810 break;
811 }
812 printf("%d",i);
813 }
814 }*/
815
816
817 }
818
819 // adds a pixel to its area, merging touching areas
820 void processPixel(s32 x, s32 y)
821 {
822 // solid?
823 if (getPixel(x,y))
824 {
825 s32 g=0, grp=0;
826
827 bool found=false;
828 if (x>0) // look one behind
829 {
830 grp = getRef(x-1,y);
831 if (grp) found=true;
832 }
833 if (y>0) // look above
834 {
835 if (x>0) // top left
836 {
837 g = getRef(x-1,y-1);
838
839 if (g)
840 {
841 if (found)
842 {
843 mergeGroups(grp, g);
844 }
845 else
846 {
847 grp = g;
848 found = true;
849 }
850 }
851 }
852
853 if (x<width-1) // top right
854 {
855 g = getRef(x+1,y-1);
856
857 if (g)
858 {
859 if (found)
860 {
861 mergeGroups(grp, g);
862 }
863 else
864 {
865 grp = g;
866 found = true;
867 }
868 }
869 }
870
871 // top
872
873 g = getRef(x,y-1);
874
875 if (g)
876 {
877 if (found)
878 {
879 mergeGroups(grp, g);
880 }
881 else
882 {
883 grp = g;
884 found = true;
885 }
886 }
887
888 }
889
890 // didn't find a group for this pixel, so we add one
891 if (!found)
892 {
893 SPixelGroup p(Device);
894 p.pixels.push_back(core::position2di(x,y));
895 groups.push_back(p);
896 groupRefs.push_back(groups.size());
897 grp=groups.size();
898 }
899 else
900 {
901 groups[groupRefs[grp-1]-1].pixels.push_back(core::position2di(x,y));
902 }
903 setRef(x,y,groupRefs[grp-1]);
904 }
905 }
906
907 bool& getPixel(s32 x, s32 y) { return mem[y*width +x]; }
908 s32& getRef(s32 x, s32 y) { return refbuffer[y*width +x]; }
909 void setRef(s32 x, s32 y, s32 g) { refbuffer[y*width +x] = g; }
910
911 void mergeGroups(s32 g1, s32 g2)
912 {
913 if (g1==g2)
914 return;
915 // joins two groups together
916 for (u32 i=0; i<groups[g2-1].pixels.size(); ++i)
917 groups[g1-1].pixels.push_back(groups[g2-1].pixels[i]);
918 groups[g2-1].pixels.clear();
919 groupRefs[g2-1] = g1;
920 }
921
922 s32 width, height;
923 core::array<SPixelGroup> groups;
924 core::array<s32> groupRefs;
925 core::array<s32> refbuffer;
926 bool *mem;
927 IrrlichtDevice *Device;
928};
929
930// creates a simple vector font from a bitmap from the font tool
931class CVectorFontTool
932{
933public:
934 CVectorFontTool(CFontTool *fonttool) :
935 triangulator(0), FontTool(fonttool),
936 letterHeight(0), letterWidth(0), triangles()
937 {
938 core::map<wchar_t, u32>::Iterator it = FontTool->CharMap.getIterator();
939
940 while(!it.atEnd())
941 {
942 CFontTool::SFontArea &fa = FontTool->Areas[(*it).getValue()];
943
944 if (fa.rectangle.getWidth() > letterWidth)
945 letterWidth = fa.rectangle.getWidth();
946 if (fa.rectangle.getHeight() > letterHeight)
947 letterHeight = fa.rectangle.getHeight();
948
949 it++;
950 }
951
952 // number of verts is one more than number of pixels because it's a grid of squares
953 letterWidth++;
954 letterHeight++;
955
956 // create image memory
957 imagedata.set_used(letterWidth*letterHeight);
958
959 // create vertex list, set position etc
960 verts.set_used(letterWidth*letterHeight);
961 for (s32 y=0; y<letterHeight; ++y)
962 {
963 for (s32 x=0; x<letterWidth; ++x)
964 {
965 S3DVertex &v = getVert(x,y);
966 v.Pos = core::vector3df((f32)x,(f32)y,0.0f);
967 v.TCoords.X = (f32)letterWidth / (f32)x;
968 v.TCoords.Y = (f32)letterHeight / (f32)y;
969 v.Normal = core::vector3df(0,0,-1);
970 v.Color = SColor(255,255,255,255);
971 }
972 }
973 // clear index list
974 inds.clear();
975
976 // create each char in the font...
977 it = FontTool->CharMap.getIterator();
978 while(!it.atEnd())
979 {
980 addChar((*it).getKey());
981 it++;
982 }
983 }
984
985 ~CVectorFontTool()
986 {
987 if (triangulator)
988 delete triangulator;
989 }
990
991 void addChar(wchar_t thischar)
992 {
993 const s32 area = FontTool->CharMap[thischar];
994 const CFontTool::SFontArea &fa = FontTool->Areas[area];
995
996 const s32 img = fa.sourceimage;
997 const core::rect<s32>& r = fa.rectangle;
998
999 // init image memory
1000 IImage *image = FontTool->currentImages[img];
1001 for (u32 i=0; i < imagedata.size(); ++i)
1002 imagedata[i] = false;
1003 for (s32 y=r.UpperLeftCorner.Y; y < r.LowerRightCorner.Y; ++y)
1004 {
1005 for (s32 x=r.UpperLeftCorner.X; x < r.LowerRightCorner.X ; ++x)
1006 if (image->getPixel(x,y).getBlue() > 0)
1007 {
1008 imagedata[letterWidth*(y-r.UpperLeftCorner.Y) +(x-r.UpperLeftCorner.X)] = true;
1009 }
1010 }
1011
1012 // get shape areas
1013 triangulator = new CGroupFinder(imagedata.pointer(), letterWidth, letterHeight, FontTool->Device );
1014
1015 wprintf(L"Created character '%c' in texture %d\n", thischar, img );
1016
1017 //floodfill->drawEdges(FontTool->Device, 500, 3);
1018 //floodfill->drawTriangles(FontTool->Device, 500,30);
1019 //floodfill->drawTriLines(FontTool->Device, 200,3);
1020
1021 /*
1022 if (area==32 && map == 0)
1023 {
1024 scene::ISceneManager *smgr = FontTool->Device->getSceneManager();
1025 smgr->addCameraSceneNodeFPS();
1026 while(FontTool->Device->run())
1027 {
1028 //floodfill->drawEdges(FontTool->Device, 100, 30);
1029 FontTool->Device->getVideoDriver()->beginScene(true, true, video::SColor(0,200,200,200));
1030 smgr->drawAll();
1031 floodfill->drawTri3D(FontTool->Device, 100);
1032 FontTool->Device->getVideoDriver()->endScene();
1033 }
1034 }*/
1035
1036 u32 lastind = triangles.indexes.size();
1037
1038 // loop through each shape and add it to the current character...
1039 for (u32 i=0; i < triangulator->groups.size(); ++i)
1040 triangles += triangulator->groups[i].triangles;
1041
1042 // add character details
1043 charstarts.push_back(lastind);
1044 charlengths.push_back(triangles.indexes.size() - lastind);
1045 chars.push_back(thischar);
1046 }
1047
1048 bool saveVectorFont(const c8 *filename, const c8 *formatname)
1049 {
1050 IrrlichtDevice *Device = FontTool->Device;
1051
1052 if (triangles.indexes.size() == 0)
1053 {
1054 Device->getLogger()->log("No vector data to write, aborting.");
1055 return false;
1056 }
1057
1058 core::stringc fn = filename;
1059
1060 if (core::stringc(formatname) == core::stringc("xml"))
1061 {
1062 fn += ".xml";
1063 io::IXMLWriter *writer = FontTool->Device->getFileSystem()->createXMLWriter(fn.c_str());
1064
1065 // header and line breaks
1066 writer->writeXMLHeader();
1067 writer->writeLineBreak();
1068
1069 // write info header
1070 writer->writeElement(L"font", false, L"type", L"vector");
1071 writer->writeLineBreak();
1072 writer->writeLineBreak();
1073
1074 // write each letter
1075
1076 for (u32 n=0; n<chars.size(); ++n)
1077 {
1078 u32 i = FontTool->CharMap[chars[n]];
1079 CFontTool::SFontArea &fa = FontTool->Areas[i];
1080 wchar_t c[2];
1081 c[0] = chars[n];
1082 c[1] = L'\0';
1083 core::stringw area, under, over;
1084 area = core::stringw(fa.rectangle.LowerRightCorner.X-
1085 fa.rectangle.UpperLeftCorner.X);
1086 area += L", ";
1087 area += fa.rectangle.LowerRightCorner.Y-
1088 fa.rectangle.UpperLeftCorner.Y;
1089
1090
1091 core::array<core::stringw> names;
1092 core::array<core::stringw> values;
1093 names.clear();
1094 values.clear();
1095 // char
1096 names.push_back(core::stringw(L"c"));
1097 values.push_back(core::stringw(c));
1098
1099 // width+height
1100 names.push_back(core::stringw(L"wh"));
1101 values.push_back(area);
1102
1103 // start
1104 names.push_back(core::stringw(L"st"));
1105 values.push_back(core::stringw(charstarts[n]));
1106 // length
1107 names.push_back(core::stringw(L"len"));
1108 values.push_back(core::stringw(charlengths[n]));
1109
1110 if (fa.underhang != 0)
1111 {
1112 under = core::stringw(fa.underhang);
1113 names.push_back(core::stringw(L"u"));
1114 values.push_back(under);
1115 }
1116 if (fa.overhang != 0)
1117 {
1118 over = core::stringw(fa.overhang);
1119 names.push_back(core::stringw(L"o"));
1120 values.push_back(over);
1121 }
1122 writer->writeElement(L"c", true, names, values);
1123
1124 writer->writeLineBreak();
1125 }
1126
1127 // write vertex data
1128 core::stringw data, count;
1129 data = L"";
1130 count = core::stringw(triangles.positions.size());
1131 for (u32 i=0; i<triangles.positions.size(); ++i)
1132 {
1133 if (i!=0)
1134 data += L", ";
1135 data += (s32)triangles.positions[i].X;
1136 data += L",";
1137 data += (s32)triangles.positions[i].Y;
1138 }
1139 writer->writeElement(L"Vertices", true, L"count", count.c_str(), L"data", data.c_str());
1140 writer->writeLineBreak();
1141
1142 // write index list
1143 data = L"";
1144 count = core::stringw(triangles.indexes.size());
1145 for (u32 i=0; i<triangles.indexes.size(); i+=3)
1146 {
1147 if (i!=0)
1148 data += L", ";
1149 data += triangles.indexes[i+0];
1150 data += L",";
1151 data += triangles.indexes[i+1],
1152 data += L",";
1153 data += triangles.indexes[i+2];
1154 }
1155
1156 writer->writeElement(L"Indices", true, L"count", count.c_str(), L"data", data.c_str());
1157 writer->writeLineBreak();
1158
1159 writer->writeClosingTag(L"font");
1160
1161 writer->drop();
1162
1163 Device->getLogger()->log("Font saved.");
1164 return true;
1165
1166 }
1167 else if (core::stringc(formatname) == core::stringc("bin"))
1168 {
1169 FontTool->Device->getLogger()->log("binary fonts not supported yet, sorry");
1170 return false;
1171 }
1172 else
1173 {
1174 FontTool->Device->getLogger()->log("unsupported file format, unable to save vector font");
1175 return false;
1176 }
1177 }
1178
1179 S3DVertex& getVert(s32 x, s32 y) { return verts[letterWidth*y +x]; }
1180
1181 core::array<S3DVertex> verts;
1182 core::array<u16> inds;
1183 core::array<bool> imagedata;
1184
1185 core::array<s32> charstarts; // start position of each char
1186 core::array<s32> charlengths; // index count
1187 core::array<wchar_t> chars; // letters
1188
1189 CGroupFinder* triangulator;
1190 CFontTool* FontTool;
1191
1192 s32 letterHeight;
1193 s32 letterWidth;
1194
1195 STriangleList triangles;
1196};
1197
1198#endif // __VECTOR_FONT_TOOL_INCLUDED__
1199
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/Makefile b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/Makefile
new file mode 100644
index 0000000..7444e44
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/Makefile
@@ -0,0 +1,38 @@
1# Makefile for Irrlicht Examples
2# It's usually sufficient to change just the target name and source file list
3# and be sure that CXX is set to a valid compiler
4Target = FontTool
5Sources = CFontTool.cpp main.cpp
6
7# general compiler settings
8CPPFLAGS = -I../../../include -I/usr/X11R6/include -I/usr/include/freetype2/
9CXXFLAGS = -O3 -ffast-math
10#CXXFLAGS = -g -Wall
11
12#default target is Linux
13all: all_linux
14
15ifeq ($(HOSTTYPE), x86_64)
16LIBSELECT=64
17endif
18
19# target specific settings
20all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXft
21all_linux clean_linux: SYSTEM=Linux
22all_win32: LDFLAGS = -L../../../lib/Win32-gcc -lIrrlicht -lgdi32 -lopengl32 -lglu32 -lm
23all_win32 clean_win32: SYSTEM=Win32-gcc
24all_win32 clean_win32: SUF=.exe
25# name of the binary - only valid for targets which set SYSTEM
26DESTPATH = ../../../bin/$(SYSTEM)/$(Target)$(SUF)
27
28all_linux all_win32:
29 $(warning Building...)
30 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
31
32clean: clean_linux clean_win32
33 $(warning Cleaning...)
34
35clean_linux clean_win32:
36 @$(RM) $(DESTPATH)
37
38.PHONY: all all_win32 clean clean_linux clean_win32
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v8.sln b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v8.sln
new file mode 100644
index 0000000..1e24460
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v8.sln
@@ -0,0 +1,20 @@
1
2Microsoft Visual Studio Solution File, Format Version 9.00
3# Visual C++ Express 2005
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Font Tool", "irrFontTool_v8.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Debug|Win32 = Debug|Win32
9 Release|Win32 = Release|Win32
10 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32
13 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32
14 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32
15 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32
16 EndGlobalSection
17 GlobalSection(SolutionProperties) = preSolution
18 HideSolutionNode = FALSE
19 EndGlobalSection
20EndGlobal
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v8.vcproj b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v8.vcproj
new file mode 100644
index 0000000..fcb71a1
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v8.vcproj
@@ -0,0 +1,201 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="Font Tool"
6 ProjectGUID="{853A396E-C031-4C26-A716-5B4E176BE11D}"
7 Keyword="Win32Proj"
8 >
9 <Platforms>
10 <Platform
11 Name="Win32"
12 />
13 </Platforms>
14 <ToolFiles>
15 </ToolFiles>
16 <Configurations>
17 <Configuration
18 Name="Debug|Win32"
19 OutputDirectory="Debug"
20 IntermediateDirectory="Debug"
21 ConfigurationType="1"
22 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
23 CharacterSet="2"
24 >
25 <Tool
26 Name="VCPreBuildEventTool"
27 />
28 <Tool
29 Name="VCCustomBuildTool"
30 />
31 <Tool
32 Name="VCXMLDataGeneratorTool"
33 />
34 <Tool
35 Name="VCWebServiceProxyGeneratorTool"
36 />
37 <Tool
38 Name="VCMIDLTool"
39 />
40 <Tool
41 Name="VCCLCompilerTool"
42 Optimization="0"
43 AdditionalIncludeDirectories="../../../include"
44 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
45 MinimalRebuild="true"
46 BasicRuntimeChecks="3"
47 RuntimeLibrary="1"
48 UsePrecompiledHeader="0"
49 WarningLevel="3"
50 Detect64BitPortabilityProblems="true"
51 DebugInformationFormat="4"
52 />
53 <Tool
54 Name="VCManagedResourceCompilerTool"
55 />
56 <Tool
57 Name="VCResourceCompilerTool"
58 />
59 <Tool
60 Name="VCPreLinkEventTool"
61 />
62 <Tool
63 Name="VCLinkerTool"
64 AdditionalOptions=" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib"
65 OutputFile="../../../bin/Win32-visualstudio/FontTool.exe"
66 LinkIncremental="2"
67 GenerateDebugInformation="true"
68 ProgramDatabaseFile="$(OutDir)/TestProject.pdb"
69 SubSystem="1"
70 TargetMachine="1"
71 />
72 <Tool
73 Name="VCALinkTool"
74 />
75 <Tool
76 Name="VCManifestTool"
77 />
78 <Tool
79 Name="VCXDCMakeTool"
80 />
81 <Tool
82 Name="VCBscMakeTool"
83 />
84 <Tool
85 Name="VCFxCopTool"
86 />
87 <Tool
88 Name="VCAppVerifierTool"
89 />
90 <Tool
91 Name="VCWebDeploymentTool"
92 />
93 <Tool
94 Name="VCPostBuildEventTool"
95 />
96 </Configuration>
97 <Configuration
98 Name="Release|Win32"
99 OutputDirectory="Release"
100 IntermediateDirectory="Release"
101 ConfigurationType="1"
102 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
103 CharacterSet="2"
104 WholeProgramOptimization="1"
105 >
106 <Tool
107 Name="VCPreBuildEventTool"
108 />
109 <Tool
110 Name="VCCustomBuildTool"
111 />
112 <Tool
113 Name="VCXMLDataGeneratorTool"
114 />
115 <Tool
116 Name="VCWebServiceProxyGeneratorTool"
117 />
118 <Tool
119 Name="VCMIDLTool"
120 />
121 <Tool
122 Name="VCCLCompilerTool"
123 WholeProgramOptimization="true"
124 AdditionalIncludeDirectories="..\..\include"
125 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
126 RuntimeLibrary="0"
127 UsePrecompiledHeader="0"
128 WarningLevel="3"
129 Detect64BitPortabilityProblems="true"
130 DebugInformationFormat="3"
131 />
132 <Tool
133 Name="VCManagedResourceCompilerTool"
134 />
135 <Tool
136 Name="VCResourceCompilerTool"
137 />
138 <Tool
139 Name="VCPreLinkEventTool"
140 />
141 <Tool
142 Name="VCLinkerTool"
143 OutputFile="../../bin/Win32-visualstudio/FontTool.exe"
144 LinkIncremental="1"
145 GenerateDebugInformation="true"
146 SubSystem="1"
147 OptimizeReferences="2"
148 EnableCOMDATFolding="2"
149 LinkTimeCodeGeneration="1"
150 TargetMachine="1"
151 />
152 <Tool
153 Name="VCALinkTool"
154 />
155 <Tool
156 Name="VCManifestTool"
157 />
158 <Tool
159 Name="VCXDCMakeTool"
160 />
161 <Tool
162 Name="VCBscMakeTool"
163 />
164 <Tool
165 Name="VCFxCopTool"
166 />
167 <Tool
168 Name="VCAppVerifierTool"
169 />
170 <Tool
171 Name="VCWebDeploymentTool"
172 />
173 <Tool
174 Name="VCPostBuildEventTool"
175 />
176 </Configuration>
177 </Configurations>
178 <References>
179 </References>
180 <Files>
181 <File
182 RelativePath=".\CFontTool.cpp"
183 >
184 </File>
185 <File
186 RelativePath=".\CFontTool.h"
187 >
188 </File>
189 <File
190 RelativePath=".\CVectorFontTool.h"
191 >
192 </File>
193 <File
194 RelativePath=".\main.cpp"
195 >
196 </File>
197 </Files>
198 <Globals>
199 </Globals>
200</VisualStudioProject>
201
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v9.sln b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v9.sln
new file mode 100644
index 0000000..be110b8
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v9.sln
@@ -0,0 +1,20 @@
1
2Microsoft Visual Studio Solution File, Format Version 10.00
3# Visual C++ Express 2008
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Font Tool", "irrFontTool_v9.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Debug|Win32 = Debug|Win32
9 Release|Win32 = Release|Win32
10 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32
13 {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32
14 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32
15 {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32
16 EndGlobalSection
17 GlobalSection(SolutionProperties) = preSolution
18 HideSolutionNode = FALSE
19 EndGlobalSection
20EndGlobal
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v9.vcproj b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v9.vcproj
new file mode 100644
index 0000000..4fa1e4b
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_v9.vcproj
@@ -0,0 +1,202 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="9,00"
5 Name="Font Tool"
6 ProjectGUID="{4D53E40F-37E3-42B1-8848-F4C6F8313A17}"
7 Keyword="Win32Proj"
8 TargetFrameworkVersion="131072"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="Debug"
21 IntermediateDirectory="Debug"
22 ConfigurationType="1"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="2"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="../../../include"
45 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 UsePrecompiledHeader="0"
50 WarningLevel="3"
51 DebugInformationFormat="4"
52 />
53 <Tool
54 Name="VCManagedResourceCompilerTool"
55 />
56 <Tool
57 Name="VCResourceCompilerTool"
58 />
59 <Tool
60 Name="VCPreLinkEventTool"
61 />
62 <Tool
63 Name="VCLinkerTool"
64 AdditionalOptions=" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib"
65 OutputFile="../../../bin/Win32-visualstudio/FontTool.exe"
66 LinkIncremental="2"
67 AdditionalLibraryDirectories="../../../lib/Win32-visualstudio"
68 GenerateDebugInformation="true"
69 ProgramDatabaseFile="$(OutDir)/TestProject.pdb"
70 SubSystem="1"
71 RandomizedBaseAddress="1"
72 DataExecutionPrevention="0"
73 TargetMachine="1"
74 />
75 <Tool
76 Name="VCALinkTool"
77 />
78 <Tool
79 Name="VCManifestTool"
80 />
81 <Tool
82 Name="VCXDCMakeTool"
83 />
84 <Tool
85 Name="VCBscMakeTool"
86 />
87 <Tool
88 Name="VCFxCopTool"
89 />
90 <Tool
91 Name="VCAppVerifierTool"
92 />
93 <Tool
94 Name="VCPostBuildEventTool"
95 />
96 </Configuration>
97 <Configuration
98 Name="Release|Win32"
99 OutputDirectory="Release"
100 IntermediateDirectory="Release"
101 ConfigurationType="1"
102 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
103 CharacterSet="2"
104 WholeProgramOptimization="1"
105 >
106 <Tool
107 Name="VCPreBuildEventTool"
108 />
109 <Tool
110 Name="VCCustomBuildTool"
111 />
112 <Tool
113 Name="VCXMLDataGeneratorTool"
114 />
115 <Tool
116 Name="VCWebServiceProxyGeneratorTool"
117 />
118 <Tool
119 Name="VCMIDLTool"
120 />
121 <Tool
122 Name="VCCLCompilerTool"
123 Optimization="2"
124 WholeProgramOptimization="false"
125 AdditionalIncludeDirectories="../../../include"
126 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
127 MinimalRebuild="true"
128 RuntimeLibrary="0"
129 UsePrecompiledHeader="0"
130 WarningLevel="3"
131 DebugInformationFormat="3"
132 />
133 <Tool
134 Name="VCManagedResourceCompilerTool"
135 />
136 <Tool
137 Name="VCResourceCompilerTool"
138 />
139 <Tool
140 Name="VCPreLinkEventTool"
141 />
142 <Tool
143 Name="VCLinkerTool"
144 AdditionalOptions=" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib"
145 OutputFile="../../../bin/Win32-visualstudio/FontTool.exe"
146 LinkIncremental="0"
147 AdditionalLibraryDirectories="../../../lib/Win32-visualstudio"
148 GenerateDebugInformation="false"
149 SubSystem="1"
150 OptimizeReferences="2"
151 EnableCOMDATFolding="2"
152 LinkTimeCodeGeneration="0"
153 RandomizedBaseAddress="1"
154 DataExecutionPrevention="0"
155 TargetMachine="1"
156 />
157 <Tool
158 Name="VCALinkTool"
159 />
160 <Tool
161 Name="VCManifestTool"
162 />
163 <Tool
164 Name="VCXDCMakeTool"
165 />
166 <Tool
167 Name="VCBscMakeTool"
168 />
169 <Tool
170 Name="VCFxCopTool"
171 />
172 <Tool
173 Name="VCAppVerifierTool"
174 />
175 <Tool
176 Name="VCPostBuildEventTool"
177 />
178 </Configuration>
179 </Configurations>
180 <References>
181 </References>
182 <Files>
183 <File
184 RelativePath=".\CFontTool.cpp"
185 >
186 </File>
187 <File
188 RelativePath=".\CFontTool.h"
189 >
190 </File>
191 <File
192 RelativePath=".\CVectorFontTool.h"
193 >
194 </File>
195 <File
196 RelativePath=".\main.cpp"
197 >
198 </File>
199 </Files>
200 <Globals>
201 </Globals>
202</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc10.sln b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc10.sln
new file mode 100644
index 0000000..48651a8
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc10.sln
@@ -0,0 +1,20 @@
1
2Microsoft Visual Studio Solution File, Format Version 11.00
3# Visual Studio 2010
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Font Tool", "irrFontTool_vc10.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Debug|Win32 = Debug|Win32
9 Release|Win32 = Release|Win32
10 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32
13 {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32
14 {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32
15 {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32
16 EndGlobalSection
17 GlobalSection(SolutionProperties) = preSolution
18 HideSolutionNode = FALSE
19 EndGlobalSection
20EndGlobal
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc10.vcxproj b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc10.vcxproj
new file mode 100644
index 0000000..e1ee889
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc10.vcxproj
@@ -0,0 +1,203 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectName>FontTool</ProjectName>
23 <ProjectGuid>{4D53E40F-37E3-42B1-8848-F4C6F8313A17}</ProjectGuid>
24 <Keyword>Win32Proj</Keyword>
25 </PropertyGroup>
26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
28 <ConfigurationType>Application</ConfigurationType>
29 <CharacterSet>MultiByte</CharacterSet>
30 <WholeProgramOptimization>true</WholeProgramOptimization>
31 </PropertyGroup>
32 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
33 <ConfigurationType>Application</ConfigurationType>
34 <CharacterSet>MultiByte</CharacterSet>
35 <WholeProgramOptimization>true</WholeProgramOptimization>
36 </PropertyGroup>
37 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
38 <ConfigurationType>Application</ConfigurationType>
39 <CharacterSet>MultiByte</CharacterSet>
40 </PropertyGroup>
41 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
42 <ConfigurationType>Application</ConfigurationType>
43 <CharacterSet>MultiByte</CharacterSet>
44 </PropertyGroup>
45 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
46 <ImportGroup Label="ExtensionSettings">
47 </ImportGroup>
48 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
49 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
50 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
51 </ImportGroup>
52 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
53 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
54 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
55 </ImportGroup>
56 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
57 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
58 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
59 </ImportGroup>
60 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
61 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
63 </ImportGroup>
64 <PropertyGroup Label="UserMacros" />
65 <PropertyGroup>
66 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
67 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\Win32-VisualStudio\</OutDir>
68 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\Win64-VisualStudio\</OutDir>
69 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
70 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
71 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\Win32-VisualStudio\</OutDir>
72 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\Win64-VisualStudio\</OutDir>
73 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
74 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
75 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
76 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
77 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
78 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
79 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
80 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
81 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
82 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
83 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
84 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
85 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
86 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
87 </PropertyGroup>
88 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
89 <ClCompile>
90 <Optimization>Disabled</Optimization>
91 <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
92 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
93 <MinimalRebuild>true</MinimalRebuild>
94 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
95 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
96 <PrecompiledHeader>
97 </PrecompiledHeader>
98 <WarningLevel>Level3</WarningLevel>
99 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
100 </ClCompile>
101 <Link>
102 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions)</AdditionalOptions>
103 <OutputFile>../../../bin/Win32-visualstudio/FontTool.exe</OutputFile>
104 <AdditionalLibraryDirectories>../../../lib/Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
105 <GenerateDebugInformation>true</GenerateDebugInformation>
106 <SubSystem>Console</SubSystem>
107 <DataExecutionPrevention>
108 </DataExecutionPrevention>
109 </Link>
110 </ItemDefinitionGroup>
111 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
112 <ClCompile>
113 <Optimization>Disabled</Optimization>
114 <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
115 <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
116 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
117 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
118 <PrecompiledHeader>
119 </PrecompiledHeader>
120 <WarningLevel>Level3</WarningLevel>
121 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
122 </ClCompile>
123 <Link>
124 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions)</AdditionalOptions>
125 <OutputFile>../../../bin/Win64-visualstudio/FontTool.exe</OutputFile>
126 <AdditionalLibraryDirectories>../../../lib/Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
127 <GenerateDebugInformation>true</GenerateDebugInformation>
128 <SubSystem>Console</SubSystem>
129 <DataExecutionPrevention>
130 </DataExecutionPrevention>
131 </Link>
132 </ItemDefinitionGroup>
133 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
134 <ClCompile>
135 <Optimization>MaxSpeed</Optimization>
136 <WholeProgramOptimization>false</WholeProgramOptimization>
137 <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
138 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
139 <MinimalRebuild>true</MinimalRebuild>
140 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
141 <PrecompiledHeader>
142 </PrecompiledHeader>
143 <WarningLevel>Level3</WarningLevel>
144 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
145 </ClCompile>
146 <Link>
147 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions)</AdditionalOptions>
148 <OutputFile>../../../bin/Win32-visualstudio/FontTool.exe</OutputFile>
149 <AdditionalLibraryDirectories>../../../lib/Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
150 <GenerateDebugInformation>false</GenerateDebugInformation>
151 <SubSystem>Console</SubSystem>
152 <OptimizeReferences>true</OptimizeReferences>
153 <EnableCOMDATFolding>true</EnableCOMDATFolding>
154 <LinkTimeCodeGeneration>
155 </LinkTimeCodeGeneration>
156 <DataExecutionPrevention>
157 </DataExecutionPrevention>
158 </Link>
159 </ItemDefinitionGroup>
160 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
161 <ClCompile>
162 <Optimization>MaxSpeed</Optimization>
163 <WholeProgramOptimization>false</WholeProgramOptimization>
164 <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
165 <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
166 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
167 <PrecompiledHeader>
168 </PrecompiledHeader>
169 <WarningLevel>Level3</WarningLevel>
170 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
171 </ClCompile>
172 <Link>
173 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions)</AdditionalOptions>
174 <OutputFile>../../../bin/Win64-visualstudio/FontTool.exe</OutputFile>
175 <AdditionalLibraryDirectories>../../../lib/Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
176 <GenerateDebugInformation>false</GenerateDebugInformation>
177 <SubSystem>Console</SubSystem>
178 <OptimizeReferences>true</OptimizeReferences>
179 <EnableCOMDATFolding>true</EnableCOMDATFolding>
180 <LinkTimeCodeGeneration>
181 </LinkTimeCodeGeneration>
182 <DataExecutionPrevention>
183 </DataExecutionPrevention>
184 </Link>
185 </ItemDefinitionGroup>
186 <ItemGroup>
187 <ClCompile Include="CFontTool.cpp" />
188 <ClCompile Include="main.cpp" />
189 </ItemGroup>
190 <ItemGroup>
191 <ClInclude Include="CFontTool.h" />
192 <ClInclude Include="CVectorFontTool.h" />
193 </ItemGroup>
194 <ItemGroup>
195 <ProjectReference Include="..\..\..\source\Irrlicht\Irrlicht10.0.vcxproj">
196 <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project>
197 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
198 </ProjectReference>
199 </ItemGroup>
200 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
201 <ImportGroup Label="ExtensionTargets">
202 </ImportGroup>
203</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc11.sln b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc11.sln
new file mode 100644
index 0000000..05b60ad
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc11.sln
@@ -0,0 +1,20 @@
1
2Microsoft Visual Studio Solution File, Format Version 11.00
3# Visual Studio 2012
4Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Font Tool", "irrFontTool_vc11.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Debug|Win32 = Debug|Win32
9 Release|Win32 = Release|Win32
10 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32
13 {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32
14 {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32
15 {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32
16 EndGlobalSection
17 GlobalSection(SolutionProperties) = preSolution
18 HideSolutionNode = FALSE
19 EndGlobalSection
20EndGlobal
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc11.vcxproj b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc11.vcxproj
new file mode 100644
index 0000000..4513cfa
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/irrFontTool_vc11.vcxproj
@@ -0,0 +1,207 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectName>FontTool</ProjectName>
23 <ProjectGuid>{4D53E40F-37E3-42B1-8848-F4C6F8313A17}</ProjectGuid>
24 <Keyword>Win32Proj</Keyword>
25 </PropertyGroup>
26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
28 <ConfigurationType>Application</ConfigurationType>
29 <CharacterSet>MultiByte</CharacterSet>
30 <WholeProgramOptimization>true</WholeProgramOptimization>
31 <PlatformToolset>v110</PlatformToolset>
32 </PropertyGroup>
33 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
34 <ConfigurationType>Application</ConfigurationType>
35 <CharacterSet>MultiByte</CharacterSet>
36 <WholeProgramOptimization>true</WholeProgramOptimization>
37 <PlatformToolset>v110</PlatformToolset>
38 </PropertyGroup>
39 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
40 <ConfigurationType>Application</ConfigurationType>
41 <CharacterSet>MultiByte</CharacterSet>
42 <PlatformToolset>v110</PlatformToolset>
43 </PropertyGroup>
44 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
45 <ConfigurationType>Application</ConfigurationType>
46 <CharacterSet>MultiByte</CharacterSet>
47 <PlatformToolset>v110</PlatformToolset>
48 </PropertyGroup>
49 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
50 <ImportGroup Label="ExtensionSettings">
51 </ImportGroup>
52 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
53 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
54 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
55 </ImportGroup>
56 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
57 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
58 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
59 </ImportGroup>
60 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
61 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
63 </ImportGroup>
64 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
65 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
66 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
67 </ImportGroup>
68 <PropertyGroup Label="UserMacros" />
69 <PropertyGroup>
70 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
71 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\bin\Win32-VisualStudio\</OutDir>
72 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\bin\Win64-VisualStudio\</OutDir>
73 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
74 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
75 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\bin\Win32-VisualStudio\</OutDir>
76 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\bin\Win64-VisualStudio\</OutDir>
77 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
78 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
79 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
80 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
81 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
82 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
83 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
84 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
85 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
86 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
87 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
88 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
89 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
90 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
91 </PropertyGroup>
92 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
93 <ClCompile>
94 <Optimization>Disabled</Optimization>
95 <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
96 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
97 <MinimalRebuild>true</MinimalRebuild>
98 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
99 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
100 <PrecompiledHeader>
101 </PrecompiledHeader>
102 <WarningLevel>Level3</WarningLevel>
103 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
104 </ClCompile>
105 <Link>
106 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions)</AdditionalOptions>
107 <OutputFile>../../../bin/Win32-visualstudio/FontTool.exe</OutputFile>
108 <AdditionalLibraryDirectories>../../../lib/Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
109 <GenerateDebugInformation>true</GenerateDebugInformation>
110 <SubSystem>Console</SubSystem>
111 <DataExecutionPrevention>
112 </DataExecutionPrevention>
113 </Link>
114 </ItemDefinitionGroup>
115 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
116 <ClCompile>
117 <Optimization>Disabled</Optimization>
118 <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
119 <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
120 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
121 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
122 <PrecompiledHeader>
123 </PrecompiledHeader>
124 <WarningLevel>Level3</WarningLevel>
125 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
126 </ClCompile>
127 <Link>
128 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions)</AdditionalOptions>
129 <OutputFile>../../../bin/Win64-visualstudio/FontTool.exe</OutputFile>
130 <AdditionalLibraryDirectories>../../../lib/Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
131 <GenerateDebugInformation>true</GenerateDebugInformation>
132 <SubSystem>Console</SubSystem>
133 <DataExecutionPrevention>
134 </DataExecutionPrevention>
135 </Link>
136 </ItemDefinitionGroup>
137 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
138 <ClCompile>
139 <Optimization>MaxSpeed</Optimization>
140 <WholeProgramOptimization>false</WholeProgramOptimization>
141 <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
142 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
143 <MinimalRebuild>true</MinimalRebuild>
144 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
145 <PrecompiledHeader>
146 </PrecompiledHeader>
147 <WarningLevel>Level3</WarningLevel>
148 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
149 </ClCompile>
150 <Link>
151 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions)</AdditionalOptions>
152 <OutputFile>../../../bin/Win32-visualstudio/FontTool.exe</OutputFile>
153 <AdditionalLibraryDirectories>../../../lib/Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
154 <GenerateDebugInformation>false</GenerateDebugInformation>
155 <SubSystem>Console</SubSystem>
156 <OptimizeReferences>true</OptimizeReferences>
157 <EnableCOMDATFolding>true</EnableCOMDATFolding>
158 <LinkTimeCodeGeneration>
159 </LinkTimeCodeGeneration>
160 <DataExecutionPrevention>
161 </DataExecutionPrevention>
162 </Link>
163 </ItemDefinitionGroup>
164 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
165 <ClCompile>
166 <Optimization>MaxSpeed</Optimization>
167 <WholeProgramOptimization>false</WholeProgramOptimization>
168 <AdditionalIncludeDirectories>../../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
169 <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
170 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
171 <PrecompiledHeader>
172 </PrecompiledHeader>
173 <WarningLevel>Level3</WarningLevel>
174 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
175 </ClCompile>
176 <Link>
177 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions)</AdditionalOptions>
178 <OutputFile>../../../bin/Win64-visualstudio/FontTool.exe</OutputFile>
179 <AdditionalLibraryDirectories>../../../lib/Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
180 <GenerateDebugInformation>false</GenerateDebugInformation>
181 <SubSystem>Console</SubSystem>
182 <OptimizeReferences>true</OptimizeReferences>
183 <EnableCOMDATFolding>true</EnableCOMDATFolding>
184 <LinkTimeCodeGeneration>
185 </LinkTimeCodeGeneration>
186 <DataExecutionPrevention>
187 </DataExecutionPrevention>
188 </Link>
189 </ItemDefinitionGroup>
190 <ItemGroup>
191 <ClCompile Include="CFontTool.cpp" />
192 <ClCompile Include="main.cpp" />
193 </ItemGroup>
194 <ItemGroup>
195 <ClInclude Include="CFontTool.h" />
196 <ClInclude Include="CVectorFontTool.h" />
197 </ItemGroup>
198 <ItemGroup>
199 <ProjectReference Include="..\..\..\source\Irrlicht\Irrlicht11.0.vcxproj">
200 <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project>
201 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
202 </ProjectReference>
203 </ItemGroup>
204 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
205 <ImportGroup Label="ExtensionTargets">
206 </ImportGroup>
207</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/main.cpp b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/main.cpp
new file mode 100644
index 0000000..9e9e87f
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/newFontTool/main.cpp
@@ -0,0 +1,493 @@
1/*
2 Tool for creating Irrlicht bitmap+vector fonts,
3 started by Gaz Davidson in December 2006
4
5 Due to my laziness and Microsoft's unituitive API, surragate pairs and
6 nonspacing diacritical marks are not supported!
7
8 Linux bitmap font support added by Neil Burlock Oct 2008
9 Note: Xft/Freetype2 is used to render the fonts under X11. Anti-aliasing
10 is controlled by the system and cannot be overriden by an application,
11 so fonts that are rendered will be aliased or anti-aliased depending
12 on the system that they are created on.
13
14*/
15
16
17#include <irrlicht.h>
18#include <iostream>
19
20#include "CFontTool.h"
21#include "CVectorFontTool.h"
22#include "ITexture.h"
23
24using namespace irr;
25using namespace gui;
26
27#pragma comment(lib, "Irrlicht.lib")
28
29const s32 texturesizes[] = {128, 256, 512, 1024, 2048, 4096, 0};
30
31const wchar_t *fileformats[] = { L"bmp", L"ppm", 0 }; // bitmap font formats
32const wchar_t *alphafileformats[] = { L"png", L"tga", 0 }; // bitmap font formats which support alpha channels
33const wchar_t *vectorfileformats[] = { L"xml", L"bin", 0 }; // file formats for vector fonts
34
35const wchar_t *warntext = L"Legal Notice\n"
36 L"------------\n\n"
37 L"When making bitmap and vector fonts, you should consider the potential legal "
38 L"issues with redistributing the fonts with your software; this tool basically "
39 L"copies font data and some authors might not like this!\n"
40 L"If you purchased fonts or they came with an application or your OS, you'll have"
41 L"to check the license to see what restrictions are placed on making derivative works.\n\n"
42 L"PD and the OFL\n"
43 L"--------------\n\n"
44 L"You'll find lots of fonts on the web listed as Public Domain, you can do what you like "
45 L"with these.\n"
46 L"Many fonts are released under the Open Font License, which is a 'viral' open source "
47 L"license like the GPL. It's worth reading the license here: http://scripts.sil.org/OFL\n"
48 L"The most important restrictions are- you must include the original font's license, you "
49 L"can't stop your users from using or distributing the font, the font must have a "
50 L"different name the original.\n\n"
51 L"Some free fonts can be found here- www.openfontlibrary.org\n"
52 L"http://savannah.nongnu.org/projects/freefont/";
53
54const wchar_t *helptext = L"This tool creates bitmap fonts for the Irrlicht Engine\n\n"
55
56 L"First select a character encoding from the list, then choose the font, "
57 L"size, and whether you'd like bold, italic, antialiasing and an alpha channel. "
58 L"In Windows, antialiasing will be ignored for small fonts\n\n"
59
60 L"Then select a texture width and height. If the output exceeds this then more than "
61 L"one image will be created. You can use the scrollbar at the top of the screen to "
62 L"preview them. Most modern graphics cards will support up to 2048x2048, "
63 L"keep in mind that more images means worse performance when drawing text!\n\n"
64
65 L"If you want a vector font rather than a bitmap font, check the vector box. "
66 L"Vector fonts are stored in system memory while bitmap fonts are in video ram\n\n"
67
68 L"Click create to preview your font, this may take lots of time and memory "
69 L"when making a font with a lot of characters, please be patient!\n\n"
70
71 L"Now you're ready to give your font a name, select a format and click save.\n\n"
72 L"To load your font in Irrlicht, simply use env->getFont(\"Myfont.xml\");\n\n"
73
74 L"That's all, have fun :-)";
75
76#ifdef _IRR_WINDOWS_
77 const wchar_t *completeText = L"Font created";
78#else
79 const wchar_t *completeText = L"Font created\n\n"
80 L"Please note that anti-aliasing under X11 is controlled by the system "
81 L"configuration, so if your system is set to use anti-aliasing, then so "
82 L"will any fonts you create with FontTool";
83#endif
84
85enum MYGUI
86{
87 MYGUI_CHARSET = 100,
88 MYGUI_FONTNAME,
89 MYGUI_SIZE,
90 MYGUI_TEXWIDTH,
91 MYGUI_TEXHEIGHT,
92 MYGUI_BOLD,
93 MYGUI_ITALIC,
94 MYGUI_ANTIALIAS,
95 MYGUI_ALPHA,
96 MYGUI_VECTOR,
97 MYGUI_FILENAME,
98 MYGUI_FORMAT,
99 MYGUI_CREATE,
100 MYGUI_SAVE,
101 MYGUI_IMAGE,
102 MYGUI_CURRENTIMAGE,
103 MYGUI_HELPBUTTON
104};
105
106
107// event reciever
108class MyEventReceiver : public IEventReceiver
109{
110public:
111
112 MyEventReceiver(IrrlichtDevice* device, CFontTool*& fonttool, CVectorFontTool* &vectool) :
113 Device(device), FontTool(fonttool), VecTool(vectool)
114 {
115 device->setEventReceiver(this);
116 }
117
118 virtual bool OnEvent(const SEvent &event)
119 {
120 if (event.EventType == EET_GUI_EVENT)
121 {
122 s32 id = event.GUIEvent.Caller->getID();
123 IGUIEnvironment* env = Device->getGUIEnvironment();
124
125 switch(event.GUIEvent.EventType)
126 {
127 case EGET_SCROLL_BAR_CHANGED:
128 if (id == MYGUI_CURRENTIMAGE)
129 {
130 IGUIImage* img = (IGUIImage*)env->getRootGUIElement()->getElementFromId(MYGUI_IMAGE,true);
131 s32 i = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos();
132 img->setImage(FontTool->currentTextures[i]);
133
134 return true;
135 }
136 break;
137 case EGET_COMBO_BOX_CHANGED:
138 if (id == MYGUI_CHARSET)
139 {
140 IGUIComboBox* cbo = (IGUIComboBox*)event.GUIEvent.Caller;
141 FontTool->selectCharSet(cbo->getSelected());
142 // rebuild font list
143 cbo = (IGUIComboBox*)env->getRootGUIElement()->getElementFromId(MYGUI_FONTNAME,true);
144 cbo->clear();
145 for (u32 i=0; i < FontTool->FontNames.size(); ++i)
146 cbo->addItem(FontTool->FontNames[i].c_str());
147 return true;
148 }
149 break;
150 case EGET_CHECKBOX_CHANGED:
151 if (id == MYGUI_VECTOR)
152 {
153 IGUICheckBox* chk = (IGUICheckBox*)event.GUIEvent.Caller;
154
155 IGUIComboBox *cbo = (IGUIComboBox*)env->getRootGUIElement()->getElementFromId(MYGUI_FORMAT,true);
156 cbo->clear();
157
158 if (chk->isChecked() && VecTool)
159 {
160 // vector formats
161 for (s32 i=0; fileformats[i] != 0; ++i)
162 cbo->addItem( core::stringw(vectorfileformats[i]).c_str());
163
164 }
165 else
166 {
167
168 // bitmap formats
169 if (!FontTool->UseAlphaChannel)
170 {
171 // add non-alpha formats
172 for (s32 i=0; fileformats[i] != 0; ++i)
173 cbo->addItem( core::stringw(fileformats[i]).c_str());
174 }
175 // add formats which support alpha
176 for (s32 i=0; alphafileformats[i] != 0; ++i)
177 cbo->addItem( core::stringw(alphafileformats[i]).c_str());
178 }
179
180 }
181 break;
182
183 case EGET_BUTTON_CLICKED:
184
185 if (id == MYGUI_CREATE)
186 {
187 // create the font with the params
188 IGUIComboBox* cbo = (IGUIComboBox*)env->getRootGUIElement()->getElementFromId(MYGUI_CHARSET, true);
189 int charset = cbo->getSelected();
190
191 cbo = (IGUIComboBox*)env->getRootGUIElement()->getElementFromId(MYGUI_FONTNAME,true);
192 int fontname = cbo->getSelected();
193
194 cbo = (IGUIComboBox*)env->getRootGUIElement()->getElementFromId(MYGUI_SIZE,true);
195 int fontsize = cbo->getSelected();
196
197 cbo = (IGUIComboBox*)env->getRootGUIElement()->getElementFromId(MYGUI_TEXWIDTH,true);
198 int texwidth = cbo->getSelected();
199
200 cbo = (IGUIComboBox*)env->getRootGUIElement()->getElementFromId(MYGUI_TEXHEIGHT,true);
201 int texheight = cbo->getSelected();
202
203 IGUICheckBox* chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_BOLD,true);
204 bool bold = chk->isChecked();
205 chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_ITALIC,true);
206 bool italic = chk->isChecked();
207
208 chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_ALPHA,true);
209 bool alpha = chk->isChecked();
210
211 chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_ANTIALIAS,true);
212 bool aa = chk->isChecked();
213
214 // vector fonts disabled
215 //chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_VECTOR,true);
216 bool vec = false;//chk->isChecked();
217
218 FontTool->makeBitmapFont(fontname, charset, FontTool->FontSizes[fontsize], texturesizes[texwidth], texturesizes[texheight], bold, italic, aa, alpha);
219
220 IGUIScrollBar* scrl = (IGUIScrollBar*)env->getRootGUIElement()->getElementFromId(MYGUI_CURRENTIMAGE,true);
221 scrl->setMax(FontTool->currentTextures.size() == 0 ? 0 : FontTool->currentTextures.size()-1);
222
223 if (FontTool->currentTextures.size() > 0)
224 {
225 IGUIImage* img = (IGUIImage*)env->getRootGUIElement()->getElementFromId(MYGUI_IMAGE,true);
226 img->setImage(FontTool->currentTextures[0]);
227 scrl->setPos(0);
228 }
229
230 // make sure users pick a file format that supports alpha channel
231 cbo = (IGUIComboBox*)env->getRootGUIElement()->getElementFromId(MYGUI_FORMAT,true);
232 cbo->clear();
233
234 if (vec)
235 {
236 // add vector formats
237 for (s32 i=0; fileformats[i] != 0; ++i)
238 cbo->addItem( core::stringw(vectorfileformats[i]).c_str());
239 }
240 else
241 {
242 if (!alpha)
243 {
244 // add non-alpha formats
245 for (s32 i=0; fileformats[i] != 0; ++i)
246 cbo->addItem( core::stringw(fileformats[i]).c_str());
247 }
248 // add formats which support alpha
249 for (s32 i=0; alphafileformats[i] != 0; ++i)
250 cbo->addItem( core::stringw(alphafileformats[i]).c_str());
251 }
252 if (VecTool)
253 {
254 delete VecTool;
255 VecTool = 0;
256 }
257 if (vec)
258 {
259 VecTool = new CVectorFontTool(FontTool);
260 }
261
262 /* Message box letting the user know the process is complete */
263 env->addMessageBox(L"Create", completeText);
264
265 return true;
266 }
267
268 if (id == MYGUI_SAVE)
269 {
270 IGUIEditBox *edt = (IGUIEditBox*)env->getRootGUIElement()->getElementFromId(MYGUI_FILENAME,true);
271 core::stringc name = edt->getText();
272
273 IGUIComboBox *fmt = (IGUIComboBox*)env->getRootGUIElement()->getElementFromId(MYGUI_FORMAT,true);
274 core::stringc format = fmt->getItem(fmt->getSelected());
275
276 // vector fonts disabled
277 IGUICheckBox *chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_VECTOR,true);
278 bool vec = false; // chk->isChecked();
279
280 if (vec && VecTool)
281 VecTool->saveVectorFont(name.c_str(), format.c_str());
282 else
283 FontTool->saveBitmapFont(name.c_str(), format.c_str());
284
285 return true;
286 }
287
288 if (id == MYGUI_HELPBUTTON)
289 {
290 env->addMessageBox(L"Irrlicht Unicode Font Tool", helptext);
291 return true;
292 }
293
294 break;
295 }
296 }
297
298 return false;
299 }
300
301 IrrlichtDevice* Device;
302 CFontTool* FontTool;
303 CVectorFontTool* VecTool;
304
305};
306
307void createGUI(IrrlichtDevice* device, CFontTool* fc)
308{
309 gui::IGUIEnvironment *env = device->getGUIEnvironment();
310
311 // change transparency of skin
312 for (s32 i=0; i<gui::EGDC_COUNT ; ++i)
313 {
314 video::SColor col = env->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i);
315 col.setAlpha(255);
316 env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col);
317 }
318
319 IGUIWindow *win = env->addWindow( core::rect<s32>(10,10,200,500), false, L"Font Creator");
320 win->getCloseButton()->setVisible(false);
321
322 s32 xs=10,xp=xs, yp=30, h=20;
323
324 env->addStaticText(L"Charset", core::rect<s32>(xp,yp,50,yp+h),false,false, win);
325
326 xp+=60;
327
328 // charset combo
329 gui::IGUIComboBox* cbo = env->addComboBox( core::rect<s32>(xp,yp,180,yp+h),win, MYGUI_CHARSET);
330 for (u32 i=0; i < fc->CharSets.size(); ++i)
331 cbo->addItem(fc->CharSets[i].c_str());
332
333 yp += (s32)(h*1.5f);
334 xp = xs;
335
336 env->addStaticText(L"Font", core::rect<s32>(xp,yp,50,yp+h),false,false, win);
337
338 xp+=60;
339
340 // font name combo
341 cbo = env->addComboBox( core::rect<s32>(xp,yp,180,yp+h),win, MYGUI_FONTNAME);
342 for (u32 i=0; i < fc->FontNames.size(); ++i)
343 cbo->addItem(fc->FontNames[i].c_str());
344
345 yp += (s32)(h*1.5f);
346 xp = xs;
347
348 env->addStaticText(L"Size", core::rect<s32>(xp,yp,50,yp+h),false,false, win);
349
350 xp += 60;
351
352 // font size combo
353 cbo = env->addComboBox( core::rect<s32>(xp,yp,xp+50,yp+h),win, MYGUI_SIZE);
354 for (s32 i=0; fc->FontSizes[i] != 0; ++i)
355 cbo->addItem( ((core::stringw(fc->FontSizes[i])) + L"px").c_str());
356
357 xp = xs;
358 yp += (s32)(h*1.5f);
359
360 // bold checkbox
361 env->addCheckBox(false, core::rect<s32>(xp,yp,xp+50,yp+h),win, MYGUI_BOLD, L"Bold");
362
363 xp += 45;
364
365 // italic checkbox
366 env->addCheckBox(false, core::rect<s32>(xp,yp,xp+50,yp+h),win, MYGUI_ITALIC, L"Italic");
367
368 xp += 45;
369
370 // AA checkbox
371 env->addCheckBox(false, core::rect<s32>(xp,yp,xp+50,yp+h),win, MYGUI_ANTIALIAS, L"AA");
372
373 xp +=40;
374
375 // Alpha checkbox
376 env->addCheckBox(false, core::rect<s32>(xp,yp,xp+50,yp+h),win, MYGUI_ALPHA, L"Alpha");
377
378 xp = xs;
379 yp += (s32)(h*1.5f);
380
381 /*
382 // vector fonts can't be loaded yet
383 env->addCheckBox(false, core::rect<s32>(xp,yp,xp+200,yp+h),win, MYGUI_VECTOR, L"Vector Font");
384 */
385
386 yp += (s32)(h*1.5f);
387
388 env->addStaticText(L"Max Width:", core::rect<s32>(xp,yp,50,yp+h),false,false, win);
389
390 xp += 60;
391
392 // texture widths
393 cbo = env->addComboBox( core::rect<s32>(xp,yp,xp+70,yp+h),win, MYGUI_TEXWIDTH);
394 for (s32 i=0; texturesizes[i] != 0; ++i)
395 cbo->addItem( ((core::stringw(texturesizes[i])) + L" wide").c_str());
396
397 xp=xs;
398 yp += (s32)(h*1.5f);
399
400 env->addStaticText(L"Max Height:", core::rect<s32>(xp,yp,60,yp+h),false,false, win);
401
402 xp += 60;
403
404 // texture height
405 cbo = env->addComboBox( core::rect<s32>(xp,yp,xp+70,yp+h),win, MYGUI_TEXHEIGHT);
406 for (s32 i=0; texturesizes[i] != 0; ++i)
407 cbo->addItem( ((core::stringw(texturesizes[i])) + L" tall").c_str());
408
409 // file name
410 xp = xs;
411 yp += (s32)(h*1.5f);
412 env->addStaticText(L"Filename", core::rect<s32>(xp,yp,60,yp+h),false,false, win);
413 xp += 60;
414 env->addEditBox(L"myfont",core::rect<s32>(xp,yp,xp+70,yp+h), true, win, MYGUI_FILENAME);
415
416 // file format
417 xp = xs;
418 yp += (s32)(h*1.5f);
419 env->addStaticText(L"File Format", core::rect<s32>(xp,yp,60,yp+h),false,false, win);
420 xp += 60;
421
422 cbo = env->addComboBox( core::rect<s32>(xp,yp,xp+70,yp+h),win, MYGUI_FORMAT);
423 for (s32 i=0; fileformats[i] != 0; ++i)
424 cbo->addItem( core::stringw(fileformats[i]).c_str());
425 for (s32 i=0; alphafileformats[i] != 0; ++i)
426 cbo->addItem( core::stringw(alphafileformats[i]).c_str());
427
428 xp = xs;
429 yp += h*2;
430
431 // create button
432 env->addButton( core::rect<s32>(xp,yp,xp+50,yp+h),win, MYGUI_CREATE, L"Create");
433
434 xp += 60;
435
436 // save button
437 env->addButton( core::rect<s32>(xp,yp,xp+50,yp+h),win, MYGUI_SAVE, L"Save");
438
439 xp += 60;
440
441 // help button
442 env->addButton( core::rect<s32>(xp,yp,xp+50,yp+h),win, MYGUI_HELPBUTTON, L"Help");
443
444 // font image
445 gui::IGUIImage *img = env->addImage(0, core::position2d<s32>(0,0), true,0, MYGUI_IMAGE);
446 img->setRelativePosition(core::rect<s32>(0,20,800,600));
447
448 // font scrollbar
449 IGUIScrollBar *scrl= env->addScrollBar(true,core::rect<s32>(0,0,800,20),0, MYGUI_CURRENTIMAGE);
450 scrl->setMax(0);
451 scrl->setSmallStep(1);
452
453 yp += h*3;
454
455 env->getRootGUIElement()->bringToFront(win);
456 win->setRelativePosition( core::rect<s32>(10,10,200,yp));
457}
458
459int main()
460{
461 IrrlichtDevice* device =createDevice(video::EDT_OPENGL, core::dimension2du(800, 600));
462 video::IVideoDriver* driver = device->getVideoDriver();
463 scene::ISceneManager* smgr = device->getSceneManager();
464 gui::IGUIEnvironment *env = device->getGUIEnvironment();
465
466 // create font tool
467 CFontTool *fc = new CFontTool(device);
468 CVectorFontTool *vc = 0;
469
470 IEventReceiver *events = new MyEventReceiver(device,fc,vc);
471
472 createGUI(device, fc);
473
474 while(device->run())
475 {
476 if (device->isWindowActive())
477 {
478
479 driver->beginScene(true, true, video::SColor(0,200,200,200));
480 smgr->drawAll();
481 env->drawAll();
482 driver->endScene();
483 }
484 }
485
486 // drop the font tool and resources
487 fc->drop();
488
489 device->drop();
490
491 return 0;
492}
493
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/oldFontTool/source.zip b/src/others/irrlicht-1.8.1/tools/IrrFontTool/oldFontTool/source.zip
new file mode 100644
index 0000000..9228ebb
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/oldFontTool/source.zip
Binary files differ
diff --git a/src/others/irrlicht-1.8.1/tools/IrrFontTool/readme.txt b/src/others/irrlicht-1.8.1/tools/IrrFontTool/readme.txt
new file mode 100644
index 0000000..fda16d5
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/IrrFontTool/readme.txt
@@ -0,0 +1,13 @@
1There are two tools available for creating fonts for irrlicht, both are supported.
2
3oldFontTool:
4 only works in Windows, creates a simple image file containing all data for displaying fonts.
5 Those file contain no alpha informations and are limited in their character set.
6 use the IrrFontTool.exe file in this directory.
7
8newFontTool:
9 a more sophisticated font tool supporting alpha channels, anti aliasing,
10 different character sets, vector fonts and other operating systems than
11 just windows. It will create multiple image files and an .xml file
12 containing meta information for the generated font.
13 You can find it as FontTool.exe in the /bin directory. \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/MeshConverter/Makefile b/src/others/irrlicht-1.8.1/tools/MeshConverter/Makefile
new file mode 100644
index 0000000..5328223
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/MeshConverter/Makefile
@@ -0,0 +1,38 @@
1# Makefile for Irrlicht Examples
2# It's usually sufficient to change just the target name and source file list
3# and be sure that CXX is set to a valid compiler
4Target = MeshConverter
5Sources = main.cpp
6
7# general compiler settings
8CPPFLAGS = -I../../include -I/usr/X11R6/include
9CXXFLAGS = -O3 -ffast-math -Wall
10#CXXFLAGS = -g -Wall
11
12#default target is Linux
13all: all_linux
14
15ifeq ($(HOSTTYPE), x86_64)
16LIBSELECT=64
17endif
18
19# target specific settings
20all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
21all_linux clean_linux: SYSTEM=Linux
22all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lglu32 -lm
23all_win32 clean_win32: SYSTEM=Win32-gcc
24all_win32 clean_win32: SUF=.exe
25# name of the binary - only valid for targets which set SYSTEM
26DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
27
28all_linux all_win32:
29 $(warning Building...)
30 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
31
32clean: clean_linux clean_win32
33 $(warning Cleaning...)
34
35clean_linux clean_win32:
36 @$(RM) $(DESTPATH)
37
38.PHONY: all all_win32 clean clean_linux clean_win32
diff --git a/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter.cbp b/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter.cbp
new file mode 100644
index 0000000..08ebbfb
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter.cbp
@@ -0,0 +1,54 @@
1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
2<CodeBlocks_project_file>
3 <FileVersion major="1" minor="6" />
4 <Project>
5 <Option title="Mesh Converter" />
6 <Option pch_mode="0" />
7 <Option compiler="gcc" />
8 <Build>
9 <Target title="Linux">
10 <Option platforms="Unix;" />
11 <Option output="..\..\bin\Linux\MeshConverter" prefix_auto="0" extension_auto="0" />
12 <Option type="1" />
13 <Option compiler="gcc" />
14 <Compiler>
15 <Add option="-g" />
16 <Add option="-D_IRR_STATIC_LIB_" />
17 </Compiler>
18 <Linker>
19 <Add library="Xxf86vm" />
20 <Add library="GL" />
21 <Add directory="..\..\lib\Linux" />
22 </Linker>
23 </Target>
24 <Target title="Windows">
25 <Option platforms="Windows;" />
26 <Option output="..\..\bin\Win32-gcc\MeshConverter" prefix_auto="0" extension_auto="1" />
27 <Option type="1" />
28 <Option compiler="gcc" />
29 <Compiler>
30 <Add option="-g" />
31 </Compiler>
32 <Linker>
33 <Add directory="..\..\lib\Win32-gcc" />
34 </Linker>
35 </Target>
36 </Build>
37 <VirtualTargets>
38 <Add alias="All" targets="Windows;Linux;" />
39 </VirtualTargets>
40 <Compiler>
41 <Add option="-g" />
42 <Add directory="..\..\include" />
43 </Compiler>
44 <Linker>
45 <Add library="Irrlicht" />
46 </Linker>
47 <Unit filename="main.cpp" />
48 <Extensions>
49 <code_completion />
50 <debugger />
51 <envvars />
52 </Extensions>
53 </Project>
54</CodeBlocks_project_file>
diff --git a/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_v9.vcproj b/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_v9.vcproj
new file mode 100644
index 0000000..5747218
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_v9.vcproj
@@ -0,0 +1,187 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="9,00"
5 Name="Mesh Converter"
6 ProjectGUID="{E72B637E-4AA6-46F3-885F-AC67B4B470ED}"
7 RootNamespace="GUI Editor"
8 Keyword="Win32Proj"
9 TargetFrameworkVersion="131072"
10 >
11 <Platforms>
12 <Platform
13 Name="Win32"
14 />
15 </Platforms>
16 <ToolFiles>
17 </ToolFiles>
18 <Configurations>
19 <Configuration
20 Name="Debug|Win32"
21 OutputDirectory="Debug"
22 IntermediateDirectory="Debug"
23 ConfigurationType="1"
24 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
25 CharacterSet="2"
26 >
27 <Tool
28 Name="VCPreBuildEventTool"
29 />
30 <Tool
31 Name="VCCustomBuildTool"
32 />
33 <Tool
34 Name="VCXMLDataGeneratorTool"
35 />
36 <Tool
37 Name="VCWebServiceProxyGeneratorTool"
38 />
39 <Tool
40 Name="VCMIDLTool"
41 />
42 <Tool
43 Name="VCCLCompilerTool"
44 Optimization="0"
45 FavorSizeOrSpeed="0"
46 WholeProgramOptimization="false"
47 AdditionalIncludeDirectories="..\..\include"
48 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
49 MinimalRebuild="true"
50 BasicRuntimeChecks="3"
51 RuntimeLibrary="1"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 DebugInformationFormat="4"
55 />
56 <Tool
57 Name="VCManagedResourceCompilerTool"
58 />
59 <Tool
60 Name="VCResourceCompilerTool"
61 />
62 <Tool
63 Name="VCPreLinkEventTool"
64 />
65 <Tool
66 Name="VCLinkerTool"
67 AdditionalOptions=" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib "
68 OutputFile="../../bin/Win32-visualstudio/MeshConverter.exe"
69 LinkIncremental="2"
70 AdditionalLibraryDirectories="&quot;..\..\lib\Win32-visualstudio&quot;"
71 GenerateDebugInformation="true"
72 ProgramDatabaseFile="$(OutDir)/TestProject.pdb"
73 SubSystem="1"
74 RandomizedBaseAddress="1"
75 DataExecutionPrevention="0"
76 TargetMachine="1"
77 />
78 <Tool
79 Name="VCALinkTool"
80 />
81 <Tool
82 Name="VCManifestTool"
83 />
84 <Tool
85 Name="VCXDCMakeTool"
86 />
87 <Tool
88 Name="VCBscMakeTool"
89 />
90 <Tool
91 Name="VCFxCopTool"
92 />
93 <Tool
94 Name="VCAppVerifierTool"
95 />
96 <Tool
97 Name="VCPostBuildEventTool"
98 />
99 </Configuration>
100 <Configuration
101 Name="Release|Win32"
102 OutputDirectory="Release"
103 IntermediateDirectory="Release"
104 ConfigurationType="1"
105 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
106 CharacterSet="2"
107 >
108 <Tool
109 Name="VCPreBuildEventTool"
110 />
111 <Tool
112 Name="VCCustomBuildTool"
113 />
114 <Tool
115 Name="VCXMLDataGeneratorTool"
116 />
117 <Tool
118 Name="VCWebServiceProxyGeneratorTool"
119 />
120 <Tool
121 Name="VCMIDLTool"
122 />
123 <Tool
124 Name="VCCLCompilerTool"
125 Optimization="3"
126 WholeProgramOptimization="false"
127 AdditionalIncludeDirectories="..\..\include"
128 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
129 RuntimeLibrary="0"
130 UsePrecompiledHeader="0"
131 WarningLevel="3"
132 />
133 <Tool
134 Name="VCManagedResourceCompilerTool"
135 />
136 <Tool
137 Name="VCResourceCompilerTool"
138 />
139 <Tool
140 Name="VCPreLinkEventTool"
141 />
142 <Tool
143 Name="VCLinkerTool"
144 OutputFile="../../bin/Win32-visualstudio/GUIEditor.exe"
145 LinkIncremental="1"
146 GenerateDebugInformation="true"
147 SubSystem="1"
148 OptimizeReferences="2"
149 EnableCOMDATFolding="2"
150 RandomizedBaseAddress="1"
151 DataExecutionPrevention="0"
152 TargetMachine="1"
153 />
154 <Tool
155 Name="VCALinkTool"
156 />
157 <Tool
158 Name="VCManifestTool"
159 />
160 <Tool
161 Name="VCXDCMakeTool"
162 />
163 <Tool
164 Name="VCBscMakeTool"
165 />
166 <Tool
167 Name="VCFxCopTool"
168 />
169 <Tool
170 Name="VCAppVerifierTool"
171 />
172 <Tool
173 Name="VCPostBuildEventTool"
174 />
175 </Configuration>
176 </Configurations>
177 <References>
178 </References>
179 <Files>
180 <File
181 RelativePath=".\main.cpp"
182 >
183 </File>
184 </Files>
185 <Globals>
186 </Globals>
187</VisualStudioProject>
diff --git a/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_vc10.vcxproj b/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_vc10.vcxproj
new file mode 100644
index 0000000..1f1ce49
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_vc10.vcxproj
@@ -0,0 +1,192 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectName>MeshConverter</ProjectName>
23 <ProjectGuid>{E72B637E-4AA6-46F3-885F-AC67B4B470ED}</ProjectGuid>
24 <RootNamespace>GUI Editor</RootNamespace>
25 <Keyword>Win32Proj</Keyword>
26 </PropertyGroup>
27 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
29 <ConfigurationType>Application</ConfigurationType>
30 <CharacterSet>MultiByte</CharacterSet>
31 </PropertyGroup>
32 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
33 <ConfigurationType>Application</ConfigurationType>
34 <CharacterSet>MultiByte</CharacterSet>
35 </PropertyGroup>
36 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
37 <ConfigurationType>Application</ConfigurationType>
38 <CharacterSet>MultiByte</CharacterSet>
39 </PropertyGroup>
40 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
41 <ConfigurationType>Application</ConfigurationType>
42 <CharacterSet>MultiByte</CharacterSet>
43 </PropertyGroup>
44 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
45 <ImportGroup Label="ExtensionSettings">
46 </ImportGroup>
47 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
48 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
49 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
50 </ImportGroup>
51 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
52 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
53 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
54 </ImportGroup>
55 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
56 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
58 </ImportGroup>
59 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
60 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
62 </ImportGroup>
63 <PropertyGroup Label="UserMacros" />
64 <PropertyGroup>
65 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
66 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
67 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
68 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
69 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
70 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
71 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
72 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
73 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
74 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
75 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
76 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
77 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
78 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
79 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
80 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
81 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
82 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
83 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
84 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
85 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
86 </PropertyGroup>
87 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
88 <ClCompile>
89 <Optimization>Disabled</Optimization>
90 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
91 <WholeProgramOptimization>false</WholeProgramOptimization>
92 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
93 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
94 <MinimalRebuild>true</MinimalRebuild>
95 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
96 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
97 <PrecompiledHeader>
98 </PrecompiledHeader>
99 <WarningLevel>Level3</WarningLevel>
100 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
101 </ClCompile>
102 <Link>
103 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
104 <OutputFile>../../bin/Win32-visualstudio/MeshConverter.exe</OutputFile>
105 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
106 <GenerateDebugInformation>true</GenerateDebugInformation>
107 <ProgramDatabaseFile>$(OutDir)TestProject.pdb</ProgramDatabaseFile>
108 <SubSystem>Console</SubSystem>
109 <DataExecutionPrevention>
110 </DataExecutionPrevention>
111 </Link>
112 </ItemDefinitionGroup>
113 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
114 <ClCompile>
115 <Optimization>Disabled</Optimization>
116 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
117 <WholeProgramOptimization>false</WholeProgramOptimization>
118 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
119 <PreprocessorDefinitions>WIN32;WIN64_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
120 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
121 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
122 <PrecompiledHeader>
123 </PrecompiledHeader>
124 <WarningLevel>Level3</WarningLevel>
125 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
126 </ClCompile>
127 <Link>
128 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
129 <OutputFile>../../bin/Win64-visualstudio/MeshConverter.exe</OutputFile>
130 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
131 <GenerateDebugInformation>true</GenerateDebugInformation>
132 <ProgramDatabaseFile>$(OutDir)TestProject.pdb</ProgramDatabaseFile>
133 <SubSystem>Console</SubSystem>
134 <DataExecutionPrevention>
135 </DataExecutionPrevention>
136 </Link>
137 </ItemDefinitionGroup>
138 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
139 <ClCompile>
140 <Optimization>Full</Optimization>
141 <WholeProgramOptimization>false</WholeProgramOptimization>
142 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
143 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
144 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
145 <PrecompiledHeader>
146 </PrecompiledHeader>
147 <WarningLevel>Level3</WarningLevel>
148 </ClCompile>
149 <Link>
150 <OutputFile>../../bin/Win32-visualstudio/MeshConverter.exe</OutputFile>
151 <GenerateDebugInformation>true</GenerateDebugInformation>
152 <SubSystem>Console</SubSystem>
153 <OptimizeReferences>true</OptimizeReferences>
154 <EnableCOMDATFolding>true</EnableCOMDATFolding>
155 <DataExecutionPrevention>
156 </DataExecutionPrevention>
157 </Link>
158 </ItemDefinitionGroup>
159 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
160 <ClCompile>
161 <Optimization>Full</Optimization>
162 <WholeProgramOptimization>false</WholeProgramOptimization>
163 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
164 <PreprocessorDefinitions>WIN32;WIN64NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
165 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
166 <PrecompiledHeader>
167 </PrecompiledHeader>
168 <WarningLevel>Level3</WarningLevel>
169 </ClCompile>
170 <Link>
171 <OutputFile>../../bin/Win64-visualstudio/MeshConverter.exe</OutputFile>
172 <GenerateDebugInformation>true</GenerateDebugInformation>
173 <SubSystem>Console</SubSystem>
174 <OptimizeReferences>true</OptimizeReferences>
175 <EnableCOMDATFolding>true</EnableCOMDATFolding>
176 <DataExecutionPrevention>
177 </DataExecutionPrevention>
178 </Link>
179 </ItemDefinitionGroup>
180 <ItemGroup>
181 <ClCompile Include="main.cpp" />
182 </ItemGroup>
183 <ItemGroup>
184 <ProjectReference Include="..\..\source\Irrlicht\Irrlicht10.0.vcxproj">
185 <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project>
186 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
187 </ProjectReference>
188 </ItemGroup>
189 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
190 <ImportGroup Label="ExtensionTargets">
191 </ImportGroup>
192</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_vc11.vcxproj b/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_vc11.vcxproj
new file mode 100644
index 0000000..6493206
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/MeshConverter/MeshConverter_vc11.vcxproj
@@ -0,0 +1,196 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
4 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
12 <ProjectConfiguration Include="Release|Win32">
13 <Configuration>Release</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|x64">
17 <Configuration>Release</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectName>MeshConverter</ProjectName>
23 <ProjectGuid>{E72B637E-4AA6-46F3-885F-AC67B4B470ED}</ProjectGuid>
24 <RootNamespace>GUI Editor</RootNamespace>
25 <Keyword>Win32Proj</Keyword>
26 </PropertyGroup>
27 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
29 <ConfigurationType>Application</ConfigurationType>
30 <CharacterSet>MultiByte</CharacterSet>
31 <PlatformToolset>v110</PlatformToolset>
32 </PropertyGroup>
33 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
34 <ConfigurationType>Application</ConfigurationType>
35 <CharacterSet>MultiByte</CharacterSet>
36 <PlatformToolset>v110</PlatformToolset>
37 </PropertyGroup>
38 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
39 <ConfigurationType>Application</ConfigurationType>
40 <CharacterSet>MultiByte</CharacterSet>
41 <PlatformToolset>v110</PlatformToolset>
42 </PropertyGroup>
43 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
44 <ConfigurationType>Application</ConfigurationType>
45 <CharacterSet>MultiByte</CharacterSet>
46 <PlatformToolset>v110</PlatformToolset>
47 </PropertyGroup>
48 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
49 <ImportGroup Label="ExtensionSettings">
50 </ImportGroup>
51 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
52 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
53 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
54 </ImportGroup>
55 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
56 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
57 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
58 </ImportGroup>
59 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
60 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
62 </ImportGroup>
63 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
64 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65 <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
66 </ImportGroup>
67 <PropertyGroup Label="UserMacros" />
68 <PropertyGroup>
69 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
70 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
71 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
72 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
73 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
74 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
75 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
76 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
77 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
78 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
79 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
80 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
81 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
82 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
83 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
84 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
85 <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
86 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
87 <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
88 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
89 <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
90 </PropertyGroup>
91 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
92 <ClCompile>
93 <Optimization>Disabled</Optimization>
94 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
95 <WholeProgramOptimization>false</WholeProgramOptimization>
96 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
97 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
98 <MinimalRebuild>true</MinimalRebuild>
99 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
100 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
101 <PrecompiledHeader>
102 </PrecompiledHeader>
103 <WarningLevel>Level3</WarningLevel>
104 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
105 </ClCompile>
106 <Link>
107 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
108 <OutputFile>../../bin/Win32-visualstudio/MeshConverter.exe</OutputFile>
109 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
110 <GenerateDebugInformation>true</GenerateDebugInformation>
111 <ProgramDatabaseFile>$(OutDir)TestProject.pdb</ProgramDatabaseFile>
112 <SubSystem>Console</SubSystem>
113 <DataExecutionPrevention>
114 </DataExecutionPrevention>
115 </Link>
116 </ItemDefinitionGroup>
117 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
118 <ClCompile>
119 <Optimization>Disabled</Optimization>
120 <FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
121 <WholeProgramOptimization>false</WholeProgramOptimization>
122 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
123 <PreprocessorDefinitions>WIN32;WIN64_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
124 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
125 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
126 <PrecompiledHeader>
127 </PrecompiledHeader>
128 <WarningLevel>Level3</WarningLevel>
129 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
130 </ClCompile>
131 <Link>
132 <AdditionalOptions> kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions)</AdditionalOptions>
133 <OutputFile>../../bin/Win64-visualstudio/MeshConverter.exe</OutputFile>
134 <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
135 <GenerateDebugInformation>true</GenerateDebugInformation>
136 <ProgramDatabaseFile>$(OutDir)TestProject.pdb</ProgramDatabaseFile>
137 <SubSystem>Console</SubSystem>
138 <DataExecutionPrevention>
139 </DataExecutionPrevention>
140 </Link>
141 </ItemDefinitionGroup>
142 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
143 <ClCompile>
144 <Optimization>Full</Optimization>
145 <WholeProgramOptimization>false</WholeProgramOptimization>
146 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
147 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
148 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
149 <PrecompiledHeader>
150 </PrecompiledHeader>
151 <WarningLevel>Level3</WarningLevel>
152 </ClCompile>
153 <Link>
154 <OutputFile>../../bin/Win32-visualstudio/MeshConverter.exe</OutputFile>
155 <GenerateDebugInformation>true</GenerateDebugInformation>
156 <SubSystem>Console</SubSystem>
157 <OptimizeReferences>true</OptimizeReferences>
158 <EnableCOMDATFolding>true</EnableCOMDATFolding>
159 <DataExecutionPrevention>
160 </DataExecutionPrevention>
161 </Link>
162 </ItemDefinitionGroup>
163 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
164 <ClCompile>
165 <Optimization>Full</Optimization>
166 <WholeProgramOptimization>false</WholeProgramOptimization>
167 <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
168 <PreprocessorDefinitions>WIN32;WIN64NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
169 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
170 <PrecompiledHeader>
171 </PrecompiledHeader>
172 <WarningLevel>Level3</WarningLevel>
173 </ClCompile>
174 <Link>
175 <OutputFile>../../bin/Win64-visualstudio/MeshConverter.exe</OutputFile>
176 <GenerateDebugInformation>true</GenerateDebugInformation>
177 <SubSystem>Console</SubSystem>
178 <OptimizeReferences>true</OptimizeReferences>
179 <EnableCOMDATFolding>true</EnableCOMDATFolding>
180 <DataExecutionPrevention>
181 </DataExecutionPrevention>
182 </Link>
183 </ItemDefinitionGroup>
184 <ItemGroup>
185 <ClCompile Include="main.cpp" />
186 </ItemGroup>
187 <ItemGroup>
188 <ProjectReference Include="..\..\source\Irrlicht\Irrlicht10.0.vcxproj">
189 <Project>{e08e042a-6c45-411b-92be-3cc31331019f}</Project>
190 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
191 </ProjectReference>
192 </ItemGroup>
193 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
194 <ImportGroup Label="ExtensionTargets">
195 </ImportGroup>
196</Project> \ No newline at end of file
diff --git a/src/others/irrlicht-1.8.1/tools/MeshConverter/main.cpp b/src/others/irrlicht-1.8.1/tools/MeshConverter/main.cpp
new file mode 100644
index 0000000..d6b878f
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/MeshConverter/main.cpp
@@ -0,0 +1,108 @@
1#include <irrlicht.h>
2#include <iostream>
3
4using namespace irr;
5
6using namespace core;
7using namespace scene;
8using namespace video;
9using namespace io;
10using namespace gui;
11
12#ifdef _IRR_WINDOWS_
13#pragma comment(lib, "Irrlicht.lib")
14#endif
15
16void usage(const char* name)
17{
18 std::cerr << "Usage: " << name << " [options] <srcFile> <destFile>" << std::endl;
19 std::cerr << " where options are" << std::endl;
20 std::cerr << " --createTangents: convert to tangents mesh is possible." << std::endl;
21 std::cerr << " --format=[irrmesh|collada|stl|obj|ply]: Choose target format" << std::endl;
22}
23
24int main(int argc, char* argv[])
25{
26 if ((argc < 3) ||
27 ((argc==3) && (argv[1][0]=='-')))
28 {
29 usage(argv[0]);
30 return 1;
31 }
32
33 IrrlichtDevice *device = createDevice( video::EDT_NULL,
34 dimension2d<u32>(800, 600), 32, false, false, false, 0);
35
36 device->setWindowCaption(L"Mesh Converter");
37
38 scene::EMESH_WRITER_TYPE type = EMWT_IRR_MESH;
39 u32 i=1;
40 bool createTangents=false;
41 while (argv[i][0]=='-')
42 {
43 core::stringc format = argv[i];
44 if (format.size() > 3)
45 {
46 if (format.equalsn("--format=",9))
47 {
48 format = format.subString(9,format.size());
49 if (format=="collada")
50 type = EMWT_COLLADA;
51 else if (format=="stl")
52 type = EMWT_STL;
53 else if (format=="obj")
54 type = EMWT_OBJ;
55 else if (format=="ply")
56 type = EMWT_PLY;
57 else
58 type = EMWT_IRR_MESH;
59 }
60 else
61 if (format =="--createTangents")
62 createTangents=true;
63 }
64 else
65 if (format=="--")
66 {
67 ++i;
68 break;
69 }
70 ++i;
71 }
72
73 const s32 srcmesh = i;
74 const s32 destmesh = i+1;
75
76 --argc;
77 if ((argc<srcmesh) || (argc<destmesh))
78 {
79 std::cerr << "Not enough files given." << std::endl;
80 usage(argv[0]);
81 return 1;
82 }
83
84 createTangents = createTangents && (type==EMWT_IRR_MESH);
85 std::cout << "Converting " << argv[srcmesh] << " to " << argv[destmesh] << std::endl;
86 IMesh* mesh = device->getSceneManager()->getMesh(argv[srcmesh])->getMesh(0);
87 if (!mesh)
88 {
89 std::cerr << "Could not load " << argv[srcmesh] << std::endl;
90 return 1;
91 }
92 if (createTangents)
93 {
94 IMesh* tmp = device->getSceneManager()->getMeshManipulator()->createMeshWithTangents(mesh);
95 mesh->drop();
96 mesh=tmp;
97 }
98 IMeshWriter* mw = device->getSceneManager()->createMeshWriter(type);
99 IWriteFile* file = device->getFileSystem()->createAndWriteFile(argv[destmesh]);
100 mw->writeMesh(file, mesh);
101
102 file->drop();
103 mw->drop();
104 device->drop();
105
106 return 0;
107}
108
diff --git a/src/others/irrlicht-1.8.1/tools/irrEdit/irrEdit.jpg b/src/others/irrlicht-1.8.1/tools/irrEdit/irrEdit.jpg
new file mode 100644
index 0000000..deafb3f
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/irrEdit/irrEdit.jpg
Binary files differ
diff --git a/src/others/irrlicht-1.8.1/tools/irrEdit/irrEdit.txt b/src/others/irrlicht-1.8.1/tools/irrEdit/irrEdit.txt
new file mode 100644
index 0000000..5e6fe60
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/tools/irrEdit/irrEdit.txt
@@ -0,0 +1,7 @@
1irrEdit is a free scene graph editor for Irrlicht Engine .irr files and is capable as being used as world editor,
2particle system designer, meshviewer and more. It is a visual front end for the Irrlicht Engine, and thus has a lot
3of impressive features like importing meshes of every format Irrlicht supports, simple but powerful material
4system and lots of special effects.
5
6For package size reasons, irrEdit is not included in this SDK, but you can download it from
7http://www.ambiera.com/irredit \ No newline at end of file