Drop XML implementation, related code and dependent features

This commit is contained in:
sfan5 2021-07-07 16:52:49 +02:00
parent ecb30e3d96
commit 729c214c00
60 changed files with 10 additions and 15350 deletions

@ -4,8 +4,7 @@ This tutorial show how to create a more complex application with the engine.
We construct a simple mesh viewer using the user interface API and the We construct a simple mesh viewer using the user interface API and the
scene management of Irrlicht. The tutorial show how to create and use Buttons, scene management of Irrlicht. The tutorial show how to create and use Buttons,
Windows, Toolbars, Menus, ComboBoxes, Tabcontrols, Editboxes, Images, Windows, Toolbars, Menus, ComboBoxes, Tabcontrols, Editboxes, Images,
MessageBoxes, SkyBoxes, and how to parse XML files with the integrated XML MessageBoxes, SkyBoxes.
reader of the engine.
We start like in most other tutorials: Include all necessary header files, add We start like in most other tutorials: Include all necessary header files, add
a comment to let the engine be linked with the correct .lib file in Visual a comment to let the engine be linked with the correct .lib file in Visual
@ -766,55 +765,6 @@ int main(int argc, char* argv[])
// add our media directory as "search path" // add our media directory as "search path"
Device->getFileSystem()->addFileArchive(getExampleMediaPath()); Device->getFileSystem()->addFileArchive(getExampleMediaPath());
/*
The next step is to read the configuration file. It is stored in the xml
format and looks a little bit like this:
@verbatim
<?xml version="1.0"?>
<config>
<startUpModel file="some filename" />
<messageText caption="Irrlicht Engine Mesh Viewer">
Hello!
</messageText>
</config>
@endverbatim
We need the data stored in there to be written into the global variables
StartUpModelFile, MessageText and Caption. This is now done using the
Irrlicht Engine integrated XML parser:
*/
// read configuration from xml file
io::IXMLReader* xml = Device->getFileSystem()->createXMLReader( L"config.xml");
while(xml && xml->read())
{
switch(xml->getNodeType())
{
case io::EXN_TEXT:
// in this xml file, the only text which occurs is the
// messageText
MessageText = xml->getNodeData();
break;
case io::EXN_ELEMENT:
{
if (core::stringw("startUpModel") == xml->getNodeName())
StartUpModelFile = xml->getAttributeValue(L"file");
else
if (core::stringw("messageText") == xml->getNodeName())
Caption = xml->getAttributeValue(L"caption");
}
break;
default:
break;
}
}
if (xml)
xml->drop(); // don't forget to delete the xml reader
// We can pass a model to load per command line parameter // We can pass a model to load per command line parameter
if (argc > 1) if (argc > 1)
StartUpModelFile = argv[1]; StartUpModelFile = argv[1];

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Irrlicht Example 15 Load .irr File" />
<Option pch_mode="0" />
<Option compiler="gcc" />
<Build>
<Target title="Windows">
<Option platforms="Windows;" />
<Option output="../../bin/Win32-gcc/LoadIrrFile" prefix_auto="0" extension_auto="1" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
<Linker>
<Add directory="../../lib/Win32-gcc" />
</Linker>
</Target>
<Target title="Linux">
<Option platforms="Unix;" />
<Option output="../../bin/Linux/LoadIrrFile" prefix_auto="0" extension_auto="0" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
<Linker>
<Add library="Xxf86vm" />
<Add library="X11" />
<Add library="GL" />
<Add directory="../../lib/Linux" />
</Linker>
</Target>
</Build>
<VirtualTargets>
<Add alias="All" targets="Windows;Linux;" />
</VirtualTargets>
<Compiler>
<Add option="-g" />
<Add directory="../../include" />
</Compiler>
<Linker>
<Add library="Irrlicht" />
</Linker>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<debugger />
<envvars />
</Extensions>
</Project>
</CodeBlocks_project_file>

@ -1,162 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="15.LoadIrrFile"
ProjectGUID="{1AD3DB5E-D751-42D5-8F3E-7C3010539F5C}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/LoadIrrFile.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe"
LinkIncremental="0"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/LoadIrrFile.pdb"
SubSystem="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/LoadIrrFile.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="3079"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/LoadIrrFile.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe"
LinkIncremental="0"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
ProgramDatabaseFile=".\Release/LoadIrrFile.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/LoadIrrFile.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="3079"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="main.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

@ -1,324 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
5E34CC751B7F8EEF00F212E8 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E34CC741B7F8EEF00F212E8 /* main.cpp */; };
5E8570B61B7F9A3200B267D2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E8570B01B7F99F500B267D2 /* Cocoa.framework */; };
5E8570B71B7F9A3200B267D2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E8570B41B7F9A0700B267D2 /* IOKit.framework */; };
5E8570B81B7F9A3200B267D2 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */; };
5E8570BF1B7F9D3A00B267D2 /* media in Resources */ = {isa = PBXBuildFile; fileRef = 5E8570BE1B7F9D3A00B267D2 /* media */; };
5E8571181B7FBE8D00B267D2 /* libIrrlicht.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
5E34CC511B7F8E6E00F212E8 /* 15.LoadIrrFile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 15.LoadIrrFile.app; sourceTree = BUILT_PRODUCTS_DIR; };
5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = "<group>"; };
5E8570B01B7F99F500B267D2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
5E8570B21B7F99FE00B267D2 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
5E8570B41B7F9A0700B267D2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
5E8570BE1B7F9D3A00B267D2 /* media */ = {isa = PBXFileReference; lastKnownFileType = folder; name = media; path = ../../media; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
5E34CC4E1B7F8E6E00F212E8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5E8570B61B7F9A3200B267D2 /* Cocoa.framework in Frameworks */,
5E8570B71B7F9A3200B267D2 /* IOKit.framework in Frameworks */,
5E8570B81B7F9A3200B267D2 /* OpenGL.framework in Frameworks */,
5E8571181B7FBE8D00B267D2 /* libIrrlicht.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
5E34C6D81B7F4A0C00F212E8 = {
isa = PBXGroup;
children = (
5E34CC741B7F8EEF00F212E8 /* main.cpp */,
5E34CC761B7F905600F212E8 /* Libraries */,
5E34CC521B7F8E6E00F212E8 /* Products */,
5E34CC771B7F906D00F212E8 /* Resources */,
);
sourceTree = "<group>";
};
5E34CC521B7F8E6E00F212E8 /* Products */ = {
isa = PBXGroup;
children = (
5E34CC511B7F8E6E00F212E8 /* 15.LoadIrrFile.app */,
);
name = Products;
sourceTree = "<group>";
};
5E34CC761B7F905600F212E8 /* Libraries */ = {
isa = PBXGroup;
children = (
5E8570B01B7F99F500B267D2 /* Cocoa.framework */,
5E8570B41B7F9A0700B267D2 /* IOKit.framework */,
5E8570B21B7F99FE00B267D2 /* OpenGL.framework */,
5E34CC781B7F90A000F212E8 /* libIrrlicht.a */,
);
name = Libraries;
sourceTree = "<group>";
};
5E34CC771B7F906D00F212E8 /* Resources */ = {
isa = PBXGroup;
children = (
5E8570BE1B7F9D3A00B267D2 /* media */,
);
name = Resources;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
5E34CC501B7F8E6E00F212E8 /* 15.LoadIrrFile */ = {
isa = PBXNativeTarget;
buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "15.LoadIrrFile" */;
buildPhases = (
5E34CC4D1B7F8E6E00F212E8 /* Sources */,
5E34CC4E1B7F8E6E00F212E8 /* Frameworks */,
5E34CC4F1B7F8E6E00F212E8 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = 15.LoadIrrFile;
productName = 01.HelloWorld;
productReference = 5E34CC511B7F8E6E00F212E8 /* 15.LoadIrrFile.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
5E34C6D91B7F4A0C00F212E8 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0830;
TargetAttributes = {
5E34CC501B7F8E6E00F212E8 = {
CreatedOnToolsVersion = 6.1;
};
};
};
buildConfigurationList = 5E34C6DC1B7F4A0C00F212E8 /* Build configuration list for PBXProject "LoadIrrFile" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 5E34C6D81B7F4A0C00F212E8;
productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
5E34CC501B7F8E6E00F212E8 /* 15.LoadIrrFile */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
5E34CC4F1B7F8E6E00F212E8 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5E8570BF1B7F9D3A00B267D2 /* media in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
5E34CC4D1B7F8E6E00F212E8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5E34CC751B7F8EEF00F212E8 /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
5E34C6DD1B7F4A0C00F212E8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = c11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = YES;
};
name = Debug;
};
5E34C6DE1B7F4A0C00F212E8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = c11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
};
name = Release;
};
5E34CC6C1B7F8E6E00F212E8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEPLOYMENT_LOCATION = YES;
DSTROOT = "$(SRCROOT)/../../bin/OSX";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../../include",
);
INFOPLIST_FILE = "$(SRCROOT)/../../media/info_osx.plist";
INSTALL_PATH = /;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../../lib/OSX";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Debug;
};
5E34CC6D1B7F8E6E00F212E8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_LOCATION = YES;
DSTROOT = "$(SRCROOT)/../../bin/OSX";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../../include",
);
INFOPLIST_FILE = "$(SRCROOT)/../../media/info_osx.plist";
INSTALL_PATH = /;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../../lib/OSX";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
5E34C6DC1B7F4A0C00F212E8 /* Build configuration list for PBXProject "LoadIrrFile" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5E34C6DD1B7F4A0C00F212E8 /* Debug */,
5E34C6DE1B7F4A0C00F212E8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "15.LoadIrrFile" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5E34CC6C1B7F8E6E00F212E8 /* Debug */,
5E34CC6D1B7F8E6E00F212E8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */;
}

@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "15.LoadIrrFile.app"
BlueprintName = "15.LoadIrrFile"
ReferencedContainer = "container:LoadIrrFile.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "15.LoadIrrFile.app"
BlueprintName = "15.LoadIrrFile"
ReferencedContainer = "container:LoadIrrFile.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "15.LoadIrrFile.app"
BlueprintName = "15.LoadIrrFile"
ReferencedContainer = "container:LoadIrrFile.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "15.LoadIrrFile.app"
BlueprintName = "15.LoadIrrFile"
ReferencedContainer = "container:LoadIrrFile.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

@ -1,235 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>15.LoadIrrFile</ProjectName>
<ProjectGuid>{78C9F424-523C-49AC-94B7-823AA4A26BF9}</ProjectGuid>
<RootNamespace>LoadIrrFile</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TypeLibraryName>.\Debug/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TypeLibraryName>.\Release/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -1,235 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>15.LoadIrrFile</ProjectName>
<ProjectGuid>{78C9F424-523C-49AC-94B7-823AA4A26BF9}</ProjectGuid>
<RootNamespace>LoadIrrFile</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TypeLibraryName>.\Debug/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TypeLibraryName>.\Release/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -1,235 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>15.LoadIrrFile</ProjectName>
<ProjectGuid>{78C9F424-523C-49AC-94B7-823AA4A26BF9}</ProjectGuid>
<RootNamespace>LoadIrrFile</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TypeLibraryName>.\Debug/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TypeLibraryName>.\Release/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -1,235 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>15.LoadIrrFile</ProjectName>
<ProjectGuid>{78C9F424-523C-49AC-94B7-823AA4A26BF9}</ProjectGuid>
<RootNamespace>LoadIrrFile</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TypeLibraryName>.\Debug/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TypeLibraryName>.\Release/LoadIrrFile.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c07</Culture>
</ResourceCompile>
<Link>
<OutputFile>..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe</OutputFile>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -1,56 +0,0 @@
# Makefile for Irrlicht Examples
# It's usually sufficient to change just the target name and source file list
# and be sure that CXX is set to a valid compiler
# Name of the executable created (.exe will be added automatically if necessary)
Target := 15.LoadIrrFile
# List of source files, separated by spaces
Sources := main.cpp
# Path to Irrlicht directory, should contain include/ and lib/
IrrlichtHome := ../..
# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems
BinPath = ../../bin/$(SYSTEM)
# general compiler settings (might need to be set when compiling the lib, too)
CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include
ifndef NDEBUG
CXXFLAGS += -g -Wall
else
CXXFLAGS += -O3
endif
#default target is Linux
all: all_linux
# target specific settings
all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor
all_linux clean_linux: SYSTEM=Linux
all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
all_win32 clean_win32 static_win32: SUF=.exe
static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_
all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm
static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2
# name of the binary - only valid for targets which set SYSTEM
DESTPATH = $(BinPath)/$(Target)$(SUF)
all_linux all_win32 static_win32:
$(warning Building...)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
clean: clean_linux clean_win32
$(warning Cleaning...)
clean_linux clean_win32:
@$(RM) $(DESTPATH)
.PHONY: all all_win32 static_win32 clean clean_linux clean_win32
#multilib handling
ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
#solaris real-time features
ifeq ($(HOSTTYPE), sun4)
LDFLAGS += -lrt
endif

@ -1,181 +0,0 @@
/** Example 015 Loading Scenes from .irr Files
Since version 1.1, Irrlicht is able to save and load
the full scene graph into an .irr file, an xml based
format. There is an editor available to edit
those files, named irrEdit (http://www.ambiera.com/irredit)
which can also be used as world and particle editor.
This tutorial shows how to use .irr files.
Lets start: Create an Irrlicht device and setup the window.
*/
#include <irrlicht.h>
#include "driverChoice.h"
#include "exampleHelper.h"
using namespace irr;
#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib")
#endif
int main(int argc, char** argv)
{
// ask user for driver
video::E_DRIVER_TYPE driverType=driverChoiceConsole();
if (driverType==video::EDT_COUNT)
return 1;
// create device and exit if creation failed
IrrlichtDevice* device =
createDevice(driverType, core::dimension2d<u32>(640, 480));
if (device == 0)
return 1; // could not create selected driver.
device->setWindowCaption(L"Load .irr file example");
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
/*
Now load our .irr file.
.irr files can store the whole scene graph including animators,
materials and particle systems. And there is also the possibility to
store arbitrary user data for every scene node in that file. To keep
this example simple, we are simply loading the scene here. See the
documentation at ISceneManager::loadScene and ISceneManager::saveScene
for more information. So to load and display a complicated huge scene,
we only need a single call to loadScene().
*/
// load the scene
/* You might have to work around some minor problems in current .irr loader:
- It can't load meshes relative to the .irr file, but only relative to the working directory.
So you might have to change your working directory to the path where the .irr file is in.
- When passing a custom parent node to loadScene then irr_scene attributes will be passed to that.
Usually not a problem, but for example AmbientLight will not change that way unless you create a custom
SceneNode type which can interpret those attributes.
*/
if (argc>1)
smgr->loadScene(argv[1]);
else
smgr->loadScene(getExampleMediaPath() + "example.irr");
/*
Now we'll create a camera, and give it a collision response animator
that's built from the mesh nodes in the scene we just loaded.
*/
scene::ICameraSceneNode * camera = smgr->addCameraSceneNodeFPS(0, 50.f, 0.1f);
// Create a meta triangle selector to hold several triangle selectors.
scene::IMetaTriangleSelector * meta = smgr->createMetaTriangleSelector();
/*
Now we will find all the nodes in the scene and create triangle
selectors for all suitable nodes. Typically, you would want to make a
more informed decision about which nodes to performs collision checks
on; you could capture that information in the node name or Id.
*/
core::array<scene::ISceneNode *> nodes;
smgr->getSceneNodesFromType(scene::ESNT_ANY, nodes); // Find all nodes
for (u32 i=0; i < nodes.size(); ++i)
{
scene::ISceneNode * node = nodes[i];
scene::ITriangleSelector * selector = 0;
switch(node->getType())
{
case scene::ESNT_CUBE:
case scene::ESNT_ANIMATED_MESH:
// Because the selector won't animate with the mesh,
// and is only being used for camera collision, we'll just use an approximate
// bounding box instead of ((scene::IAnimatedMeshSceneNode*)node)->getMesh(0)
selector = smgr->createTriangleSelectorFromBoundingBox(node);
break;
case scene::ESNT_MESH:
case scene::ESNT_SPHERE: // Derived from IMeshSceneNode
selector = smgr->createTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node);
break;
case scene::ESNT_TERRAIN:
selector = smgr->createTerrainTriangleSelector((scene::ITerrainSceneNode*)node);
break;
case scene::ESNT_OCTREE:
selector = smgr->createOctreeTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node);
break;
default:
// Don't create a selector for this node type
break;
}
if(selector)
{
// Add it to the meta selector, which will take a reference to it
meta->addTriangleSelector(selector);
// And drop my reference to it, so that the meta selector owns it.
selector->drop();
}
}
/*
Now that the mesh scene nodes have had triangle selectors created and added
to the meta selector, create a collision response animator from that meta selector.
*/
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
meta, camera, core::vector3df(5,5,5),
core::vector3df(0,0,0));
meta->drop(); // I'm done with the meta selector now
camera->addAnimator(anim);
anim->drop(); // I'm done with the animator now
// And set the camera position so that it doesn't start off stuck in the geometry
camera->setPosition(core::vector3df(0.f, 20.f, 0.f));
// Point the camera at the cube node, by finding the first node of type ESNT_CUBE
scene::ISceneNode * cube = smgr->getSceneNodeFromType(scene::ESNT_CUBE);
if(cube)
camera->setTarget(cube->getAbsolutePosition());
/*
That's it. Draw everything and finish as usual.
*/
int lastFPS = -1;
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,200,200,200));
smgr->drawAll();
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw str = L"Load Irrlicht File example - Irrlicht Engine [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}
device->drop();
return 0;
}
/*
**/

@ -1,129 +0,0 @@
<html>
<head>
<title>Irrlicht Engine Tutorial</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr>
<td bgcolor="#666699" width="10"><b><a href="http://irrlicht.sourceforge.net" target="_blank"><img src="../../media/irrlichtlogo.jpg" width="88" height="31" border="0"></a></b></td>
<td bgcolor="#666699" width="100%"> <div align="center"><b><font color="#FFFFFF"></font></b></div>
<b><font color="#FFFFFF">Tutorial 15. Load .irr File</font></b></td>
</tr>
<tr bgcolor="#eeeeff">
<td height="90" colspan="2"> <div align="left">
<p>Since version 1.1, Irrlicht is able to save and load the full scene
graph into an .irr file, an xml based format. There is also an editor
available to edit those files, named irrEdit on <a href="http://www.ambiera.com/irredit" target="_blank">http://www.ambiera.com/irredit</a>,
which can also be used as world and particle editor. This tutorial shows
how to use .irr files.</p>
<p align="center"><img src="../../media/015shot.jpg" width="256" height="200"><br>
</p>
</div></td>
</tr>
</table>
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="2" align="center">
<tr>
<td bgcolor="#666699"> <div align="center"><b><font color="#000000"></font></b></div>
<font color="#FFFFFF"><b>Lets start!</b></font></td>
</tr>
<tr>
<td height="90" bgcolor="#eeeeff" valign="top"> <div align="left">
<p>Lets start: Create an Irrlicht device and setup the window.</p>
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
<tr>
<td> <pre>#include <irrlicht.h>
#include <iostream>
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
int main()
{
// ask user for driver
video::E_DRIVER_TYPE driverType;
printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");
char i;
std::cin >> i;
switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
}
// create device and exit if creation failed
IrrlichtDevice* device =
createDevice(driverType, core::dimension2d<s32>(640, 480));
if (device == 0)
return 1; // could not create selected driver.
device->setWindowCaption(L"Load .irr file example");
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
</pre></td>
</tr>
</table>
<p>Now load our .irr file. .irr files can store the whole scene graph
including animators, materials and particle systems. And there is also
the possibility to store arbitrary user data for every scene node in
that file. To keep this example simple, we are simply loading the scene
here. See the documentation at ISceneManager::loadScene and ISceneManager::saveScene
for more information. So to load and display a complicated huge scene,
we only need a single call to loadScene().</p>
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
<tr>
<td><pre>// load the scene<br>smgr-&gt;loadScene(&quot;../../media/example.irr&quot;); </pre></td>
</tr>
</table>
<p>That was it already. Now add a camera and draw the scene.</p>
<table width="95%" border="0" cellspacing="2" cellpadding="0" bgcolor="#CCCCCC" align="center">
<tr>
<td> <pre> // add a user controlled camera
smgr->addCameraSceneNodeFPS();
// and draw everything.
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(0,200,200,200));
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
</pre> </td>
</tr>
</table>
</div>
<p>&nbsp;</p>
</td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>

@ -1,56 +0,0 @@
# Makefile for Irrlicht Examples
# It's usually sufficient to change just the target name and source file list
# and be sure that CXX is set to a valid compiler
# Name of the executable created (.exe will be added automatically if necessary)
Target := 25.XmlHandling
# List of source files, separated by spaces
Sources := main.cpp
# Path to Irrlicht directory, should contain include/ and lib/
IrrlichtHome := ../..
# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems
BinPath = ../../bin/$(SYSTEM)
# general compiler settings (might need to be set when compiling the lib, too)
CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include
ifndef NDEBUG
CXXFLAGS += -g -Wall
else
CXXFLAGS += -O3
endif
#default target is Linux
all: all_linux
# target specific settings
all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor
all_linux clean_linux: SYSTEM=Linux
all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
all_win32 clean_win32 static_win32: SUF=.exe
static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_
all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm
static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2
# name of the binary - only valid for targets which set SYSTEM
DESTPATH = $(BinPath)/$(Target)$(SUF)
all_linux all_win32 static_win32:
$(warning Building...)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
clean: clean_linux clean_win32
$(warning Cleaning...)
clean_linux clean_win32:
@$(RM) $(DESTPATH)
.PHONY: all all_win32 static_win32 clean clean_linux clean_win32
#multilib handling
ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
#solaris real-time features
ifeq ($(HOSTTYPE), sun4)
LDFLAGS += -lrt
endif

@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Irrlicht Example 25 Xml handling" />
<Option pch_mode="0" />
<Option compiler="gcc" />
<Build>
<Target title="Linux">
<Option platforms="Unix;" />
<Option output="../../bin/Linux/XmlHandling" prefix_auto="0" extension_auto="0" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
<Add option="-D_IRR_STATIC_LIB_" />
</Compiler>
<Linker>
<Add library="Xxf86vm" />
<Add library="X11" />
<Add library="GL" />
<Add directory="../../lib/Linux" />
</Linker>
</Target>
<Target title="Windows">
<Option platforms="Windows;" />
<Option output="../../bin/Win32-gcc/XmlHandling" prefix_auto="0" extension_auto="1" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
<Linker>
<Add directory="../../lib/Win32-gcc" />
</Linker>
</Target>
</Build>
<VirtualTargets>
<Add alias="All" targets="Windows;Linux;" />
</VirtualTargets>
<Compiler>
<Add option="-g" />
<Add directory="../../include" />
</Compiler>
<Linker>
<Add library="Irrlicht" />
</Linker>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<debugger />
<envvars />
</Extensions>
</Project>
</CodeBlocks_project_file>

@ -1,195 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="25.XmlHandling"
ProjectGUID="{8FDA260E-EF27-4f8c-8720-7AF707DD0D9E}"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="_IRR_STATIC_LIB_;WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\25.XmlHandling.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/XmlHandling.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/QIfist /Oa"
Optimization="3"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
RuntimeLibrary="0"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="0"
CallingConvention="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\..\bin\Win32-VisualStudio\25.XmlHandling.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\main.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

@ -1,324 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
5E34CC751B7F8EEF00F212E8 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E34CC741B7F8EEF00F212E8 /* main.cpp */; };
5E8570B61B7F9A3200B267D2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E8570B01B7F99F500B267D2 /* Cocoa.framework */; };
5E8570B71B7F9A3200B267D2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E8570B41B7F9A0700B267D2 /* IOKit.framework */; };
5E8570B81B7F9A3200B267D2 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E8570B21B7F99FE00B267D2 /* OpenGL.framework */; };
5E8570BF1B7F9D3A00B267D2 /* media in Resources */ = {isa = PBXBuildFile; fileRef = 5E8570BE1B7F9D3A00B267D2 /* media */; };
5E8571181B7FBE8D00B267D2 /* libIrrlicht.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E34CC781B7F90A000F212E8 /* libIrrlicht.a */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
5E34CC511B7F8E6E00F212E8 /* 25.XmlHandling.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 25.XmlHandling.app; sourceTree = BUILT_PRODUCTS_DIR; };
5E34CC741B7F8EEF00F212E8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
5E34CC781B7F90A000F212E8 /* libIrrlicht.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libIrrlicht.a; path = ../../lib/OSX/libIrrlicht.a; sourceTree = "<group>"; };
5E8570B01B7F99F500B267D2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
5E8570B21B7F99FE00B267D2 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
5E8570B41B7F9A0700B267D2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
5E8570BE1B7F9D3A00B267D2 /* media */ = {isa = PBXFileReference; lastKnownFileType = folder; name = media; path = ../../media; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
5E34CC4E1B7F8E6E00F212E8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5E8570B61B7F9A3200B267D2 /* Cocoa.framework in Frameworks */,
5E8570B71B7F9A3200B267D2 /* IOKit.framework in Frameworks */,
5E8570B81B7F9A3200B267D2 /* OpenGL.framework in Frameworks */,
5E8571181B7FBE8D00B267D2 /* libIrrlicht.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
5E34C6D81B7F4A0C00F212E8 = {
isa = PBXGroup;
children = (
5E34CC741B7F8EEF00F212E8 /* main.cpp */,
5E34CC761B7F905600F212E8 /* Libraries */,
5E34CC521B7F8E6E00F212E8 /* Products */,
5E34CC771B7F906D00F212E8 /* Resources */,
);
sourceTree = "<group>";
};
5E34CC521B7F8E6E00F212E8 /* Products */ = {
isa = PBXGroup;
children = (
5E34CC511B7F8E6E00F212E8 /* 25.XmlHandling.app */,
);
name = Products;
sourceTree = "<group>";
};
5E34CC761B7F905600F212E8 /* Libraries */ = {
isa = PBXGroup;
children = (
5E8570B01B7F99F500B267D2 /* Cocoa.framework */,
5E8570B41B7F9A0700B267D2 /* IOKit.framework */,
5E8570B21B7F99FE00B267D2 /* OpenGL.framework */,
5E34CC781B7F90A000F212E8 /* libIrrlicht.a */,
);
name = Libraries;
sourceTree = "<group>";
};
5E34CC771B7F906D00F212E8 /* Resources */ = {
isa = PBXGroup;
children = (
5E8570BE1B7F9D3A00B267D2 /* media */,
);
name = Resources;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
5E34CC501B7F8E6E00F212E8 /* 25.XmlHandling */ = {
isa = PBXNativeTarget;
buildConfigurationList = 5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "25.XmlHandling" */;
buildPhases = (
5E34CC4D1B7F8E6E00F212E8 /* Sources */,
5E34CC4E1B7F8E6E00F212E8 /* Frameworks */,
5E34CC4F1B7F8E6E00F212E8 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = 25.XmlHandling;
productName = 01.HelloWorld;
productReference = 5E34CC511B7F8E6E00F212E8 /* 25.XmlHandling.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
5E34C6D91B7F4A0C00F212E8 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0830;
TargetAttributes = {
5E34CC501B7F8E6E00F212E8 = {
CreatedOnToolsVersion = 6.1;
};
};
};
buildConfigurationList = 5E34C6DC1B7F4A0C00F212E8 /* Build configuration list for PBXProject "XmlHandling" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 5E34C6D81B7F4A0C00F212E8;
productRefGroup = 5E34CC521B7F8E6E00F212E8 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
5E34CC501B7F8E6E00F212E8 /* 25.XmlHandling */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
5E34CC4F1B7F8E6E00F212E8 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5E8570BF1B7F9D3A00B267D2 /* media in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
5E34CC4D1B7F8E6E00F212E8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5E34CC751B7F8EEF00F212E8 /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
5E34C6DD1B7F4A0C00F212E8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = c11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = YES;
};
name = Debug;
};
5E34C6DE1B7F4A0C00F212E8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = c11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
};
name = Release;
};
5E34CC6C1B7F8E6E00F212E8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEPLOYMENT_LOCATION = YES;
DSTROOT = "$(SRCROOT)/../../bin/OSX";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../../include",
);
INFOPLIST_FILE = "$(SRCROOT)/../../media/info_osx.plist";
INSTALL_PATH = /;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../../lib/OSX";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Debug;
};
5E34CC6D1B7F8E6E00F212E8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_LOCATION = YES;
DSTROOT = "$(SRCROOT)/../../bin/OSX";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../../include",
);
INFOPLIST_FILE = "$(SRCROOT)/../../media/info_osx.plist";
INSTALL_PATH = /;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../../lib/OSX";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
5E34C6DC1B7F4A0C00F212E8 /* Build configuration list for PBXProject "XmlHandling" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5E34C6DD1B7F4A0C00F212E8 /* Debug */,
5E34C6DE1B7F4A0C00F212E8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
5E34CC701B7F8E6E00F212E8 /* Build configuration list for PBXNativeTarget "25.XmlHandling" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5E34CC6C1B7F8E6E00F212E8 /* Debug */,
5E34CC6D1B7F8E6E00F212E8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 5E34C6D91B7F4A0C00F212E8 /* Project object */;
}

@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "25.XmlHandling.app"
BlueprintName = "25.XmlHandling"
ReferencedContainer = "container:XmlHandling.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "25.XmlHandling.app"
BlueprintName = "25.XmlHandling"
ReferencedContainer = "container:XmlHandling.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "25.XmlHandling.app"
BlueprintName = "25.XmlHandling"
ReferencedContainer = "container:XmlHandling.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E34CC501B7F8E6E00F212E8"
BuildableName = "25.XmlHandling.app"
BlueprintName = "25.XmlHandling"
ReferencedContainer = "container:XmlHandling.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

@ -1,182 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>25.XmlHandling</ProjectName>
<ProjectGuid>{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}</ProjectGuid>
<RootNamespace>25.XmlHandling</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -1,182 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>25.XmlHandling</ProjectName>
<ProjectGuid>{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}</ProjectGuid>
<RootNamespace>25.XmlHandling</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -1,182 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>25.XmlHandling</ProjectName>
<ProjectGuid>{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}</ProjectGuid>
<RootNamespace>25.XmlHandling</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -1,182 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>25.XmlHandling</ProjectName>
<ProjectGuid>{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}</ProjectGuid>
<RootNamespace>25.XmlHandling</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CallingConvention>Cdecl</CallingConvention>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -1,510 +0,0 @@
/** Example 025 Xml Handling
Demonstrates loading and saving of configurations via XML
@author Y.M. Bosman \<yoran.bosman@gmail.com\>
This demo features a fully usable system for configuration handling. The code
can easily be integrated into own apps.
*/
#include <irrlicht.h>
#include "exampleHelper.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib")
#endif
/* SettingManager class.
This class loads and writes the settings and manages the options.
The class makes use of irrMap which is a an associative arrays using a
red-black tree it allows easy mapping of a key to a value, along the way there
is some information on how to use it.
*/
class SettingManager
{
public:
// Construct setting managers and set default settings
SettingManager(const stringw& settings_file): SettingsFile(settings_file), NullDevice(0)
{
// Irrlicht null device, we want to load settings before we actually created our device, therefore, nulldevice
NullDevice = irr::createDevice(irr::video::EDT_NULL);
//DriverOptions is an irrlicht map,
//we can insert values in the map in two ways by calling insert(key,value) or by using the [key] operator
//the [] operator overrides values if they already exist
DriverOptions.insert(L"Software", EDT_SOFTWARE);
DriverOptions.insert(L"OpenGL", EDT_OPENGL);
DriverOptions.insert(L"Direct3D9", EDT_DIRECT3D9);
//some resolution options
ResolutionOptions.insert(L"640x480", dimension2du(640,480));
ResolutionOptions.insert(L"800x600", dimension2du(800,600));
ResolutionOptions.insert(L"1024x768", dimension2du(1024,768));
//our preferred defaults
SettingMap.insert(L"driver", L"Direct3D9");
SettingMap.insert(L"resolution", L"640x480");
SettingMap.insert(L"fullscreen", L"0"); //0 is false
}
// Destructor, you could store settings automatically on exit of your
// application if you wanted to in our case we simply drop the
// nulldevice
~SettingManager()
{
if (NullDevice)
{
NullDevice->closeDevice();
NullDevice->drop();
}
};
/*
Load xml from disk, overwrite default settings
The xml we are trying to load has the following structure
settings nested in sections nested in the root node, like so
<pre>
<?xml version="1.0"?>
<mygame>
<video>
<setting name="driver" value="Direct3D9" />
<setting name="fullscreen" value="0" />
<setting name="resolution" value="1024x768" />
</video>
</mygame>
</pre>
*/
bool load()
{
//if not able to create device don't attempt to load
if (!NullDevice)
return false;
irr::io::IXMLReader* xml = NullDevice->getFileSystem()->createXMLReader(SettingsFile); //create xml reader
if (!xml)
return false;
const stringw settingTag(L"setting"); //we'll be looking for this tag in the xml
stringw currentSection; //keep track of our current section
const stringw videoTag(L"video"); //constant for videotag
//while there is more to read
while (xml->read())
{
//check the node type
switch (xml->getNodeType())
{
//we found a new element
case irr::io::EXN_ELEMENT:
{
//we currently are in the empty or mygame section and find the video tag so we set our current section to video
if (currentSection.empty() && videoTag.equals_ignore_case(xml->getNodeName()))
{
currentSection = videoTag;
}
//we are in the video section and we find a setting to parse
else if (currentSection.equals_ignore_case(videoTag) && settingTag.equals_ignore_case(xml->getNodeName() ))
{
//read in the key
stringw key = xml->getAttributeValueSafe(L"name");
//if there actually is a key to set
if (!key.empty())
{
//set the setting in the map to the value,
//the [] operator overrides values if they already exist or inserts a new key value
//pair into the settings map if it was not defined yet
SettingMap[key] = xml->getAttributeValueSafe(L"value");
}
}
//..
// You can add your own sections and tags to read in here
//..
}
break;
//we found the end of an element
case irr::io::EXN_ELEMENT_END:
//we were at the end of the video section so we reset our tag
currentSection=L"";
break;
default:
break;
}
}
// don't forget to delete the xml reader
xml->drop();
return true;
}
// Save the xml to disk. We use the nulldevice.
bool save()
{
//if not able to create device don't attempt to save
if (!NullDevice)
return false;
//create xml writer
irr::io::IXMLWriter* xwriter = NullDevice->getFileSystem()->createXMLWriter( SettingsFile );
if (!xwriter)
return false;
//write out the obligatory xml header. Each xml-file needs to have exactly one of those.
xwriter->writeXMLHeader();
//start element mygame, you replace the label "mygame" with anything you want
xwriter->writeElement(L"mygame");
xwriter->writeLineBreak(); //new line
//start section with video settings
xwriter->writeElement(L"video");
xwriter->writeLineBreak(); //new line
// getIterator gets us a pointer to the first node of the settings map
// every iteration we increase the iterator which gives us the next map node
// until we reach the end we write settings one by one by using the nodes key and value functions
map<stringw, stringw>::Iterator i = SettingMap.getIterator();
for(; !i.atEnd(); i++)
{
//write element as <setting name="key" value="x" />
//the second parameter indicates this is an empty element with no children, just attributes
xwriter->writeElement(L"setting",true, L"name", i->getKey().c_str(), L"value",i->getValue().c_str() );
xwriter->writeLineBreak();
}
xwriter->writeLineBreak();
//close video section
xwriter->writeClosingTag(L"video");
xwriter->writeLineBreak();
//..
// You can add writing sound settings, savegame information etc
//..
//close mygame section
xwriter->writeClosingTag(L"mygame");
//delete xml writer
xwriter->drop();
return true;
}
// Set setting in our manager
void setSetting(const stringw& name, const stringw& value)
{
SettingMap[name]=value;
}
// set setting overload to quickly assign integers to our setting map
void setSetting(const stringw& name, s32 value)
{
SettingMap[name]=stringw(value);
}
// Get setting as string
stringw getSetting(const stringw& key) const
{
//the find function or irrmap returns a pointer to a map Node
//if the key can be found, otherwise it returns null
//the map node has the function getValue and getKey, as we already know the key, we return node->getValue()
map<stringw, stringw>::Node* n = SettingMap.find(key);
if (n)
return n->getValue();
else
return L"";
}
//
bool getSettingAsBoolean(const stringw& key ) const
{
stringw s = getSetting(key);
if (s.empty())
return false;
return s.equals_ignore_case(L"1");
}
//
s32 getSettingAsInteger(const stringw& key) const
{
//we implicitly cast to string instead of stringw because strtol10 does not accept wide strings
const stringc s = getSetting(key);
if (s.empty())
return 0;
return strtol10(s.c_str());
}
public:
map<stringw, s32> DriverOptions; //available options for driver config
map<stringw, dimension2du> ResolutionOptions; //available options for resolution config
private:
SettingManager(const SettingManager& other); // defined but not implemented
SettingManager& operator=(const SettingManager& other); // defined but not implemented
map<stringw, stringw> SettingMap; //current config
stringw SettingsFile; // location of the xml, usually the
irr::IrrlichtDevice* NullDevice;
};
/*
Application context for global variables
*/
struct SAppContext
{
SAppContext()
: Device(0),Gui(0), Driver(0), Settings(0), ShouldQuit(false),
ButtonSave(0), ButtonExit(0), ListboxDriver(0),
ListboxResolution(0), CheckboxFullscreen(0)
{
}
~SAppContext()
{
if (Settings)
delete Settings;
if (Device)
{
Device->closeDevice();
Device->drop();
}
}
IrrlichtDevice* Device;
IGUIEnvironment* Gui;
IVideoDriver* Driver;
SettingManager* Settings;
bool ShouldQuit;
//settings dialog
IGUIButton* ButtonSave;
IGUIButton* ButtonExit;
IGUIListBox* ListboxDriver;
IGUIListBox* ListboxResolution;
IGUICheckBox* CheckboxFullscreen;
};
/*
A typical event receiver.
*/
class MyEventReceiver : public IEventReceiver
{
public:
MyEventReceiver(SAppContext & a) : App(a) { }
virtual bool OnEvent(const SEvent& event)
{
if (event.EventType == EET_GUI_EVENT )
{
switch ( event.GUIEvent.EventType )
{
//handle button click events
case EGET_BUTTON_CLICKED:
{
//Our save button was called so we obtain the settings from our dialog and save them
if ( event.GUIEvent.Caller == App.ButtonSave )
{
//if there is a selection write it
if ( App.ListboxDriver->getSelected() != -1)
App.Settings->setSetting(L"driver", App.ListboxDriver->getListItem(App.ListboxDriver->getSelected()));
//if there is a selection write it
if ( App.ListboxResolution->getSelected() != -1)
App.Settings->setSetting(L"resolution", App.ListboxResolution->getListItem(App.ListboxResolution->getSelected()));
App.Settings->setSetting(L"fullscreen", App.CheckboxFullscreen->isChecked());
if (App.Settings->save())
{
App.Gui->addMessageBox(L"settings save",L"settings saved, please restart for settings to change effect","",true);
}
}
// cancel/exit button clicked, tell the application to exit
else if ( event.GUIEvent.Caller == App.ButtonExit)
{
App.ShouldQuit = true;
}
}
break;
default:
break;
}
}
return false;
}
private:
SAppContext & App;
};
/*
Function to create a video settings dialog
This dialog shows the current settings from the configuration xml and allows them to be changed
*/
void createSettingsDialog(SAppContext& app)
{
// first get rid of alpha in gui
for (irr::s32 i=0; i<irr::gui::EGDC_COUNT ; ++i)
{
irr::video::SColor col = app.Gui->getSkin()->getColor((irr::gui::EGUI_DEFAULT_COLOR)i);
col.setAlpha(255);
app.Gui->getSkin()->setColor((irr::gui::EGUI_DEFAULT_COLOR)i, col);
}
//create video settings windows
gui::IGUIWindow* windowSettings = app.Gui->addWindow(rect<s32>(10,10,400,400),true,L"Videosettings");
app.Gui->addStaticText (L"Select your desired video settings", rect< s32 >(10,20, 200, 40), false, true, windowSettings);
// add listbox for driver choice
app.Gui->addStaticText (L"Driver", rect< s32 >(10,50, 200, 60), false, true, windowSettings);
app.ListboxDriver = app.Gui->addListBox(rect<s32>(10,60,220,120), windowSettings, 1,true);
//add all available options to the driver choice listbox
map<stringw, s32>::Iterator i = app.Settings->DriverOptions.getIterator();
for(; !i.atEnd(); i++)
app.ListboxDriver->addItem(i->getKey().c_str());
//set currently selected driver
app.ListboxDriver->setSelected(app.Settings->getSetting("driver").c_str());
// add listbox for resolution choice
app.Gui->addStaticText (L"Resolution", rect< s32 >(10,130, 200, 140), false, true, windowSettings);
app.ListboxResolution = app.Gui->addListBox(rect<s32>(10,140,220,200), windowSettings, 1,true);
//add all available options to the resolution listbox
map<stringw, dimension2du>::Iterator ri = app.Settings->ResolutionOptions.getIterator();
for(; !ri.atEnd(); ri++)
app.ListboxResolution->addItem(ri->getKey().c_str());
//set currently selected resolution
app.ListboxResolution->setSelected(app.Settings->getSetting("resolution").c_str());
//add checkbox to toggle fullscreen, initially set to loaded setting
app.CheckboxFullscreen = app.Gui->addCheckBox(
app.Settings->getSettingAsBoolean("fullscreen"),
rect<s32>(10,220,220,240), windowSettings, -1,
L"Fullscreen");
//last but not least add save button
app.ButtonSave = app.Gui->addButton(
rect<s32>(80,250,150,270), windowSettings, 2,
L"Save video settings");
//exit/cancel button
app.ButtonExit = app.Gui->addButton(
rect<s32>(160,250,240,270), windowSettings, 2,
L"Cancel and exit");
}
/*
The main function. Creates all objects and does the XML handling.
*/
int main()
{
//create new application context
SAppContext app;
//create device creation parameters that can get overwritten by our settings file
SIrrlichtCreationParameters param;
param.DriverType = EDT_SOFTWARE;
param.WindowSize.set(640,480);
// Try to load config.
// I leave it as an exercise of the reader to store the configuration in the local application data folder,
// the only logical place to store config data for games. For all other operating systems I redirect to your manuals
app.Settings = new SettingManager(getExampleMediaPath() + "settings.xml");
if ( !app.Settings->load() )
{
// ...
// Here add your own exception handling, for now we continue because there are defaults set in SettingManager constructor
// ...
}
else
{
//settings xml loaded from disk,
//map driversetting to driver type and test if the setting is valid
//the DriverOptions map contains string representations mapped to to irrlicht E_DRIVER_TYPE enum
//e.g "direct3d9" will become 4
//see DriverOptions in the settingmanager class for details
map<stringw, s32>::Node* driver = app.Settings->DriverOptions.find( app.Settings->getSetting("driver") );
if (driver)
{
if ( irr::IrrlichtDevice::isDriverSupported( static_cast<E_DRIVER_TYPE>( driver->getValue() )))
{
// selected driver is supported, so we use it.
param.DriverType = static_cast<E_DRIVER_TYPE>( driver->getValue());
}
}
//map resolution setting to dimension in a similar way as demonstrated above
map<stringw, dimension2du>::Node* res = app.Settings->ResolutionOptions.find( app.Settings->getSetting("resolution") );
if (res)
{
param.WindowSize = res->getValue();
}
//get fullscreen setting from config
param.Fullscreen = app.Settings->getSettingAsBoolean("fullscreen");
}
//create the irrlicht device using the settings
app.Device = createDeviceEx(param);
if (app.Device == 0)
{
// You can add your own exception handling on driver failure
exit(0);
}
app.Device->setWindowCaption(L"Xmlhandling - Irrlicht engine tutorial");
app.Driver = app.Device->getVideoDriver();
app.Gui = app.Device->getGUIEnvironment();
createSettingsDialog(app);
//set event receiver so we can respond to gui events
MyEventReceiver receiver(app);
app.Device->setEventReceiver(&receiver);
//enter main loop
while (!app.ShouldQuit && app.Device->run())
{
if (app.Device->isWindowActive())
{
app.Driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200));
app.Gui->drawAll();
app.Driver->endScene();
}
app.Device->sleep(10);
}
//app destroys device in destructor
return 0;
}
/*
**/

@ -13,7 +13,6 @@ set(IRREXAMPLES
11.PerPixelLighting 11.PerPixelLighting
12.TerrainRendering 12.TerrainRendering
13.RenderToTexture 13.RenderToTexture
15.LoadIrrFile
16.Quake3MapShader 16.Quake3MapShader
18.SplitScreen 18.SplitScreen
19.MouseAndJoystick 19.MouseAndJoystick
@ -22,7 +21,6 @@ set(IRREXAMPLES
22.MaterialViewer 22.MaterialViewer
23.SMeshHandling 23.SMeshHandling
24.CursorControl 24.CursorControl
25.XmlHandling
26.OcclusionQuery 26.OcclusionQuery
27.PostProcessing 27.PostProcessing
28.CubeMapping 28.CubeMapping

@ -23,8 +23,6 @@
#include "line3d.h" #include "line3d.h"
#include "irrString.h" #include "irrString.h"
#include "irrArray.h" #include "irrArray.h"
#include "IXMLReader.h"
#include "IXMLWriter.h"
#include "EAttributes.h" #include "EAttributes.h"
#include "path.h" #include "path.h"
@ -76,20 +74,6 @@ public:
//! Removes all attributes //! Removes all attributes
virtual void clear() = 0; virtual void clear() = 0;
//! Reads attributes from a xml file.
//! \param reader The XML reader to read from
//! \param readCurrentElementOnly If set to true, reading only works if current element has the name 'attributes' or
//! the name specified using elementName.
//! \param elementName The surrounding element name. If it is null, the default one, "attributes" will be taken.
//! If set to false, the first appearing list of attributes are read.
virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false, const wchar_t* elementName=0) = 0;
//! Write these attributes into a xml file
//! \param writer: The XML writer to write to
//! \param writeXMLHeader: Writes a header to the XML file, required if at the beginning of the file
//! \param elementName: The surrounding element name. If it is null, the default one, "attributes" will be taken.
virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false, const wchar_t* elementName=0) = 0;
/* /*

@ -1,456 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __IRR_I_COLLADA_MESH_WRITER_H_INCLUDED__
#define __IRR_I_COLLADA_MESH_WRITER_H_INCLUDED__
#include "IMeshWriter.h"
#include "ISceneNode.h"
#include "IAnimatedMesh.h"
#include "SMaterial.h"
namespace irr
{
namespace io
{
class IWriteFile;
} // end namespace io
namespace scene
{
//! Lighting models - more or less the way Collada categorizes materials
enum E_COLLADA_TECHNIQUE_FX
{
//! Blinn-phong which is default for opengl and dx fixed function pipelines.
//! But several well-known renderers don't support it and prefer phong.
ECTF_BLINN,
//! Phong shading, default in many external renderers.
ECTF_PHONG,
//! diffuse shaded surface that is independent of lighting.
ECTF_LAMBERT,
// constantly shaded surface that is independent of lighting.
ECTF_CONSTANT
};
//! How to interpret the opacity in collada
enum E_COLLADA_TRANSPARENT_FX
{
//! default - only alpha channel of color or texture is used.
ECOF_A_ONE = 0,
//! Alpha values for each RGB channel of color or texture are used.
ECOF_RGB_ZERO = 1
};
//! Color names collada uses in it's color samplers
enum E_COLLADA_COLOR_SAMPLER
{
ECCS_DIFFUSE,
ECCS_AMBIENT,
ECCS_EMISSIVE,
ECCS_SPECULAR,
ECCS_TRANSPARENT,
ECCS_REFLECTIVE
};
//! Irrlicht colors which can be mapped to E_COLLADA_COLOR_SAMPLER values
enum E_COLLADA_IRR_COLOR
{
//! Don't write this element at all
ECIC_NONE,
//! Check IColladaMeshWriterProperties for custom color
ECIC_CUSTOM,
//! Use SMaterial::DiffuseColor
ECIC_DIFFUSE,
//! Use SMaterial::AmbientColor
ECIC_AMBIENT,
//! Use SMaterial::EmissiveColor
ECIC_EMISSIVE,
//! Use SMaterial::SpecularColor
ECIC_SPECULAR
};
//! Control when geometry elements are created
enum E_COLLADA_GEOMETRY_WRITING
{
//! Default - write each mesh exactly once to collada. Optimal but will not work with many tools.
ECGI_PER_MESH,
//! Write each mesh as often as it's used with different materials-names in the scene.
//! Material names which are used here are created on export, so using the IColladaMeshWriterNames
//! interface you have some control over how many geometries are written.
ECGI_PER_MESH_AND_MATERIAL
};
//! Callback interface for properties which can be used to influence collada writing
class IColladaMeshWriterProperties : public virtual IReferenceCounted
{
public:
virtual ~IColladaMeshWriterProperties () {}
//! Which lighting model should be used in the technique (FX) section when exporting effects (materials)
virtual E_COLLADA_TECHNIQUE_FX getTechniqueFx(const video::SMaterial& material) const = 0;
//! Which texture index should be used when writing the texture of the given sampler color.
/** \return the index to the texture-layer or -1 if that texture should never be exported
Note: for ECCS_TRANSPARENT by default the alpha channel is used, if you want to use RGB you have to set
also the ECOF_RGB_ZERO flag in getTransparentFx. */
virtual s32 getTextureIdx(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
//! Return which color from Irrlicht should be used for the color requested by collada
/** Note that collada allows exporting either texture or color, not both.
So color mapping is only checked if we have no valid texture already.
By default we try to return best fits when possible. For example ECCS_DIFFUSE is mapped to ECIC_DIFFUSE.
When ECIC_CUSTOM is returned then the result of getCustomColor will be used. */
virtual E_COLLADA_IRR_COLOR getColorMapping(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
//! Return custom colors for certain color types requested by collada.
/** Only used when getColorMapping returns ECIC_CUSTOM for the same parameters. */
virtual video::SColor getCustomColor(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
//! Return the transparence color interpretation.
/** Not this is only about ECCS_TRANSPARENT and does not affect getTransparency. */
virtual E_COLLADA_TRANSPARENT_FX getTransparentFx(const video::SMaterial& material) const = 0;
//! Transparency value for that material.
/** This value is additional to transparent settings, if both are set they will be multiplicated.
\return 1.0 for fully transparent, 0.0 for not transparent and not written at all when < 0.f */
virtual f32 getTransparency(const video::SMaterial& material) const = 0;
//! Reflectivity value for that material
/** The amount of perfect mirror reflection to be added to the reflected light
\return 0.0 - 1.0 for reflectivity and element is not written at all when < 0.f */
virtual f32 getReflectivity(const video::SMaterial& material) const = 0;
//! Return index of refraction for that material
/** By default we don't write that.
\return a value greater equal 0.f to write \<index_of_refraction\> when it is lesser than 0 nothing will be written */
virtual f32 getIndexOfRefraction(const video::SMaterial& material) const = 0;
//! Should node be used in scene export? (only needed for scene-writing, ignored in mesh-writing)
//! By default all visible nodes are exported.
virtual bool isExportable(const irr::scene::ISceneNode * node) const = 0;
//! Return the mesh for the given node. If it has no mesh or shouldn't export it's mesh
//! you can return 0 in which case only the transformation matrix of the node will be used.
// TODO: Function is not const because there is no const getMesh() function for several Irrlicht nodes.
virtual IMesh* getMesh(irr::scene::ISceneNode * node) = 0;
//! Return if the node has it's own material overwriting the mesh-materials
/** Usually true except for mesh-nodes which have isReadOnlyMaterials set.
This is mostly important for naming (as ISceneNode::getMaterial() already returns the correct material).
You have to override it when exporting custom scenenodes with own materials.
\return true => The node's own material is used, false => ignore node material and use the one from the mesh */
virtual bool useNodeMaterial(const scene::ISceneNode* node) const = 0;
};
//! Callback interface to use custom names on collada writing.
/** You can either modify names and id's written to collada or you can use
this interface to just find out which names are used on writing.
Names are often used later as xs:anyURI, so avoid whitespace, '#' and '%' in the names.
*/
class IColladaMeshWriterNames : public virtual IReferenceCounted
{
public:
virtual ~IColladaMeshWriterNames () {}
//! Return a unique name for the given mesh
/** Note that names really must be unique here per mesh-pointer, so
mostly it's a good idea to return the nameForMesh from
IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow
the xs:NCName standard to be valid, you can run them through
IColladaMeshWriter::toNCName to ensure that.
\param mesh Pointer to the mesh which needs a name
\param instance When E_COLLADA_GEOMETRY_WRITING is not ECGI_PER_MESH then
several instances of the same mesh can be written and this counts them.
*/
virtual irr::core::stringc nameForMesh(const scene::IMesh* mesh, int instance) = 0;
//! Return a unique name for the given node
/** Note that names really must be unique here per node-pointer, so
mostly it's a good idea to return the nameForNode from
IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow
the xs:NCName standard to be valid, you can run them through
IColladaMeshWriter::toNCName to ensure that.
*/
virtual irr::core::stringc nameForNode(const scene::ISceneNode* node) = 0;
//! Return a name for the material
/** There is one material created in the writer for each unique name.
So you can use this to control the number of materials which get written.
For example Irrlicht does by default write one material for each material
instanced by a node. So if you know that in your application material
instances per node are identical between different nodes you can reduce
the number of exported materials using that knowledge by using identical
names for such shared materials.
Names must follow the xs:NCName standard to be valid, you can run them
through IColladaMeshWriter::toNCName to ensure that.
*/
virtual irr::core::stringc nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node) = 0;
};
//! Interface for writing meshes
class IColladaMeshWriter : public IMeshWriter
{
public:
IColladaMeshWriter()
: Properties(0), DefaultProperties(0), NameGenerator(0), DefaultNameGenerator(0)
, WriteTextures(true), WriteDefaultScene(true), ExportSMaterialOnce(true)
, AmbientLight(0.f, 0.f, 0.f, 1.f)
, UnitMeter(1.f), UnitName("meter")
, GeometryWriting(ECGI_PER_MESH)
{
ParamNamesUV[0] = "U";
ParamNamesUV[1] = "V";
}
//! Destructor
virtual ~IColladaMeshWriter()
{
if ( Properties )
Properties->drop();
if ( DefaultProperties )
DefaultProperties->drop();
if ( NameGenerator )
NameGenerator->drop();
if ( DefaultNameGenerator )
DefaultNameGenerator->drop();
}
//! writes a scene starting with the given node
//\param writeRoot: 0 = no, 1=yes unless root is scenemanager, 2=yes
virtual bool writeScene(io::IWriteFile* file, scene::ISceneNode* root, int writeRoot=1) = 0;
//! Set if texture information should be written
virtual void setWriteTextures(bool write)
{
WriteTextures = write;
}
//! Get if texture information should be written
virtual bool getWriteTextures() const
{
return WriteTextures;
}
//! Set if a default scene should be written when writing meshes.
/** Many collada readers fail to read a mesh if the collada files doesn't contain a scene as well.
The scene is doing an instantiation of the mesh.
When using writeScene this flag is ignored (as we have scene there already)
*/
virtual void setWriteDefaultScene(bool write)
{
WriteDefaultScene = write;
}
//! Get if a default scene should be written
virtual bool getWriteDefaultScene() const
{
return WriteDefaultScene;
}
//! Sets ambient color of the scene to write
virtual void setAmbientLight(const video::SColorf &ambientColor)
{
AmbientLight = ambientColor;
}
//! Return ambient light of the scene which is written
virtual video::SColorf getAmbientLight() const
{
return AmbientLight;
}
//! Set the unit distances for all elements and objects
/**
\param meter: Real-world meters to use per unit. Default 1 unit = 1 meter. For 1 unit = 1cm you would set to 0.01
\param name: Name to use for distance unit. Default is "meter". */
virtual void setUnit(irr::f32 meter, const irr::core::stringc& name)
{
UnitMeter = meter;
UnitName = name;
}
//! Return real world meters to use per unit for all elements and objects
virtual irr::f32 getUnitMeter() const
{
return UnitMeter;
}
//! Return name to use for distance units. Like p.E. "meter".
virtual irr::core::stringc getUnitName() const
{
return UnitName;
}
//! Control when and how often a mesh is written
/** Optimally ECGI_PER_MESH would be always sufficient - writing geometry once per mesh.
Unfortunately many tools (at the time of writing this nearly all of them) have trouble
on import when different materials are used per node. So when you override materials
per node and importing the resulting collada has materials problems in other tools try
using other values here.
\param writeStyle One of the E_COLLADA_GEOMETRY_WRITING settings.
*/
virtual void setGeometryWriting(E_COLLADA_GEOMETRY_WRITING writeStyle)
{
GeometryWriting = writeStyle;
}
//! Get the current style of geometry writing.
virtual E_COLLADA_GEOMETRY_WRITING getGeometryWriting() const
{
return GeometryWriting;
}
//! Make certain there is only one collada material generated per Irrlicht material
/** Checks before creating a collada material-name if an identical
irr:::video::SMaterial has been exported already. If so don't export it with
another name. This is set by default and leads to way smaller .dae files.
Note that if you need to disable this flag for some reason you can still
get a similar effect using the IColladaMeshWriterNames::nameForMaterial
by returning identical names for identical materials there.
*/
virtual void setExportSMaterialsOnlyOnce(bool exportOnce)
{
ExportSMaterialOnce = exportOnce;
}
virtual bool getExportSMaterialsOnlyOnce() const
{
return ExportSMaterialOnce;
}
//! Set properties to use by the meshwriter instead of it's default properties.
/** Overloading properties with an own class allows modifying the writing process in certain ways.
By default properties are set to the DefaultProperties. */
virtual void setProperties(IColladaMeshWriterProperties * p)
{
if ( p == Properties )
return;
if ( p )
p->grab();
if ( Properties )
Properties->drop();
Properties = p;
}
//! Get properties which are currently used.
virtual IColladaMeshWriterProperties * getProperties() const
{
return Properties;
}
//! Return the original default properties of the writer.
/** You can use this pointer in your own properties to access and return default values. */
IColladaMeshWriterProperties * getDefaultProperties() const
{
return DefaultProperties;
}
//! Install a generator to create custom names on export.
virtual void setNameGenerator(IColladaMeshWriterNames * nameGenerator)
{
if ( nameGenerator == NameGenerator )
return;
if ( nameGenerator )
nameGenerator->grab();
if ( NameGenerator )
NameGenerator->drop();
NameGenerator = nameGenerator;
}
//! Get currently used name generator
virtual IColladaMeshWriterNames * getNameGenerator() const
{
return NameGenerator;
}
//! Return the original default name generator of the writer.
/** You can use this pointer in your own generator to access and return default values. */
IColladaMeshWriterNames * getDefaultNameGenerator() const
{
return DefaultNameGenerator;
}
//! Restrict the characters of oldString a set of allowed characters in xs:NCName and add the prefix.
/** A tool function to help when using a custom name generator to generative valid names for collada names and id's. */
virtual irr::core::stringc toNCName(const irr::core::stringc& oldString, const irr::core::stringc& prefix=irr::core::stringc("_NC_")) const = 0;
//! After export you can find out which name had been used for writing the geometry for this node.
/** The name comes from IColladaMeshWriterNames::nameForMesh, but you can't access the node there.
\return Either a pointer to the name or NULL */
// TODO: Function is not const because there is no const getMesh() function for several Irrlicht nodes.
virtual const irr::core::stringc* findGeometryNameForNode(ISceneNode* node) = 0;
//! Change param name used for UV's.
/** Param names for UV's have a name. By default it's "U" and "V".
Usually it doesn't matter as names are optional in Collada anyway.
But unfortunately some tools insist on specific names.
So if "U", "V" does not work then try to export by setting this to "S", "T".
One tool which insists on "S", "T" is for example SketchUp.
*/
void SetParamNamesUV(const core::stringc& u, const core::stringc& v)
{
ParamNamesUV[0] = u;
ParamNamesUV[1] = v;
}
protected:
// NOTE: You usually should also call setProperties with the same parameter when using setDefaultProperties
virtual void setDefaultProperties(IColladaMeshWriterProperties * p)
{
if ( p == DefaultProperties )
return;
if ( p )
p->grab();
if ( DefaultProperties )
DefaultProperties->drop();
DefaultProperties = p;
}
// NOTE: You usually should also call setNameGenerator with the same parameter when using setDefaultProperties
virtual void setDefaultNameGenerator(IColladaMeshWriterNames * p)
{
if ( p == DefaultNameGenerator )
return;
if ( p )
p->grab();
if ( DefaultNameGenerator )
DefaultNameGenerator->drop();
DefaultNameGenerator = p;
}
protected:
irr::core::stringc ParamNamesUV[2];
private:
IColladaMeshWriterProperties * Properties;
IColladaMeshWriterProperties * DefaultProperties;
IColladaMeshWriterNames * NameGenerator;
IColladaMeshWriterNames * DefaultNameGenerator;
bool WriteTextures;
bool WriteDefaultScene;
bool ExportSMaterialOnce;
video::SColorf AmbientLight;
irr::f32 UnitMeter;
irr::core::stringc UnitName;
E_COLLADA_GEOMETRY_WRITING GeometryWriting;
};
} // end namespace
} // end namespace
#endif

@ -6,8 +6,6 @@
#define __I_FILE_SYSTEM_H_INCLUDED__ #define __I_FILE_SYSTEM_H_INCLUDED__
#include "IReferenceCounted.h" #include "IReferenceCounted.h"
#include "IXMLReader.h"
#include "IXMLWriter.h"
#include "IFileArchive.h" #include "IFileArchive.h"
namespace irr namespace irr
@ -318,70 +316,6 @@ public:
\return True if file exists, and false if it does not exist or an error occurred. */ \return True if file exists, and false if it does not exist or an error occurred. */
virtual bool existFile(const path& filename) const =0; virtual bool existFile(const path& filename) const =0;
//! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
/** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
more information on how to use the parser.
\return 0, if file could not be opened, otherwise a pointer to the created
IXMLReader is returned. After use, the reader
has to be deleted using its IXMLReader::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLReader* createXMLReader(const path& filename) =0;
//! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
/** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
more information on how to use the parser.
\return 0, if file could not be opened, otherwise a pointer to the created
IXMLReader is returned. After use, the reader
has to be deleted using its IXMLReader::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLReader* createXMLReader(IReadFile* file) =0;
//! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
/** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for
more information on how to use the parser.
\return 0, if file could not be opened, otherwise a pointer to the created
IXMLReader is returned. After use, the reader
has to be deleted using its IXMLReaderUTF8::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLReaderUTF8* createXMLReaderUTF8(const path& filename) =0;
//! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
/** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for
more information on how to use the parser.
\return 0, if file could not be opened, otherwise a pointer to the created
IXMLReader is returned. After use, the reader
has to be deleted using its IXMLReaderUTF8::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) =0;
//! Creates a XML Writer from a file which will write ASCII/UTF-8 characters (char*).
/** \return 0, if file could not be opened, otherwise a pointer to the created
IXMLWriter is returned. After use, the reader
has to be deleted using its IXMLWriter::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLWriterUTF8* createXMLWriterUTF8(const path& filename) =0;
//! Creates a XML Writer from a file which will write ASCII/UTF-8 characters (char*).
/** \return 0, if file could not be opened, otherwise a pointer to the created
IXMLWriter is returned. After use, the reader
has to be deleted using its IXMLWriter::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLWriterUTF8* createXMLWriterUTF8(IWriteFile* file) =0;
//! Creates a XML Writer from a file.
/** \return 0, if file could not be opened, otherwise a pointer to the created
IXMLWriter is returned. After use, the reader
has to be deleted using its IXMLWriter::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLWriter* createXMLWriter(const path& filename) =0;
//! Creates a XML Writer from a file.
/** \return 0, if file could not be opened, otherwise a pointer to the created
IXMLWriter is returned. After use, the reader
has to be deleted using its IXMLWriter::drop() method.
See IReferenceCounted::drop() for more information. */
virtual IXMLWriter* createXMLWriter(IWriteFile* file) =0;
//! Creates a new empty collection of attributes, usable for serialization and more. //! Creates a new empty collection of attributes, usable for serialization and more.
/** \param driver: Video driver to be used to load textures when specified as attribute values. /** \param driver: Video driver to be used to load textures when specified as attribute values.
Can be null to prevent automatic texture loading by attributes. Can be null to prevent automatic texture loading by attributes.

@ -11,8 +11,6 @@
#include "EMessageBoxFlags.h" #include "EMessageBoxFlags.h"
#include "EFocusFlags.h" #include "EFocusFlags.h"
#include "IEventReceiver.h" #include "IEventReceiver.h"
#include "IXMLReader.h"
#include "IXMLWriter.h"
#include "path.h" #include "path.h"
namespace irr namespace irr
@ -622,12 +620,6 @@ public:
//! Reads attributes of the gui environment //! Reads attributes of the gui environment
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)=0; virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)=0;
//! writes an element
virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* element) =0;
//! reads an element
virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* element) =0;
//! Find the next element which would be selected when pressing the tab-key //! Find the next element which would be selected when pressing the tab-key
/** If you set the focus for the result you can manually force focus-changes like they /** If you set the focus for the result you can manually force focus-changes like they
would happen otherwise by the tab-keys. would happen otherwise by the tab-keys.

@ -19,7 +19,6 @@
#include "SceneParameters.h" #include "SceneParameters.h"
#include "IGeometryCreator.h" #include "IGeometryCreator.h"
#include "ISkinnedMesh.h" #include "ISkinnedMesh.h"
#include "IXMLWriter.h"
namespace irr namespace irr
{ {
@ -199,37 +198,6 @@ namespace scene
* directly in Irrlicht. * directly in Irrlicht.
* </TR> * </TR>
* <TR> * <TR>
* <TD>COLLADA (.dae, .xml)</TD>
* <TD>COLLADA is an open Digital Asset Exchange Schema for
* the interactive 3D industry. There are exporters and
* importers for this format available for most of the
* big 3d packagesat http://collada.org. Irrlicht can
* import COLLADA files by using the
* ISceneManager::getMesh() method. COLLADA files need
* not contain only one single mesh but multiple meshes
* and a whole scene setup with lights, cameras and mesh
* instances, this loader can set up a scene as
* described by the COLLADA file instead of loading and
* returning one single mesh. By default, this loader
* behaves like the other loaders and does not create
* instances, but it can be switched into this mode by
* using
* SceneManager-&gt;getParameters()-&gt;setAttribute(COLLADA_CREATE_SCENE_INSTANCES, true);
* Created scene nodes will be named as the names of the
* nodes in the COLLADA file. The returned mesh is just
* a dummy object in this mode. Meshes included in the
* scene will be added into the scene manager with the
* following naming scheme:
* "path/to/file/file.dea#meshname". The loading of such
* meshes is logged. Currently, this loader is able to
* create meshes (made of only polygons), lights, and
* cameras. Materials and animations are currently not
* supported but this will change with future releases.
* </TD>
* </TR>
* <TR>
* <TD>Delgine DeleD (.dmf)</TD> * <TD>Delgine DeleD (.dmf)</TD>
* <TD>DeleD (delgine.com) is a 3D editor and level-editor * <TD>DeleD (delgine.com) is a 3D editor and level-editor
* combined into one and is specifically designed for 3D * combined into one and is specifically designed for 3D
@ -266,13 +234,6 @@ namespace scene
* by Fabio Concas and adapted by Thomas Alten.</TD> * by Fabio Concas and adapted by Thomas Alten.</TD>
* </TR> * </TR>
* <TR> * <TR>
* <TD>Irrlicht Mesh (.irrMesh)</TD>
* <TD>This is a static mesh format written in XML, native
* to Irrlicht and written by the irr mesh writer.
* This format is exported by the CopperCube engine's
* lightmapper.</TD>
* </TR>
* <TR>
* <TD>LightWave (.lwo)</TD> * <TD>LightWave (.lwo)</TD>
* <TD>Native to NewTek's LightWave 3D, the LWO format is well * <TD>Native to NewTek's LightWave 3D, the LWO format is well
* known and supported by many exporters. This loader will * known and supported by many exporters. This loader will
@ -1586,26 +1547,6 @@ namespace scene
\return True if successful. */ \return True if successful. */
virtual bool saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0; virtual bool saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0;
//! Saves the current scene into a file.
/** Scene nodes with the option isDebugObject set to true are
not being saved. The scene is usually written to an .irr file,
an xml based format. .irr files can Be edited with the Irrlicht
Engine Editor, irrEdit (http://www.ambiera.com/irredit/). To
load .irr files again, see ISceneManager::loadScene().
\param writer XMLWriter with which the scene is saved.
\param currentPath Path which is used for relative file names.
Usually the directory of the file written into.
\param userDataSerializer If you want to save some user data
for every scene node into the file, implement the
ISceneUserDataSerializer interface and provide it as parameter
here. Otherwise, simply specify 0 as this parameter.
\param node Node which is taken as the top node of the scene.
This node and all of its descendants are saved into the scene
file. Pass 0 or the scene manager to save the full scene (which
is also the default).
\return True if successful. */
virtual bool saveScene(io::IXMLWriter* writer, const io::path& currentPath, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0;
//! Loads a scene. Note that the current scene is not cleared before. //! Loads a scene. Note that the current scene is not cleared before.
/** The scene is usually loaded from an .irr file, an xml based /** The scene is usually loaded from an .irr file, an xml based
format, but other scene formats can be added to the engine via format, but other scene formats can be added to the engine via

@ -1,31 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_XML_READER_H_INCLUDED__
#define __I_XML_READER_H_INCLUDED__
#include "IReferenceCounted.h"
#include "irrXML.h"
namespace irr
{
namespace io
{
//! An xml reader for wide characters, derived from IReferenceCounted.
/** This XML Parser can read any type of text files from any source
Irrlicht can read. Just call IFileSystem::createXMLReader(). For more
information on how to use the parser, see IIrrXMLReader */
typedef IIrrXMLReader<wchar_t, IReferenceCounted> IXMLReader;
//! An xml reader for ASCII or UTF-8 characters, derived from IReferenceCounted.
/** This XML Parser can read any type of text files from any source
Irrlicht can read. Just call IFileSystem::createXMLReaderUTF8(). For
more information on how to use the parser, see IIrrXMLReader */
typedef IIrrXMLReader<c8, IReferenceCounted> IXMLReaderUTF8;
} // end namespace io
} // end namespace irr
#endif

@ -1,26 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_XML_WRITER_H_INCLUDED__
#define __I_XML_WRITER_H_INCLUDED__
#include "IReferenceCounted.h"
#include "irrXML.h"
namespace irr
{
namespace io
{
//! An xml writer for wide characters, derived from IReferenceCounted.
/** Call IFileSystem::createXMLReader(). to create an IXMLWriter */
typedef IIrrXMLWriter<wchar_t, IReferenceCounted> IXMLWriter;
//! An xml writer for ASCII or UTF-8 characters, derived from IReferenceCounted.
/** Call IFileSystem::createXMLReaderUtf8(). to create an IXMLWriter */
typedef IIrrXMLWriter<c8, IReferenceCounted> IXMLWriterUTF8;
} // end namespace io
} // end namespace irr
#endif

@ -151,12 +151,6 @@
//! Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht. //! Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht.
#define _IRR_MATERIAL_MAX_TEXTURES_ 8 #define _IRR_MATERIAL_MAX_TEXTURES_ 8
//! Whether to support XML and XML-based formats (irrmesh, collada...)
#define _IRR_COMPILE_WITH_XML_
#ifdef NO_IRR_COMPILE_WITH_XML_
#undef _IRR_COMPILE_WITH_XML_
#endif
//! Add a leak-hunter to Irrlicht which helps finding unreleased reference counted objects. //! Add a leak-hunter to Irrlicht which helps finding unreleased reference counted objects.
//! NOTE: This is slow and should only be used for debugging //! NOTE: This is slow and should only be used for debugging
//#define _IRR_COMPILE_WITH_LEAK_HUNTER_ //#define _IRR_COMPILE_WITH_LEAK_HUNTER_
@ -532,11 +526,6 @@ B3D, MS3D or X meshes */
#endif #endif
#endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ #endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
//! Define _IRR_COMPILE_WITH_IRR_MESH_LOADER_ if you want to load Irrlicht Engine .irrmesh files
#define _IRR_COMPILE_WITH_IRR_MESH_LOADER_
#ifdef NO_IRR_COMPILE_WITH_IRR_MESH_LOADER_
#undef _IRR_COMPILE_WITH_IRR_MESH_LOADER_
#endif
//! Define _IRR_COMPILE_WITH_HALFLIFE_LOADER_ if you want to load Halflife animated files //! Define _IRR_COMPILE_WITH_HALFLIFE_LOADER_ if you want to load Halflife animated files
#define _IRR_COMPILE_WITH_HALFLIFE_LOADER_ #define _IRR_COMPILE_WITH_HALFLIFE_LOADER_
#ifdef NO_IRR_COMPILE_WITH_HALFLIFE_LOADER_ #ifdef NO_IRR_COMPILE_WITH_HALFLIFE_LOADER_
@ -557,11 +546,6 @@ B3D, MS3D or X meshes */
#ifdef NO_IRR_COMPILE_WITH_3DS_LOADER_ #ifdef NO_IRR_COMPILE_WITH_3DS_LOADER_
#undef _IRR_COMPILE_WITH_3DS_LOADER_ #undef _IRR_COMPILE_WITH_3DS_LOADER_
#endif #endif
//! Define _IRR_COMPILE_WITH_COLLADA_LOADER_ if you want to load Collada files
#define _IRR_COMPILE_WITH_COLLADA_LOADER_
#ifdef NO_IRR_COMPILE_WITH_COLLADA_LOADER_
#undef _IRR_COMPILE_WITH_COLLADA_LOADER_
#endif
//! Define _IRR_COMPILE_WITH_CSM_LOADER_ if you want to load Cartography Shop files //! Define _IRR_COMPILE_WITH_CSM_LOADER_ if you want to load Cartography Shop files
#define _IRR_COMPILE_WITH_CSM_LOADER_ #define _IRR_COMPILE_WITH_CSM_LOADER_
#ifdef NO_IRR_COMPILE_WITH_CSM_LOADER_ #ifdef NO_IRR_COMPILE_WITH_CSM_LOADER_
@ -618,16 +602,6 @@ B3D, MS3D or X meshes */
#undef _IRR_COMPILE_WITH_SMF_LOADER_ #undef _IRR_COMPILE_WITH_SMF_LOADER_
#endif #endif
//! Define _IRR_COMPILE_WITH_IRR_WRITER_ if you want to write static .irrMesh files
#define _IRR_COMPILE_WITH_IRR_WRITER_
#ifdef NO_IRR_COMPILE_WITH_IRR_WRITER_
#undef _IRR_COMPILE_WITH_IRR_WRITER_
#endif
//! Define _IRR_COMPILE_WITH_COLLADA_WRITER_ if you want to write Collada files
#define _IRR_COMPILE_WITH_COLLADA_WRITER_
#ifdef NO_IRR_COMPILE_WITH_COLLADA_WRITER_
#undef _IRR_COMPILE_WITH_COLLADA_WRITER_
#endif
//! Define _IRR_COMPILE_WITH_STL_WRITER_ if you want to write .stl files //! Define _IRR_COMPILE_WITH_STL_WRITER_ if you want to write .stl files
#define _IRR_COMPILE_WITH_STL_WRITER_ #define _IRR_COMPILE_WITH_STL_WRITER_
#ifdef NO_IRR_COMPILE_WITH_STL_WRITER_ #ifdef NO_IRR_COMPILE_WITH_STL_WRITER_
@ -866,14 +840,6 @@ precision will be lower but speed higher. currently X86 only
#undef __IRR_HAS_S64 #undef __IRR_HAS_S64
#endif #endif
// These depend on XML
#ifndef _IRR_COMPILE_WITH_XML_
#undef _IRR_COMPILE_WITH_IRR_MESH_LOADER_
#undef _IRR_COMPILE_WITH_IRR_WRITER_
#undef _IRR_COMPILE_WITH_COLLADA_WRITER_
#undef _IRR_COMPILE_WITH_COLLADA_LOADER_
#endif
#if defined(__BORLANDC__) #if defined(__BORLANDC__)
#include <tchar.h> #include <tchar.h>

@ -1,645 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h
#ifndef __IRR_XML_H_INCLUDED__
#define __IRR_XML_H_INCLUDED__
#include <stdio.h>
#include "IrrCompileConfig.h"
#include "irrArray.h"
#include "irrString.h"
/** \mainpage irrXML 1.2 API documentation
<div align="center"><img src="logobig.png" ></div>
\section intro Introduction
Welcome to the irrXML API documentation.
Here you'll find any information you'll need to develop applications with
irrXML. If you look for a tutorial on how to start, take a look at the \ref irrxmlexample,
at the homepage of irrXML at <A HREF="http://www.ambiera.com/irrxml/">www.ambiera.com/irrxml/</A>
or into the SDK in the directory example.
irrXML is intended to be a high speed and easy-to-use XML Parser for C++, and
this documentation is an important part of it. If you have any questions or
suggestions, just send a email to the author of the engine, Nikolaus Gebhardt
(niko (at) irrlicht3d.org). For more information about this parser, see \ref history.
\section features Features
irrXML provides forward-only, read-only
access to a stream of non validated XML data. It was fully implemented by
Nikolaus Gebhardt. Its current features are:
- It it fast as lighting and has very low memory usage. It was
developed with the intention of being used in 3D games, as it already has been.
- irrXML is very small: It only consists of 60 KB of code and can be added easily
to your existing project.
- Of course, it is platform independent and works with lots of compilers.
- It is able to parse ASCII, UTF-8, UTF-16 and UTF-32 text files, both in
little and big endian format.
- Independent of the input file format, the parser can return all strings in ASCII, UTF-8,
UTF-16 and UTF-32 format.
- With its optional file access abstraction it has the advantage that it can read not
only from files but from any type of data (memory, network, ...). For example when
used with the Irrlicht Engine, it directly reads from compressed .zip files.
- Just like the Irrlicht Engine for which it was originally created, it is extremely easy
to use.
- It has no external dependencies, it does not even need the STL.
Although irrXML has some strengths, it currently also has the following limitations:
- The input xml file is not validated and assumed to be correct.
\section irrxmlexample Example
The following code demonstrates the basic usage of irrXML. A simple xml
file like this is parsed:
\code
<?xml version="1.0"?>
<config>
<!-- This is a config file for the mesh viewer -->
<model file="dwarf.dea" />
<messageText caption="Irrlicht Engine Mesh Viewer">
Welcome to the Mesh Viewer of the &quot;Irrlicht Engine&quot;.
</messageText>
</config>
\endcode
The code for parsing this file would look like this:
\code
#include <irrXML.h>
using namespace irr; // irrXML is located in the namespace irr::io
using namespace io;
#include <string> // we use STL strings to store data in this example
void main()
{
// create the reader using one of the factory functions
IrrXMLReader* xml = createIrrXMLReader("config.xml");
// strings for storing the data we want to get out of the file
std::string modelFile;
std::string messageText;
std::string caption;
// parse the file until end reached
while(xml && xml->read())
{
switch(xml->getNodeType())
{
case EXN_TEXT:
// in this xml file, the only text which occurs is the messageText
messageText = xml->getNodeData();
break;
case EXN_ELEMENT:
{
if (!strcmp("model", xml->getNodeName()))
modelFile = xml->getAttributeValue("file");
else
if (!strcmp("messageText", xml->getNodeName()))
caption = xml->getAttributeValue("caption");
}
break;
}
}
// delete the xml parser after usage
delete xml;
}
\endcode
\section howto How to use
Simply add the source files in the /src directory of irrXML to your project. Done.
\section license License
The irrXML license is based on the zlib license. Basically, this means you can do with
irrXML whatever you want:
Copyright (C) 2002-2012 Nikolaus Gebhardt
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
\section history History
As lots of references in this documentation and the source show, this xml
parser has originally been a part of the
<A HREF="http://irrlicht.sourceforge.net" >Irrlicht Engine</A>. But because
the parser has become very useful with the latest release, people asked for a
separate version of it, to be able to use it in non Irrlicht projects. With
irrXML 1.0, this has now been done.
*/
namespace irr
{
namespace io
{
//! Enumeration of all supported source text file formats
enum ETEXT_FORMAT
{
//! ASCII, file without byte order mark, or not a text file
ETF_ASCII,
//! UTF-8 format
ETF_UTF8,
//! UTF-16 format, big endian
ETF_UTF16_BE,
//! UTF-16 format, little endian
ETF_UTF16_LE,
//! UTF-32 format, big endian
ETF_UTF32_BE,
//! UTF-32 format, little endian
ETF_UTF32_LE
};
//! Enumeration for all xml nodes which are parsed by IrrXMLReader
enum EXML_NODE
{
//! No xml node. This is usually the node if you did not read anything yet.
EXN_NONE,
//! An xml element such as &lt;foo&gt;
EXN_ELEMENT,
//! End of an xml element such as &lt;/foo&gt;
EXN_ELEMENT_END,
//! Text within an xml element: &lt;foo&gt; this is the text. &lt;/foo&gt;
//! Also text between 2 xml elements: &lt;/foo&gt; this is the text. &lt;foo&gt;
EXN_TEXT,
//! An xml comment like &lt;!-- I am a comment --&gt; or a DTD definition.
EXN_COMMENT,
//! An xml cdata section like &lt;![CDATA[ this is some CDATA ]]&gt;
EXN_CDATA,
//! Unknown element.
EXN_UNKNOWN
};
//! Callback class for file read abstraction.
/** With this, it is possible to make the xml parser read in other
things than just files. The Irrlicht engine is using this for example to
read xml from compressed .zip files. To make the parser read in
any other data, derive a class from this interface, implement the
two methods to read your data and give a pointer to an instance of
your implementation when calling createIrrXMLReader(),
createIrrXMLReaderUTF16() or createIrrXMLReaderUTF32() */
class IFileReadCallBack
{
public:
//! Destructor
virtual ~IFileReadCallBack() {}
//! Reads an amount of bytes from the file.
/** \param buffer: Pointer to buffer where to read bytes will be written to.
\param sizeToRead: Amount of bytes to read from the file.
\return Returns how much bytes were read. */
virtual int read(void* buffer, int sizeToRead) = 0;
//! Returns size of file in bytes on success or -1L on failure.
virtual long getSize() const = 0;
};
//! Empty class to be used as parent class for IrrXMLReader.
/** If you need another class as base class for the xml reader, you can do this by creating
the reader using for example new CXMLReaderImpl<char, YourBaseClass>(yourcallback);
The Irrlicht Engine for example needs IReferenceCounted as base class for every object to
let it automatically reference counted, hence it replaces IXMLBase with IReferenceCounted.
See irrXML.cpp on how this can be done in detail. */
class IXMLBase
{
};
//! Interface providing easy read access to a XML file.
/** You can create an instance of this reader using one of the factory functions
createIrrXMLReader(), createIrrXMLReaderUTF16() and createIrrXMLReaderUTF32().
If using the parser from the Irrlicht Engine, please use IFileSystem::createXMLReader()
instead.
For a detailed intro how to use the parser, see \ref irrxmlexample and \ref features.
The typical usage of this parser looks like this:
\code
#include <irrXML.h>
using namespace irr; // irrXML is located in the namespace irr::io
using namespace io;
void main()
{
// create the reader using one of the factory functions
IrrXMLReader* xml = createIrrXMLReader("config.xml");
if (xml == 0)
return; // file could not be opened
// parse the file until end reached
while(xml->read())
{
// based on xml->getNodeType(), do something.
}
// delete the xml parser after usage
delete xml;
}
\endcode
See \ref irrxmlexample for a more detailed example.
*/
template<class char_type, class super_class>
class IIrrXMLReader : public super_class
{
public:
//! Destructor
virtual ~IIrrXMLReader() {}
//! Reads forward to the next xml node.
/** \return Returns false, if there was no further node. */
virtual bool read() = 0;
//! Returns the type of the current XML node.
virtual EXML_NODE getNodeType() const = 0;
//! Returns attribute count of the current XML node.
/** This is usually
non null if the current node is EXN_ELEMENT, and the element has attributes.
\return Returns amount of attributes of this xml node. */
virtual unsigned int getAttributeCount() const = 0;
//! Returns name of an attribute.
/** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
\return Name of the attribute, 0 if an attribute with this index does not exist. */
virtual const char_type* getAttributeName(int idx) const = 0;
//! Returns the value of an attribute.
/** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
\return Value of the attribute, 0 if an attribute with this index does not exist. */
virtual const char_type* getAttributeValue(int idx) const = 0;
//! Returns the value of an attribute.
/** \param name: Name of the attribute.
\return Value of the attribute, 0 if an attribute with this name does not exist. */
virtual const char_type* getAttributeValue(const char_type* name) const = 0;
//! Returns the value of an attribute in a safe way.
/** Like getAttributeValue(), but does not
return 0 if the attribute does not exist. An empty string ("") is returned then.
\param name: Name of the attribute.
\return Value of the attribute, and "" if an attribute with this name does not exist */
virtual const char_type* getAttributeValueSafe(const char_type* name) const = 0;
//! Returns the value of an attribute as integer.
/** \param name Name of the attribute.
\param defaultNotFound Value returned when name does not exist
\return Value of the attribute as integer or value of defaultNotFound
when name was not found or 0 when value could not be interpreted as integer */
virtual int getAttributeValueAsInt(const char_type* name, int defaultNotFound=0) const = 0;
//! Returns the value of an attribute as integer.
/** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
\param defaultNotFound Value returned when index does not exist.
\return Value of the attribute as integer or value of defaultNotFound parameter for invalid index
or 0 when value could not be interpreted as integer */
virtual int getAttributeValueAsInt(int idx, int defaultNotFound=0) const = 0;
//! Returns the value of an attribute as float.
/** \param name: Name of the attribute.
\param defaultNotFound Value returned when name does not exist.
\return Value of the attribute as float or value of defaultNotFound parameter on failure
or 0 when value could not be interpreted as float. */
virtual float getAttributeValueAsFloat(const char_type* name, float defaultNotFound=0.f) const = 0;
//! Returns the value of an attribute as float.
/** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
\param defaultNotFound Value returned when index does not exist.
\return Value of the attribute as float or value of defaultNotFound parameter on failure
or 0 when value could not be interpreted as float. */
virtual float getAttributeValueAsFloat(int idx, float defaultNotFound=0.f) const = 0;
//! Returns the name of the current node.
/** Only valid, if the node type is EXN_ELEMENT.
\return Name of the current node or 0 if the node has no name. */
virtual const char_type* getNodeName() const = 0;
//! Returns data of the current node.
/** Only valid if the node has some
data and it is of type EXN_TEXT, EXN_COMMENT, EXN_CDATA or EXN_UNKNOWN. */
virtual const char_type* getNodeData() const = 0;
//! Returns if an element is an empty element, like &lt;foo />
virtual bool isEmptyElement() const = 0;
//! Returns format of the source xml file.
/** It is not necessary to use
this method because the parser will convert the input file format
to the format wanted by the user when creating the parser. This
method is useful to get/display additional information. */
virtual ETEXT_FORMAT getSourceFormat() const = 0;
//! Returns format of the strings returned by the parser.
/** This will be UTF8 for example when you created a parser with
IrrXMLReaderUTF8() and UTF32 when it has been created using
IrrXMLReaderUTF32. It should not be necessary to call this
method and only exists for informational purposes. */
virtual ETEXT_FORMAT getParserFormat() const = 0;
};
//! Interface providing methods for making it easier to write XML files.
template<class char_type, class super_class>
class IIrrXMLWriter : public super_class
{
public:
//! Destructor
virtual ~IIrrXMLWriter() {}
//! Writes an xml 1.0 header.
/** Looks like &lt;?xml version="1.0"?&gt;. This should always
be called before writing anything other, because also the text
file header for Unicode texts is written out with this method. */
virtual void writeXMLHeader() = 0;
//! Writes an xml element with maximal 5 attributes like "<foo />" or
//! &lt;foo optAttr="value" /&gt;.
/** The element can be empty or not.
\param name: Name of the element
\param empty: Specifies if the element should be empty. Like
"<foo />". If You set this to false, something like this is
written instead: "<foo>".
\param attr1Name: 1st attributes name
\param attr1Value: 1st attributes value
\param attr2Name: 2nd attributes name
\param attr2Value: 2nd attributes value
\param attr3Name: 3rd attributes name
\param attr3Value: 3rd attributes value
\param attr4Name: 4th attributes name
\param attr4Value: 4th attributes value
\param attr5Name: 5th attributes name
\param attr5Value: 5th attributes value */
virtual void writeElement(const char_type* name, bool empty=false,
const char_type* attr1Name = 0, const char_type* attr1Value = 0,
const char_type* attr2Name = 0, const char_type* attr2Value = 0,
const char_type* attr3Name = 0, const char_type* attr3Value = 0,
const char_type* attr4Name = 0, const char_type* attr4Value = 0,
const char_type* attr5Name = 0, const char_type* attr5Value = 0) = 0;
//! Writes an xml element with any number of attributes
virtual void writeElement(const char_type* name, bool empty,
core::array<core::string<char_type> > &names, core::array<core::string<char_type> > &values) = 0;
//! Writes a comment into the xml file
virtual void writeComment(const char_type* comment) = 0;
//! Writes the closing tag for an element. Like "</foo>"
virtual void writeClosingTag(const char_type* name) = 0;
//! Writes a text into the file.
/** All occurrences of special characters such as
& (&amp;), < (&lt;), > (&gt;), and " (&quot;) are automatically
replaced. */
virtual void writeText(const char_type* text) = 0;
//! Writes a line break
virtual void writeLineBreak() = 0;
};
template <typename T>
struct xmlChar
{
T c;
xmlChar<T>() {}
xmlChar<T>(char in) : c(static_cast<T>(in)) {}
xmlChar<T>(wchar_t in) : c(static_cast<T>(in)) {}
#if defined(__BORLANDC__)
// Note - removing explicit for Borland was to get it to even compile.
// There haven't been any kind of tests for that besides that.
xmlChar<T>(unsigned char in) : c(static_cast<T>(in)) {}
xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {}
xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {}
xmlChar<T>(unsigned long in) : c(static_cast<T>(in)) {}
#else
explicit xmlChar<T>(unsigned char in) : c(static_cast<T>(in)) {}
#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) // VS compiling without native wchar_t can't have it
explicit xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {}
#endif
explicit xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {}
explicit xmlChar<T>(unsigned long in) : c(static_cast<T>(in)) {}
#endif
operator T() const { return c; }
void operator=(int t) { c=static_cast<T>(t); }
};
//! defines the utf-16 type.
/** Not using wchar_t for this because
wchar_t has 16 bit on windows and 32 bit on other operating systems. */
typedef xmlChar<unsigned short> char16;
//! defines the utf-32 type.
/** Not using wchar_t for this because
wchar_t has 16 bit on windows and 32 bit on other operating systems. */
typedef xmlChar<unsigned int> char32;
//! A UTF-8 or ASCII character xml parser.
/** This means that all character data will be returned in 8 bit ASCII or UTF-8 by this parser.
The file to read can be in any format, it will be converted to UTF-8 if it is not
in this format.
Create an instance of this with createIrrXMLReader();
See IIrrXMLReader for description on how to use it. */
typedef IIrrXMLReader<char, IXMLBase> IrrXMLReader;
//! A UTF-16 xml parser.
/** This means that all character data will be returned in UTF-16 by this parser.
The file to read can be in any format, it will be converted to UTF-16 if it is not
in this format.
Create an instance of this with createIrrXMLReaderUTF16();
See IIrrXMLReader for description on how to use it. */
typedef IIrrXMLReader<char16, IXMLBase> IrrXMLReaderUTF16;
//! A UTF-32 xml parser.
/** This means that all character data will be returned in UTF-32 by this parser.
The file to read can be in any format, it will be converted to UTF-32 if it is not
in this format.
Create an instance of this with createIrrXMLReaderUTF32();
See IIrrXMLReader for description on how to use it. */
typedef IIrrXMLReader<char32, IXMLBase> IrrXMLReaderUTF32;
#ifdef _IRR_COMPILE_WITH_XML_
//! Creates an instance of an UFT-8 or ASCII character xml parser.
/** This means that all character data will be returned in 8 bit ASCII or UTF-8.
The file to read can be in any format, it will be converted to UTF-8 if it is not in this format.
If you are using the Irrlicht Engine, it is better not to use this function but
IFileSystem::createXMLReaderUTF8() instead.
\param filename: Name of file to be opened.
\return Returns a pointer to the created xml parser. This pointer should be
deleted using 'delete' after no longer needed. Returns 0 if an error occurred
and the file could not be opened. */
IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(const char* filename);
//! Creates an instance of an UFT-8 or ASCII character xml parser.
/** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can
be in any format, it will be converted to UTF-8 if it is not in this format.
If you are using the Irrlicht Engine, it is better not to use this function but
IFileSystem::createXMLReaderUTF8() instead.
\param file: Pointer to opened file, must have been opened in binary mode, e.g.
using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
\return Returns a pointer to the created xml parser. This pointer should be
deleted using 'delete' after no longer needed. Returns 0 if an error occurred
and the file could not be opened. */
IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(FILE* file);
//! Creates an instance of an UFT-8 or ASCII character xml parser.
/** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can
be in any format, it will be converted to UTF-8 if it is not in this format.
If you are using the Irrlicht Engine, it is better not to use this function but
IFileSystem::createXMLReaderUTF8() instead.
\param callback: Callback for file read abstraction. Implement your own
callback to make the xml parser read in other things than just files. See
IFileReadCallBack for more information about this.
\param deleteCallback: if true, the callback will be deleted after the file
has been read. Otherwise the caller is responsible for cleaning it up.
\return Returns a pointer to the created xml parser. This pointer should be
deleted using 'delete' after no longer needed. Returns 0 if an error occurred
and the file could not be opened. */
IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(IFileReadCallBack* callback,
bool deleteCallback = false);
//! Creates an instance of an UFT-16 xml parser.
/** This means that
all character data will be returned in UTF-16. The file to read can
be in any format, it will be converted to UTF-16 if it is not in this format.
If you are using the Irrlicht Engine, it is better not to use this function but
IFileSystem::createXMLReader() instead.
\param filename: Name of file to be opened.
\return Returns a pointer to the created xml parser. This pointer should be
deleted using 'delete' after no longer needed. Returns 0 if an error occurred
and the file could not be opened. */
IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(const char* filename);
//! Creates an instance of an UFT-16 xml parser.
/** This means that all character data will be returned in UTF-16. The file to read can
be in any format, it will be converted to UTF-16 if it is not in this format.
If you are using the Irrlicht Engine, it is better not to use this function but
IFileSystem::createXMLReader() instead.
\param file: Pointer to opened file, must have been opened in binary mode, e.g.
using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
\return Returns a pointer to the created xml parser. This pointer should be
deleted using 'delete' after no longer needed. Returns 0 if an error occurred
and the file could not be opened. */
IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(FILE* file);
//! Creates an instance of an UFT-16 xml parser.
/** This means that all character data will be returned in UTF-16. The file to read can
be in any format, it will be converted to UTF-16 if it is not in this format.
If you are using the Irrlicht Engine, it is better not to use this function but
IFileSystem::createXMLReader() instead.
\param callback: Callback for file read abstraction. Implement your own
callback to make the xml parser read in other things than just files. See
IFileReadCallBack for more information about this.
\param deleteCallback: if true, the callback will be deleted after the file
has been read. Otherwise the caller is responsible for cleaning it up.
\return Returns a pointer to the created xml parser. This pointer should be
deleted using 'delete' after no longer needed. Returns 0 if an error occurred
and the file could not be opened. */
IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(IFileReadCallBack* callback,
bool deleteCallback = false);
//! Creates an instance of an UFT-32 xml parser.
/** This means that all character data will be returned in UTF-32. The file to read can
be in any format, it will be converted to UTF-32 if it is not in this format.
If you are using the Irrlicht Engine, it is better not to use this function but
IFileSystem::createXMLReader() instead.
\param filename: Name of file to be opened.
\return Returns a pointer to the created xml parser. This pointer should be
deleted using 'delete' after no longer needed. Returns 0 if an error occurred
and the file could not be opened. */
IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(const char* filename);
//! Creates an instance of an UFT-32 xml parser.
/** This means that all character data will be returned in UTF-32. The file to read can
be in any format, it will be converted to UTF-32 if it is not in this format.
if you are using the Irrlicht Engine, it is better not to use this function but
IFileSystem::createXMLReader() instead.
\param file: Pointer to opened file, must have been opened in binary mode, e.g.
using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
\return Returns a pointer to the created xml parser. This pointer should be
deleted using 'delete' after no longer needed. Returns 0 if an error occurred
and the file could not be opened. */
IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(FILE* file);
//! Creates an instance of an UFT-32 xml parser.
/** This means that
all character data will be returned in UTF-32. The file to read can
be in any format, it will be converted to UTF-32 if it is not in this format.
If you are using the Irrlicht Engine, it is better not to use this function but
IFileSystem::createXMLReader() instead.
\param callback: Callback for file read abstraction. Implement your own
callback to make the xml parser read in other things than just files. See
IFileReadCallBack for more information about this.
\param deleteCallback: if true, the callback will be deleted after the file
has been read. Otherwise the caller is responsible for cleaning it up.
\return Returns a pointer to the created xml parser. This pointer should be
deleted using 'delete' after no longer needed. Returns 0 if an error occurred
and the file could not be opened. */
IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(IFileReadCallBack* callback,
bool deleteCallback = false);
#endif // _IRR_COMPILE_WITH_XML_
/*! \file irrXML.h
\brief Header file of the irrXML, the Irrlicht XML parser.
This file includes everything needed for using irrXML,
the XML parser of the Irrlicht Engine. To use irrXML,
you only need to include this file in your project:
\code
#include <irrXML.h>
\endcode
It is also common to use the two namespaces in which irrXML is included,
directly after including irrXML.h:
\code
#include <irrXML.h>
using namespace irr;
using namespace io;
\endcode
*/
} // end namespace io
} // end namespace irr
#endif // __IRR_XML_H_INCLUDED__

@ -116,7 +116,6 @@
#include "IMeshSceneNode.h" #include "IMeshSceneNode.h"
#include "IMeshWriter.h" #include "IMeshWriter.h"
#include "IOctreeSceneNode.h" #include "IOctreeSceneNode.h"
#include "IColladaMeshWriter.h"
#include "IMetaTriangleSelector.h" #include "IMetaTriangleSelector.h"
#include "IOSOperator.h" #include "IOSOperator.h"
#include "IParticleSystemSceneNode.h" // also includes all emitters and attractors #include "IParticleSystemSceneNode.h" // also includes all emitters and attractors
@ -134,7 +133,6 @@
#include "irrString.h" #include "irrString.h"
#include "irrTypes.h" #include "irrTypes.h"
#include "path.h" #include "path.h"
#include "irrXML.h"
#include "ISceneCollisionManager.h" #include "ISceneCollisionManager.h"
#include "ISceneLoader.h" #include "ISceneLoader.h"
#include "ISceneManager.h" #include "ISceneManager.h"
@ -159,8 +157,6 @@
#include "IVideoModeList.h" #include "IVideoModeList.h"
#include "IVolumeLightSceneNode.h" #include "IVolumeLightSceneNode.h"
#include "IWriteFile.h" #include "IWriteFile.h"
#include "IXMLReader.h"
#include "IXMLWriter.h"
#include "ILightManager.h" #include "ILightManager.h"
#include "Keycodes.h" #include "Keycodes.h"
#include "line2d.h" #include "line2d.h"
@ -375,7 +371,7 @@ namespace irr
{ {
} }
//! This namespace provides interfaces for input/output: Reading and writing files, accessing zip archives, xml files, ... //! This namespace provides interfaces for input/output: Reading and writing files, accessing zip archives, ...
namespace io namespace io
{ {
} }

@ -5,13 +5,8 @@
#include "CAttributes.h" #include "CAttributes.h"
#include "CAttributeImpl.h" #include "CAttributeImpl.h"
#include "ITexture.h" #include "ITexture.h"
#include "IXMLWriter.h"
#include "IVideoDriver.h" #include "IVideoDriver.h"
#ifndef _IRR_COMPILE_WITH_XML_
#include "CXMLReader.h" // for noXML
#endif
namespace irr namespace irr
{ {
namespace io namespace io
@ -1381,278 +1376,6 @@ void CAttributes::setAttribute(s32 index, void* userPointer)
} }
//! Reads attributes from a xml file.
//! \param readCurrentElementOnly: If set to true, reading only works if current element has the name 'attributes'.
//! IF set to false, the first appearing list attributes are read.
bool CAttributes::read(io::IXMLReader* reader, bool readCurrentElementOnly,
const wchar_t* nonDefaultElementName)
{
#ifdef _IRR_COMPILE_WITH_XML_
if (!reader)
return false;
clear();
core::stringw elementName = L"attributes";
if (nonDefaultElementName)
elementName = nonDefaultElementName;
if (readCurrentElementOnly)
{
if (elementName != reader->getNodeName())
return false;
}
while(reader->read())
{
switch(reader->getNodeType())
{
case io::EXN_ELEMENT:
readAttributeFromXML(reader);
break;
case io::EXN_ELEMENT_END:
if (elementName == reader->getNodeName())
return true;
break;
default:
break;
}
}
return true;
#else
noXML();
return false;
#endif
}
void CAttributes::readAttributeFromXML(const io::IXMLReader* reader)
{
#ifdef _IRR_COMPILE_WITH_XML_
core::stringw element = reader->getNodeName();
core::stringc name = reader->getAttributeValue(L"name");
if (element == L"enum")
{
addEnum(name.c_str(), 0, 0);
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"binary")
{
addBinary(name.c_str(), 0, 0);
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"color")
{
addColor(name.c_str(), video::SColor());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"colorf")
{
addColorf(name.c_str(), video::SColorf());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"float")
{
addFloat(name.c_str(), 0);
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"int")
{
addInt(name.c_str(), 0);
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"bool")
{
addBool(name.c_str(), 0);
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"string")
{
addString(name.c_str(), L"");
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"texture")
{
addTexture(name.c_str(), 0);
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"vector3d")
{
addVector3d(name.c_str(), core::vector3df());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"vector2d")
{
addVector2d(name.c_str(), core::vector2df());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"position")
{
addPosition2d(name.c_str(), core::position2di());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"rect")
{
addRect(name.c_str(), core::rect<s32>());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"matrix")
{
addMatrix(name.c_str(), core::matrix4());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"quaternion")
{
addQuaternion(name.c_str(), core::quaternion());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"box3d")
{
addBox3d(name.c_str(), core::aabbox3df());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"plane")
{
addPlane3d(name.c_str(), core::plane3df());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"triangle")
{
addTriangle3d(name.c_str(), core::triangle3df());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"line2d")
{
addLine2d(name.c_str(), core::line2df());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"line3d")
{
addLine3d(name.c_str(), core::line3df());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
else
if (element == L"stringwarray")
{
core::array<core::stringw> tmpArray;
const s32 count = reader->getAttributeValueAsInt(L"count");
s32 n=0;
const core::stringw tmpName(L"value");
for (; n<count; ++n)
{
tmpArray.push_back(reader->getAttributeValue((tmpName+core::stringw(n)).c_str()));
}
addArray(name.c_str(),tmpArray);
}
else
if (element == L"userPointer")
{
// It's debatable if a pointer should be set or not, but it's more likely that adding it now would wreck user-applications.
// Also it probably doesn't makes sense setting this to a value when it comes from file.
}
else
if (element == L"dimension2d")
{
addDimension2d(name.c_str(), core::dimension2d<u32>());
Attributes.getLast()->setString(reader->getAttributeValue(L"value"));
}
#else
noXML();
#endif
}
//! Write these attributes into a xml file
bool CAttributes::write(io::IXMLWriter* writer, bool writeXMLHeader,
const wchar_t* nonDefaultElementName)
{
#ifdef _IRR_COMPILE_WITH_XML_
if (!writer)
return false;
if (writeXMLHeader)
writer->writeXMLHeader();
core::stringw elementName = L"attributes";
if (nonDefaultElementName)
elementName = nonDefaultElementName;
writer->writeElement(elementName.c_str(), false);
writer->writeLineBreak();
s32 i=0;
for (; i<(s32)Attributes.size(); ++i)
{
if ( Attributes[i]->getType() == EAT_STRINGWARRAY )
{
core::array<core::stringw> arraynames, arrayvalues;
core::array<core::stringw> arrayinput = Attributes[i]->getArray();
// build arrays
// name
arraynames.push_back(core::stringw(L"name"));
arrayvalues.push_back(core::stringw(Attributes[i]->Name.c_str()) );
// count
arraynames.push_back(core::stringw(L"count"));
arrayvalues.push_back(core::stringw((s32)arrayinput.size()));
// array...
u32 n=0;
const core::stringw tmpName(L"value");
for (; n < arrayinput.size(); ++n)
{
arraynames.push_back((tmpName+core::stringw(n)).c_str());
arrayvalues.push_back(arrayinput[n]);
}
// write them
writer->writeElement( Attributes[i]->getTypeString(), true, arraynames, arrayvalues);
}
else
{
writer->writeElement(
Attributes[i]->getTypeString(), true,
L"name", core::stringw(Attributes[i]->Name.c_str()).c_str(),
L"value", Attributes[i]->getStringW().c_str() );
}
writer->writeLineBreak();
}
writer->writeClosingTag(elementName.c_str());
writer->writeLineBreak();
return true;
#else
noXML();
return false;
#endif
}
} // end namespace io } // end namespace io
} // end namespace irr } // end namespace irr

@ -62,15 +62,6 @@ public:
//! Removes all attributes //! Removes all attributes
virtual void clear() _IRR_OVERRIDE_; virtual void clear() _IRR_OVERRIDE_;
//! Reads attributes from a xml file.
//! \param readCurrentElementOnly: If set to true, reading only works if current element has the name 'attributes'.
//! IF set to false, the first appearing list attributes are read.
virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false,
const wchar_t* nonDefaultElementName = 0) _IRR_OVERRIDE_;
//! Write these attributes into a xml file
virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false, const wchar_t* nonDefaultElementName=0) _IRR_OVERRIDE_;
/* /*
@ -722,8 +713,6 @@ public:
protected: protected:
void readAttributeFromXML(const io::IXMLReader* reader);
core::array<IAttribute*> Attributes; core::array<IAttribute*> Attributes;
IAttribute* getAttributeP(const c8* attributeName) const; IAttribute* getAttributeP(const c8* attributeName) const;

File diff suppressed because it is too large Load Diff

@ -1,410 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_COLLADA_MESH_FILE_LOADER_H_INCLUDED__
#define __C_COLLADA_MESH_FILE_LOADER_H_INCLUDED__
#include "IMeshLoader.h"
#include "IFileSystem.h"
#include "IVideoDriver.h"
#include "irrString.h"
#include "SMesh.h"
#include "SMeshBuffer.h"
#include "ISceneManager.h"
#include "irrMap.h"
#include "CAttributes.h"
namespace irr
{
namespace scene
{
#ifdef _DEBUG
//#define COLLADA_READER_DEBUG
#endif
class IColladaPrefab;
enum ECOLLADA_PARAM_NAME
{
ECPN_COLOR = 0,
ECPN_AMBIENT,
ECPN_DIFFUSE,
ECPN_SPECULAR,
ECPN_SHININESS,
ECPN_TRANSPARENCY,
ECPN_YFOV,
ECPN_ZNEAR,
ECPN_ZFAR,
ECPN_COUNT
};
enum ECOLLADA_PARAM_TYPE
{
ECPT_FLOAT = 0,
ECPT_FLOAT2,
ECPT_FLOAT3,
ECPT_FLOAT4,
ECPT_COUNT
};
//! Collada Parameter
struct SColladaParam
{
SColladaParam()
: Name(ECPN_COUNT), Type(ECPT_COUNT)
{
for (int i=0; i<4; ++i) Floats[i] = 0;
}
ECOLLADA_PARAM_NAME Name;
ECOLLADA_PARAM_TYPE Type;
f32 Floats[4];
};
enum ECOLLADA_INPUT_SEMANTIC
{
ECIS_POSITION = 0,
ECIS_VERTEX,
ECIS_NORMAL,
ECIS_TEXCOORD,
ECIS_UV,
ECIS_TANGENT,
ECIS_IMAGE,
ECIS_TEXTURE,
ECIS_COLOR,
ECIS_COUNT
};
//! Collada Input
struct SColladaInput
{
SColladaInput()
: Semantic(ECIS_COUNT), Data(0), Offset(0), Set(0), Stride(1)
{
}
ECOLLADA_INPUT_SEMANTIC Semantic;
core::stringc Source;
f32* Data;
u32 Offset;
u32 Set;
u32 Stride;
};
//! Collada images
struct SColladaImage
{
core::stringc Id;
core::stringc Source;
core::dimension2du Dimension;
bool SourceIsFilename;
};
//! Collada texture
struct SColladaTexture
{
video::ITexture* Texture;
core::stringc Id;
};
//! Collada material
struct SColladaMaterial
{
video::SMaterial Mat;
core::stringc Id;
core::stringc InstanceEffectId;
f32 Transparency;
inline bool operator< (const SColladaMaterial & other) const
{
return Id < other.Id;
}
};
//! Collada effect (materials, shaders, and programs)
struct SColladaEffect
{
core::stringc Id;
f32 Transparency;
core::array<core::stringc> Textures;
video::SMaterial Mat;
// TODO: Parameters looks somewhat lazy workaround, I think we should really read all parameters correct.
io::IAttributes * Parameters;
inline bool operator< (const SColladaEffect & other) const
{
return Id < other.Id;
}
};
struct SNumberArray // for storing float and int arrays
{
core::stringc Name;
core::array<f32> Data;
};
struct SAccessor
{
SAccessor()
: Count(0), Offset(0), Stride(1) {}
// I don't store the source of the accessor here because I assume
// it to use the array of the source this accessor is located in.
int Count;
int Offset;
int Stride;
core::array<SColladaParam> Parameters; // parameters defining the accessor
};
struct SSource
{
core::stringc Id;
SNumberArray Array;
core::array<SAccessor> Accessors;
};
class CScenePrefab;
//! Meshloader capable of loading COLLADA meshes and scene descriptions into Irrlicht.
class CColladaFileLoader : public IMeshLoader
{
public:
//! Constructor
CColladaFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs);
//! destructor
virtual ~CColladaFileLoader();
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".cob")
virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
//! creates/loads an animated mesh from the file.
//! \return Pointer to the created mesh. Returns 0 if loading failed.
//! If you no longer need the mesh, you should call IAnimatedMesh::drop().
//! See IReferenceCounted::drop() for more information.
virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_;
private:
//! skips an (unknown) section in the collada document
void skipSection(io::IXMLReaderUTF8* reader, bool reportSkipping);
//! reads the <COLLADA> section and its content
void readColladaSection(io::IXMLReaderUTF8* reader);
//! reads a <library> section and its content
void readLibrarySection(io::IXMLReaderUTF8* reader);
//! reads a <visual_scene> element and stores it as a prefab
void readVisualScene(io::IXMLReaderUTF8* reader);
//! reads a <scene> section and its content
void readSceneSection(io::IXMLReaderUTF8* reader);
//! reads a <asset> section and its content
void readAssetSection(io::IXMLReaderUTF8* reader);
//! reads a <node> section and its content
//! if a prefab pointer is passed the nodes are created as scene prefabs children of that prefab
void readNodeSection(io::IXMLReaderUTF8* reader, scene::ISceneNode* parent, CScenePrefab* p=0);
//! reads a <lookat> element and its content and creates a matrix from it
core::matrix4 readLookAtNode(io::IXMLReaderUTF8* reader);
//! reads a <matrix> element and its content and creates a matrix from it
core::matrix4 readMatrixNode(io::IXMLReaderUTF8* reader);
//! reads a <perspective> element and its content and creates a matrix from it
core::matrix4 readPerspectiveNode(io::IXMLReaderUTF8* reader);
//! reads a <rotate> element and its content and creates a matrix from it
core::matrix4 readRotateNode(io::IXMLReaderUTF8* reader);
//! reads a <skew> element and its content and creates a matrix from it
core::matrix4 readSkewNode(io::IXMLReaderUTF8* reader);
//! reads a <boundingbox> element and its content and stores it in bbox
void readBboxNode(io::IXMLReaderUTF8* reader, core::aabbox3df& bbox);
//! reads a <scale> element and its content and creates a matrix from it
core::matrix4 readScaleNode(io::IXMLReaderUTF8* reader);
//! reads a <translate> element and its content and creates a matrix from it
core::matrix4 readTranslateNode(io::IXMLReaderUTF8* reader);
//! reads a <color> element
video::SColorf readColorNode(io::IXMLReaderUTF8* reader);
//! reads a <float> element
f32 readFloatNode(io::IXMLReaderUTF8* reader);
//! reads a <instance> node
void readInstanceNode(io::IXMLReaderUTF8* reader,
scene::ISceneNode* parent, scene::ISceneNode** outNode,
CScenePrefab* p=0, const core::stringc& type=core::stringc());
//! creates a scene node from Prefabs (with name given in 'url')
void instantiateNode(scene::ISceneNode* parent, scene::ISceneNode** outNode=0,
CScenePrefab* p=0, const core::stringc& url="",
const core::stringc& type=core::stringc());
//! reads a <light> element and stores it as prefab
void readLightPrefab(io::IXMLReaderUTF8* reader);
//! reads a <camera> element and stores it as prefab
void readCameraPrefab(io::IXMLReaderUTF8* reader);
//! reads a <image> element and stores it in the image section
void readImage(io::IXMLReaderUTF8* reader);
//! reads a <texture> element and stores it in the texture section
void readTexture(io::IXMLReaderUTF8* reader);
//! reads a <material> element and stores it in the material section
void readMaterial(io::IXMLReaderUTF8* reader);
//! reads a <effect> element and stores it in the effects section
void readEffect(io::IXMLReaderUTF8* reader, SColladaEffect * effect = 0);
//! reads a <geometry> element and stores it as mesh if possible
void readGeometry(io::IXMLReaderUTF8* reader);
//! parses a float from a char pointer and moves the pointer to
//! the end of the parsed float
inline f32 readFloat(const c8** p);
//! parses an int from a char pointer and moves the pointer to
//! the end of the parsed float
inline s32 readInt(const c8** p);
//! places pointer to next begin of a token
void findNextNoneWhiteSpace(const c8** p);
//! reads floats from inside of xml element until end of xml element
void readFloatsInsideElement(io::IXMLReaderUTF8* reader, f32* floats, u32 count);
//! reads ints from inside of xml element until end of xml element
void readIntsInsideElement(io::IXMLReaderUTF8* reader, s32* ints, u32 count);
//! clears all loaded data
void clearData();
//! parses all collada parameters inside an element and stores them in ColladaParameters
void readColladaParameters(io::IXMLReaderUTF8* reader, const core::stringc& parentName);
//! returns a collada parameter or none if not found
SColladaParam* getColladaParameter(ECOLLADA_PARAM_NAME name);
//! parses all collada inputs inside an element and stores them in Inputs. Reads
//! until first tag which is not an input tag or the end of the parent is reached
void readColladaInputs(io::IXMLReaderUTF8* reader, const core::stringc& parentName);
//! reads a collada input tag and adds it to the input parameter
void readColladaInput(io::IXMLReaderUTF8* reader, core::array<SColladaInput>& inputs);
//! returns a collada input or none if not found
SColladaInput* getColladaInput(ECOLLADA_INPUT_SEMANTIC input);
//! read Collada Id, uses id or name if id is missing
core::stringc readId(io::IXMLReaderUTF8* reader);
//! changes the XML URI into an internal id
void uriToId(core::stringc& str);
//! reads a polygons section and creates a mesh from it
void readPolygonSection(io::IXMLReaderUTF8* reader,
core::array<SSource>& sources, scene::SMesh* mesh,
const core::stringc& geometryId);
//! finds a material, possible instancing it
const SColladaMaterial * findMaterial(const core::stringc & materialName);
//! reads and bind materials as given by the symbol->target bind mapping
void readBindMaterialSection(io::IXMLReaderUTF8* reader, const core::stringc & id);
//! create an Irrlicht texture from the SColladaImage
video::ITexture* getTextureFromImage(core::stringc uri, SColladaEffect * effect);
//! read a parameter and value
void readParameter(io::IXMLReaderUTF8* reader, io::IAttributes* parameters);
//! Flip z axis in matrix around to convert between right-handed and left-handed coordinate system.
//! Note that function is symmetric (no difference if called before or after a transpose).
core::matrix4 flipZAxis(const core::matrix4& m);
//! replace escape characters with the unescaped ones
void unescape(irr::core::stringc& uri);
scene::ISceneManager* SceneManager;
io::IFileSystem* FileSystem;
scene::IAnimatedMesh* DummyMesh;
core::stringc CurrentlyLoadingMesh;
scene::IAnimatedMesh* FirstLoadedMesh;
io::path FirstLoadedMeshName;
s32 LoadedMeshCount;
u32 Version;
bool FlipAxis;
core::array<IColladaPrefab*> Prefabs;
core::array<SColladaParam> ColladaParameters;
core::array<SColladaImage> Images;
core::array<SColladaTexture> Textures;
core::array<SColladaMaterial> Materials;
core::array<SColladaInput> Inputs;
core::array<SColladaEffect> Effects;
//! meshbuffer reference ("geomid/matname") -> index into MeshesToBind
core::map<core::stringc,u32> MaterialsToBind;
//! Array of buffers for each material binding
core::array< core::array<irr::scene::IMeshBuffer*> > MeshesToBind;
bool CreateInstances;
struct EscapeCharacterURL
{
EscapeCharacterURL(irr::c8 c, const irr::c8* e)
: Character(c)
{
Escape = e;
}
irr::c8 Character; // unescaped (like ' ')
irr::core::stringc Escape; // escaped (like '%20')
};
irr::core::array<EscapeCharacterURL> EscapeCharsAnyURI;
};
//! following class is for holding and createing instances of library objects,
//! named prefabs in this loader.
class IColladaPrefab : public virtual IReferenceCounted
{
public:
//! creates an instance of this prefab
virtual scene::ISceneNode* addInstance(scene::ISceneNode* parent,
scene::ISceneManager* mgr) = 0;
//! returns id of this prefab
virtual const core::stringc& getId() = 0;
};
} // end namespace scene
} // end namespace irr
#endif

File diff suppressed because it is too large Load Diff

@ -1,282 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __IRR_C_COLLADA_MESH_WRITER_H_INCLUDED__
#define __IRR_C_COLLADA_MESH_WRITER_H_INCLUDED__
#include "IColladaMeshWriter.h"
#include "S3DVertex.h"
#include "irrMap.h"
#include "IVideoDriver.h"
#include "IXMLWriter.h"
namespace irr
{
namespace io
{
class IFileSystem;
}
namespace scene
{
//! Callback interface for properties which can be used to influence collada writing
// (Implementer note: keep namespace labels here to make it easier for users copying this one)
class CColladaMeshWriterProperties : public virtual IColladaMeshWriterProperties
{
public:
//! Which lighting model should be used in the technique (FX) section when exporting effects (materials)
virtual irr::scene::E_COLLADA_TECHNIQUE_FX getTechniqueFx(const irr::video::SMaterial& material) const _IRR_OVERRIDE_;
//! Which texture index should be used when writing the texture of the given sampler color.
virtual irr::s32 getTextureIdx(const irr::video::SMaterial & material, irr::scene::E_COLLADA_COLOR_SAMPLER cs) const _IRR_OVERRIDE_;
//! Return which color from Irrlicht should be used for the color requested by collada
virtual irr::scene::E_COLLADA_IRR_COLOR getColorMapping(const irr::video::SMaterial & material, irr::scene::E_COLLADA_COLOR_SAMPLER cs) const _IRR_OVERRIDE_;
//! Return custom colors for certain color types requested by collada.
virtual irr::video::SColor getCustomColor(const irr::video::SMaterial & material, irr::scene::E_COLLADA_COLOR_SAMPLER cs) const _IRR_OVERRIDE_;
//! Return the settings for transparence
virtual irr::scene::E_COLLADA_TRANSPARENT_FX getTransparentFx(const irr::video::SMaterial& material) const _IRR_OVERRIDE_;
//! Transparency value for that material.
virtual irr::f32 getTransparency(const irr::video::SMaterial& material) const _IRR_OVERRIDE_;
//! Reflectivity value for that material
virtual irr::f32 getReflectivity(const irr::video::SMaterial& material) const _IRR_OVERRIDE_;
//! Return index of refraction for that material
virtual irr::f32 getIndexOfRefraction(const irr::video::SMaterial& material) const _IRR_OVERRIDE_;
//! Should node be used in scene export? By default all visible nodes are exported.
virtual bool isExportable(const irr::scene::ISceneNode * node) const _IRR_OVERRIDE_;
//! Return the mesh for the given nod. If it has no mesh or shouldn't export it's mesh return 0.
virtual irr::scene::IMesh* getMesh(irr::scene::ISceneNode * node) _IRR_OVERRIDE_;
//! Return if the node has it's own material overwriting the mesh-materials
virtual bool useNodeMaterial(const scene::ISceneNode* node) const _IRR_OVERRIDE_;
};
class CColladaMeshWriterNames : public virtual IColladaMeshWriterNames
{
public:
CColladaMeshWriterNames(IColladaMeshWriter * writer);
virtual irr::core::stringc nameForMesh(const scene::IMesh* mesh, int instance) _IRR_OVERRIDE_;
virtual irr::core::stringc nameForNode(const scene::ISceneNode* node) _IRR_OVERRIDE_;
virtual irr::core::stringc nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node) _IRR_OVERRIDE_;
protected:
irr::core::stringc nameForPtr(const void* ptr) const;
private:
IColladaMeshWriter * ColladaMeshWriter;
};
//! class to write meshes, implementing a COLLADA (.dae, .xml) writer
/** This writer implementation has been originally developed for irrEdit and then
merged out to the Irrlicht Engine */
class CColladaMeshWriter : public IColladaMeshWriter
{
public:
CColladaMeshWriter(ISceneManager * smgr, video::IVideoDriver* driver, io::IFileSystem* fs);
virtual ~CColladaMeshWriter();
//! Returns the type of the mesh writer
virtual EMESH_WRITER_TYPE getType() const _IRR_OVERRIDE_;
//! writes a scene starting with the given node
virtual bool writeScene(io::IWriteFile* file, scene::ISceneNode* root, int writeRoot) _IRR_OVERRIDE_;
//! writes a mesh
virtual bool writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags=EMWF_NONE) _IRR_OVERRIDE_;
// Restrict the characters of oldString a set of allowed characters in xs:NCName and add the prefix.
virtual irr::core::stringc toNCName(const irr::core::stringc& oldString, const irr::core::stringc& prefix=irr::core::stringc("_NC_")) const _IRR_OVERRIDE_;
//! After export you can find out which name had been used for writing the geometry for this node.
virtual const irr::core::stringc* findGeometryNameForNode(ISceneNode* node) _IRR_OVERRIDE_;
protected:
void reset();
bool hasSecondTextureCoordinates(video::E_VERTEX_TYPE type) const;
void writeUv(const irr::core::vector2df& vec);
void writeVector(const irr::core::vector3df& vec);
void writeColor(const irr::video::SColorf& colorf, bool writeAlpha=true);
inline irr::core::stringc toString(const irr::video::ECOLOR_FORMAT format) const;
inline irr::core::stringc toString(const irr::video::E_TEXTURE_CLAMP clamp) const;
inline irr::core::stringc toString(const irr::scene::E_COLLADA_TRANSPARENT_FX opaque) const;
inline irr::core::stringc toRef(const irr::core::stringc& source) const;
bool isCamera(const scene::ISceneNode* node) const;
irr::core::stringc nameForMesh(const scene::IMesh* mesh, int instance) const;
irr::core::stringc nameForNode(const scene::ISceneNode* node) const;
irr::core::stringc nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node);
irr::core::stringc nameForMaterialSymbol(const scene::IMesh* mesh, int materialId) const;
irr::core::stringc findCachedMaterialName(const irr::video::SMaterial& material) const;
irr::core::stringc minTexfilterToString(bool bilinear, bool trilinear) const;
irr::core::stringc magTexfilterToString(bool bilinear, bool trilinear) const;
irr::core::stringc pathToURI(const irr::io::path& path) const;
inline bool isXmlNameStartChar(c8 c) const;
inline bool isXmlNameChar(c8 c) const;
s32 getCheckedTextureIdx(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs);
video::SColor getColorMapping(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs, E_COLLADA_IRR_COLOR colType);
void writeAsset();
void makeMeshNames(irr::scene::ISceneNode * node);
void writeNodeMaterials(irr::scene::ISceneNode * node);
void writeNodeEffects(irr::scene::ISceneNode * node);
void writeNodeLights(irr::scene::ISceneNode * node);
void writeNodeCameras(irr::scene::ISceneNode * node);
void writeAllMeshGeometries();
void writeSceneNode(irr::scene::ISceneNode * node);
void writeMeshMaterials(scene::IMesh* mesh, irr::core::array<irr::core::stringc> * materialNamesOut=0);
void writeMeshEffects(scene::IMesh* mesh);
void writeMaterialEffect(const irr::core::stringc& materialname, const video::SMaterial & material);
void writeMeshGeometry(const irr::core::stringc& meshname, scene::IMesh* mesh);
void writeMeshInstanceGeometry(const irr::core::stringc& meshname, scene::IMesh* mesh, scene::ISceneNode* node=0);
void writeMaterial(const irr::core::stringc& materialname);
void writeLightInstance(const irr::core::stringc& lightName);
void writeCameraInstance(const irr::core::stringc& cameraName);
void writeLibraryImages();
void writeColorFx(const video::SMaterial & material, const c8 * colorname, E_COLLADA_COLOR_SAMPLER cs, const c8* attr1Name=0, const c8* attr1Value=0);
void writeAmbientLightElement(const video::SColorf & col);
void writeColorElement(const video::SColor & col, bool writeAlpha=true);
void writeColorElement(const video::SColorf & col, bool writeAlpha=true);
void writeTextureSampler(s32 textureIdx);
void writeFxElement(const video::SMaterial & material, E_COLLADA_TECHNIQUE_FX techFx);
void writeNode(const c8 * nodeName, const c8 * content);
void writeFloatElement(irr::f32 value);
void writeRotateElement(const irr::core::vector3df& axis, irr::f32 angle);
void writeScaleElement(const irr::core::vector3df& scale);
void writeTranslateElement(const irr::core::vector3df& translate);
void writeLookAtElement(const irr::core::vector3df& eyePos, const irr::core::vector3df& targetPos, const irr::core::vector3df& upVector);
void writeMatrixElement(const irr::core::matrix4& matrix);
struct SComponentGlobalStartPos
{
SComponentGlobalStartPos() : PosStartIndex(0),
NormalStartIndex(0),
TCoord0StartIndex(0),
TCoord1StartIndex(0)
{ }
u32 PosStartIndex;
u32 NormalStartIndex;
u32 TCoord0StartIndex;
u32 TCoord1StartIndex;
};
io::IFileSystem* FileSystem;
video::IVideoDriver* VideoDriver;
io::IXMLWriterUTF8* Writer;
core::array<video::ITexture*> LibraryImages;
io::path Directory;
// Helper struct for creating geometry copies for the ECGI_PER_MESH_AND_MATERIAL settings.
struct SGeometryMeshMaterials
{
bool equals(const core::array<irr::core::stringc>& names) const
{
if ( names.size() != MaterialNames.size() )
return false;
for ( irr::u32 i=0; i<MaterialNames.size(); ++i )
if ( names[i] != MaterialNames[i] )
return false;
return true;
}
irr::core::stringc GeometryName; // replacing the usual ColladaMesh::Name
core::array<irr::core::stringc> MaterialNames; // Material names exported for this instance
core::array<const ISceneNode*> MaterialOwners; // Nodes using this specific mesh-material combination
};
// Check per mesh-ptr if stuff has been written for this mesh already
struct SColladaMesh
{
SColladaMesh() : MaterialsWritten(false), EffectsWritten(false)
{
}
SGeometryMeshMaterials * findGeometryMeshMaterials(const irr::core::array<irr::core::stringc> materialNames)
{
for ( irr::u32 i=0; i<GeometryMeshMaterials.size(); ++i )
{
if ( GeometryMeshMaterials[i].equals(materialNames) )
return &(GeometryMeshMaterials[i]);
}
return NULL;
}
const irr::core::stringc& findGeometryNameForNode(const ISceneNode* node) const
{
if ( GeometryMeshMaterials.size() < 2 )
return Name;
for ( irr::u32 i=0; i<GeometryMeshMaterials.size(); ++i )
{
if ( GeometryMeshMaterials[i].MaterialOwners.linear_search(node) >= 0 )
return GeometryMeshMaterials[i].GeometryName;
}
return Name; // (shouldn't get here usually)
}
irr::core::stringc Name;
bool MaterialsWritten; // just an optimization doing that here in addition to the MaterialsWritten map
bool EffectsWritten; // just an optimization doing that here in addition to the EffectsWritten map
core::array<SGeometryMeshMaterials> GeometryMeshMaterials;
};
typedef core::map<IMesh*, SColladaMesh>::Node MeshNode;
core::map<IMesh*, SColladaMesh> Meshes;
// structure for the lights library
struct SColladaLight
{
SColladaLight() {}
irr::core::stringc Name;
};
typedef core::map<ISceneNode*, SColladaLight>::Node LightNode;
core::map<ISceneNode*, SColladaLight> LightNodes;
// structure for the camera library
typedef core::map<ISceneNode*, irr::core::stringc>::Node CameraNode;
core::map<ISceneNode*, irr::core::stringc> CameraNodes;
// Check per name if stuff has been written already
// TODO: second parameter not needed, we just don't have a core::set class yet in Irrlicht
core::map<irr::core::stringc, bool> MaterialsWritten;
core::map<irr::core::stringc, bool> EffectsWritten;
// Cache material names
struct MaterialName
{
MaterialName(const irr::video::SMaterial & material, const irr::core::stringc& name)
: Material(material), Name(name)
{}
irr::video::SMaterial Material;
irr::core::stringc Name;
};
irr::core::array< MaterialName > MaterialNameCache;
irr::core::stringc WriteBuffer; // use for writing short strings to avoid regular memory allocations
struct EscapeCharacterURL
{
EscapeCharacterURL(irr::c8 c, const irr::c8* e)
: Character(c)
{
Escape = e;
}
irr::c8 Character; // unescaped (like ' ')
irr::core::stringc Escape; // escaped (like '%20')
};
irr::core::array<EscapeCharacterURL> EscapeCharsAnyURI;
};
} // end namespace
} // end namespace
#endif

@ -14,8 +14,6 @@
#include "CTarReader.h" #include "CTarReader.h"
#include "CWADReader.h" #include "CWADReader.h"
#include "CFileList.h" #include "CFileList.h"
#include "CXMLReader.h"
#include "CXMLWriter.h"
#include "stdio.h" #include "stdio.h"
#include "os.h" #include "os.h"
#include "CAttributes.h" #include "CAttributes.h"
@ -981,133 +979,6 @@ bool CFileSystem::existFile(const io::path& filename) const
} }
//! Creates a XML Reader from a file.
IXMLReader* CFileSystem::createXMLReader(const io::path& filename)
{
#ifdef _IRR_COMPILE_WITH_XML_
IReadFile* file = createAndOpenFile(filename);
if (!file)
return 0;
IXMLReader* reader = createXMLReader(file);
file->drop();
return reader;
#else
noXML();
return 0;
#endif
}
//! Creates a XML Reader from a file.
IXMLReader* CFileSystem::createXMLReader(IReadFile* file)
{
#ifdef _IRR_COMPILE_WITH_XML_
if (!file)
return 0;
return createIXMLReader(file);
#else
noXML();
return 0;
#endif
}
//! Creates a XML Reader from a file.
IXMLReaderUTF8* CFileSystem::createXMLReaderUTF8(const io::path& filename)
{
#ifdef _IRR_COMPILE_WITH_XML_
IReadFile* file = createAndOpenFile(filename);
if (!file)
return 0;
IXMLReaderUTF8* reader = createIXMLReaderUTF8(file);
file->drop();
return reader;
#else
noXML();
return 0;
#endif
}
//! Creates a XML Reader from a file.
IXMLReaderUTF8* CFileSystem::createXMLReaderUTF8(IReadFile* file)
{
#ifdef _IRR_COMPILE_WITH_XML_
if (!file)
return 0;
return createIXMLReaderUTF8(file);
#else
noXML();
return 0;
#endif
}
//! Creates a XML Writer from a file.
IXMLWriter* CFileSystem::createXMLWriter(const io::path& filename)
{
#ifdef _IRR_COMPILE_WITH_XML_
IWriteFile* file = createAndWriteFile(filename);
IXMLWriter* writer = 0;
if (file)
{
writer = createXMLWriter(file);
file->drop();
}
return writer;
#else
noXML();
return 0;
#endif
}
//! Creates a XML Writer from a file.
IXMLWriter* CFileSystem::createXMLWriter(IWriteFile* file)
{
#ifdef _IRR_COMPILE_WITH_XML_
return createIXMLWriter(file);
#else
noXML();
return 0;
#endif
}
//! Creates a XML Writer from a file.
IXMLWriterUTF8* CFileSystem::createXMLWriterUTF8(const io::path& filename)
{
#ifdef _IRR_COMPILE_WITH_XML_
IWriteFile* file = createAndWriteFile(filename);
IXMLWriterUTF8* writer = 0;
if (file)
{
writer = createXMLWriterUTF8(file);
file->drop();
}
return writer;
#else
noXML();
return 0;
#endif
}
//! Creates a XML Writer from a file.
IXMLWriterUTF8* CFileSystem::createXMLWriterUTF8(IWriteFile* file)
{
#ifdef _IRR_COMPILE_WITH_XML_
return createIXMLWriterUTF8(file);
#else
noXML();
return 0;
#endif
}
//! creates a filesystem which is able to open files from the ordinary file system, //! creates a filesystem which is able to open files from the ordinary file system,
//! and out of zipfiles, which are able to be added to the filesystem. //! and out of zipfiles, which are able to be added to the filesystem.
IFileSystem* createFileSystem() IFileSystem* createFileSystem()

@ -127,30 +127,6 @@ public:
//! determines if a file exists and would be able to be opened. //! determines if a file exists and would be able to be opened.
virtual bool existFile(const io::path& filename) const _IRR_OVERRIDE_; virtual bool existFile(const io::path& filename) const _IRR_OVERRIDE_;
//! Creates a XML Reader from a file.
virtual IXMLReader* createXMLReader(const io::path& filename) _IRR_OVERRIDE_;
//! Creates a XML Reader from a file.
virtual IXMLReader* createXMLReader(IReadFile* file) _IRR_OVERRIDE_;
//! Creates a XML Reader from a file.
virtual IXMLReaderUTF8* createXMLReaderUTF8(const io::path& filename) _IRR_OVERRIDE_;
//! Creates a XML Reader from a file.
virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) _IRR_OVERRIDE_;
//! Creates a XML Writer from a file.
virtual IXMLWriter* createXMLWriter(const io::path& filename) _IRR_OVERRIDE_;
//! Creates a XML Writer from a file.
virtual IXMLWriter* createXMLWriter(IWriteFile* file) _IRR_OVERRIDE_;
//! Creates a XML Writer from a file which will write ASCII/UTF-8 characters (char*).
virtual IXMLWriterUTF8* createXMLWriterUTF8(const path& filename) _IRR_OVERRIDE_;
//! Creates a XML Writer from a file which will write ASCII/UTF-8 characters (char*).
virtual IXMLWriterUTF8* createXMLWriterUTF8(IWriteFile* file) _IRR_OVERRIDE_;
//! Creates a new empty collection of attributes, usable for serialization and more. //! Creates a new empty collection of attributes, usable for serialization and more.
virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver) _IRR_OVERRIDE_; virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver) _IRR_OVERRIDE_;

@ -39,7 +39,6 @@
#include "CDefaultGUIElementFactory.h" #include "CDefaultGUIElementFactory.h"
#include "IWriteFile.h" #include "IWriteFile.h"
#include "IXMLWriter.h"
#include "BuiltInFont.h" #include "BuiltInFont.h"
#include "os.h" #include "os.h"
@ -49,10 +48,6 @@ namespace irr
namespace gui namespace gui
{ {
const wchar_t IRR_XML_FORMAT_GUI_ENV[] = L"irr_gui";
const wchar_t IRR_XML_FORMAT_GUI_ELEMENT[] = L"element";
const wchar_t IRR_XML_FORMAT_GUI_ELEMENT_ATTR_TYPE[] = L"type";
const io::path CGUIEnvironment::DefaultFontName = "#DefaultFont"; const io::path CGUIEnvironment::DefaultFontName = "#DefaultFont";
//! constructor //! constructor
@ -787,25 +782,10 @@ bool CGUIEnvironment::saveGUI(const io::path& filename, IGUIElement* start)
//! Saves the current gui into a file. //! Saves the current gui into a file.
bool CGUIEnvironment::saveGUI(io::IWriteFile* file, IGUIElement* start) bool CGUIEnvironment::saveGUI(io::IWriteFile* file, IGUIElement* start)
{
if (!file)
{ {
return false; return false;
} }
io::IXMLWriter* writer = FileSystem->createXMLWriter(file);
if (!writer)
{
return false;
}
writer->writeXMLHeader();
writeGUIElement(writer, start ? start : this);
writer->drop();
return true;
}
//! Loads the gui. Note that the current gui is not cleared before. //! Loads the gui. Note that the current gui is not cleared before.
//! \param filename: Name of the file. //! \param filename: Name of the file.
@ -828,172 +808,9 @@ bool CGUIEnvironment::loadGUI(const io::path& filename, IGUIElement* parent)
//! Loads the gui. Note that the current gui is not cleared before. //! Loads the gui. Note that the current gui is not cleared before.
bool CGUIEnvironment::loadGUI(io::IReadFile* file, IGUIElement* parent) bool CGUIEnvironment::loadGUI(io::IReadFile* file, IGUIElement* parent)
{ {
if (!file)
{
os::Printer::log("Unable to open GUI file", ELL_ERROR);
return false; return false;
} }
io::IXMLReader* reader = FileSystem->createXMLReader(file);
if (!reader)
{
os::Printer::log("GUI is not a valid XML file", file->getFileName(), ELL_ERROR);
return false;
}
// read file
while(reader->read())
{
readGUIElement(reader, parent);
}
// finish up
reader->drop();
return true;
}
//! reads an element
void CGUIEnvironment::readGUIElement(io::IXMLReader* reader, IGUIElement* node)
{
if (!reader)
return;
io::EXML_NODE nodeType = reader->getNodeType();
if (nodeType == io::EXN_NONE || nodeType == io::EXN_UNKNOWN || nodeType == io::EXN_ELEMENT_END)
return;
IGUIElement* deferedNode = 0;
if (!wcscmp(IRR_XML_FORMAT_GUI_ENV, reader->getNodeName()))
{
// GuiEnvironment always must be this as it would serialize into a wrong element otherwise.
// So we use the given node next time
if ( node && node != this )
deferedNode = node;
node = this; // root
}
else if (!wcscmp(IRR_XML_FORMAT_GUI_ELEMENT, reader->getNodeName()))
{
// find node type and create it
const core::stringc attrName = reader->getAttributeValue(IRR_XML_FORMAT_GUI_ELEMENT_ATTR_TYPE);
node = addGUIElement(attrName.c_str(), node);
if (!node)
os::Printer::log("Could not create GUI element of unknown type", attrName.c_str());
}
// read attributes
while(reader->read())
{
bool endreached = false;
switch (reader->getNodeType())
{
case io::EXN_ELEMENT_END:
if (!wcscmp(IRR_XML_FORMAT_GUI_ELEMENT, reader->getNodeName()) ||
!wcscmp(IRR_XML_FORMAT_GUI_ENV, reader->getNodeName()))
{
endreached = true;
}
break;
case io::EXN_ELEMENT:
if (!wcscmp(L"attributes", reader->getNodeName()))
{
// read attributes
io::IAttributes* attr = FileSystem->createEmptyAttributes(Driver);
attr->read(reader, true);
if (node)
node->deserializeAttributes(attr);
attr->drop();
}
else
if (!wcscmp(IRR_XML_FORMAT_GUI_ELEMENT, reader->getNodeName()) ||
!wcscmp(IRR_XML_FORMAT_GUI_ENV, reader->getNodeName()))
{
if ( deferedNode )
readGUIElement(reader, deferedNode);
else
readGUIElement(reader, node);
}
else
{
os::Printer::log("Found unknown element in irrlicht GUI file",
core::stringc(reader->getNodeName()).c_str());
}
break;
default:
break;
}
if (endreached)
break;
}
}
//! writes an element
void CGUIEnvironment::writeGUIElement(io::IXMLWriter* writer, IGUIElement* node)
{
if (!writer || !node )
return;
const wchar_t* name = 0;
// write properties
io::IAttributes* attr = FileSystem->createEmptyAttributes();
node->serializeAttributes(attr);
// all gui elements must have at least one attribute
// if they have nothing then we ignore them.
if (attr->getAttributeCount() != 0)
{
if (node == this)
{
name = IRR_XML_FORMAT_GUI_ENV;
writer->writeElement(name, false);
}
else
{
name = IRR_XML_FORMAT_GUI_ELEMENT;
writer->writeElement(name, false, IRR_XML_FORMAT_GUI_ELEMENT_ATTR_TYPE,
core::stringw(node->getTypeName()).c_str());
}
writer->writeLineBreak();
attr->write(writer);
}
// write children
core::list<IGUIElement*>::ConstIterator it = node->getChildren().begin();
for (; it != node->getChildren().end(); ++it)
{
if (!(*it)->isSubElement())
{
writer->writeLineBreak();
writeGUIElement(writer, (*it));
}
}
// write closing brace if required
if (attr->getAttributeCount() != 0)
{
writer->writeClosingTag(name);
writer->writeLineBreak();
}
attr->drop();
}
//! Writes attributes of the environment //! Writes attributes of the environment
void CGUIEnvironment::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const void CGUIEnvironment::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
@ -1460,35 +1277,7 @@ IGUIFont* CGUIEnvironment::getFont(const io::path& filename)
} }
IGUIFont* ifont=0; IGUIFont* ifont=0;
io::IXMLReader *xml = FileSystem->createXMLReader(filename ); #if 0
if (xml)
{
// this is an XML font, but we need to know what type
EGUI_FONT_TYPE t = EGFT_CUSTOM;
bool found=false;
while(!found && xml->read())
{
if (xml->getNodeType() == io::EXN_ELEMENT)
{
if (core::stringw(L"font") == xml->getNodeName())
{
if (core::stringw(L"vector") == xml->getAttributeValue(L"type"))
{
t = EGFT_VECTOR;
found=true;
}
else if (core::stringw(L"bitmap") == xml->getAttributeValue(L"type"))
{
t = EGFT_BITMAP;
found=true;
}
else found=true;
}
}
}
if (t==EGFT_BITMAP)
{ {
CGUIFont* font = new CGUIFont(this, filename); CGUIFont* font = new CGUIFont(this, filename);
ifont = (IGUIFont*)font; ifont = (IGUIFont*)font;
@ -1503,17 +1292,7 @@ IGUIFont* CGUIEnvironment::getFont(const io::path& filename)
ifont = 0; ifont = 0;
} }
} }
else if (t==EGFT_VECTOR) #endif
{
// todo: vector fonts
os::Printer::log("Unable to load font, XML vector fonts are not supported yet", f.NamedPath, ELL_ERROR);
//CGUIFontVector* font = new CGUIFontVector(Driver);
//ifont = (IGUIFont*)font;
//if (!font->load(xml))
}
xml->drop();
}
if (!ifont) if (!ifont)

@ -254,12 +254,6 @@ public:
//! Reads attributes of the environment. //! Reads attributes of the environment.
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_; virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) _IRR_OVERRIDE_;
//! writes an element
virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* node) _IRR_OVERRIDE_;
//! reads an element
virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* node) _IRR_OVERRIDE_;
//! Find the next element which would be selected when pressing the tab-key //! Find the next element which would be selected when pressing the tab-key
virtual IGUIElement* getNextElement(bool reverse=false, bool group=false) _IRR_OVERRIDE_; virtual IGUIElement* getNextElement(bool reverse=false, bool group=false) _IRR_OVERRIDE_;

@ -8,7 +8,6 @@
#include "os.h" #include "os.h"
#include "coreutil.h" #include "coreutil.h"
#include "IGUIEnvironment.h" #include "IGUIEnvironment.h"
#include "IXMLReader.h"
#include "IReadFile.h" #include "IReadFile.h"
#include "IVideoDriver.h" #include "IVideoDriver.h"
#include "IGUISpriteBank.h" #include "IGUISpriteBank.h"
@ -63,6 +62,7 @@ CGUIFont::~CGUIFont()
} }
#if 0
//! loads a font file from xml //! loads a font file from xml
bool CGUIFont::load(io::IXMLReader* xml, const io::path& directory) bool CGUIFont::load(io::IXMLReader* xml, const io::path& directory)
{ {
@ -195,6 +195,7 @@ bool CGUIFont::load(io::IXMLReader* xml, const io::path& directory)
return true; return true;
} }
#endif
void CGUIFont::setMaxHeight() void CGUIFont::setMaxHeight()

@ -11,7 +11,6 @@
#include "IGUIFontBitmap.h" #include "IGUIFontBitmap.h"
#include "irrString.h" #include "irrString.h"
#include "irrMap.h" #include "irrMap.h"
#include "IXMLReader.h"
#include "IReadFile.h" #include "IReadFile.h"
#include "irrArray.h" #include "irrArray.h"
@ -45,10 +44,6 @@ public:
//! loads a font from a texture file //! loads a font from a texture file
bool load(io::IReadFile* file); bool load(io::IReadFile* file);
//! loads a font from an XML file
//\param directory Directory in which the bitmaps can be found
bool load(io::IXMLReader* xml, const io::path& directory);
//! draws an text and clips it to the specified rectangle if wanted //! draws an text and clips it to the specified rectangle if wanted
virtual void draw(const core::stringw& text, const core::rect<s32>& position, virtual void draw(const core::stringw& text, const core::rect<s32>& position,
video::SColor color, bool hcenter=false, video::SColor color, bool hcenter=false,

@ -1,556 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_IRR_MESH_LOADER_
#include "CIrrMeshFileLoader.h"
#include "os.h"
#include "IXMLReader.h"
#include "SAnimatedMesh.h"
#include "fast_atof.h"
#include "IReadFile.h"
#include "IAttributes.h"
#include "IMeshSceneNode.h"
#include "CDynamicMeshBuffer.h"
#include "SMeshBufferLightMap.h"
namespace irr
{
namespace scene
{
//! Constructor
CIrrMeshFileLoader::CIrrMeshFileLoader(scene::ISceneManager* smgr,
io::IFileSystem* fs)
: SceneManager(smgr), FileSystem(fs)
{
#ifdef _DEBUG
setDebugName("CIrrMeshFileLoader");
#endif
}
//! Returns true if the file maybe is able to be loaded by this class.
/** This decision should be based only on the file extension (e.g. ".cob") */
bool CIrrMeshFileLoader::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension ( filename, "xml", "irrmesh" );
}
//! creates/loads an animated mesh from the file.
//! \return Pointer to the created mesh. Returns 0 if loading failed.
//! If you no longer need the mesh, you should call IAnimatedMesh::drop().
//! See IReferenceCounted::drop() for more information.
IAnimatedMesh* CIrrMeshFileLoader::createMesh(io::IReadFile* file)
{
io::IXMLReader* reader = FileSystem->createXMLReader(file);
if (!reader)
return 0;
// read until mesh section, skip other parts
const core::stringc meshTagName = "mesh";
IAnimatedMesh* mesh = 0;
while(reader->read())
{
if (reader->getNodeType() == io::EXN_ELEMENT)
{
if (meshTagName == reader->getNodeName())
{
mesh = readMesh(reader);
break;
}
else
skipSection(reader, true); // unknown section
}
}
reader->drop();
return mesh;
}
//! reads a mesh sections and creates a mesh from it
IAnimatedMesh* CIrrMeshFileLoader::readMesh(io::IXMLReader* reader)
{
SAnimatedMesh* animatedmesh = new SAnimatedMesh();
SMesh* mesh = new SMesh();
animatedmesh->addMesh(mesh);
mesh->drop();
core::stringc bbSectionName = "boundingBox";
core::stringc bufferSectionName = "buffer";
core::stringc meshSectionName = "mesh";
if (!reader->isEmptyElement())
while(reader->read())
{
if (reader->getNodeType() == io::EXN_ELEMENT)
{
const wchar_t* nodeName = reader->getNodeName();
if (bbSectionName == nodeName)
{
// inside a bounding box, ignore it for now because
// we are calculating this anyway ourselves later.
}
else
if (bufferSectionName == nodeName)
{
// we've got a mesh buffer
IMeshBuffer* buffer = readMeshBuffer(reader);
if (buffer)
{
mesh->addMeshBuffer(buffer);
buffer->drop();
}
}
else
skipSection(reader, true); // unknown section
} // end if node type is element
else
if (reader->getNodeType() == io::EXN_ELEMENT_END)
{
if (meshSectionName == reader->getNodeName())
{
// end of mesh section reached, cancel out
break;
}
}
} // end while reader->read();
mesh->recalculateBoundingBox();
animatedmesh->recalculateBoundingBox();
return animatedmesh;
}
//! reads a mesh sections and creates a mesh buffer from it
IMeshBuffer* CIrrMeshFileLoader::readMeshBuffer(io::IXMLReader* reader)
{
CDynamicMeshBuffer* buffer = 0;
core::stringc verticesSectionName = "vertices";
core::stringc bbSectionName = "boundingBox";
core::stringc materialSectionName = "material";
core::stringc indicesSectionName = "indices";
core::stringc bufferSectionName = "buffer";
bool insideVertexSection = false;
bool insideIndexSection = false;
int vertexCount = 0;
int indexCount = 0;
video::SMaterial material;
if (!reader->isEmptyElement())
while(reader->read())
{
if (reader->getNodeType() == io::EXN_ELEMENT)
{
const wchar_t* nodeName = reader->getNodeName();
if (bbSectionName == nodeName)
{
// inside a bounding box, ignore it for now because
// we are calculating this anyway ourselves later.
}
else
if (materialSectionName == nodeName)
{
//we've got a material
material = video::SMaterial(); // reset
io::IAttributes* attributes = FileSystem->createEmptyAttributes(SceneManager->getVideoDriver());
attributes->read(reader, true, L"material");
SceneManager->getVideoDriver()->fillMaterialStructureFromAttributes(material, attributes);
attributes->drop();
}
else
if (verticesSectionName == nodeName)
{
// vertices section
const core::stringc vertexTypeName1 = "standard";
const core::stringc vertexTypeName2 = "2tcoords";
const core::stringc vertexTypeName3 = "tangents";
const wchar_t* vertexType = reader->getAttributeValue(L"type");
vertexCount = reader->getAttributeValueAsInt(L"vertexCount");
insideVertexSection = true;
video::E_INDEX_TYPE itype = (vertexCount > 65536)?irr::video::EIT_32BIT:irr::video::EIT_16BIT;
if (vertexTypeName1 == vertexType)
{
buffer = new CDynamicMeshBuffer(irr::video::EVT_STANDARD, itype);
}
else
if (vertexTypeName2 == vertexType)
{
buffer = new CDynamicMeshBuffer(irr::video::EVT_2TCOORDS, itype);
}
else
if (vertexTypeName3 == vertexType)
{
buffer = new CDynamicMeshBuffer(irr::video::EVT_TANGENTS, itype);
}
buffer->getVertexBuffer().reallocate(vertexCount);
buffer->Material = material;
}
else
if (indicesSectionName == nodeName)
{
// indices section
indexCount = reader->getAttributeValueAsInt(L"indexCount");
insideIndexSection = true;
}
} // end if node type is element
else
if (reader->getNodeType() == io::EXN_TEXT)
{
// read vertex data
if (insideVertexSection)
{
readMeshBuffer(reader, vertexCount, buffer);
insideVertexSection = false;
} // end reading vertex array
else
if (insideIndexSection)
{
readIndices(reader, indexCount, buffer->getIndexBuffer());
insideIndexSection = false;
}
} // end if node type is text
else
if (reader->getNodeType() == io::EXN_ELEMENT_END)
{
if (bufferSectionName == reader->getNodeName())
{
// end of buffer section reached, cancel out
break;
}
}
} // end while reader->read();
if (buffer)
buffer->recalculateBoundingBox();
return buffer;
}
//! read indices
void CIrrMeshFileLoader::readIndices(io::IXMLReader* reader, int indexCount, IIndexBuffer& indices)
{
indices.reallocate(indexCount);
core::stringc data = reader->getNodeData();
const c8* p = &data[0];
for (int i=0; i<indexCount && *p; ++i)
{
findNextNoneWhiteSpace(&p);
indices.push_back(readInt(&p));
}
}
void CIrrMeshFileLoader::readMeshBuffer(io::IXMLReader* reader, int vertexCount, CDynamicMeshBuffer* sbuffer)
{
core::stringc data = reader->getNodeData();
const c8* p = &data[0];
scene::IVertexBuffer& Vertices = sbuffer->getVertexBuffer();
video::E_VERTEX_TYPE vType = Vertices.getType();
if (sbuffer)
{
for (int i=0; i<vertexCount && *p; ++i)
{
switch(vType)
{
case video::EVT_STANDARD:
{
video::S3DVertex vtx;
// position
findNextNoneWhiteSpace(&p);
vtx.Pos.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Pos.Y = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Pos.Z = readFloat(&p);
// normal
findNextNoneWhiteSpace(&p);
vtx.Normal.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Normal.Y = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Normal.Z = readFloat(&p);
// color
u32 col;
findNextNoneWhiteSpace(&p);
sscanf(p, "%08x", &col);
vtx.Color.set(col);
skipCurrentNoneWhiteSpace(&p);
// tcoord1
findNextNoneWhiteSpace(&p);
vtx.TCoords.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.TCoords.Y = readFloat(&p);
Vertices.push_back(vtx);
}
break;
case video::EVT_2TCOORDS:
{
video::S3DVertex2TCoords vtx;
// position
findNextNoneWhiteSpace(&p);
vtx.Pos.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Pos.Y = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Pos.Z = readFloat(&p);
// normal
findNextNoneWhiteSpace(&p);
vtx.Normal.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Normal.Y = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Normal.Z = readFloat(&p);
// color
u32 col;
findNextNoneWhiteSpace(&p);
sscanf(p, "%08x", &col);
vtx.Color.set(col);
skipCurrentNoneWhiteSpace(&p);
// tcoord1
findNextNoneWhiteSpace(&p);
vtx.TCoords.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.TCoords.Y = readFloat(&p);
// tcoord2
findNextNoneWhiteSpace(&p);
vtx.TCoords2.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.TCoords2.Y = readFloat(&p);
Vertices.push_back(vtx);
}
break;
case video::EVT_TANGENTS:
{
video::S3DVertexTangents vtx;
// position
findNextNoneWhiteSpace(&p);
vtx.Pos.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Pos.Y = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Pos.Z = readFloat(&p);
// normal
findNextNoneWhiteSpace(&p);
vtx.Normal.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Normal.Y = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Normal.Z = readFloat(&p);
// color
u32 col;
findNextNoneWhiteSpace(&p);
sscanf(p, "%08x", &col);
vtx.Color.set(col);
skipCurrentNoneWhiteSpace(&p);
// tcoord1
findNextNoneWhiteSpace(&p);
vtx.TCoords.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.TCoords.Y = readFloat(&p);
// tangent
findNextNoneWhiteSpace(&p);
vtx.Tangent.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Tangent.Y = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Tangent.Z = readFloat(&p);
// binormal
findNextNoneWhiteSpace(&p);
vtx.Binormal.X = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Binormal.Y = readFloat(&p);
findNextNoneWhiteSpace(&p);
vtx.Binormal.Z = readFloat(&p);
Vertices.push_back(vtx);
}
break;
};
}
}
}
//! skips an (unknown) section in the irrmesh document
void CIrrMeshFileLoader::skipSection(io::IXMLReader* reader, bool reportSkipping)
{
#ifdef _DEBUG
os::Printer::log("irrMesh skipping section", core::stringc(reader->getNodeName()).c_str());
#endif
// skip if this element is empty anyway.
if (reader->isEmptyElement())
return;
// read until we've reached the last element in this section
u32 tagCounter = 1;
while(tagCounter && reader->read())
{
if (reader->getNodeType() == io::EXN_ELEMENT &&
!reader->isEmptyElement())
{
#ifdef _DEBUG
if (reportSkipping)
os::Printer::log("irrMesh unknown element:", core::stringc(reader->getNodeName()).c_str());
#endif
++tagCounter;
}
else
if (reader->getNodeType() == io::EXN_ELEMENT_END)
--tagCounter;
}
}
//! parses a float from a char pointer and moves the pointer
//! to the end of the parsed float
inline f32 CIrrMeshFileLoader::readFloat(const c8** p)
{
f32 ftmp;
*p = core::fast_atof_move(*p, ftmp);
return ftmp;
}
//! parses an int from a char pointer and moves the pointer to
//! the end of the parsed float
inline s32 CIrrMeshFileLoader::readInt(const c8** p)
{
return (s32)readFloat(p);
}
//! places pointer to next begin of a token
void CIrrMeshFileLoader::skipCurrentNoneWhiteSpace(const c8** start)
{
const c8* p = *start;
while(*p && !(*p==' ' || *p=='\n' || *p=='\r' || *p=='\t'))
++p;
// TODO: skip comments <!-- -->
*start = p;
}
//! places pointer to next begin of a token
void CIrrMeshFileLoader::findNextNoneWhiteSpace(const c8** start)
{
const c8* p = *start;
while(*p && (*p==' ' || *p=='\n' || *p=='\r' || *p=='\t'))
++p;
// TODO: skip comments <!-- -->
*start = p;
}
//! reads floats from inside of xml element until end of xml element
void CIrrMeshFileLoader::readFloatsInsideElement(io::IXMLReader* reader, f32* floats, u32 count)
{
if (reader->isEmptyElement())
return;
while(reader->read())
{
// TODO: check for comments inside the element
// and ignore them.
if (reader->getNodeType() == io::EXN_TEXT)
{
// parse float data
core::stringc data = reader->getNodeData();
const c8* p = &data[0];
for (u32 i=0; i<count; ++i)
{
findNextNoneWhiteSpace(&p);
if (*p)
floats[i] = readFloat(&p);
else
floats[i] = 0.0f;
}
}
else
if (reader->getNodeType() == io::EXN_ELEMENT_END)
break; // end parsing text
}
}
} // end namespace scene
} // end namespace irr
#endif // _IRR_COMPILE_WITH_IRR_MESH_LOADER_

@ -1,90 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_IRR_MESH_FILE_LOADER_H_INCLUDED__
#define __C_IRR_MESH_FILE_LOADER_H_INCLUDED__
#include "IMeshLoader.h"
#include "IFileSystem.h"
#include "IVideoDriver.h"
#include "irrString.h"
#include "SMesh.h"
#include "SMeshBuffer.h"
#include "CDynamicMeshBuffer.h"
#include "ISceneManager.h"
namespace irr
{
namespace scene
{
//! Meshloader capable of loading .irrmesh meshes, the Irrlicht Engine mesh format for static meshes
class CIrrMeshFileLoader : public IMeshLoader
{
public:
//! Constructor
CIrrMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs);
//! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".cob")
virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
//! creates/loads an animated mesh from the file.
//! \return Pointer to the created mesh. Returns 0 if loading failed.
//! If you no longer need the mesh, you should call IAnimatedMesh::drop().
//! See IReferenceCounted::drop() for more information.
virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_;
private:
//! reads a mesh sections and creates a mesh from it
IAnimatedMesh* readMesh(io::IXMLReader* reader);
//! reads a mesh sections and creates a mesh buffer from it
IMeshBuffer* readMeshBuffer(io::IXMLReader* reader);
//! skips an (unknown) section in the irrmesh file
void skipSection(io::IXMLReader* reader, bool reportSkipping);
//! reads a <material> element and stores it in the material section
void readMaterial(io::IXMLReader* reader);
//! parses a float from a char pointer and moves the pointer to
//! the end of the parsed float
inline f32 readFloat(const c8** p);
//! parses an int from a char pointer and moves the pointer to
//! the end of the parsed float
inline s32 readInt(const c8** p);
//! places pointer to next begin of a token
void findNextNoneWhiteSpace(const c8** p);
//! places pointer to next begin of a token
void skipCurrentNoneWhiteSpace(const c8** p);
//! reads floats from inside of xml element until end of xml element
void readFloatsInsideElement(io::IXMLReader* reader, f32* floats, u32 count);
//! read the mesh buffers
void readMeshBuffer(io::IXMLReader* reader, int vertexCount, CDynamicMeshBuffer* sbuffer);
//! read indices
void readIndices(io::IXMLReader* reader, int indexCount, IIndexBuffer& indices);
// member variables
scene::ISceneManager* SceneManager;
io::IFileSystem* FileSystem;
};
} // end namespace scene
} // end namespace irr
#endif

@ -1,312 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_IRR_WRITER_
#include "CIrrMeshWriter.h"
#include "os.h"
#include "IWriteFile.h"
#include "IXMLWriter.h"
#include "IMesh.h"
#include "IAttributes.h"
namespace irr
{
namespace scene
{
CIrrMeshWriter::CIrrMeshWriter(video::IVideoDriver* driver,
io::IFileSystem* fs)
: FileSystem(fs), VideoDriver(driver), Writer(0)
{
#ifdef _DEBUG
setDebugName("CIrrMeshWriter");
#endif
if (VideoDriver)
VideoDriver->grab();
if (FileSystem)
FileSystem->grab();
}
CIrrMeshWriter::~CIrrMeshWriter()
{
if (VideoDriver)
VideoDriver->drop();
if (FileSystem)
FileSystem->drop();
}
//! Returns the type of the mesh writer
EMESH_WRITER_TYPE CIrrMeshWriter::getType() const
{
return EMWT_IRR_MESH;
}
//! writes a mesh
bool CIrrMeshWriter::writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags)
{
if (!file)
return false;
Writer = FileSystem->createXMLWriter(file);
if (!Writer)
{
os::Printer::log("Could not write file", file->getFileName());
return false;
}
os::Printer::log("Writing mesh", file->getFileName());
// write IRR MESH header
Writer->writeXMLHeader();
Writer->writeElement(L"mesh", false,
L"xmlns", L"http://irrlicht.sourceforge.net/IRRMESH_09_2007",
L"version", L"1.0");
Writer->writeLineBreak();
// add some informational comment. Add a space after and before the comment
// tags so that some braindead xml parsers (AS anyone?) are able to parse this too.
core::stringw infoComment = L" This file contains a static mesh in the Irrlicht Engine format with ";
infoComment += core::stringw(mesh->getMeshBufferCount());
infoComment += L" materials.";
Writer->writeComment(infoComment.c_str());
Writer->writeLineBreak();
// write mesh bounding box
writeBoundingBox(mesh->getBoundingBox());
Writer->writeLineBreak();
// write mesh buffers
for (int i=0; i<(int)mesh->getMeshBufferCount(); ++i)
{
scene::IMeshBuffer* buffer = mesh->getMeshBuffer(i);
if (buffer)
{
writeMeshBuffer(buffer);
Writer->writeLineBreak();
}
}
Writer->writeClosingTag(L"mesh");
Writer->drop();
return true;
}
void CIrrMeshWriter::writeBoundingBox(const core::aabbox3df& box)
{
Writer->writeElement(L"boundingBox", true,
L"minEdge", getVectorAsStringLine(box.MinEdge).c_str(),
L"maxEdge", getVectorAsStringLine(box.MaxEdge).c_str());
}
core::stringw CIrrMeshWriter::getVectorAsStringLine(const core::vector3df& v) const
{
core::stringw str;
str = core::stringw(v.X);
str += L" ";
str += core::stringw(v.Y);
str += L" ";
str += core::stringw(v.Z);
return str;
}
core::stringw CIrrMeshWriter::getVectorAsStringLine(const core::vector2df& v) const
{
core::stringw str;
str = core::stringw(v.X);
str += L" ";
str += core::stringw(v.Y);
return str;
}
void CIrrMeshWriter::writeMeshBuffer(const scene::IMeshBuffer* buffer)
{
Writer->writeElement(L"buffer", false);
Writer->writeLineBreak();
// write bounding box
writeBoundingBox(buffer->getBoundingBox());
Writer->writeLineBreak();
// write material
writeMaterial(buffer->getMaterial());
// write vertices
const core::stringw vertexTypeStr = video::sBuiltInVertexTypeNames[buffer->getVertexType()];
Writer->writeElement(L"vertices", false,
L"type", vertexTypeStr.c_str(),
L"vertexCount", core::stringw(buffer->getVertexCount()).c_str());
Writer->writeLineBreak();
u32 vertexCount = buffer->getVertexCount();
switch(buffer->getVertexType())
{
case video::EVT_STANDARD:
{
video::S3DVertex* vtx = (video::S3DVertex*)buffer->getVertices();
for (u32 j=0; j<vertexCount; ++j)
{
core::stringw str = getVectorAsStringLine(vtx[j].Pos);
str += L" ";
str += getVectorAsStringLine(vtx[j].Normal);
char tmp[12];
sprintf(tmp, " %02x%02x%02x%02x ", vtx[j].Color.getAlpha(), vtx[j].Color.getRed(), vtx[j].Color.getGreen(), vtx[j].Color.getBlue());
str += tmp;
str += getVectorAsStringLine(vtx[j].TCoords);
Writer->writeText(str.c_str());
Writer->writeLineBreak();
}
}
break;
case video::EVT_2TCOORDS:
{
video::S3DVertex2TCoords* vtx = (video::S3DVertex2TCoords*)buffer->getVertices();
for (u32 j=0; j<vertexCount; ++j)
{
core::stringw str = getVectorAsStringLine(vtx[j].Pos);
str += L" ";
str += getVectorAsStringLine(vtx[j].Normal);
char tmp[12];
sprintf(tmp, " %02x%02x%02x%02x ", vtx[j].Color.getAlpha(), vtx[j].Color.getRed(), vtx[j].Color.getGreen(), vtx[j].Color.getBlue());
str += tmp;
str += getVectorAsStringLine(vtx[j].TCoords);
str += L" ";
str += getVectorAsStringLine(vtx[j].TCoords2);
Writer->writeText(str.c_str());
Writer->writeLineBreak();
}
}
break;
case video::EVT_TANGENTS:
{
video::S3DVertexTangents* vtx = (video::S3DVertexTangents*)buffer->getVertices();
for (u32 j=0; j<vertexCount; ++j)
{
core::stringw str = getVectorAsStringLine(vtx[j].Pos);
str += L" ";
str += getVectorAsStringLine(vtx[j].Normal);
char tmp[12];
sprintf(tmp, " %02x%02x%02x%02x ", vtx[j].Color.getAlpha(), vtx[j].Color.getRed(), vtx[j].Color.getGreen(), vtx[j].Color.getBlue());
str += tmp;
str += getVectorAsStringLine(vtx[j].TCoords);
str += L" ";
str += getVectorAsStringLine(vtx[j].Tangent);
str += L" ";
str += getVectorAsStringLine(vtx[j].Binormal);
Writer->writeText(str.c_str());
Writer->writeLineBreak();
}
}
break;
}
Writer->writeClosingTag(L"vertices");
Writer->writeLineBreak();
// write indices
Writer->writeElement(L"indices", false,
L"indexCount", core::stringw(buffer->getIndexCount()).c_str());
Writer->writeLineBreak();
int indexCount = (int)buffer->getIndexCount();
video::E_INDEX_TYPE iType = buffer->getIndexType();
const u16* idx16 = buffer->getIndices();
const u32* idx32 = (u32*) buffer->getIndices();
const int maxIndicesPerLine = 25;
for (int i=0; i<indexCount; ++i)
{
if(iType == video::EIT_16BIT)
{
core::stringw str((int)idx16[i]);
Writer->writeText(str.c_str());
}
else
{
core::stringw str((int)idx32[i]);
Writer->writeText(str.c_str());
}
if (i % maxIndicesPerLine == maxIndicesPerLine-1)
Writer->writeLineBreak();
else
Writer->writeText(L" ");
}
if ((indexCount-1) % maxIndicesPerLine != maxIndicesPerLine-1)
Writer->writeLineBreak();
Writer->writeClosingTag(L"indices");
Writer->writeLineBreak();
// close buffer tag
Writer->writeClosingTag(L"buffer");
}
void CIrrMeshWriter::writeMaterial(const video::SMaterial& material)
{
// simply use irrlichts built-in attribute serialization capabilities here:
io::IAttributes* attributes =
VideoDriver->createAttributesFromMaterial(material);
if (attributes)
{
attributes->write(Writer, false, L"material");
attributes->drop();
}
}
} // end namespace
} // end namespace
#endif

@ -1,61 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __IRR_IRR_MESH_WRITER_H_INCLUDED__
#define __IRR_IRR_MESH_WRITER_H_INCLUDED__
#include "IMeshWriter.h"
#include "S3DVertex.h"
#include "IVideoDriver.h"
#include "IFileSystem.h"
#include "IXMLWriter.h"
namespace irr
{
namespace scene
{
class IMeshBuffer;
//! class to write meshes, implementing a IrrMesh (.irrmesh, .xml) writer
/** This writer implementation has been originally developed for irrEdit and then
merged out to the Irrlicht Engine */
class CIrrMeshWriter : public IMeshWriter
{
public:
CIrrMeshWriter(video::IVideoDriver* driver, io::IFileSystem* fs);
virtual ~CIrrMeshWriter();
//! Returns the type of the mesh writer
virtual EMESH_WRITER_TYPE getType() const _IRR_OVERRIDE_;
//! writes a mesh
virtual bool writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags=EMWF_NONE) _IRR_OVERRIDE_;
protected:
void writeBoundingBox(const core::aabbox3df& box);
void writeMeshBuffer(const scene::IMeshBuffer* buffer);
void writeMaterial(const video::SMaterial& material);
core::stringw getVectorAsStringLine(const core::vector3df& v) const;
core::stringw getVectorAsStringLine(const core::vector2df& v) const;
// member variables:
io::IFileSystem* FileSystem;
video::IVideoDriver* VideoDriver;
io::IXMLWriter* Writer;
};
} // end namespace
} // end namespace
#endif

@ -110,14 +110,12 @@ set(IRRMESHLOADER
C3DSMeshFileLoader.cpp C3DSMeshFileLoader.cpp
COgreMeshFileLoader.cpp COgreMeshFileLoader.cpp
COBJMeshFileLoader.cpp COBJMeshFileLoader.cpp
CColladaFileLoader.cpp
CCSMLoader.cpp CCSMLoader.cpp
CDMFLoader.cpp CDMFLoader.cpp
CLMTSMeshFileLoader.cpp CLMTSMeshFileLoader.cpp
CMY3DMeshFileLoader.cpp CMY3DMeshFileLoader.cpp
COCTLoader.cpp COCTLoader.cpp
CXMeshFileLoader.cpp CXMeshFileLoader.cpp
CIrrMeshFileLoader.cpp
CSTLMeshFileLoader.cpp CSTLMeshFileLoader.cpp
CLWOMeshFileLoader.cpp CLWOMeshFileLoader.cpp
CPLYMeshFileLoader.cpp CPLYMeshFileLoader.cpp
@ -126,8 +124,6 @@ set(IRRMESHLOADER
) )
set(IRRMESHWRITER set(IRRMESHWRITER
CColladaMeshWriter.cpp
CIrrMeshWriter.cpp
CSTLMeshWriter.cpp CSTLMeshWriter.cpp
COBJMeshWriter.cpp COBJMeshWriter.cpp
CPLYMeshWriter.cpp CPLYMeshWriter.cpp
@ -176,7 +172,6 @@ add_library(IRROBJ OBJECT
CMeshCache.cpp CMeshCache.cpp
CDefaultSceneNodeAnimatorFactory.cpp CDefaultSceneNodeAnimatorFactory.cpp
CDefaultSceneNodeFactory.cpp CDefaultSceneNodeFactory.cpp
CSceneLoaderIrr.cpp
) )
add_library(IRRPARTICLEOBJ OBJECT add_library(IRRPARTICLEOBJ OBJECT
@ -318,15 +313,12 @@ add_library(IRRIOOBJ OBJECT
CMemoryFile.cpp CMemoryFile.cpp
CReadFile.cpp CReadFile.cpp
CWriteFile.cpp CWriteFile.cpp
CXMLReader.cpp
CXMLWriter.cpp
CWADReader.cpp CWADReader.cpp
CZipReader.cpp CZipReader.cpp
CPakReader.cpp CPakReader.cpp
CNPKReader.cpp CNPKReader.cpp
CTarReader.cpp CTarReader.cpp
CMountPointReader.cpp CMountPointReader.cpp
irrXML.cpp
CAttributes.cpp CAttributes.cpp
) )

@ -1,284 +0,0 @@
// Copyright (C) 2010-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CSceneLoaderIrr.h"
#include "ISceneNodeAnimatorFactory.h"
#include "ISceneUserDataSerializer.h"
#include "ISceneManager.h"
#include "IVideoDriver.h"
#include "IFileSystem.h"
#include "os.h"
namespace irr
{
namespace scene
{
//! Constructor
CSceneLoaderIrr::CSceneLoaderIrr(ISceneManager *smgr, io::IFileSystem* fs)
: SceneManager(smgr), FileSystem(fs),
IRR_XML_FORMAT_SCENE(L"irr_scene"), IRR_XML_FORMAT_NODE(L"node"), IRR_XML_FORMAT_NODE_ATTR_TYPE(L"type"),
IRR_XML_FORMAT_ATTRIBUTES(L"attributes"), IRR_XML_FORMAT_MATERIALS(L"materials"),
IRR_XML_FORMAT_ANIMATORS(L"animators"), IRR_XML_FORMAT_USERDATA(L"userData")
{
}
//! Destructor
CSceneLoaderIrr::~CSceneLoaderIrr()
{
}
//! Returns true if the class might be able to load this file.
bool CSceneLoaderIrr::isALoadableFileExtension(const io::path& filename) const
{
return core::hasFileExtension(filename, "irr");
}
//! Returns true if the class might be able to load this file.
bool CSceneLoaderIrr::isALoadableFileFormat(io::IReadFile *file) const
{
// todo: check inside the file
return true;
}
//! Loads the scene into the scene manager.
bool CSceneLoaderIrr::loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer,
ISceneNode* rootNode)
{
if (!file)
{
os::Printer::log("Unable to open scene file", ELL_ERROR);
return false;
}
io::IXMLReader* reader = FileSystem->createXMLReader(file);
if (!reader)
{
os::Printer::log("Scene is not a valid XML file", file->getFileName().c_str(), ELL_ERROR);
return false;
}
// TODO: COLLADA_CREATE_SCENE_INSTANCES can be removed when the COLLADA loader is a scene loader
bool oldColladaSingleMesh = SceneManager->getParameters()->getAttributeAsBool(COLLADA_CREATE_SCENE_INSTANCES);
SceneManager->getParameters()->setAttribute(COLLADA_CREATE_SCENE_INSTANCES, false);
// read file
while (reader->read())
{
readSceneNode(reader, rootNode, userDataSerializer);
}
// restore old collada parameters
SceneManager->getParameters()->setAttribute(COLLADA_CREATE_SCENE_INSTANCES, oldColladaSingleMesh);
// clean up
reader->drop();
return true;
}
//! Reads the next node
void CSceneLoaderIrr::readSceneNode(io::IXMLReader* reader, ISceneNode* parent,
ISceneUserDataSerializer* userDataSerializer)
{
if (!reader)
return;
scene::ISceneNode* node = 0;
if (!parent && IRR_XML_FORMAT_SCENE==reader->getNodeName())
node = SceneManager->getRootSceneNode();
else if (parent && IRR_XML_FORMAT_NODE==reader->getNodeName())
{
// find node type and create it
core::stringc attrName = reader->getAttributeValue(IRR_XML_FORMAT_NODE_ATTR_TYPE.c_str());
node = SceneManager->addSceneNode(attrName.c_str(), parent);
if (!node)
os::Printer::log("Could not create scene node of unknown type", attrName.c_str());
}
else
node=parent;
// read attributes
while(reader->read())
{
bool endreached = false;
const wchar_t* name = reader->getNodeName();
switch (reader->getNodeType())
{
case io::EXN_ELEMENT_END:
if ((IRR_XML_FORMAT_NODE == name) ||
(IRR_XML_FORMAT_SCENE == name))
{
endreached = true;
}
break;
case io::EXN_ELEMENT:
if (IRR_XML_FORMAT_ATTRIBUTES == name)
{
// read attributes
io::IAttributes* attr = FileSystem->createEmptyAttributes(SceneManager->getVideoDriver());
attr->read(reader, true);
if (node)
node->deserializeAttributes(attr);
attr->drop();
}
else
if (IRR_XML_FORMAT_MATERIALS == name)
readMaterials(reader, node);
else
if (IRR_XML_FORMAT_ANIMATORS == name)
readAnimators(reader, node);
else
if (IRR_XML_FORMAT_USERDATA == name)
readUserData(reader, node, userDataSerializer);
else
if ((IRR_XML_FORMAT_NODE == name) ||
(IRR_XML_FORMAT_SCENE == name))
{
readSceneNode(reader, node, userDataSerializer);
}
else
{
os::Printer::log("Found unknown element in irrlicht scene file",
core::stringc(name).c_str());
}
break;
default:
break;
}
if (endreached)
break;
}
if (node && userDataSerializer)
userDataSerializer->OnCreateNode(node);
}
//! reads materials of a node
void CSceneLoaderIrr::readMaterials(io::IXMLReader* reader, ISceneNode* node)
{
u32 nr = 0;
while(reader->read())
{
const wchar_t* name = reader->getNodeName();
switch(reader->getNodeType())
{
case io::EXN_ELEMENT_END:
if (IRR_XML_FORMAT_MATERIALS == name)
return;
break;
case io::EXN_ELEMENT:
if (IRR_XML_FORMAT_ATTRIBUTES == name)
{
// read materials from attribute list
io::IAttributes* attr = FileSystem->createEmptyAttributes(SceneManager->getVideoDriver());
attr->read(reader);
if (node && node->getMaterialCount() > nr)
{
SceneManager->getVideoDriver()->fillMaterialStructureFromAttributes(
node->getMaterial(nr), attr);
}
attr->drop();
++nr;
}
break;
default:
break;
}
}
}
//! reads animators of a node
void CSceneLoaderIrr::readAnimators(io::IXMLReader* reader, ISceneNode* node)
{
while(reader->read())
{
const wchar_t* name = reader->getNodeName();
switch(reader->getNodeType())
{
case io::EXN_ELEMENT_END:
if (IRR_XML_FORMAT_ANIMATORS == name)
return;
break;
case io::EXN_ELEMENT:
if (IRR_XML_FORMAT_ATTRIBUTES == name)
{
// read animator data from attribute list
io::IAttributes* attr = FileSystem->createEmptyAttributes(SceneManager->getVideoDriver());
attr->read(reader);
if (node)
{
core::stringc typeName = attr->getAttributeAsString("Type");
ISceneNodeAnimator* anim = SceneManager->createSceneNodeAnimator(typeName.c_str(), node);
if (anim)
{
anim->deserializeAttributes(attr);
anim->drop();
}
}
attr->drop();
}
break;
default:
break;
}
}
}
//! reads user data of a node
void CSceneLoaderIrr::readUserData(io::IXMLReader* reader, ISceneNode* node, ISceneUserDataSerializer* userDataSerializer)
{
while(reader->read())
{
const wchar_t* name = reader->getNodeName();
switch(reader->getNodeType())
{
case io::EXN_ELEMENT_END:
if (IRR_XML_FORMAT_USERDATA == name)
return;
break;
case io::EXN_ELEMENT:
if (IRR_XML_FORMAT_ATTRIBUTES == name)
{
// read user data from attribute list
io::IAttributes* attr = FileSystem->createEmptyAttributes(SceneManager->getVideoDriver());
attr->read(reader);
if (node && userDataSerializer)
{
userDataSerializer->OnReadUserData(node, attr);
}
attr->drop();
}
break;
default:
break;
}
}
}
} // scene
} // irr

@ -1,83 +0,0 @@
// Copyright (C) 2010-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_SCENE_LOADER_IRR_H_INCLUDED__
#define __C_SCENE_LOADER_IRR_H_INCLUDED__
#include "ISceneLoader.h"
#include "IXMLReader.h"
namespace irr
{
namespace io
{
class IFileSystem;
}
namespace scene
{
class ISceneManager;
//! Class which can load a scene into the scene manager.
class CSceneLoaderIrr : public virtual ISceneLoader
{
public:
//! Constructor
CSceneLoaderIrr(ISceneManager *smgr, io::IFileSystem* fs);
//! Destructor
virtual ~CSceneLoaderIrr();
//! Returns true if the class might be able to load this file.
virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
//! Returns true if the class might be able to load this file.
virtual bool isALoadableFileFormat(io::IReadFile *file) const _IRR_OVERRIDE_;
//! Loads the scene into the scene manager.
virtual bool loadScene(io::IReadFile* file,
ISceneUserDataSerializer* userDataSerializer=0,
ISceneNode* rootNode=0) _IRR_OVERRIDE_;
private:
//! Recursively reads nodes from the xml file
void readSceneNode(io::IXMLReader* reader, ISceneNode* parent,
ISceneUserDataSerializer* userDataSerializer);
//! read a node's materials
void readMaterials(io::IXMLReader* reader, ISceneNode* node);
//! read a node's animators
void readAnimators(io::IXMLReader* reader, ISceneNode* node);
//! read any other data into the user serializer
void readUserData(io::IXMLReader* reader, ISceneNode* node,
ISceneUserDataSerializer* userDataSerializer);
ISceneManager *SceneManager;
io::IFileSystem *FileSystem;
//! constants for reading and writing XML.
//! Not made static due to portability problems.
// TODO: move to own header
const core::stringw IRR_XML_FORMAT_SCENE;
const core::stringw IRR_XML_FORMAT_NODE;
const core::stringw IRR_XML_FORMAT_NODE_ATTR_TYPE;
const core::stringw IRR_XML_FORMAT_ATTRIBUTES;
const core::stringw IRR_XML_FORMAT_MATERIALS;
const core::stringw IRR_XML_FORMAT_ANIMATORS;
const core::stringw IRR_XML_FORMAT_USERDATA;
};
} // end namespace scene
} // end namespace irr
#endif

@ -8,7 +8,6 @@
#include "IFileSystem.h" #include "IFileSystem.h"
#include "SAnimatedMesh.h" #include "SAnimatedMesh.h"
#include "CMeshCache.h" #include "CMeshCache.h"
#include "IXMLWriter.h"
#include "ISceneUserDataSerializer.h" #include "ISceneUserDataSerializer.h"
#include "IGUIEnvironment.h" #include "IGUIEnvironment.h"
#include "IMaterialRenderer.h" #include "IMaterialRenderer.h"
@ -26,10 +25,6 @@
#include "CSkinnedMesh.h" #include "CSkinnedMesh.h"
#endif #endif
#ifdef _IRR_COMPILE_WITH_IRR_MESH_LOADER_
#include "CIrrMeshFileLoader.h"
#endif
#ifdef _IRR_COMPILE_WITH_BSP_LOADER_ #ifdef _IRR_COMPILE_WITH_BSP_LOADER_
#include "CBSPMeshFileLoader.h" #include "CBSPMeshFileLoader.h"
#endif #endif
@ -70,10 +65,6 @@
#include "CMY3DMeshFileLoader.h" #include "CMY3DMeshFileLoader.h"
#endif #endif
#ifdef _IRR_COMPILE_WITH_COLLADA_LOADER_
#include "CColladaFileLoader.h"
#endif
#ifdef _IRR_COMPILE_WITH_DMF_LOADER_ #ifdef _IRR_COMPILE_WITH_DMF_LOADER_
#include "CDMFLoader.h" #include "CDMFLoader.h"
#endif #endif
@ -110,18 +101,6 @@
#include "CSMFMeshFileLoader.h" #include "CSMFMeshFileLoader.h"
#endif #endif
#ifdef _IRR_COMPILE_WITH_IRR_SCENE_LOADER_
#include "CSceneLoaderIrr.h"
#endif
#ifdef _IRR_COMPILE_WITH_COLLADA_WRITER_
#include "CColladaMeshWriter.h"
#endif
#ifdef _IRR_COMPILE_WITH_IRR_WRITER_
#include "CIrrMeshWriter.h"
#endif
#ifdef _IRR_COMPILE_WITH_STL_WRITER_ #ifdef _IRR_COMPILE_WITH_STL_WRITER_
#include "CSTLMeshWriter.h" #include "CSTLMeshWriter.h"
#endif #endif
@ -219,8 +198,7 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
: ISceneNode(0, 0), Driver(driver), FileSystem(fs), GUIEnvironment(gui), : ISceneNode(0, 0), Driver(driver), FileSystem(fs), GUIEnvironment(gui),
CursorControl(cursorControl), CollisionManager(0), CursorControl(cursorControl), CollisionManager(0),
ActiveCamera(0), ShadowColor(150,0,0,0), AmbientLight(0,0,0,0), Parameters(0), ActiveCamera(0), ShadowColor(150,0,0,0), AmbientLight(0,0,0,0), Parameters(0),
MeshCache(cache), CurrentRenderPass(ESNRP_NONE), LightManager(0), MeshCache(cache), CurrentRenderPass(ESNRP_NONE), LightManager(0)
IRR_XML_FORMAT_SCENE(L"irr_scene"), IRR_XML_FORMAT_NODE(L"node"), IRR_XML_FORMAT_NODE_ATTR_TYPE(L"type")
{ {
#ifdef _DEBUG #ifdef _DEBUG
ISceneManager::setDebugName("CSceneManager ISceneManager"); ISceneManager::setDebugName("CSceneManager ISceneManager");
@ -304,15 +282,9 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
#ifdef _IRR_COMPILE_WITH_MD2_LOADER_ #ifdef _IRR_COMPILE_WITH_MD2_LOADER_
MeshLoaderList.push_back(new CMD2MeshFileLoader()); MeshLoaderList.push_back(new CMD2MeshFileLoader());
#endif #endif
#ifdef _IRR_COMPILE_WITH_IRR_MESH_LOADER_
MeshLoaderList.push_back(new CIrrMeshFileLoader(this, FileSystem));
#endif
#ifdef _IRR_COMPILE_WITH_BSP_LOADER_ #ifdef _IRR_COMPILE_WITH_BSP_LOADER_
MeshLoaderList.push_back(new CBSPMeshFileLoader(this, FileSystem)); MeshLoaderList.push_back(new CBSPMeshFileLoader(this, FileSystem));
#endif #endif
#ifdef _IRR_COMPILE_WITH_COLLADA_LOADER_
MeshLoaderList.push_back(new CColladaFileLoader(this, FileSystem));
#endif
#ifdef _IRR_COMPILE_WITH_3DS_LOADER_ #ifdef _IRR_COMPILE_WITH_3DS_LOADER_
MeshLoaderList.push_back(new C3DSMeshFileLoader(this, FileSystem)); MeshLoaderList.push_back(new C3DSMeshFileLoader(this, FileSystem));
#endif #endif
@ -329,11 +301,6 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
MeshLoaderList.push_back(new CB3DMeshFileLoader(this)); MeshLoaderList.push_back(new CB3DMeshFileLoader(this));
#endif #endif
// scene loaders
#ifdef _IRR_COMPILE_WITH_IRR_SCENE_LOADER_
SceneLoaderList.push_back(new CSceneLoaderIrr(this, FileSystem));
#endif
// factories // factories
ISceneNodeFactory* factory = new CDefaultSceneNodeFactory(this); ISceneNodeFactory* factory = new CDefaultSceneNodeFactory(this);
registerSceneNodeFactory(factory); registerSceneNodeFactory(factory);
@ -2297,47 +2264,10 @@ bool CSceneManager::saveScene(const io::path& filename, ISceneUserDataSerializer
//! Saves the current scene into a file. //! Saves the current scene into a file.
bool CSceneManager::saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer, ISceneNode* node) bool CSceneManager::saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer, ISceneNode* node)
{
if (!file)
{ {
return false; return false;
} }
bool result=false;
io::IXMLWriter* writer = FileSystem->createXMLWriter(file);
if (!writer)
{
os::Printer::log("Unable to create XML writer", file->getFileName(), ELL_ERROR);
}
else
{
result = saveScene(writer, FileSystem->getFileDir(FileSystem->getAbsolutePath(file->getFileName())), userDataSerializer, node);
writer->drop();
}
return result;
}
//! Saves the current scene into a file.
bool CSceneManager::saveScene(io::IXMLWriter* writer, const io::path& currentPath, ISceneUserDataSerializer* userDataSerializer, ISceneNode* node)
{
if (!writer)
return false;
if (!node)
node=this;
char* oldLocale = setlocale(LC_NUMERIC, NULL);
setlocale(LC_NUMERIC, "C"); // float number should to be saved with dots in this format independent of current locale settings.
writer->writeXMLHeader();
writeSceneNode(writer, node, userDataSerializer, currentPath.c_str(), true);
setlocale(LC_NUMERIC, oldLocale);
return true;
}
//! Loads a scene. //! Loads a scene.
bool CSceneManager::loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer, ISceneNode* rootNode) bool CSceneManager::loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer, ISceneNode* rootNode)
@ -2380,139 +2310,6 @@ bool CSceneManager::loadScene(io::IReadFile* file, ISceneUserDataSerializer* use
} }
//! writes a scene node
void CSceneManager::writeSceneNode(io::IXMLWriter* writer, ISceneNode* node, ISceneUserDataSerializer* userDataSerializer,
const fschar_t* currentPath, bool init)
{
if (!writer || !node || node->isDebugObject())
return;
const wchar_t* name;
ISceneNode* tmpNode=node;
if (init)
{
name = IRR_XML_FORMAT_SCENE.c_str();
writer->writeElement(name, false);
node=this;
}
else
{
name = IRR_XML_FORMAT_NODE.c_str();
writer->writeElement(name, false, IRR_XML_FORMAT_NODE_ATTR_TYPE.c_str(),
core::stringw(getSceneNodeTypeName(node->getType())).c_str());
}
writer->writeLineBreak();
// write properties
io::IAttributes* attr = FileSystem->createEmptyAttributes(Driver);
io::SAttributeReadWriteOptions options;
if (currentPath)
{
options.Filename=currentPath;
options.Flags|=io::EARWF_USE_RELATIVE_PATHS;
}
node->serializeAttributes(attr, &options);
if (attr->getAttributeCount() != 0)
{
attr->write(writer);
writer->writeLineBreak();
}
// write materials
if (node->getMaterialCount() && Driver)
{
const wchar_t* materialElement = L"materials";
writer->writeElement(materialElement);
writer->writeLineBreak();
for (u32 i=0; i < node->getMaterialCount(); ++i)
{
io::IAttributes* tmp_attr =
Driver->createAttributesFromMaterial(node->getMaterial(i), &options);
tmp_attr->write(writer);
tmp_attr->drop();
}
writer->writeClosingTag(materialElement);
writer->writeLineBreak();
}
// write animators
if (!node->getAnimators().empty())
{
const wchar_t* animatorElement = L"animators";
writer->writeElement(animatorElement);
writer->writeLineBreak();
ISceneNodeAnimatorList::ConstIterator it = node->getAnimators().begin();
for (; it != node->getAnimators().end(); ++it)
{
attr->clear();
attr->addString("Type", getAnimatorTypeName((*it)->getType()));
(*it)->serializeAttributes(attr);
attr->write(writer);
}
writer->writeClosingTag(animatorElement);
writer->writeLineBreak();
}
// write possible user data
if (userDataSerializer)
{
io::IAttributes* userData = userDataSerializer->createUserData(node);
if (userData)
{
const wchar_t* userDataElement = L"userData";
writer->writeLineBreak();
writer->writeElement(userDataElement);
writer->writeLineBreak();
userData->write(writer);
writer->writeClosingTag(userDataElement);
writer->writeLineBreak();
writer->writeLineBreak();
userData->drop();
}
}
// reset to actual root node
if (init)
node=tmpNode;
// write children once root node is written
// if parent is not scene manager, we need to write out node first
if (init && (node != this))
{
writeSceneNode(writer, node, userDataSerializer, currentPath);
}
else
{
ISceneNodeList::ConstIterator it = node->getChildren().begin();
for (; it != node->getChildren().end(); ++it)
writeSceneNode(writer, (*it), userDataSerializer, currentPath);
}
attr->drop();
writer->writeClosingTag(name);
writer->writeLineBreak();
writer->writeLineBreak();
}
//! Returns a typename from a scene node type or null if not found //! Returns a typename from a scene node type or null if not found
const c8* CSceneManager::getSceneNodeTypeName(ESCENE_NODE_TYPE type) const c8* CSceneManager::getSceneNodeTypeName(ESCENE_NODE_TYPE type)
{ {
@ -2648,17 +2445,8 @@ IMeshWriter* CSceneManager::createMeshWriter(EMESH_WRITER_TYPE type)
switch(type) switch(type)
{ {
case EMWT_IRR_MESH: case EMWT_IRR_MESH:
#ifdef _IRR_COMPILE_WITH_IRR_WRITER_
return new CIrrMeshWriter(Driver, FileSystem);
#else
return 0;
#endif
case EMWT_COLLADA: case EMWT_COLLADA:
#ifdef _IRR_COMPILE_WITH_COLLADA_WRITER_
return new CColladaMeshWriter(this, Driver, FileSystem);
#else
return 0; return 0;
#endif
case EMWT_STL: case EMWT_STL:
#ifdef _IRR_COMPILE_WITH_STL_WRITER_ #ifdef _IRR_COMPILE_WITH_STL_WRITER_
return new CSTLMeshWriter(this); return new CSTLMeshWriter(this);

@ -492,9 +492,6 @@ namespace scene
//! Saves the current scene into a file. //! Saves the current scene into a file.
virtual bool saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) _IRR_OVERRIDE_; virtual bool saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) _IRR_OVERRIDE_;
//! Saves the current scene into a file.
virtual bool saveScene(io::IXMLWriter* writer, const io::path& currentPath, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) _IRR_OVERRIDE_;
//! Loads a scene. Note that the current scene is not cleared before. //! Loads a scene. Note that the current scene is not cleared before.
virtual bool loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* rootNode=0) _IRR_OVERRIDE_; virtual bool loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* rootNode=0) _IRR_OVERRIDE_;
@ -542,9 +539,6 @@ namespace scene
//! clears the deletion list //! clears the deletion list
void clearDeletionList(); void clearDeletionList();
//! writes a scene node
void writeSceneNode(io::IXMLWriter* writer, ISceneNode* node, ISceneUserDataSerializer* userDataSerializer, const fschar_t* currentPath=0, bool init=false);
struct DefaultNodeEntry struct DefaultNodeEntry
{ {
DefaultNodeEntry(ISceneNode* n) : DefaultNodeEntry(ISceneNode* n) :
@ -660,12 +654,6 @@ namespace scene
//! over the scene lighting and rendering. //! over the scene lighting and rendering.
ILightManager* LightManager; ILightManager* LightManager;
//! constants for reading and writing XML.
//! Not made static due to portability problems.
const core::stringw IRR_XML_FORMAT_SCENE;
const core::stringw IRR_XML_FORMAT_NODE;
const core::stringw IRR_XML_FORMAT_NODE_ATTR_TYPE;
IGeometryCreator* GeometryCreator; IGeometryCreator* GeometryCreator;
}; };

@ -1,84 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CXMLReader.h"
#ifdef _IRR_COMPILE_WITH_XML_
#include "CXMLReaderImpl.h"
#include "IReadFile.h"
namespace irr
{
namespace io
{
//! Irrlicht implementation of the file read callback for the xml parser
class CIrrXMLFileReadCallBack : public IFileReadCallBack
{
public:
//! construct from FILE pointer
CIrrXMLFileReadCallBack(IReadFile* file)
: ReadFile(file)
{
ReadFile->grab();
}
//! destructor
virtual ~CIrrXMLFileReadCallBack()
{
ReadFile->drop();
}
//! Reads an amount of bytes from the file.
virtual int read(void* buffer, int sizeToRead) _IRR_OVERRIDE_
{
return (int)ReadFile->read(buffer, sizeToRead);
}
//! Returns size of file in bytes
virtual long getSize() const _IRR_OVERRIDE_
{
return ReadFile->getSize();
}
private:
IReadFile* ReadFile;
}; // end class CMyXMLFileReadCallBack
// now create an implementation for IXMLReader using irrXML.
//! Creates an instance of a wide character xml parser.
IXMLReader* createIXMLReader(IReadFile* file)
{
if (!file)
return 0;
return new CXMLReaderImpl<wchar_t, IReferenceCounted>(new CIrrXMLFileReadCallBack(file));
}
//! Creates an instance of an UFT-8 or ASCII character xml parser.
IXMLReaderUTF8* createIXMLReaderUTF8(IReadFile* file)
{
if (!file)
return 0;
return new CXMLReaderImpl<char, IReferenceCounted>(new CIrrXMLFileReadCallBack(file));
}
} // end namespace
} // end namespace
#else // not _IRR_COMPILE_WITH_XML_
#include "os.h"
namespace irr
{
void noXML()
{
irr::os::Printer::log("XML support disabled in IrrCompileConfig.", irr::ELL_ERROR);
}
} // end namespace
#endif // _IRR_COMPILE_WITH_XML_

@ -1,30 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_XML_READER_H_INCLUDED__
#define __C_XML_READER_H_INCLUDED__
#include "IXMLReader.h"
namespace irr
{
#ifdef _IRR_COMPILE_WITH_XML_
namespace io
{
class IReadFile;
//! creates an IXMLReader
IXMLReader* createIXMLReader(IReadFile* file);
//! creates an IXMLReader
IXMLReaderUTF8* createIXMLReaderUTF8(IReadFile* file);
} // end namespace irr
#else // _IRR_COMPILE_WITH_XML_
//! print a message that Irrlicht is compiled without _IRR_COMPILE_WITH_XML_
void noXML();
#endif // _IRR_COMPILE_WITH_XML_
} // end namespace io
#endif

@ -1,821 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h
#ifndef __ICXML_READER_IMPL_H_INCLUDED__
#define __ICXML_READER_IMPL_H_INCLUDED__
#include "irrXML.h"
#include "irrString.h"
#include "irrArray.h"
#include "fast_atof.h"
#ifdef _DEBUG
#define IRR_DEBUGPRINT(x) printf((x));
#else // _DEBUG
#define IRR_DEBUGPRINT(x)
#endif // _DEBUG
namespace irr
{
namespace io
{
//! implementation of the IrrXMLReader
template<class char_type, class superclass>
class CXMLReaderImpl : public IIrrXMLReader<char_type, superclass>
{
public:
//! Constructor
CXMLReaderImpl(IFileReadCallBack* callback, bool deleteCallBack = true)
: IgnoreWhitespaceText(true), TextData(0), P(0), TextBegin(0), TextSize(0), CurrentNodeType(EXN_NONE),
SourceFormat(ETF_ASCII), TargetFormat(ETF_ASCII), IsEmptyElement(false)
{
if (!callback)
return;
storeTargetFormat();
// read whole xml file
readFile(callback);
// clean up
if (deleteCallBack)
delete callback;
// create list with special characters
createSpecialCharacterList();
// set pointer to text begin
P = TextBegin;
}
//! Destructor
virtual ~CXMLReaderImpl()
{
delete [] TextData;
}
//! Reads forward to the next xml node.
//! \return Returns false, if there was no further node.
virtual bool read() _IRR_OVERRIDE_
{
// if not end reached, parse the node
if (P && ((unsigned int)(P - TextBegin) < TextSize - 1) && (*P != 0))
{
return parseCurrentNode();
}
return false;
}
//! Returns the type of the current XML node.
virtual EXML_NODE getNodeType() const _IRR_OVERRIDE_
{
return CurrentNodeType;
}
//! Returns attribute count of the current XML node.
virtual unsigned int getAttributeCount() const _IRR_OVERRIDE_
{
return Attributes.size();
}
//! Returns name of an attribute.
virtual const char_type* getAttributeName(int idx) const _IRR_OVERRIDE_
{
if ((u32)idx >= Attributes.size())
return 0;
return Attributes[idx].Name.c_str();
}
//! Returns the value of an attribute.
virtual const char_type* getAttributeValue(int idx) const _IRR_OVERRIDE_
{
if ((unsigned int)idx >= Attributes.size())
return 0;
return Attributes[idx].Value.c_str();
}
//! Returns the value of an attribute.
virtual const char_type* getAttributeValue(const char_type* name) const _IRR_OVERRIDE_
{
const SAttribute* attr = getAttributeByName(name);
if (!attr)
return 0;
return attr->Value.c_str();
}
//! Returns the value of an attribute
virtual const char_type* getAttributeValueSafe(const char_type* name) const _IRR_OVERRIDE_
{
const SAttribute* attr = getAttributeByName(name);
if (!attr)
return EmptyString.c_str();
return attr->Value.c_str();
}
//! Returns the value of an attribute as integer.
virtual int getAttributeValueAsInt(const char_type* name, int defaultNotFound) const _IRR_OVERRIDE_
{
const SAttribute* attr = getAttributeByName(name);
if (!attr)
return defaultNotFound;
core::stringc c(attr->Value.c_str());
return core::strtol10(c.c_str());
}
//! Returns the value of an attribute as integer.
virtual int getAttributeValueAsInt(int idx, int defaultNotFound) const _IRR_OVERRIDE_
{
const char_type* attrvalue = getAttributeValue(idx);
if (!attrvalue)
return defaultNotFound;
core::stringc c(attrvalue);
return core::strtol10(c.c_str());
}
//! Returns the value of an attribute as float.
virtual float getAttributeValueAsFloat(const char_type* name, float defaultNotFound) const _IRR_OVERRIDE_
{
const SAttribute* attr = getAttributeByName(name);
if (!attr)
return defaultNotFound;
core::stringc c = attr->Value.c_str();
return core::fast_atof(c.c_str());
}
//! Returns the value of an attribute as float.
virtual float getAttributeValueAsFloat(int idx, float defaultNotFound) const _IRR_OVERRIDE_
{
const char_type* attrvalue = getAttributeValue(idx);
if (!attrvalue)
return defaultNotFound;
core::stringc c = attrvalue;
return core::fast_atof(c.c_str());
}
//! Returns the name of the current node.
virtual const char_type* getNodeName() const _IRR_OVERRIDE_
{
return NodeName.c_str();
}
//! Returns data of the current node.
virtual const char_type* getNodeData() const _IRR_OVERRIDE_
{
return NodeName.c_str();
}
//! Returns if an element is an empty element, like <foo />
virtual bool isEmptyElement() const _IRR_OVERRIDE_
{
return IsEmptyElement;
}
//! Returns format of the source xml file.
virtual ETEXT_FORMAT getSourceFormat() const _IRR_OVERRIDE_
{
return SourceFormat;
}
//! Returns format of the strings returned by the parser.
virtual ETEXT_FORMAT getParserFormat() const _IRR_OVERRIDE_
{
return TargetFormat;
}
private:
// Reads the current xml node
// return false if no further node is found
bool parseCurrentNode()
{
char_type* start = P;
// more forward until '<' found
while(*P != L'<' && *P)
++P;
// not a node, so return false
if (!*P)
return false;
if (P - start > 0)
{
// we found some text, store it
if (setText(start, P))
return true;
}
++P;
// based on current token, parse and report next element
switch(*P)
{
case L'/':
parseClosingXMLElement();
break;
case L'?':
ignoreDefinition();
break;
case L'!':
if (!parseCDATA())
parseComment();
break;
default:
parseOpeningXMLElement();
break;
}
return true;
}
//! sets the state that text was found. Returns true if set should be set
bool setText(char_type* start, char_type* end)
{
// By default xml preserves all whitespace. But Irrlicht dropped some whitespace by default
// in the past which did lead to OS dependent behavior. We just ignore all whitespace for now
// as it's the closest to fixing behavior without breaking downward compatibility too much.
if ( IgnoreWhitespaceText )
{
char_type* p = start;
for(; p != end; ++p)
if (!isWhiteSpace(*p))
break;
if (p == end)
return false;
}
// set current text to the parsed text, and replace xml special characters
core::string<char_type> s(start, (int)(end - start));
NodeName = replaceSpecialCharacters(s);
// current XML node type is text
CurrentNodeType = EXN_TEXT;
return true;
}
//! ignores an xml definition like <?xml something />
void ignoreDefinition()
{
CurrentNodeType = EXN_UNKNOWN;
// move until end marked with '>' reached
while(*P != L'>')
++P;
++P;
}
//! parses a comment
void parseComment()
{
CurrentNodeType = EXN_COMMENT;
P += 1;
char_type *pCommentBegin = P;
int count = 1;
// move until end of comment reached
while(count)
{
if (*P == L'>')
--count;
else
if (*P == L'<')
++count;
++P;
}
P -= 3;
NodeName = core::string<char_type>(pCommentBegin+2, (int)(P - pCommentBegin-2));
P += 3;
}
//! parses an opening xml element and reads attributes
void parseOpeningXMLElement()
{
CurrentNodeType = EXN_ELEMENT;
IsEmptyElement = false;
Attributes.clear();
// find name
const char_type* startName = P;
// find end of element
while(*P != L'>' && !isWhiteSpace(*P))
++P;
const char_type* endName = P;
// find Attributes
while(*P != L'>')
{
if (isWhiteSpace(*P))
++P;
else
{
if (*P != L'/')
{
// we've got an attribute
// read the attribute names
const char_type* attributeNameBegin = P;
while(!isWhiteSpace(*P) && *P != L'=')
++P;
const char_type* attributeNameEnd = P;
++P;
// read the attribute value
// check for quotes and single quotes, thx to murphy
while( (*P != L'\"') && (*P != L'\'') && *P)
++P;
if (!*P) // malformatted xml file
return;
const char_type attributeQuoteChar = *P;
++P;
const char_type* attributeValueBegin = P;
while(*P != attributeQuoteChar && *P)
++P;
if (!*P) // malformatted xml file
return;
const char_type* attributeValueEnd = P;
++P;
SAttribute attr;
attr.Name = core::string<char_type>(attributeNameBegin,
(int)(attributeNameEnd - attributeNameBegin));
core::string<char_type> s(attributeValueBegin,
(int)(attributeValueEnd - attributeValueBegin));
attr.Value = replaceSpecialCharacters(s);
Attributes.push_back(attr);
}
else
{
// tag is closed directly
++P;
IsEmptyElement = true;
break;
}
}
}
// check if this tag is closing directly
if (endName > startName && *(endName-1) == L'/')
{
// directly closing tag
IsEmptyElement = true;
endName--;
}
NodeName = core::string<char_type>(startName, (int)(endName - startName));
++P;
}
//! parses an closing xml tag
void parseClosingXMLElement()
{
CurrentNodeType = EXN_ELEMENT_END;
IsEmptyElement = false;
Attributes.clear();
++P;
const char_type* pBeginClose = P;
while(*P != L'>')
++P;
NodeName = core::string<char_type>(pBeginClose, (int)(P - pBeginClose));
++P;
}
//! parses a possible CDATA section, returns false if begin was not a CDATA section
bool parseCDATA()
{
if (*(P+1) != L'[')
return false;
CurrentNodeType = EXN_CDATA;
// skip '<![CDATA['
int count=0;
while( *P && count<8 )
{
++P;
++count;
}
if (!*P)
return true;
char_type *cDataBegin = P;
char_type *cDataEnd = 0;
// find end of CDATA
while(*P && !cDataEnd)
{
if (*P == L'>' &&
(*(P-1) == L']') &&
(*(P-2) == L']'))
{
cDataEnd = P - 2;
}
++P;
}
if ( cDataEnd )
NodeName = core::string<char_type>(cDataBegin, (int)(cDataEnd - cDataBegin));
else
NodeName = "";
return true;
}
// structure for storing attribute-name pairs
struct SAttribute
{
core::string<char_type> Name;
core::string<char_type> Value;
};
// finds a current attribute by name, returns 0 if not found
const SAttribute* getAttributeByName(const char_type* name) const
{
if (!name)
return 0;
core::string<char_type> n = name;
for (int i=0; i<(int)Attributes.size(); ++i)
if (Attributes[i].Name == n)
return &Attributes[i];
return 0;
}
// replaces xml special characters in a string and creates a new one
core::string<char_type> replaceSpecialCharacters(
const core::string<char_type>& origstr)
{
int pos = origstr.findFirst(L'&');
int oldPos = 0;
if (pos == -1)
return origstr;
core::string<char_type> newstr;
while(pos != -1 && pos < (int)origstr.size()-2)
{
// check if it is one of the special characters
int specialChar = -1;
for (int i=0; i<(int)SpecialCharacters.size(); ++i)
{
const char_type* p = &origstr.c_str()[pos]+1;
if (equalsn(&SpecialCharacters[i][1], p, SpecialCharacters[i].size()-1))
{
specialChar = i;
break;
}
}
if (specialChar != -1)
{
newstr.append(origstr.subString(oldPos, pos - oldPos));
newstr.append(SpecialCharacters[specialChar][0]);
pos += SpecialCharacters[specialChar].size();
}
else
{
newstr.append(origstr.subString(oldPos, pos - oldPos + 1));
pos += 1;
}
// find next &
oldPos = pos;
pos = origstr.findNext(L'&', pos);
}
if (oldPos < (int)origstr.size()-1)
newstr.append(origstr.subString(oldPos, origstr.size()-oldPos));
return newstr;
}
//! reads the xml file and converts it into the wanted character format.
bool readFile(IFileReadCallBack* callback)
{
long size = callback->getSize();
if (size<0)
return false;
// We need four terminating 0's at the end.
// For ASCII we need 1 0's, for UTF-16 2, for UTF-32 4.
size += 4;
char* data8 = new char[size];
if (!callback->read(data8, size-4))
{
delete [] data8;
return false;
}
// add zeros at end
memset(data8+size-4, 0, 4);
char16* data16 = reinterpret_cast<char16*>(data8);
char32* data32 = reinterpret_cast<char32*>(data8);
// now we need to convert the data to the desired target format
// based on the byte order mark.
const unsigned char UTF8[] = {0xEF, 0xBB, 0xBF}; // 0xEFBBBF;
const u16 UTF16_BE = 0xFFFE;
const u16 UTF16_LE = 0xFEFF;
const u32 UTF32_BE = 0xFFFE0000;
const u32 UTF32_LE = 0x0000FEFF;
// check source for all utf versions and convert to target data format
if (size >= 4 && data32[0]
== static_cast<char32>(UTF32_BE))
{
// UTF-32, big endian
SourceFormat = ETF_UTF32_BE;
convertTextData(data32+1, data8, (size/4)-1); // data32+1 because we need to skip the header
}
else
if (size >= 4 && data32[0] == static_cast<char32>(UTF32_LE))
{
// UTF-32, little endian
SourceFormat = ETF_UTF32_LE;
convertTextData(data32+1, data8, (size/4)-1); // data32+1 because we need to skip the header
}
else
if (size >= 2 && data16[0] == UTF16_BE)
{
// UTF-16, big endian
SourceFormat = ETF_UTF16_BE;
convertTextData(data16+1, data8, (size/2)-1); // data16+1 because we need to skip the header
}
else
if (size >= 2 && data16[0] == UTF16_LE)
{
// UTF-16, little endian
SourceFormat = ETF_UTF16_LE;
convertTextData(data16+1, data8, (size/2)-1); // data16+1 because we need to skip the header
}
else
if (size >= 3 && memcmp(data8,UTF8,3)==0)
{
// UTF-8
SourceFormat = ETF_UTF8;
convertTextData(data8+3, data8, size-3); // data8+3 because we need to skip the header
}
else
{
// ASCII
SourceFormat = ETF_ASCII;
convertTextData(data8, data8, size);
}
return true;
}
//! converts the text file into the desired format.
/** \param source: begin of the text (without byte order mark)
\param pointerToStore: pointer to text data block which can be
stored or deleted based on the nesessary conversion.
\param sizeWithoutHeader: Text size in characters without header
*/
template<class src_char_type>
void convertTextData(src_char_type* source, char* pointerToStore, int sizeWithoutHeader)
{
// convert little to big endian if necessary
if (sizeof(src_char_type) > 1 &&
isLittleEndian(TargetFormat) != isLittleEndian(SourceFormat))
convertToLittleEndian(source);
// check if conversion is necessary:
if (sizeof(src_char_type) == sizeof(char_type))
{
// no need to convert
TextBegin = (char_type*)source;
TextData = (char_type*)pointerToStore;
TextSize = sizeWithoutHeader;
}
else
{
// convert source into target data format.
// TODO: implement a real conversion. This one just
// copies bytes. This is a problem when there are
// unicode symbols using more than one character.
TextData = new char_type[sizeWithoutHeader];
if ( sizeof(src_char_type) == 1 )
{
// we have to cast away negative numbers or results might add the sign instead of just doing a copy
for (int i=0; i<sizeWithoutHeader; ++i)
{
TextData[i] = static_cast<char_type>(static_cast<unsigned char>(source[i]));
}
}
else
{
for (int i=0; i<sizeWithoutHeader; ++i)
TextData[i] = static_cast<char_type>(source[i]);
}
TextBegin = TextData;
TextSize = sizeWithoutHeader;
// delete original data because no longer needed
delete [] pointerToStore;
}
}
//! converts whole text buffer to little endian
template<class src_char_type>
void convertToLittleEndian(src_char_type* t)
{
if (sizeof(src_char_type) == 4)
{
// 32 bit
while(*t)
{
*t = ((*t & 0xff000000) >> 24) |
((*t & 0x00ff0000) >> 8) |
((*t & 0x0000ff00) << 8) |
((*t & 0x000000ff) << 24);
++t;
}
}
else
{
// 16 bit
while(*t)
{
*t = (*t >> 8) | (*t << 8);
++t;
}
}
}
//! returns if a format is little endian
inline bool isLittleEndian(ETEXT_FORMAT f)
{
return f == ETF_ASCII ||
f == ETF_UTF8 ||
f == ETF_UTF16_LE ||
f == ETF_UTF32_LE;
}
//! returns true if a character is whitespace
inline bool isWhiteSpace(char_type c)
{
return (c==' ' || c=='\t' || c=='\n' || c=='\r');
}
//! generates a list with xml special characters
void createSpecialCharacterList()
{
// list of strings containing special symbols,
// the first character is the special character,
// the following is the symbol string without trailing &.
SpecialCharacters.push_back("&amp;");
SpecialCharacters.push_back("<lt;");
SpecialCharacters.push_back(">gt;");
SpecialCharacters.push_back("\"quot;");
SpecialCharacters.push_back("'apos;");
}
//! compares the first n characters of the strings
bool equalsn(const char_type* str1, const char_type* str2, int len)
{
int i;
for(i=0; str1[i] && str2[i] && i < len; ++i)
if (str1[i] != str2[i])
return false;
// if one (or both) of the strings was smaller then they
// are only equal if they have the same length
return (i == len) || (str1[i] == 0 && str2[i] == 0);
}
//! stores the target text format
void storeTargetFormat()
{
// get target format. We could have done this using template specialization,
// but VisualStudio 6 don't like it and we want to support it.
switch(sizeof(char_type))
{
case 1:
TargetFormat = ETF_UTF8;
break;
case 2:
TargetFormat = ETF_UTF16_LE;
break;
case 4:
TargetFormat = ETF_UTF32_LE;
break;
default:
TargetFormat = ETF_ASCII; // should never happen.
}
}
// instance variables:
bool IgnoreWhitespaceText; // do not return EXN_TEXT nodes for pure whitespace
char_type* TextData; // data block of the text file
char_type* P; // current point in text to parse
char_type* TextBegin; // start of text to parse
unsigned int TextSize; // size of text to parse in characters, not bytes
EXML_NODE CurrentNodeType; // type of the currently parsed node
ETEXT_FORMAT SourceFormat; // source format of the xml file
ETEXT_FORMAT TargetFormat; // output format of this parser
core::string<char_type> NodeName; // name of the node currently in - also used for text
core::string<char_type> EmptyString; // empty string to be returned by getSafe() methods
bool IsEmptyElement; // is the currently parsed node empty?
core::array< core::string<char_type> > SpecialCharacters; // see createSpecialCharacterList()
core::array<SAttribute> Attributes; // attributes of current element
}; // end CXMLReaderImpl
} // end namespace
} // end namespace
#endif

@ -1,472 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CXMLWriter.h"
#ifdef _IRR_COMPILE_WITH_XML_
#include <wchar.h>
#include "irrString.h"
#include "IrrCompileConfig.h"
namespace irr
{
namespace io
{
//! creates an IXMLReader
IXMLWriter* createIXMLWriter(IWriteFile* file)
{
return new CXMLWriter(file);
}
//! creates an IXMLReader
IXMLWriterUTF8* createIXMLWriterUTF8(IWriteFile* file)
{
return new CXMLWriterUTF8(file);
}
//! Constructor
CXMLWriter::CXMLWriter(IWriteFile* file)
: CXMLWriterCommon(file)
{
#ifdef _DEBUG
setDebugName("CXMLWriter");
#endif
}
//! Writes a xml 1.0 header like <?xml version="1.0"?>
void CXMLWriter::writeXMLHeader()
{
if (!File)
return;
if (sizeof(wchar_t)==2)
{
const u16 h = 0xFEFF;
File->write(&h, 2);
}
else
{
const u32 h = 0x0000FEFF;
File->write(&h, sizeof(wchar_t));
}
const wchar_t* const p = L"<?xml version=\"1.0\"?>";
File->write(p, wcslen(p)*sizeof(wchar_t));
writeLineBreak();
TextWrittenLast = false;
}
//! Writes an xml element with maximal 5 attributes
void CXMLWriter::writeElement(const wchar_t* name, bool empty,
const wchar_t* attr1Name, const wchar_t* attr1Value,
const wchar_t* attr2Name, const wchar_t* attr2Value,
const wchar_t* attr3Name, const wchar_t* attr3Value,
const wchar_t* attr4Name, const wchar_t* attr4Value,
const wchar_t* attr5Name, const wchar_t* attr5Value)
{
if (!File || !name)
return;
if (Tabs > 0)
{
for (int i=0; i<Tabs; ++i)
File->write(L"\t", sizeof(wchar_t));
}
// write name
File->write(L"<", sizeof(wchar_t));
File->write(name, wcslen(name)*sizeof(wchar_t));
// write attributes
writeAttribute(attr1Name, attr1Value);
writeAttribute(attr2Name, attr2Value);
writeAttribute(attr3Name, attr3Value);
writeAttribute(attr4Name, attr4Value);
writeAttribute(attr5Name, attr5Value);
// write closing tag
if (empty)
File->write(L" />", 3*sizeof(wchar_t));
else
{
File->write(L">", sizeof(wchar_t));
++Tabs;
}
TextWrittenLast = false;
}
//! Writes an xml element with any number of attributes
void CXMLWriter::writeElement(const wchar_t* name, bool empty,
core::array<core::stringw> &names,
core::array<core::stringw> &values)
{
if (!File || !name)
return;
if (Tabs > 0)
{
for (int i=0; i<Tabs; ++i)
File->write(L"\t", sizeof(wchar_t));
}
// write name
File->write(L"<", sizeof(wchar_t));
File->write(name, wcslen(name)*sizeof(wchar_t));
// write attributes
u32 i=0;
for (; i < names.size() && i < values.size(); ++i)
writeAttribute(names[i].c_str(), values[i].c_str());
// write closing tag
if (empty)
File->write(L" />", 3*sizeof(wchar_t));
else
{
File->write(L">", sizeof(wchar_t));
++Tabs;
}
TextWrittenLast = false;
}
void CXMLWriter::writeAttribute(const wchar_t* name, const wchar_t* value)
{
if (!name || !value)
return;
File->write(L" ", sizeof(wchar_t));
File->write(name, wcslen(name)*sizeof(wchar_t));
File->write(L"=\"", 2*sizeof(wchar_t));
writeText(value);
File->write(L"\"", sizeof(wchar_t));
}
//! Writes a comment into the xml file
void CXMLWriter::writeComment(const wchar_t* comment)
{
if (!File || !comment)
return;
File->write(L"<!--", 4*sizeof(wchar_t));
writeText(comment);
File->write(L"-->", 3*sizeof(wchar_t));
}
//! Writes the closing tag for an element. Like </foo>
void CXMLWriter::writeClosingTag(const wchar_t* name)
{
if (!File || !name)
return;
--Tabs;
if (Tabs > 0 && !TextWrittenLast)
{
for (int i=0; i<Tabs; ++i)
File->write(L"\t", sizeof(wchar_t));
}
File->write(L"</", 2*sizeof(wchar_t));
File->write(name, wcslen(name)*sizeof(wchar_t));
File->write(L">", sizeof(wchar_t));
TextWrittenLast = false;
}
//! Writes a text into the file. All occurrences of special characters like
//! & (&amp;), < (&lt;), > (&gt;), and " (&quot;) are automatically replaced.
void CXMLWriter::writeText(const wchar_t* text)
{
if (!File || !text)
return;
static const CXMLWriter::XMLSpecialCharacters XMLWSChar[] =
{
{ L'&', L"&amp;" },
{ L'<', L"&lt;" },
{ L'>', L"&gt;" },
{ L'"', L"&quot;" },
{ L'\0', 0 }
};
// TODO: we have to get rid of that reserve call as well as it slows down xml-writing seriously.
// Making a member-variable would work, but a lot of memory would stay around after writing.
// So the correct solution is probably using fixed block here and always write when that is full.
core::stringw s;
s.reserve(wcslen(text)+1);
const wchar_t* p = text;
while(*p)
{
// check if it is matching
bool found = false;
for (s32 i=0; XMLWSChar[i].Character != '\0'; ++i)
if (*p == XMLWSChar[i].Character)
{
s.append(XMLWSChar[i].Symbol);
found = true;
break;
}
if (!found)
s.append(*p);
++p;
}
// write new string
File->write(s.c_str(), s.size()*sizeof(wchar_t));
TextWrittenLast = true;
}
//! Writes a line break
void CXMLWriter::writeLineBreak()
{
if (!File)
return;
#if defined(_IRR_OSX_PLATFORM_)
File->write(L"\r", sizeof(wchar_t));
#elif defined(_IRR_WINDOWS_API_)
File->write(L"\r\n", 2*sizeof(wchar_t));
#else
File->write(L"\n", sizeof(wchar_t));
#endif
}
//! Constructor
CXMLWriterUTF8::CXMLWriterUTF8(IWriteFile* file)
: CXMLWriterCommon(file)
{
#ifdef _DEBUG
setDebugName("CXMLWriter");
#endif
}
//! Writes a xml 1.0 header like <?xml version="1.0"?>
void CXMLWriterUTF8::writeXMLHeader()
{
if (!File)
return;
// No BOM as it's not necessarily utf8
const c8* const p = "<?xml version=\"1.0\"?>";
File->write(p, strlen(p) * sizeof(c8));
writeLineBreak();
TextWrittenLast = false;
}
//! Writes an xml element with maximal 5 attributes
void CXMLWriterUTF8::writeElement(const c8* name, bool empty,
const c8* attr1Name, const c8* attr1Value,
const c8* attr2Name, const c8* attr2Value,
const c8* attr3Name, const c8* attr3Value,
const c8* attr4Name, const c8* attr4Value,
const c8* attr5Name, const c8* attr5Value)
{
if (!File || !name)
return;
if (Tabs > 0)
{
for (int i=0; i<Tabs; ++i)
File->write("\t", sizeof(c8));
}
// write name
File->write("<", sizeof(c8));
File->write(name, strlen(name)*sizeof(c8));
// write attributes
writeAttribute(attr1Name, attr1Value);
writeAttribute(attr2Name, attr2Value);
writeAttribute(attr3Name, attr3Value);
writeAttribute(attr4Name, attr4Value);
writeAttribute(attr5Name, attr5Value);
// write closing tag
if (empty)
File->write(" />", 3*sizeof(c8));
else
{
File->write(">", sizeof(c8));
++Tabs;
}
TextWrittenLast = false;
}
//! Writes an xml element with any number of attributes
void CXMLWriterUTF8::writeElement(const c8* name, bool empty,
core::array<core::stringc> &names,
core::array<core::stringc> &values)
{
if (!File || !name)
return;
if (Tabs > 0)
{
for (int i=0; i<Tabs; ++i)
File->write("\t", sizeof(c8));
}
// write name
File->write("<", sizeof(c8));
File->write(name, strlen(name)*sizeof(c8));
// write attributes
u32 i=0;
for (; i < names.size() && i < values.size(); ++i)
writeAttribute(names[i].c_str(), values[i].c_str());
// write closing tag
if (empty)
File->write(" />", 3*sizeof(c8));
else
{
File->write(">", sizeof(c8));
++Tabs;
}
TextWrittenLast = false;
}
void CXMLWriterUTF8::writeAttribute(const c8* name, const c8* value)
{
if (!name || !value)
return;
File->write(" ", sizeof(c8));
File->write(name, strlen(name)*sizeof(c8));
File->write("=\"", 2*sizeof(c8));
writeText(value);
File->write("\"", sizeof(c8));
}
//! Writes a comment into the xml file
void CXMLWriterUTF8::writeComment(const c8* comment)
{
if (!File || !comment)
return;
File->write("<!--", 4*sizeof(c8));
writeText(comment);
File->write("-->", 3*sizeof(c8));
}
//! Writes the closing tag for an element. Like </foo>
void CXMLWriterUTF8::writeClosingTag(const c8* name)
{
if (!File || !name)
return;
--Tabs;
if (Tabs > 0 && !TextWrittenLast)
{
for (int i=0; i<Tabs; ++i)
File->write("\t", sizeof(c8));
}
File->write("</", 2*sizeof(c8));
File->write(name, strlen(name)*sizeof(c8));
File->write(">", sizeof(c8));
TextWrittenLast = false;
}
//! Writes a text into the file. All occurrences of special characters like
//! & (&amp;), < (&lt;), > (&gt;), and " (&quot;) are automatically replaced.
void CXMLWriterUTF8::writeText(const c8* text)
{
if (!File || !text)
return;
static const CXMLWriterUTF8::XMLSpecialCharacters XMLWSChar[] =
{
{ '&', "&amp;" },
{ '<', "&lt;" },
{ '>', "&gt;" },
{ '"', "&quot;" },
{ '\0', 0 }
};
// TODO: we have to get rid of that reserve call as well as it slows down xml-writing seriously.
// Making a member-variable would work, but a lot of memory would stay around after writing.
// So the correct solution is probably using fixed block here and always write when that is full.
core::stringc s;
s.reserve(strlen(text)+1);
const c8* p = text;
while(*p)
{
// check if it is matching
bool found = false;
for (s32 i=0; XMLWSChar[i].Character != '\0'; ++i)
if (*p == XMLWSChar[i].Character)
{
s.append(XMLWSChar[i].Symbol);
found = true;
break;
}
if (!found)
s.append(*p);
++p;
}
// write new string
File->write(s.c_str(), s.size()*sizeof(c8));
TextWrittenLast = true;
}
//! Writes a line break
void CXMLWriterUTF8::writeLineBreak()
{
if (!File)
return;
#if defined(_IRR_OSX_PLATFORM_)
File->write("\r", sizeof(c8));
#elif defined(_IRR_WINDOWS_API_)
File->write("\r\n", 2*sizeof(c8));
#else
File->write("\n", sizeof(c8));
#endif
}
} // end namespace irr
} // end namespace io
#endif // _IRR_COMPILE_WITH_XML_

@ -1,156 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_XML_WRITER_H_INCLUDED__
#define __C_XML_WRITER_H_INCLUDED__
#include "IXMLWriter.h"
#ifdef _IRR_COMPILE_WITH_XML_
#include <wchar.h>
#include "IWriteFile.h"
namespace irr
{
namespace io
{
//! creates an IXMLReader
IXMLWriter* createIXMLWriter(IWriteFile* file);
//! creates an IXMLReader
IXMLWriterUTF8* createIXMLWriterUTF8(IWriteFile* file);
// Stuff needed by implementations for all character types
// TODO: With some more work it could maybe become a pure template based thing like CXMLReaderImpl
// and replace the type based writer implementations. Sorry, too lazy for now :-/
template<class char_type>
class CXMLWriterCommon
{
public:
//! Constructor
CXMLWriterCommon(IWriteFile* file): File(file), Tabs(0), TextWrittenLast(false)
{
if (File)
File->grab();
}
//! Destructor
virtual ~CXMLWriterCommon()
{
if (File)
File->drop();
}
struct XMLSpecialCharacters
{
char_type Character;
const char_type* Symbol;
};
protected:
IWriteFile* File;
s32 Tabs;
bool TextWrittenLast;
};
//! Implementation providing methods for making it easier to write XML files.
class CXMLWriter : public IXMLWriter, public CXMLWriterCommon<wchar_t>
{
public:
//! Constructor
CXMLWriter(IWriteFile* file);
//! Destructor
virtual ~CXMLWriter() {}
//! Writes a xml 1.0 header like <?xml version="1.0"?>
virtual void writeXMLHeader() _IRR_OVERRIDE_;
//! Writes an xml element with maximal 5 attributes
virtual void writeElement(const wchar_t* name, bool empty=false,
const wchar_t* attr1Name = 0, const wchar_t* attr1Value = 0,
const wchar_t* attr2Name = 0, const wchar_t* attr2Value = 0,
const wchar_t* attr3Name = 0, const wchar_t* attr3Value = 0,
const wchar_t* attr4Name = 0, const wchar_t* attr4Value = 0,
const wchar_t* attr5Name = 0, const wchar_t* attr5Value = 0) _IRR_OVERRIDE_;
//! Writes an xml element with any number of attributes
virtual void writeElement(const wchar_t* name, bool empty,
core::array<core::stringw> &names, core::array<core::stringw> &values) _IRR_OVERRIDE_;
//! Writes a comment into the xml file
virtual void writeComment(const wchar_t* comment) _IRR_OVERRIDE_;
//! Writes the closing tag for an element. Like </foo>
virtual void writeClosingTag(const wchar_t* name) _IRR_OVERRIDE_;
//! Writes a text into the file. All occurrences of special characters like
//! & (&amp;), < (&lt;), > (&gt;), and " (&quot;) are automatically replaced.
virtual void writeText(const wchar_t* text) _IRR_OVERRIDE_;
//! Writes a line break
virtual void writeLineBreak() _IRR_OVERRIDE_;
private:
void writeAttribute(const wchar_t* att, const wchar_t* name);
};
//! Implementation providing methods for making it easier to write XML files.
class CXMLWriterUTF8 : public IXMLWriterUTF8, public CXMLWriterCommon<c8>
{
public:
//! Constructor
CXMLWriterUTF8(IWriteFile* file);
//! Destructor
virtual ~CXMLWriterUTF8() {}
//! Writes a xml 1.0 header like <?xml version="1.0"?>
virtual void writeXMLHeader() _IRR_OVERRIDE_;
//! Writes an xml element with maximal 5 attributes
virtual void writeElement(const c8* name, bool empty=false,
const c8* attr1Name = 0, const c8* attr1Value = 0,
const c8* attr2Name = 0, const c8* attr2Value = 0,
const c8* attr3Name = 0, const c8* attr3Value = 0,
const c8* attr4Name = 0, const c8* attr4Value = 0,
const c8* attr5Name = 0, const c8* attr5Value = 0) _IRR_OVERRIDE_;
//! Writes an xml element with any number of attributes
virtual void writeElement(const c8* name, bool empty,
core::array<core::stringc> &names, core::array<core::stringc> &values) _IRR_OVERRIDE_;
//! Writes a comment into the xml file
virtual void writeComment(const c8* comment) _IRR_OVERRIDE_;
//! Writes the closing tag for an element. Like </foo>
virtual void writeClosingTag(const c8* name) _IRR_OVERRIDE_;
//! Writes a text into the file. All occurrences of special characters like
//! & (&amp;), < (&lt;), > (&gt;), and " (&quot;) are automatically replaced.
virtual void writeText(const c8* text) _IRR_OVERRIDE_;
//! Writes a line break
virtual void writeLineBreak() _IRR_OVERRIDE_;
private:
void writeAttribute(const c8* att, const c8* name);
};
} // end namespace irr
} // end namespace io
#endif // _IRR_COMPILE_WITH_XML_
#endif

@ -1,185 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h
#include "irrXML.h"
#ifdef _IRR_COMPILE_WITH_XML_
#include "irrString.h"
#include "irrArray.h"
#include "fast_atof.h"
#include "CXMLReaderImpl.h"
namespace irr
{
namespace io
{
//! Implementation of the file read callback for ordinary files
class CFileReadCallBack : public IFileReadCallBack
{
public:
//! construct from filename
CFileReadCallBack(const char* filename)
: File(0), Size(-1), Close(true)
{
// open file
File = fopen(filename, "rb");
if (File)
getFileSize();
}
//! construct from FILE pointer
CFileReadCallBack(FILE* file)
: File(file), Size(-1), Close(false)
{
if (File)
getFileSize();
}
//! destructor
virtual ~CFileReadCallBack()
{
if (Close && File)
fclose(File);
}
//! Reads an amount of bytes from the file.
virtual int read(void* buffer, int sizeToRead) _IRR_OVERRIDE_
{
if (!File)
return 0;
return (int)fread(buffer, 1, sizeToRead, File);
}
//! Returns size of file in bytes
virtual long getSize() const _IRR_OVERRIDE_
{
return Size;
}
private:
//! retrieves the file size of the open file
void getFileSize()
{
fseek(File, 0, SEEK_END);
Size = ftell(File);
fseek(File, 0, SEEK_SET);
}
FILE* File;
long Size;
bool Close;
}; // end class CFileReadCallBack
// FACTORY FUNCTIONS:
//! Creates an instance of an UFT-8 or ASCII character xml parser.
IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(const char* filename)
{
return createIrrXMLReader(new CFileReadCallBack(filename), true);
}
//! Creates an instance of an UFT-8 or ASCII character xml parser.
IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(FILE* file)
{
return createIrrXMLReader(new CFileReadCallBack(file), true);
}
//! Creates an instance of an UFT-8 or ASCII character xml parser.
IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(IFileReadCallBack* callback,
bool deleteCallback)
{
if (callback && (callback->getSize() >= 0))
{
return new CXMLReaderImpl<char, IXMLBase>(callback, deleteCallback);
}
else
{
if(callback && deleteCallback)
delete callback;
return 0;
}
}
//! Creates an instance of an UTF-16 xml parser.
IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(const char* filename)
{
return createIrrXMLReaderUTF16(new CFileReadCallBack(filename), true);
}
//! Creates an instance of an UTF-16 xml parser.
IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(FILE* file)
{
return createIrrXMLReaderUTF16(new CFileReadCallBack(file), true);
}
//! Creates an instance of an UTF-16 xml parser.
IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(IFileReadCallBack* callback,
bool deleteCallback)
{
if (callback && (callback->getSize() >= 0))
{
return new CXMLReaderImpl<char16, IXMLBase>(callback, deleteCallback);
}
else
{
if(callback && deleteCallback)
delete callback;
return 0;
}
}
//! Creates an instance of an UTF-32 xml parser.
IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(const char* filename)
{
return createIrrXMLReaderUTF32(new CFileReadCallBack(filename), true);
}
//! Creates an instance of an UTF-32 xml parser.
IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(FILE* file)
{
return createIrrXMLReaderUTF32(new CFileReadCallBack(file), true);
}
//! Creates an instance of an UTF-32 xml parser.
IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(
IFileReadCallBack* callback, bool deleteCallback)
{
if (callback && (callback->getSize() >= 0))
{
return new CXMLReaderImpl<char32, IXMLBase>(callback, deleteCallback);
}
else
{
if(callback && deleteCallback)
delete callback;
return 0;
}
}
} // end namespace io
} // end namespace irr
#endif // _IRR_COMPILE_WITH_XML_